Skip to content

Th/fix qwen35 mtp companion mainline - #44

Merged
Thireus merged 2 commits into
th/fix-qwen35-mtp-companionfrom
th/fix-qwen35-mtp-companion-mainline
Aug 16, 2026
Merged

Th/fix qwen35 mtp companion mainline#44
Thireus merged 2 commits into
th/fix-qwen35-mtp-companionfrom
th/fix-qwen35-mtp-companion-mainline

Conversation

@Thireus

@Thireus Thireus commented Aug 16, 2026

Copy link
Copy Markdown
Owner

A predictor-only MTP GGUF reports the full block count (n_main +
nextn_predict_layers) but only ships the NextN block, so loading one
with -md failed:

  check_tensor_dims: tensor 'blk.0.attn_norm.weight' not found

create_qwen35_tensors() and create_qwen35moe_tensors() create every
main block as required. Detect the predictor-only case the same way
create_step35_tensors() does and mark the absent blocks
TENSOR_SKIP|TENSOR_NOT_REQUIRED.

Qwen3.5 also has to use the common MTP package contract, otherwise the
predictor-only GGUF is never classified as a companion, and the target
is not classified TARGET_ONLY - which is what makes it export the
hidden states the companion consumes.

The remaining two hunks cover cases the above newly reaches: a
predictor-only GGUF passed as -m now loads far enough to abort in the
graph builder, and its empty main blocks reach split_recurrent_tensors()
under -sm graph.
…arch

Review follow-up.

A dense NextN block loads q_proj as optional because it can be shared
with the last main block. A predictor-only GGUF has no main blocks, so
one built that way loaded with wq == nullptr and then hung. Require the
tensor in that case so the load fails naming it. eh_proj, attn_q and the
MLP are all optional on that block, so the tail probe stays on enorm,
which is required - the comment there said only eh_proj.

Adding Qwen3.5 to the common MTP package contract also made
common_speculative_has_recognized_mtp_companion() accept any GGUF
classified COMPANION, with no architecture check of the kind the Step
and DeepSeek branches have. Add it, plus the predictor count. Dense and
MoE are separate architectures, so the comparison is on the arch itself.
@Thireus
Thireus merged commit c63fb21 into th/fix-qwen35-mtp-companion Aug 16, 2026
1 check 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.

1 participant