Skip to content

ggml-webgpu: fix buffer aliasing for ssm_scan and refactor aliasing logic#22456

Merged
reeselevine merged 3 commits into
ggml-org:masterfrom
reeselevine:buffer-aliasing
Apr 28, 2026
Merged

ggml-webgpu: fix buffer aliasing for ssm_scan and refactor aliasing logic#22456
reeselevine merged 3 commits into
ggml-org:masterfrom
reeselevine:buffer-aliasing

Conversation

@reeselevine

Copy link
Copy Markdown
Contributor

Overview

@SharmaRithik noticed that when running Granite 4.0 ssm_scan aliases several tensors, which this PR fixes by adding logic to merge those tensors into a single binding in the shader. After making that change, I realized that some of the logic for calculating aliasing could be refactored so that it is consistent across all operations and takes place in the shader library during preprocessing, so I made that change as well. I also added a test for the overlapping tensors for ssm_scan.

fyi @yomaytk

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: yes to help move functions around as part of the refactor

@reeselevine reeselevine requested review from a team and ggerganov as code owners April 28, 2026 02:47
@github-actions github-actions Bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning WebGPU labels Apr 28, 2026
@SharmaRithik

Copy link
Copy Markdown
Contributor

Thanks @reeselevine! I just tested it on my Intel Arc B580 and Apple M2, and everything looks good on my end.

@reeselevine reeselevine added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Apr 28, 2026
@reeselevine reeselevine requested a review from CISC April 28, 2026 03:47
@yomaytk

yomaytk commented Apr 28, 2026

Copy link
Copy Markdown
Member

@SharmaRithik Nice catch on the bug! @reeselevine The approach makes sense, and the fix for rms_norm_mul is nice. Thank you both!

@reeselevine reeselevine merged commit 98bb579 into ggml-org:master Apr 28, 2026
45 of 46 checks passed
IntelNav pushed a commit to IntelNav/llama.cpp that referenced this pull request Apr 29, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
IntelNav pushed a commit to IntelNav/llama.cpp that referenced this pull request Apr 29, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
cnsiva pushed a commit to saas-home/llama.cpp that referenced this pull request Apr 29, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
samuraieng pushed a commit to samuraieng/llama.cpp that referenced this pull request May 6, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
meh pushed a commit to meh/llama.cpp that referenced this pull request May 10, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
baramofme pushed a commit to baramofme/llama-cpp-turboquant that referenced this pull request May 23, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
winstonma pushed a commit to winstonma/llama.cpp that referenced this pull request May 27, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
…ogic (ggml-org#22456)

* Refactor buffer aliasing to be part of shader lib decisions

* cleanup

* formatting
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 merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. testing Everything test related WebGPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants