Repository navigation
Fix CI: Fix models Backend webgpu by supporting GGML_OP_DUP - #30216
Conversation
The mixed batch path of PR-29622 writes the token rows with set_rows into a dup of the embeddings. WebGPU did not support DUP, so the dup ran on the CPU while the set_rows writing into it was scheduled on WebGPU, which then bound a CPU buffer and crashed. DUP is the same copy as CPY and CONT and now goes through the same path.
|
@ServeurpersoCom Thanks. You can try to tackle the failing server test next: https://github.com/ggml-org/llama.cpp/actions/runs/37903861970/job/113732486606#step:6:4633 I've root-caused it to be due to graph reallocations when we use backend sampling. Basically, we reserve a graph for the worst case of all sequences having a sampling enabled. But then the test runs a decoding batch using only one sequence, which changes the number of nodes. There are 2 possible ways to fix it:
Both options are a bit tricky and I am not sure if it would increase the complexity a lot. So worst case is to adapt the failing tests to not trigger this and add TODOs to rework this in the future. |
Thanks for the root cause! Option 1 turned out to be small: build_sampling already did it for inactive samplers, so every sampler now always builds n_outputs_max_per_seq chains and decodes keep the topology of the reserve. |
|
The two WebGPU self-hosted reds are on master too, not related to DUP (DUP, CPY and CONT all pass in that log) I'll see if I can follow up |
The mixed batch path of PR-29622 writes the token rows with set_rows into a dup of the embeddings. WebGPU did not support DUP, so the dup ran on the CPU while the set_rows writing into it was scheduled on WebGPU, which then bound a CPU buffer and crashed. DUP is the same copy as CPY and CONT and now goes through the same path.
Overview
Fix CI:
Models Backend webgpu-nvidia segfaults on master since #29622, on the very first model of test-llama-archs.
The new mixed batch path writes the token rows with set_rows into a ggml_dup of the embeddings. WebGPU had no GGML_OP_DUP, so the dup stayed on the CPU, while the set_rows writing in place into it was scheduled on WebGPU. WebGPU then got a destination living in a CPU buffer, read its context as a WebGPU buffer, and Dawn crashed. CUDA and Vulkan support DUP, so they never hit it.
DUP is the same copy as CPY and CONT, so it now goes through the same path and the whole mixed chain stays on WebGPU.
Additional information
Tested on an RTX PRO 6000 through WebGPU with the CI Dawn build:
Follow-up #29622
Requirements