Skip to content
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

vulkan: implement several ops relevant for ggml_opt #11769

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

Conversation

remyoudompheng
Copy link
Contributor

This PR implements several GGML opcodes which are possibly relevant for #10544 (SUM, ARGMAX, SUB, COUNT_EQUAL, OPT_STEP_ADAMW, REPEAT_BACK).
After these patches, it is possible to run test-opt using the Vulkan backend (with a few failures maybe caused by rounding issues?).

Several issues were identified in test-backend-ops:

  • SUB was not tested at all
  • REPEAT_BACK has a few cases not supported by the CPU backend (crash with -b CPU)

Several issues were identified in Vulkan CHECK_RESULTS mode:

  • RWKV_WKV6 was crashing
  • various buffers were not freed

@github-actions github-actions bot added testing Everything test related Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Feb 9, 2025
count += uint(data_a[idx] == data_b[idx]);
}

atomicAdd(data_d[0], D_TYPE(count));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This shader crashes my Intel A770. I assume it's this atomicAdd. Maybe there is a way to avoid it?

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'm not sure how to perform reduction with multiple workgroups without adding an extra buffer.
Maybe doing a single atomic per warp helps with your crash?

Does it also crash with this variant : a1633e4 ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's surprising this crashes because int32 atomics in compute shaders are required in vulkan 1.0. Does it crash during the compile or while executing? Maybe the compiler would handle uint better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning testing Everything test related Vulkan Issues specific to the Vulkan backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants