Skip to content

[SYCL] Document the SYCL Runtime Plugin Interface. #206

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

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

kbobrovs
Copy link
Contributor

The SYCL Runtime Plugin Interface (PI) is the interface layer between
device-agnostic part of the SYCL runtime and the device-specific runtime layers
which control execution on the device. It employs the “plugin” mechanism to bind
to the device specific runtime layers similarly to what is used by libomptarget
or OpenCL.

Signed-off-by: Konstantin Bobrovsky konstantin.s.bobrovsky@intel.com

piGetEventProfilingInfo
piFlush
piFinish
piEnqueueReadBuffer
Copy link
Contributor

@agozillon agozillon Jun 11, 2019

Choose a reason for hiding this comment

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

I could be wrong or misunderstanding it, but I think this list is missing some of the calls from the pi.h interface (it may be intentional though as its the minimal subset, this comment can be disregarded then). For example piEnqueueReadBufferRect, piEnqueueWriteBufferRect and piEnqueueCopyBufferRect which are used for handling 2d/3d buffer transfers.

Copy link
Contributor Author

@kbobrovs kbobrovs Jun 12, 2019

Choose a reason for hiding this comment

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

Should we maybe avoid this duplication then and maintain APIs in one place - pi.h? Opinions?

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 just directing people to the relevant place to find the plugin interface (pi.h) and giving an example interface call would work, so they know what they're looking for. It means you wouldn't have to maintain the list in the .md every time pi.h changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Doxygen or similar could be used to generate a more readable documentation directly from the headers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It means you wouldn't have to maintain the list in the .md every time pi.h changed.

Right, that's what I meant by avoiding duplication. Will remove most of the APIs and leave just few examples.

Doxygen or similar could be used to generate a more readable documentation directly from the headers

Good idea. Should be doxygen, I think, to be compatible with llvm/clang. We can start with maintaining doxygen in the pi.h

@keryell
Copy link
Contributor

keryell commented Jun 12, 2019

Thanks for providing the SVG of the images. :-)
But is there any reason to provide the PNG and just use the PNG?
Do you have any issue with just using the SVG everywhere?

@kbobrovs
Copy link
Contributor Author

Do you have any issue with just using the SVG everywhere?

This is just a lack of experience with Open Source tools. Looks like .md viewers can show directly SVG :-) Will remove PNG.

keryell
keryell previously approved these changes Jun 14, 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.

Good for the pure SVG solution. :-)

@kbobrovs
Copy link
Contributor Author

@Ruyk , @agozillon - can someone please comment or give an approve if this version seems OK?

agozillon
agozillon previously approved these changes Jun 19, 2019
Copy link
Contributor

@agozillon agozillon left a comment

Choose a reason for hiding this comment

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

Sorry, it LGTM.

@kbobrovs kbobrovs requested a review from bader June 19, 2019 23:31
@kbobrovs
Copy link
Contributor Author

@agozillon - thanks.
@bader, please provide your input

to the device specific runtime layers similarly to what is used by libomptarget
or OpenCL.

![PI in SYCL runtime architecture](images/SYCL_RT_arch.svg)
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 we can make this picture clearer by removing components not related to the SYCL runtime plug-in interface.
E.g. TBB/OpenMP, all SYCL runtime components except PI related component.

Please, add legend clarifying the difference between solid and dotted lines.

Not sure how important is to have "host device" on this picture, but if you decide to not remove it, please, update SYCL runtime library component name.
"Host device RT interace" -> "Host device RT interface".
It would be great if can highlight that "PI interface" != "Host device RT interface".

Please, stretch out the image to fill the canvas. All images look smaller than they can be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, will update

Ruyk
Ruyk previously approved these changes Jul 9, 2019
Copy link
Contributor

@Ruyk Ruyk left a comment

Choose a reason for hiding this comment

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

Some minor comments. Also, names should match the PI interface names in the various @smaslov-intel PR (more points in favor of a Doxygen-maintained documentation!)

matches unless the differences are explicitly specified in this document. While
PI has roots in OpenCL, it does have many differences, and the gap is likely
to grow, for example in the areas of memory model and management, program
management.
Copy link
Contributor

Choose a reason for hiding this comment

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

After the (welcomed) latest changes to the naming scheme, is not so clear anymore which functions map 1:1 to OpenCL.
Maybe the document could contain the mapping down below?

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'd expect (at least part of) PI<->OpenCL mapping is to evolve, so I suggest that instead every function in the pi.h is commented whether it has direct OpenCL couterpart or not.

@bader
Copy link
Contributor

bader commented Aug 7, 2019

@kbobrovs, please, upload updated version.

bader
bader previously approved these changes Sep 23, 2019
Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

LGTM.
I'd like @smaslov-intel and @Ruyk to confirm that all their comments are addressed, before merging this change.

@bader
Copy link
Contributor

bader commented Sep 23, 2019

@kbobrovs, could you rebase the patch to the tip of the sycl branch, please?
There are some unexpected test failures, which seems to be related to the outdated sources.

Initial version of the SYCL runtime plugin interface document.
The SYCL Runtime Plugin Interface (PI) is the interface layer between
device-agnostic part of the SYCL runtime and the device-specific runtime layers
which control execution on the device. It employs the plugin mechanism to bind
to the device specific runtime layers similarly to what is used by libomptarget
or OpenCL.

Signed-off-by: Konstantin Bobrovsky konstantin.s.bobrovsky@intel.com
@kbobrovs
Copy link
Contributor Author

@bader , done

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.

I have no issues committing this as is. @garimagu is working on incremental update to this, which should be available tomorrow.

@kbobrovs
Copy link
Contributor Author

@bader, is there anything which prevents this PR from merging?

@bader
Copy link
Contributor

bader commented Sep 26, 2019

@kbobrovs, yes.
@sergey-semenov requested changes in the past. He must approve to unblock merging.

@kbobrovs
Copy link
Contributor Author

Those changes were fixed and committed. @sergey-semenov, please confirm/approve

Copy link
Contributor

@sergey-semenov sergey-semenov left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, LGTM

@bader bader merged commit bffdbcd into intel:sycl Sep 30, 2019
@kbobrovs kbobrovs deleted the pi_doc branch July 30, 2020 12:34
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.

7 participants