-
Notifications
You must be signed in to change notification settings - Fork 117
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
[Exp][usm-p2p] Initial usm-p2p UR extension. #631
Conversation
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Co-authored-by: Petr Vesely <22935437+veselypeta@users.noreply.github.com>
Co-authored-by: Petr Vesely <22935437+veselypeta@users.noreply.github.com>
Co-authored-by: Petr Vesely <22935437+veselypeta@users.noreply.github.com>
Co-authored-by: Petr Vesely <22935437+veselypeta@users.noreply.github.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
@pbalcer Thanks, it is looking good now. |
Correct subtitle format. Co-authored-by: Kenneth Benzie (Benie) <k.benzie83@gmail.com>
Co-authored-by: Kenneth Benzie (Benie) <k.benzie83@gmail.com>
@JackAKirk looks like you need to commit files after running the |
Removed unrequired description of UR_RESULT_ERROR_ADAPTER_SPECIFIC. Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Just needed to add the indent changes but got distracted. Should be good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Let me know when you're happy to merge and I can hit the button (I'm assuming that you don't have the permissions) 👍 |
Cheers, I just have a little query then I'm happy for this to be merged. Currently "ur_api.cpp" has these generated functions returning
So what is the procedure to do this. I guess in the intel/llvm PR I should define the function in each adapter. But I just wanted to check that it isn't the case that there will be a default definition that some adapters might revert to? |
If your question is about asking UR if the extension is supported. I believe we currently do this through the device query This is something we should have documented so I will add this to the documentation. |
The point is that previously we could have a portable implementation of e.g. this function: even when a particular backend did not yet implement P2P in the PI/UR: In such case the Adapter should return an error stating it isn't yet implemented. Note that the query functions had a default where the P2P_infos simply return false if the Enable/Disable functions are not yet implemented for that adapter. This behaviour was requested by Greg in this PR intel/llvm#8303. So is this not still the case because the SYCL function will have to instead query if the extension is supported for each adapter? |
I think you can implement this in the pi2ur layer. If the adapter doesn't support it, then you can set the PI error as you say. |
OK cool, I'm just wondering what the long term solution is to such a situation when pi2ur is removed. But in any case I don't think anything is to be changed in this PR so happy for it to be merged now! |
I'm not sure long-term in terms of the SYCL-RT, but in UR I don't think we should be returning a |
So the advantage of returning UR_ADAPTER_SPECIFIC is that the sycl runtime looks for the PI equivalent of this error automatically via plugin::check: if it is returned then it passes the last message to sycl::exception. This allows the relevant information (that the function isn't yet implemented for that adapter) to be passed to the runtime automatically without any special backend specific checks. |
Maybe this is a topic for discussion at the WG call @kbenzie ? |
The answer seems to be that atm people are using (see https://github.com/intel/llvm/pull/9992/files):
etc, which uses |
This PR adds new functions and enum to UR corresponding to the new PI functions introduced in this PR (which will be updated to take into account the UR migration): intel/llvm#8303
FYI note that currently "P2P" is being translated to "P2_P". I was thinking of getting around this by switching to "usm-ptop", but this is not ideal since I don't think I am allows the case variation: "PtoP"?