Skip to content

[SYCL][Graph] Implement dynamic_work_group_memory for SYCL-Graphs #17314

Merged
martygrant merged 3 commits intointel:syclfrom
keyradical:dynamicWorkGroupMemWithFFKV2
Mar 28, 2025
Merged

[SYCL][Graph] Implement dynamic_work_group_memory for SYCL-Graphs #17314
martygrant merged 3 commits intointel:syclfrom
keyradical:dynamicWorkGroupMemWithFFKV2

Conversation

@keyradical
Copy link
Contributor

@keyradical keyradical commented Mar 5, 2025

Implements dynamic_work_group_memory for SYCL-Graphs: #16712

With this PR we're able to update work_group_memory size on subsequent graph executions. We're also now able to use dynamic_work_group_memory with both lambdas and free function kernels.

@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from 7fb552a to a5e4bbf Compare March 5, 2025 13:13
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from a5e4bbf to 2a0c7c9 Compare March 5, 2025 13:15
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from 2a0c7c9 to f15fae7 Compare March 5, 2025 13:28
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from f15fae7 to 521b53e Compare March 5, 2025 13:40
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from 521b53e to 6813258 Compare March 5, 2025 13:45
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from 3948bfe to d2dd3f4 Compare March 5, 2025 16:00
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from a3140d1 to fc2c09a Compare March 5, 2025 20:35
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from fc2c09a to 3d79d2e Compare March 6, 2025 12:05
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from aee7b34 to 5352503 Compare March 6, 2025 13:22
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from 5352503 to f5a2473 Compare March 6, 2025 17:29
Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

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

It looks like you are adding new extension exp_ext::dynamic_work_group_memory.
Could you please clarify what spec/doc covers it?

update: I see, #16712. Should Spec PR be blocking for this one then?

@keyradical
Copy link
Contributor Author

It looks like you are adding new extension exp_ext::dynamic_work_group_memory. Could you please clarify what spec/doc covers it?

update: I see, #16712. Should Spec PR be blocking for this one then?

This is actually not a new extension, it is just an addition to the experimental sycl::ext::oneapi::graph extension. So in this case we'd want to merge the implementation first, before the PR with the spec changes to avoid having something in the spec which is not supported (yet).

If this were a new specification/distinct feature it might be different (since that would be merged as "proposed" first before the implementation is done), but since we are updating an existing feature/specification it's the other way around.

@keyradical keyradical marked this pull request as draft March 13, 2025 13:03
@keyradical keyradical force-pushed the dynamicWorkGroupMemWithFFKV2 branch from 05a3419 to 1ba08c4 Compare March 13, 2025 13:25
@keyradical
Copy link
Contributor Author

I had to fix some L0 leaks but this is now done and this PR is ready for final review.

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.

Nice work, LGTM. I'd like @Bensuo and @fabiomestre to approve this as well.

Copy link
Contributor

@Bensuo Bensuo left a comment

Choose a reason for hiding this comment

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

LGTM just a few nitpicks

Copy link
Contributor

@sommerlukas sommerlukas left a comment

Choose a reason for hiding this comment

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

JIT compiler changes LGTM.

@EwanC
Copy link
Contributor

EwanC commented Mar 21, 2025

pinging @intel/dpcpp-cfe-reviewers for review

Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

Are more kinds of work_group_memory coming?
The copy-paste in clang's code is somewhat unfortunate. Any chance the runtime library may not need to know which kind of work_group_memory is that?

@keyradical
Copy link
Contributor Author

keyradical commented Mar 24, 2025

Are more kinds of work_group_memory coming? The copy-paste in clang's code is somewhat unfortunate. Any chance the runtime library may not need to know which kind of work_group_memory is that?

Short answer is yes. We're extending sycl-graph specification with dynamic_work_group_memory, dynamic_local_accessor and dynamic_accessor. These are outlined in the spec changes PR: #16712. Similarly to this PR, the plan is for all these new types to follow the similar pattern which wraps around the existing classes to add the update functionality in graphs. Altough actually they would be related to local_accessor and accessor and not work_group_memory. Specifically for work_group_memory, no, there are no more new kinds of it coming.

That's true, there has been a bit of a copy-paste in clang's code but AFAIK, this is required if we want to pass dynamic_work_group_memory type to a kernel. I can't think of a way in which the frontend doesn't need to know the exact kind of work_group_memory. I'll follow up with a refactor PR if I manage to find a solution.

@keyradical
Copy link
Contributor Author

keyradical commented Mar 27, 2025

@intel/llvm-gatekeepers this is ready to be merged, thank you.

@EwanC
Copy link
Contributor

EwanC commented Mar 27, 2025

@intel/llvm-gatekeepers this is ready to be merged, thank you.

I think this still needs a @intel/llvm-reviewers-runtime approval

@keyradical
Copy link
Contributor Author

@intel/llvm-gatekeepers this is ready to be merged, thank you.

I think this still needs a @intel/llvm-reviewers-runtime approval

That's true, gatekeepers, sorry for the oversight.

@keyradical
Copy link
Contributor Author

@KseniyaTikhomirova could I get a review on this, please?

Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

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

sycl part LGTM

@keyradical
Copy link
Contributor Author

@intel/llvm-gatekeepers this is now ready to merge

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.

8 participants