Skip to content

[SYCL][Graph] Implement dynamic local accessors #18437

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 8 commits into from
May 27, 2025

Conversation

fabiomestre
Copy link
Contributor

@fabiomestre fabiomestre commented May 13, 2025

  • Implements the dynamic_local_accessor class with compiler support.
  • Refactor the recently added dynamic_work_group_memory class to only use one impl member variable. This brings it closer to the design of other sycl classes and avoids future ABI break issues.
  • There are 2 ABI breaking changes. However, they are both related to the dynamic_work_group_memory class whose specification has not been merged yet and is not yet officially supported.

@fabiomestre fabiomestre changed the title Implement dynamic local accessors [SYCL][Graph] Implement dynamic local accessors May 13, 2025
@fabiomestre fabiomestre force-pushed the fabio/v2_dynamic_local_accessor_impl branch from 56eaa40 to 32945a2 Compare May 13, 2025 12:23
@fabiomestre fabiomestre force-pushed the fabio/v2_dynamic_local_accessor_impl branch from 00f1bbf to da31888 Compare May 13, 2025 14:02
@fabiomestre fabiomestre force-pushed the fabio/v2_dynamic_local_accessor_impl branch from db1d142 to 19e107c Compare May 13, 2025 18:16
@fabiomestre fabiomestre marked this pull request as ready for review May 13, 2025 18:43
@fabiomestre fabiomestre requested review from a team as code owners May 13, 2025 18:43
@fabiomestre
Copy link
Contributor Author

Missing reviews from @intel/llvm-reviewers-runtime and @intel/dpcpp-cfe-reviewers. Could someone from these groups have a look at this PR?

Copy link
Contributor

@EwanC EwanC left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'm not as familiar with this code or Ben/Konrad, so should get one or both of them to approve this too.

Copy link
Contributor

@konradkusiak97 konradkusiak97 left a comment

Choose a reason for hiding this comment

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

LGTM!

setArgHelper(int ArgIndex,
ext::oneapi::experimental::detail::dynamic_work_group_memory_base
&DynWorkGroupBase);
template <typename DataT, typename PropertyListT>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would it make sense to only have declaration here and provide out-of-class definition somewhere in the graph 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.

I think that it makes sense to keep this in the handler header, at least for this PR. There is already a precedent to having setArgHelper() implementations in the handler for existing graph functionality (e.g. dynamic_parameter) and other extensions (e.g. work_group_memory). Moving only part of the implementation to the graph headers can be confusing. However, if you think that the handler header is getting too large / full of extension functionality, we can consider possible refactoring options as part of future work.

@fabiomestre
Copy link
Contributor Author

Friendly ping to @intel/dpcpp-cfe-reviewers. Would appreciate a review on this PR.

@fabiomestre
Copy link
Contributor Author

@intel/llvm-gatekeepers This PR should be ready to merge.

@steffenlarsen steffenlarsen merged commit c20712f into intel:sycl May 27, 2025
24 checks passed
steffenlarsen added a commit to steffenlarsen/llvm that referenced this pull request May 27, 2025
After intel#18437, the runtime library is
producing a warning about an unused variable AccTarget in handler.cpp.
This is due to the variable only being used in assert, which may in turn
be removed when assertions are disabled. This commit removes the
variable in favor of making the conversion inside the assert.

Signed-off-by: Larsen, Steffen <[email protected]>
@steffenlarsen
Copy link
Contributor

Post-commit failure addressed in #18675.

steffenlarsen added a commit that referenced this pull request May 27, 2025
After #18437, the runtime library is
producing a warning about an unused variable AccTarget in handler.cpp.
This is due to the variable only being used in assert, which may in turn
be removed when assertions are disabled. This commit removes the
variable in favor of making the conversion inside the assert.

Signed-off-by: Larsen, Steffen <[email protected]>
@@ -3520,7 +3519,14 @@ _ZN4sycl3_V17handler11saveCodeLocENS0_6detail13code_locationE
_ZN4sycl3_V17handler11saveCodeLocENS0_6detail13code_locationEb
_ZN4sycl3_V17handler11storeRawArgEPKvm
_ZN4sycl3_V17handler12addReductionERKSt10shared_ptrIKvE
_ZN4sycl3_V17handler12setArgHelperEiRNS0_3ext6oneapi12experimental6detail30dynamic_work_group_memory_baseE
_ZN4sycl3_V13ext6oneapi12experimental6detail30dynamic_work_group_memory_base18updateWorkGroupMemEm
Copy link
Contributor

Choose a reason for hiding this comment

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

These aren't sorted, @fabiomestre how did you generate this diff? Was it the script or did you do it manually?

Copy link
Contributor

Choose a reason for hiding this comment

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

@fabiomestre , ping.

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 has been a while so I don't remember exactly. I believe I used the script, for the initial PR but there were changes as a result of review comments, maybe I didn't use it at that point and assumed that the CI would tell me if anything was wrong.

I tried to run the script just now and it doesn't show any changes. How do I check whether this files are correctly sorted or not? If this is important, wouldn't it make sense for the CI to enforce it?

Please let me know if there is anything that still needs to be fixed at this point as a result of this PR. I can look into it and open a follow up PR.

Copy link
Contributor Author

@fabiomestre fabiomestre Jun 11, 2025

Choose a reason for hiding this comment

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

Nevermind, I ran the script again and got the diff. Please review: https://github.com/intel/llvm/pull/18924/files

Note that it also showed diff for changes unrelated to this PR (e.g. submit_without_events).

Copy link
Contributor

Choose a reason for hiding this comment

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

I've been thinking that the CI should check if the lines are sorted, but I wasn't sure if breaks when people manually edit the file, or if difference in the development environment (e.g. python version) make the script itself produce different output, hence my questions.

If that's always some manual edit, then we can enforce sorting, otherwise some tooling change is required first.

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