Skip to content

Zyphra Zamba2 on Vulkan: carry ggml-org#21412, and a d_state-64 Mamba-2 scan - #114

Merged
bong-water-water-bong merged 1 commit into
mainfrom
zamba2
Sep 26, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
zamba2

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

First step of Zyphra-family support. Zamba2 (Mamba-2 layers plus shared transformer blocks) is the family's most downloaded line (Zamba2-1.2B-instruct alone: 213k).

Vulkan pin third_party/llama.cpp-vulkan → 1bit/vulkan-upstream a32f0d6f:

Commit What
62484fba ggml-org#28243, Flash-Next MTP (as before)
5ce79a56 ggml-org#21412 Zamba2 + converter. Reviewed line by line: model code self-contained; the one shared change (is_n_embd_{k,v}_gqa_variable skipping KV-less layers) only affects a warning in v0.5.0; no network/file/process/build changes. Changed lines identical to the PR (530/530).
a32f0d6f ours: Vulkan SSM_SCAN had pipelines only for d_state 128/256, so Zamba2-2.7B/7B (d_state 64) ran the scan on the CPU in every layer (110 graph splits). Adds the 64 pipeline where it is a whole number of subgroups, plus two test-backend-ops cases.

Measured on Strix Halo (Q8_0, llama-bench):

Zamba2 tg64 before → after pp256 before → after
1.2B-instruct 88.7 → 89.8 3227 → 3166
2.7B-instruct 4.3 → 45.2 614 → 1541
7B-Instruct 2.1 → 17.1 29 → 523

test-backend-ops SSM_SCAN: 14/14 on Vulkan0. Engine ctest 8/8 (-DONEBIT_VULKAN=ON). 1bit serve --device vulkan + Zamba2-2.7B: "The capital of France is Paris." at 45.6 tok/s. registry_check: PASS for Zamba2 1.2B / 2.7B / 7B (recorded in registry/checked.json).

Registry regenerated from the pins: Zamba2ForCausalLM → vulkan; it also brings the recorded HRX pin up to 5556bf2 (it still said c358334). docs/vulkan.md lists the carried commits and the numbers; NOTICE credits #21412.

Next for the family: ZAYA1-74B / base / reasoning (same zaya architecture), Zamba v1 and BlackMamba (our own implementations), the VL models.

🤖 Generated with Claude Code

…-2 scan

third_party/llama.cpp-vulkan moves to 1bit/vulkan-upstream a32f0d6f: v0.5.0,
ggml-org#28243 (Flash-Next MTP, as before), ggml-org#21412 (Zamba2, reviewed
line by line; carried until upstream merges it) and our Vulkan fix: the
Mamba-2 SSM_SCAN had pipelines only for a 128/256 state, so Zamba2-2.7B/7B
(state 64) ran the scan on the CPU in every layer (110 graph splits). Now:

  Zamba2 Q8_0      tg64 before -> after   pp256 before -> after
  1.2B-instruct    88.7 -> 89.8           3227 -> 3166
  2.7B-instruct     4.3 -> 45.2            614 -> 1541
  7B-Instruct       2.1 -> 17.1             29 ->  523

test-backend-ops SSM_SCAN 14/14 on Vulkan0 (two new cases with Zamba2's
shapes). registry: Zamba2ForCausalLM -> vulkan (regenerated from the pins,
which also brings the recorded HRX pin up to 5556bf2); registry_check PASS
for Zamba2 1.2B/2.7B/7B. docs/vulkan.md lists the carried PRs and the
numbers; NOTICE credits #21412.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@context7

context7 Bot commented Sep 26, 2026

Copy link
Copy Markdown

Docs7 for 1bit-monster/engine

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit 9114757

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Performance Claim Verification

The PR claims significant performance improvements for Zamba2 models on Vulkan (e.g., 2.1 → 17.1 tok/s for 7B-Instruct), but these claims are based on measurements from a specific hardware (Strix Halo) and may not be universally applicable. The PR should clarify if these performance gains are consistent across different Vulkan implementations or if they are specific to the Strix Halo hardware.

v0.5.0 + #28243 + #21412 + the d_state-64 scan (`a32f0d6f`); Zamba2 converted with the carried converter (`convert_hf_to_gguf.py --outtype q8_0`), test-backend-ops SSM_SCAN 14/14 on Vulkan0:

| Zamba2 (Q8_0, `llama-bench -p 256 -n 64`) | pp256 | tg64 | chat |
|---|---|---|---|
| 1.2B-instruct | 3166 | 89.8 | "The capital of France is Paris." |
| 2.7B-instruct | 1541 (was 614) | 45.2 (was 4.3: scan on the CPU) | correct |
| 7B-Instruct (2 shared blocks, RoPE) | 523 (was 29) | 17.1 (was 2.1) | correct, 16.7 tok/s |
Architecture Registration

The PR registers 'Zamba2ForCausalLM' architecture for the 'vulkan' backend. It's important to verify that this registration is complete and accurate, and that all necessary backend-specific code paths are properly implemented to support this architecture on Vulkan.

"Zamba2ForCausalLM": {
 "gguf": "zamba2",
 "backends": [
  "vulkan"
 ]
},

@bong-water-water-bong
bong-water-water-bong merged commit 8977ce9 into main Sep 26, 2026
5 checks passed
bong-water-water-bong added a commit that referenced this pull request Oct 20, 2026
…6 on HRX (#476)

* Pin gpu-kernels be68256d and llama.cpp b14a2836: census gaps G1, G3-G6

gpu-kernels #6 (q8_0 KV cache: SET_ROWS + flash attention), #7 (LFM2 multi-sequence MUL_MAT), #8 (ZAYA ragged lm_head), #9 (PAD f32); llama.cpp fork #113 (zero-element CPY elided), #114 (PAD params), #115 (Loom rmsnorm_gate footprint).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* registry: regenerated at llama.cpp b14a2836

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant