Skip to content

Make the WebGPU backend pass test-llama-archs tests#26146

Draft
fairydreaming wants to merge 8 commits into
ggml-org:masterfrom
fairydreaming:webgpu-ci-fix
Draft

Make the WebGPU backend pass test-llama-archs tests#26146
fairydreaming wants to merge 8 commits into
ggml-org:masterfrom
fairydreaming:webgpu-ci-fix

Conversation

@fairydreaming

@fairydreaming fairydreaming commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Overview

This PR fixes multiple issues that caused crashes and tests failures when running test-llama-archs with WebGPU backend.

Additional information

WebGPU fixes are:

  • handling of src0/src1 overlap in GLU OP (happened in Phi-3 that uses split SwiGLU)
  • handling of b/c overlap in SSM_SCAN OP (happened in Mamba)

Additionally WebGPU can't handle zero-length tensors (happened with MiniCPM3 and DeepSeek V3.2 due to default rope length being equal to key length - so nothing was left for nope part), so I added small tweaks in test-llama-archs to prevent them.

This is my first time touching WebGPU backend, so someone with more knowledge shall thoroughly review these changes.

Edit: after checking freshly added MiniMax M3 of course it also crashed in WebGPU due to weird issue - ggml_add_inplace() resulted in src0 and src1 being on WebGPU backend but dst being on CPU backend. I temporarily replaced it with ggml_add().

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - consulted possible fixes with GPT-5.6, then ignored its suggestions and did it my way

@github-actions github-actions Bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning WebGPU labels Jul 26, 2026
@github-actions github-actions Bot added the model Model specific label Jul 26, 2026
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 model Model specific testing Everything test related WebGPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants