Skip to content

[GPU] Set minimum memory of count for reduce mean mode of scatter_elements_update, fix typos and remove space #30491

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

steve-y
Copy link
Contributor

@steve-y steve-y commented May 11, 2025

Details:

  • Set minimum memory of count for reduce mean mode of scatter_elements_update
  • Fix typos and remove redundant spaces
  • Add unit test

Tickets:

  • 155068

@steve-y steve-y requested review from a team as code owners May 11, 2025 12:25
@github-actions github-actions bot added the category: GPU OpenVINO GPU plugin label May 11, 2025
__local int count_v[1];
__local int count_k[COUNT_LIMIT/64];
__local int count_v[COUNT_LIMIT/64];
count_length = COUNT_LIMIT/64;
Copy link
Contributor

Choose a reason for hiding this comment

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

what about implementing it from jitter-side? I think that will be clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fix was implemented from jitter-side as you commented.
Thanks for your comment.

@steve-y steve-y changed the title [GPU] Set minimum memory of count for reduce mean, fix typos and remove space [GPU] Set minimum memory of count for reduce mean mode of scatter_elements_update, fix typos and remove space May 12, 2025
@steve-y steve-y force-pushed the sy/fix_reduce_mean branch from 53c2aa7 to dd8ef87 Compare May 13, 2025 00:00
@@ -201,6 +201,7 @@ KernelsData ScatterElementsUpdateKernelRef::GetKernelsData(const Params& params)
if (i == 1) {
cldnn_jit.AddConstant(MakeJitConstant("IS_SECOND_ITER", "true"));
cldnn_jit.AddConstant(MakeJitConstant("COUNT_LIMIT", params.engineInfo.maxLocalMemSize));
cldnn_jit.AddConstant(MakeJitConstant("COUNT_MINIMUM", params.engineInfo.maxLocalMemSize/64));
Copy link
Contributor

Choose a reason for hiding this comment

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

  • What does it mean that COUNT_LENGTH==0? Then I guess total workitem size is just 0 and no code will be executed. Isn't it?

  • what about just setting COUNT_LENGTH = dispatchData.gws[0] * dispatchData.gws[1] * dispatchData.gws[2] if dispatchData.gws[0] * dispatchData.gws[1] * dispatchData.gws[2] != 0 else COUNT_MINIMUM? Then you don't need to introduce additional variable.

Copy link
Contributor Author

@steve-y steve-y May 13, 2025

Choose a reason for hiding this comment

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

When running, COUNT_LENGTH = 0 if shape agnostic kernel is selected. So the original code has [1] in case of shape agnostic kernel, and it is fixed to [1k].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GPU OpenVINO GPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants