Repository navigation
Native Vulkan backend for Qwen3.5-2B (opt-in) - #1517
joshuaswarren wants to merge 15 commits into
Conversation
…rted preservation
|
Thanks @joshuaswarren. Yes, please register them. As we said on #1420, the Vulkan backend comes in on the same terms as HIP and Intel: every kernel in the kernel contract, with its float64 cases and planted controls. The harness in Two more things before this leaves draft:
|
|
Thanks. We will split it as asked: a base PR with the device, buffers and the Q4 projection registered in the kernel contract (gates 1 to 4 on device, gate 5 from device limits, SUMMARY lines in the description), then the 2B end to end, then submit batching and penalties. The v2 fidelity margins go into the PR as the gate, and we will run it on new fixtures not used to choose it (contexts 256, 1024 and 7105), keeping the v1.1 failures in the description, judged teacher-forced against float64 versus the Metal engine. We are keeping #1517 as a draft only until the base PR is up. |
|
The base PR is up as a draft: #1526 (the Vulkan runtime and the Q4 projection registered in the kernel contract, with the SUMMARY lines from M1 Max, M1 and M2 Max). The 2B engine, submit batching and penalties will follow as separate PRs on top of it. |
|
This is superseded by #1544, the split you asked for: #1526 is the runtime and the Q4 projection, and #1544 (draft, stacked on #1526) is the engine plus every remaining kernel registered in the kernel contract, one runner per group, with the v2 fidelity gate in the description and the held-fixture result as a FAIL. The same six contract groups pass on M1 Max, M1 and M2 Max; the one known device finding (fp32 denormal flush) is recorded, not fitted. I'm leaving this draft open until you say whether to close it. |
|
Thanks @joshuaswarren for splitting this up as asked. Since #1526 and #1544 now carry the work, we'll close this one to keep the queue clear. Review continues on #1526 first, then #1544. Thanks again for the careful work here. |
|
Closing as superseded, as agreed: #1526 (the opt-in Vulkan runtime and the Q4 projection in the kernel contract) has landed on main, and the engine continues in #1544. Thanks again @joshuaswarren. |
What this changes
Adds an opt-in native Vulkan backend for one model: dense Qwen3.5-2B, MLX Q4 group 64, one GPU, one stream, greedy decoding. It builds only with
-Dvulkan=true. Outside the new Vulkan files, the diff touches four shared files:build.zig(declares the-Dvulkanoption, default off, and adds the Vulkan build steps only when it is set),zig/src/server/cli.zig(addsvulkanto the--backendchoices; the backend is offered only in a build that serves it), andTHIRD_PARTY_NOTICES.mdplusLICENSES/mlx-omarchy-MIT.txt(the MIT notice for shader code adapted from mlx-omarchy). The CUDA, Metal, HIP and XPU backends' code is unchanged. It uses the shared lane host and server, so there is no scheduler of its own. Part of #1420 (the issue this was agreed under); the submit-batching speedup is a separate follow-up PR, not in this one.Scope limits, enforced in code: Q4g64 transposed projections only, 7168-token capacity ceiling, no sampling, no speculation or drafts, no tensor parallel, no vision. Unsupported flags are refused, not ignored. Presence/frequency penalties are not applied (the shared server already logs and ignores them for a backend that does not advertise them).
Receipt
-Dvulkan=trueno Vulkan step is added to the build); any other checkpoint, device, driver, or AMD/Intel GPU; contexts of 256/1024/7105 tokens; sampling; long soak.Checklist notes
speculate=false), so draft equality does not apply.