Skip to content

[SYCL][UR][HIP] s/ScopedContext/ScopedDevice #10672

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

Closed
wants to merge 1 commit into from

Conversation

ldrumm
Copy link
Contributor

@ldrumm ldrumm commented Aug 3, 2023

d1c92cb changed ScopedContext to take a device instead of a context thus sematically changing its meaning. This rename makes it clear what the intented usages are.

@ldrumm ldrumm requested review from omarahmed1111 and hdelan August 3, 2023 10:47
@ldrumm ldrumm requested a review from a team as a code owner August 3, 2023 10:47
@ldrumm ldrumm requested a review from jchlanda August 3, 2023 10:47
@hdelan
Copy link
Contributor

hdelan commented Aug 3, 2023

Also would it be possible to do this in the CUDA adapter as well?

@ldrumm ldrumm temporarily deployed to aws August 3, 2023 11:06 — with GitHub Actions Inactive
@ldrumm
Copy link
Contributor Author

ldrumm commented Aug 3, 2023

Also would it be possible to do this in the CUDA adapter as well?

I'll leave that for someone else, another time. This is a side effect of work on HIP only

@ldrumm ldrumm force-pushed the sycl-ur-scopeddevice branch 2 times, most recently from 1fac38f to 8bf78d7 Compare August 3, 2023 11:37
@ldrumm ldrumm temporarily deployed to aws August 3, 2023 11:39 — with GitHub Actions Inactive
@ldrumm ldrumm force-pushed the sycl-ur-scopeddevice branch from 8bf78d7 to 8bc2c38 Compare August 3, 2023 12:41
@ldrumm ldrumm temporarily deployed to aws August 3, 2023 12:43 — with GitHub Actions Inactive
@ldrumm ldrumm force-pushed the sycl-ur-scopeddevice branch from 8bc2c38 to fd3f7ef Compare August 3, 2023 12:55
@ldrumm ldrumm requested a review from a team as a code owner August 3, 2023 12:55
@ldrumm ldrumm temporarily deployed to aws August 3, 2023 13:02 — with GitHub Actions Inactive
@ldrumm ldrumm force-pushed the sycl-ur-scopeddevice branch from fd3f7ef to a18e9e8 Compare August 3, 2023 15:49
@ldrumm ldrumm temporarily deployed to aws August 3, 2023 16:01 — with GitHub Actions Inactive
@hdelan
Copy link
Contributor

hdelan commented Aug 3, 2023

LGTM

@ldrumm ldrumm temporarily deployed to aws August 3, 2023 16:43 — with GitHub Actions Inactive
@jchlanda
Copy link
Contributor

jchlanda commented Aug 4, 2023

I'm not sure if I see it in the same way, the fact that it now takes a ur_device_handle_t to construct the object is merely an implementation detail, the purpose is still the same, to manage the hipCtx_t and so the original name (ScopedContext) seems more fitting. I do not feel strong about it, so if the majority prefers the updated version I'm happy to roll with it.

@ldrumm
Copy link
Contributor Author

ldrumm commented Aug 8, 2023

I'm not sure if I see it in the same way, the fact that it now takes a ur_device_handle_t to construct the object is merely an implementation detail, the purpose is still the same, to manage the hipCtx_t and so the original name (ScopedContext) seems more fitting. I do not feel strong about it, so if the majority prefers the updated version I'm happy to roll with it.

Fair point. I did this because I got confused with the semantics, but yes - it is is still managing the context. I'll think about it a little, and then either close this PR, or convince you I'm right ;)

@hdelan
Copy link
Contributor

hdelan commented Aug 8, 2023

I think from the viewpoint of the UR, it makes sense to think of this as a scoped UR device. It is an implementation detail of the plugins that we manage UR devices through native contexts. I think as long as we are using UR, where UR contexts mean something different to native contexts, we should try to make all user facing semantics involving contexts related to UR contexts, and not native contexts. Therefore IMO we should keep this as a (UR) device related feature.

@hdelan
Copy link
Contributor

hdelan commented Aug 21, 2023

@jchlanda can we get this approved plz? @ldrumm can you maybe close and reopen the PR to retrigger the CI?

d1c92cb changed ScopedContext to take a device instead of a context
thus sematically changing its meaning. This rename makes it clear what
the intented usages are.
@ldrumm ldrumm force-pushed the sycl-ur-scopeddevice branch from a18e9e8 to 7b57951 Compare September 1, 2023 09:10
@jchlanda
Copy link
Contributor

jchlanda commented Sep 5, 2023

I understand where you are coming from and you make a good argument for it, perhaps we could fold in your reasoning in form of a comment, just in case anyone else wonders about the name?

@ldrumm did you decide if you'd like to keep this change?

I think from the viewpoint of the UR, it makes sense to think of this as a scoped UR device. It is an implementation detail of the plugins that we manage UR devices through native contexts. I think as long as we are using UR, where UR contexts mean something different to native contexts, we should try to make all user facing semantics involving contexts related to UR contexts, and not native contexts. Therefore IMO we should keep this as a (UR) device related feature.

@hdelan
Copy link
Contributor

hdelan commented Sep 5, 2023

Thanks @jchlanda I think that sounds reasonable. @ldrumm would you be able to add a comment noting why the name change?

Copy link
Contributor

@jandres742 jandres742 left a comment

Choose a reason for hiding this comment

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

no L0 changes but since L0 reviewers are requested, +1

@ldrumm ldrumm closed this May 24, 2024
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.

5 participants