Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][DOC] Update the SYCL Runtime Interface document to give some design updates #680

Merged
merged 2 commits into from
Apr 22, 2020

Conversation

garimagu
Copy link
Contributor

A preliminary design on the plugin interface.
The design is still under review, feel free to suggest changes.

@garimagu
Copy link
Contributor Author

Please review only the last commit. The first commit is currently under review @ #206

@bader
Copy link
Contributor

bader commented Sep 30, 2019

@garimagu, PR #206 is merged.
Please, resolve merge conflicts and update the PR title.

@garimagu garimagu force-pushed the private/garimagu/pi_doc_update branch from 5ac85af to 6137dea Compare September 30, 2019 18:12
@garimagu garimagu changed the title [SYCL][DOC] Private/garimagu/pi doc update [SYCL][DOC] Update the SYCL Runtime Interface document to give some design updates Sep 30, 2019
@kbobrovs kbobrovs requested a review from smaslov-intel October 1, 2019 19:49
@@ -1,5 +1,4 @@
# The SYCL Runtime Plugin Interface.

#The SYCL Runtime Plugin Interface.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Plugin interface" conflicts with the parent term. I suggest "The SYCL runtime plugin loader interface"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should it be Plugin Loader only?
Plugin Loader would refer to the loading mechanism of the plugins.
After the plugin is loaded, we are using the interface to communicate with the plugin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugin Loader is ok with me too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing it to Plugin Loader and Plugin Interface

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not using Plugin Loader in the description anywhere. Let me know if you feel it must be present.

sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 10 unresolved discussions (waiting on @garimagu, @kbobrovs, and @romanovvlad)


sycl/doc/SYCLPluginInterface.md, line 48 at r1 (raw file):

Previously, smaslov-intel wrote…

Yes, this is what it would be in more details:
A configuration file with some predefined (TBD) location inside SYCL RT will be listing the names of the PI plugin libraries to search for and load. The search is made in paths given by LD_LIBRARY_PATH. Also, to address the issue of read-only configuration file, there will be an environment variable added (e.g. SYCL_PI_CONFIG) to provide a user-specified config file, which, if given, would override the predefined location inside SYCL RT.

@garimagu, please update the doc here


sycl/doc/SYCLPluginInterface.md, line 77 at r1 (raw file):

Previously, smaslov-intel wrote…

Could you elaborate more on this cons?

If we add extra stuff into PI handles, then there is more work to extract native OpenCL handle from a PI handle. Note that today most of PI handles returned by PI OpenCL plugin are exactly the OpenCL native raw handles.

We are strongly in favor of approach 2, which is to keep/cache the PI plugin descriptors in the SYCL RT, not in the PI handles.

@garimagu, please update the doc to clarify how we are doing here

keryell
keryell previously approved these changes Oct 21, 2019
Copy link
Contributor

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this design that is a little bit outside of my concerns that I will to address in a different way anyway (embedded systems with quite more static/constexpr runtime at the C++ level).

@garimagu
Copy link
Contributor Author

garimagu commented Oct 29, 2019 via email

@kbobrovs
Copy link
Contributor

kbobrovs commented Oct 29, 2019 via email

@MrSidims
Copy link
Contributor

Off-topic: don't we want to move design doc/FAQ doc/etc to project wiki page in github?

@bader
Copy link
Contributor

bader commented Nov 12, 2019

Off-topic: don't we want to move design doc/FAQ doc/etc to project wiki page in github?

Why would we want this move? Could you elaborate when/how docs are moved?

One big disadvantage of wiki is that you can't review changes before they are applied.

@bader
Copy link
Contributor

bader commented Nov 12, 2019

If you think it's important topic to discuss, please, open a separate issue.

@bader
Copy link
Contributor

bader commented Nov 29, 2019

sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
OpenCL plugin is a usual plugin from SYCL runtime standpoint, but its loading
and initialization involves a nested discovery process which finds out available
OpenCL implementations. They can be installed either in the standard Khronos
ICD-compatible way (e.g. listed in files under /etc/OpenCL/vendors on
Linux) or not, and the OpenCL plugin can hook up with both.

TBD describe the nested OpenCL implementation discovery process performed by
TBD - describe the nested OpenCL implementation discovery process performed by
the OpenCL plugin

### Device enumeration by plugins
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me section name is misleading as content doesn't describe "device enumeration".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have still kept this section name. Do you have a suggested alternative?

sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
the PI API calls needed to run the program to the selected plugin.
The selected plugin information for a device is stored in the associated
platform during platform object construction. The API calls are arbitrated
by using this information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment.
I think the doc should cover relationship between sycl::platform, sycl::device, PI plugin, cl_platform_id, cl_device_id.
For example, it's not very clear if we can have multiple sycl::platform's with [the same|different set] of devices dispatching to the same PI plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this with the help of an example in the future.
What happens when we have the same device that can be connected with multiple platforms?
How would a program be expected to behave in that case?
Eg: A GPU that can be communicated with using OpenCL and a proprietary run time.

Copy link
Contributor

@romanovvlad romanovvlad Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when we have the same device that can be connected with multiple platforms?

It should be OK as an application works with software abstraction of real device. So, it's OK to have several "soft" devices that map to one real device unless there is no bugs/features in the underlying runtimes that prevent such model.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment.
I think the doc should cover relationship between sycl::platform, sycl::device, PI plugin, cl_platform_id, cl_device_id.
For example, it's not very clear if we can have multiple sycl::platform's with [the same|different set] of devices dispatching to the same PI plugin.

Hi Vlad, can you suggest where and how should such details be included? Aren't these more implementation specific?

sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved

TBD
TBD - Unloading a bound plugin.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's very important aspect which can affect design.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really? We are loading the plugin as a library. We can unload it in platform obj destructor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we cannot. There can be several platform objects using the same "plugin". Furthermore new platform object can be created after old one is destructed.

sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
sycl/doc/SYCLPluginInterface.md Outdated Show resolved Hide resolved
@garimagu garimagu force-pushed the private/garimagu/pi_doc_update branch from 3334bce to d48cf7b Compare December 6, 2019 02:08
@garimagu
Copy link
Contributor Author

garimagu commented Dec 6, 2019

Please expect minimum 2 more patches associated with Plugin Interface:

  1. Moving Plugin information to Platform object, and calls to the plugins using the stored information. This will change the PI_CALL semantics a little.
  2. Using config file and EVs to find all available plugins.
    Optional: Any left/missed implementation details from this doc. This may include some cleaning up.

@garimagu
Copy link
Contributor Author

TODO: After #1030 is merged add the corresponding changes to this doc.

@bader
Copy link
Contributor

bader commented Feb 28, 2020

TODO: After #1030 is merged add the corresponding changes to this doc.

#1030 is merged.

1 similar comment
@bader
Copy link
Contributor

bader commented Feb 28, 2020

TODO: After #1030 is merged add the corresponding changes to this doc.

#1030 is merged.

@bader
Copy link
Contributor

bader commented Mar 15, 2020

@garimagu, could you update the PR, please?

@garimagu
Copy link
Contributor Author

@garimagu, could you update the PR, please?

Hi @bader @kbobrovs Sorry for the late response. I have been a little stuck with other tasks and have been unable to update this. I will do it once I have some more time.
Sorry for the delay.

Signed-off-by: Garima Gupta <garima.gupta@intel.com>

[SYCL] Addition of recommended design changes

Signed-off-by: Garima Gupta <garima.gupta@intel.com>

Suggested minor changes.

Signed-off-by: Garima Gupta <garima.gupta@intel.com>
@garimagu garimagu force-pushed the private/garimagu/pi_doc_update branch from d48cf7b to 81329ea Compare April 16, 2020 23:44
@garimagu garimagu requested a review from pvchupin as a code owner April 16, 2020 23:44
@garimagu
Copy link
Contributor Author

@bader @kbobrovs @smaslov-intel Please review the updated document.

Signed-off-by: Garima Gupta <garima.gupta@intel.com>
@garimagu garimagu force-pushed the private/garimagu/pi_doc_update branch from 81329ea to 8ed0146 Compare April 17, 2020 00:35
@garimagu
Copy link
Contributor Author

garimagu commented Apr 22, 2020

@smaslov-intel @romanovvlad Please review as and when you get sometime.

Copy link
Contributor

@romanovvlad romanovvlad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bader bader merged commit 0614e9a into intel:sycl Apr 22, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Apr 29, 2020
…versioning

* origin/sycl:
  [XPTI][Framework] Reference implementation of the Xpti framework to be used with instrumentation in SYCL (intel#1557)
  [SYCL] Initial ABI checks implementation (intel#1528)
  [SYCL] Support connection with multiple plugins (intel#1490)
  [SYCL] Add a new header file with the reduction class definition (intel#1558)
  [SYCL] Add test for SYCL kernels with accessor and spec constant (intel#1536)
  [SYCL][CUDA] Move interop tests (intel#1570)
  [Driver][SYCL] Remove COFF object format designator for Windows device compiles (intel#1574)
  [SYCL] Fix conflicting visibility attributes (intel#1571)
  [SYCL][DOC] Update the SYCL Runtime Interface document with design details (intel#680)
  [SYCL] Improve image accessors support on a host device (intel#1502)
  [SYCL] Make queue's non-USM event ownership temporary (intel#1561)
  [SYCL] Added support of rounding modes for non-host devices (intel#1463)
  [SYCL] SemaSYCL significant refactoring (intel#1517)
  [SYCL] Support 0-dim accessor in handler::copy(accessor, accessor) (intel#1551)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.