Skip to content

Repin the Qwen3.8-Flash-Next MTP carry onto its fixed head - #220

Merged
danielhanchen merged 4 commits into
masterfrom
repin-mtp-hc-head-norm
Sep 18, 2026
Merged

danielhanchen merged 4 commits into
masterfrom
repin-mtp-hc-head-norm

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Sep 18, 2026

Copy link
Copy Markdown
Member

scripts/unsloth/pr-set.json pins the Qwen3.8-Flash-Next MTP carry (#144) at f40f64a81. That commit aborts at load whenever the MTP head is attached:

ggml.c:2293: GGML_ASSERT(ggml_can_repeat(b, a)) failed
  libllama.so.0(llama_model_qwen4exp::graph::build_hc_mix(...))
  libllama.so.0(llama_model_qwen4exp::graph_mtp::graph_mtp(...))
  libllama.so.0(llama_context::graph_reserve(...))
  libllama-common.so.0(common_fit_params(...))

This moves the pin forward to ca1426903, #144's current head, which now carries two fixes that landed on its branch through #219.

Why it broke

ggml-org#28896 (41abbfd599, 2026-09-14) moved the qwen4exp hyper-connection gammas to { n_embd, hc } with TENSOR_ALLOW_RESHAPE. Upstream did nothing wrong: it changed code it owns. The MTP head's gamma is fork-only, lives 110 lines further down in the same file, and did not conflict, so the rebase in f40f64a81 ("Fix merge conflicts") converted the three trunk gammas and left layer.nextn.hc_head_norm at { hc_dim }.

git blame src/models/qwen4exp.cpp on the old head:

41abbfd599 (Aman Gupta     2026-09-14 :168) // the gammas load as [n_embd, hc] so the grouped norm multiplies them without a graph reshape
f40f64a81c (danielhanchen  2026-09-16 :170) hc_head_norm = create_tensor(..., { n_embd, hc }, trunk_flags | TENSOR_ALLOW_RESHAPE);
e52b4b00c2 (Ryan Monsurate 2026-08-27 :280) layer.nextn.hc_head_norm = create_tensor(..., { hc_dim }, flags);

build_hc_mix then multiplies a [2560, 4, n_tokens] stream by a [10240] weight. Nothing about the published GGUFs changed; only the expected shape moved.

The second fix addresses a standing bug rather than this regression. common/fit.cpp opens the draft model on its own to price it, and a borrowing shared- head has no token_embd.weight, so borrow_shared_tensor threw, the fit warned fitting without it and budgeted nothing for the draft, and the real load ran out of device memory by roughly the head's size.

Measured

Built from this repo with identical flags (-DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=100, Release), B200 held at 30.7 GiB free so the load matches a 32 GB consumer card. Target unsloth/Qwen3.8-Flash-Next-GGUF UD-Q4_K_XL, --fit on --flash-attn on -c 8192 --spec-type draft-mtp --spec-draft-n-max 2, 512-token prompt, 128 generated, median of 5 samples after a warmup.

build self-contained Q8_0 head recommended shared-Q8_0 head
f40f64a81 (current pin) aborts at load aborts at load
ca1426903 (this pin) 61.2 tok/s 61.6 to 63.6 tok/s

ca1426903 is a squash of the commits measured above and produces a byte-identical tree, so those numbers carry over unchanged.

Against the published prebuilts on the same harness and card, without a drafter:

prebuilt MTP no MTP
b10909-mix-bea84f7 (pin a9e9c3c) 60.7 tok/s 43.8 tok/s
b10995-mix-3e83366 aborts
b11007-mix-3e83366 aborts
b11027-mix-3e83366 aborts 45.7 tok/s

So b10995-mix-3e83366 (2026-09-16) is the first affected build, the fix restores decode to the pre-break figure, and losing the drafter costs 28 percent. Without a drafter the newer builds are faster than b10909, by 4.4 percent offloaded and 8.4 percent fully resident, so nothing else regressed.

Reported in unslothai/unsloth#11143, unslothai/unsloth#11219 and unslothai/unsloth#11221.

#144 is pinned at f40f64a, which aborts at load with
GGML_ASSERT(ggml_can_repeat(b, a)) in build_hc_mix whenever the
Qwen3.8-Flash-Next MTP head is attached. Every mix build since
b10995-mix-3e83366 carries it.

#219 is f40f64a plus one line, so this repin merges identically
and needs nothing else changed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-18T09:33:21.721543Z 55d46a4 PR opened
🔒 Security Review Completed 2026-09-18T09:36:07.541238Z 55d46a4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The branch gained a second commit: a borrowing draft head could not be
measured by common/fit.cpp, so the fitter budgeted nothing for it and the
recommended shared-* sidecar ran out of device memory on a 16 to 32 GB
card. Both fixes ship together or the shared head stays unusable.
#219 merged into mtp/qwen4exp-nextn rather than master, so the carry PR
now holds both fixes and the entry goes back to being a single #144 pin.
Pinning the merged #219 instead would point the set at a closed PR for
work that is already in the open one.

ca14269 is a squash of the commits measured earlier and produces a
byte-identical tree, so those numbers carry over unchanged.
@danielhanchen danielhanchen changed the title Repin the Qwen3.8-Flash-Next MTP carry onto the hc_head_norm fix Repin the Qwen3.8-Flash-Next MTP carry onto its fixed head Sep 18, 2026
@danielhanchen
danielhanchen merged commit 6b22eb0 into master Sep 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants