Skip to content

[SYCL] move more common utils from pi_level_zero #7821

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 2 commits into from
Dec 21, 2022

Conversation

igchor
Copy link
Member

@igchor igchor commented Dec 16, 2022

to UR.

@igchor igchor requested review from a team as code owners December 16, 2022 17:54
@igchor igchor requested a review from steffenlarsen December 16, 2022 17:54
struct _pi_object {
_pi_object() : RefCount{} {}

// Level Zero doesn't do the reference counting, so we have to do.
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to get rid of direct mention of Level Zero in "UR"
Also we need to think how this affects backends that do refcnt, e.g. opencl

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Yes, we need to see how useful this _pi_object is for other adapters.

Also, we probably need to do something with the env variables, like SYCL_PI_LEVEL_ZERO_SINGLE_THREAD_MODE. Should we have separate ones for PI and UR?

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 need to keep SYCL_PI_LEVEL_ZERO_* ones since customers are already using those, and probably go through some deprecation process for them (suggesting to use new names instead in a warning for some period of time). That said, it looks like we should have 2 options with different names to mean the same thing while we transition.

@igchor igchor force-pushed the move_some_common_utils_to_ur branch from 86774a7 to 0ee6f42 Compare December 16, 2022 18:04
@igchor igchor force-pushed the move_some_common_utils_to_ur branch from 0ee6f42 to 988246e Compare December 16, 2022 18:36
@igchor
Copy link
Member Author

igchor commented Dec 16, 2022

@smaslov-intel what is the general recommendation for what should stay in pi_level_zero.*pp vs what should be transferred to ur/adapters/level_zero/ur_level_zero.*pp?

Do we want to end up implementing most of the pi_level_zero interfaces using UR (and just adding interop), or do we want to have a more independent implementation with just a few functions (like *PlatformGet), utils, and data structures shared?

As long as we don't introduce any overhead, we can probably start moving the implementation of pi_context, pi_device, pi_queue, etc. to the ur/adapters/level_zero/ur_level_zero.*pp, right?

@smaslov-intel
Copy link
Contributor

@smaslov-intel what is the general recommendation for what should stay in pi_level_zero.*pp vs what should be transferred to ur/adapters/level_zero/ur_level_zero.*pp?

Do we want to end up implementing most of the pi_level_zero interfaces using UR (and just adding interop), or do we want to have a more independent implementation with just a few functions (like *PlatformGet), utils, and data structures shared?

As long as we don't introduce any overhead, we can probably start moving the implementation of pi_context, pi_device, pi_queue, etc. to the ur/adapters/level_zero/ur_level_zero.*pp, right?

Right, we want to move and share as much as possible.
Ideally, after some short time, we will be able to completely get rid of the pi_level_zero plugin and switch to ur_level_zero plugin, which would be doing the same in the beginning.

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

Approving with a small comment. I will leave the final say to @smaslov-intel .

// initialization function provided in Init. All subsequent access to
// the data just returns the already stored data.
//
template <class T> struct ZeCache : private T {
Copy link
Contributor

Choose a reason for hiding this comment

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

I may be wrong, but Ze seems like a leftover from L0-related naming. Should it be renamed to be more general?

Copy link
Contributor

Choose a reason for hiding this comment

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

For sure, but renaming it here means re-naming uses in PI L0 plugin too, which might be big.
I'd prefer us to rename things that are completely moved to UR already.

@pvchupin pvchupin merged commit 0f8914b into intel:sycl Dec 21, 2022
@igchor igchor deleted the move_some_common_utils_to_ur branch December 21, 2022 16:04
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.

4 participants