-
Notifications
You must be signed in to change notification settings - Fork 20.2k
fix vulkan ggml_acc only works in 3d but not 4d #19426
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
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d4e0103
fix vulkan ggml_acc only works in 3d but not 4d
ymcki 3679d22
removed clamp in test_acc_block
ymcki 635a72a
use the correct stride and its test case
ymcki 8045d54
cuda : fix "supports op" condition
ggerganov f9f59b0
change src0 to src1 in ggml_vk_acc. Update acc.comp with jeffbolznv\'…
ymcki 570b717
Merge branch 'ggml-org:master' into vulkan_acc
ymcki a3ab50c
Merge branch 'vulkan_acc' of github.com:ymcki/llama.cpp into vulkan_acc
ymcki 81ddff9
version without boundary check
ymcki 120a311
revert back to boundary check version
ymcki 9ee0263
Merge branch 'ggml-org:master' into vulkan_acc
ymcki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,17 +13,19 @@ void main() { | |
|
|
||
| const uint offset = p.param3; | ||
| const uint src1_i = idx - offset; | ||
| const uint oz = src1_i / p.nb02; | ||
| const uint oy = (src1_i - (oz * p.nb02)) / p.nb01; | ||
| const uint ox = src1_i % p.nb01; | ||
| const uint oz = src1_i / p.nb03; | ||
| const uint remy = src1_i - oz * p.nb03; | ||
| const uint oy = remy / p.nb02; | ||
| const uint remx = remy - oy * p.nb02; | ||
| const uint ox = remx / p.nb01; | ||
| const uint ow = remx % p.nb01; | ||
|
0cc4m marked this conversation as resolved.
Outdated
|
||
|
|
||
| uint i00, i01, i02, i03; | ||
| get_indices(idx, i00, i01, i02, i03); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the CPU reference, seems like there should only be one set of indices and then you can apply |
||
|
|
||
| if (ox < p.ne10 && oy < p.ne11 && oz < p.ne12) { | ||
| data_d[get_doffset() + dst_idx(i00, i01, i02, i03)] = D_TYPE(FLOAT_TYPE(data_a[get_aoffset() + src0_idx(i00, i01, i02, i03)]) + FLOAT_TYPE(data_b[get_boffset() + ox + oy * p.ne10 + oz * p.ne10 * p.ne11])); | ||
| if (ow < p.ne10 && ox < p.ne11 && oy < p.ne12 && oz < p.ne13) { | ||
| data_d[get_doffset() + dst_idx(i00, i01, i02, i03)] = D_TYPE(FLOAT_TYPE(data_a[get_aoffset() + src0_idx(i00, i01, i02, i03)]) + FLOAT_TYPE(data_b[get_boffset() + ow + ox * p.ne10 + oy * p.ne10 * p.ne11 + oz * p.ne10 * p.ne11 * p.ne12])); | ||
| } else { | ||
| data_d[get_doffset() + dst_idx(i00, i01, i02, i03)] = D_TYPE(FLOAT_TYPE(data_a[get_aoffset() + src0_idx(i00, i01, i02, i03)])); | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.