Skip to content

llama : keep the ubatch node budget for qwen4exp - #313

Closed
dzannotti wants to merge 1 commit into
masterfrom
hb/qwen4exp-ubatch-nodes
Closed

dzannotti wants to merge 1 commit into
masterfrom
hb/qwen4exp-ubatch-nodes

Conversation

@dzannotti

Copy link
Copy Markdown
Collaborator

Fixes #301: a qwen4exp model with an MTP draft aborts at load with a long context (GGML_ASSERT(obj_new), "not enough space in the context's memory pool").

Cause: a wrong resolution in the last upstream sync. Upstream ggml-org#32078 made graph_max_nodes independent of the ubatch, and the sync took it. Upstream's graphs no longer need that budget, but the fork's qwen4exp QSA scorer still does: it splits each ubatch into score strips that get smaller as the context grows, so its node count grows with n_ubatch. This change gives qwen4exp back its n_ubatch * 40 budget, as before the sync. Other archs keep upstream's budget.

Tests:

  • New test-qwen4exp-long-ctx (test-llama-archs): reserves the main and MTP contexts at n_ctx 563200, n_ubatch 4096, yarn 2.2 (the shape in the issue). Master aborts with the same assert as the issue; this branch passes. It also passes at n_ctx 1048576 with 64 indexer heads.
  • ctest -L main: CPU 37/37, HIP 37/37.

Not tested: the full Qwen3.8 Flash Next model from the issue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YKmjzcT1LTvKtbw9EzBVGE

Upstream ggml-org#32078 made graph_max_nodes independent of the ubatch. The upstream
sync took that change, but the fork's qwen4exp QSA scorer splits each ubatch
into score strips that shrink as the context grows, so its graph still grows
with n_ubatch. At n_ctx 563200 and n_ubatch 4096 the main and MTP contexts
ran out of graph metadata space during reserve (GGML_ASSERT(obj_new)).

Give qwen4exp back its n_ubatch * 40 budget, as before the sync, and add
test-qwen4exp-long-ctx, which reserves both contexts at that shape.

Fixes #301

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKmjzcT1LTvKtbw9EzBVGE
@dzannotti

Copy link
Copy Markdown
Collaborator Author

Duplicate of #304, which has the same fix and is approved. The regression test from this branch (test-qwen4exp-long-ctx) can come in separately.

@dzannotti dzannotti closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Qwen 3.8 Flash Next no longer work at higher context size

1 participant