Skip to content

qwen38: keep the unset MTP draft off under --parallel above 1 - #695

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-mtp-default-parallel
Oct 23, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-mtp-default-parallel

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

BLOOMERY_DRAFT를 설정하지 않았을 때 MTP draft(GGUF draft 파일과 체크포인트 폴더의 MTP layer 모두)를 slot이 한 개인 서버에서만 기본으로 켜서, --parallel 4 서버의 동시 요청 네 건 처리량이 떨어지지 않게 합니다.

Part of #565.

What and why

With BLOOMERY_DRAFT unset, the default rule turns the MTP draft on at any --parallel value, whether the draft is a GGUF file or the MTP layer of an FP4-Local checkpoint folder. A drafted load steps a round of sampled or id-banning requests one slot at a time. On a --parallel 4 server with four such requests, decode throughput falls to the speed of one request.

This PR turns the unset default on only for a one-slot server. With --parallel 2 or more and BLOOMERY_DRAFT unset, the draft stays off whatever its source, and the load draft=off line names the slot count. BLOOMERY_DRAFT=mtp still drafts at every slot count, and BLOOMERY_DRAFT=off still disables the draft. A folder without an MTP layer keeps its own rule in draft_off_for.

draft_for_slots in crates/gpu-gates/src/bin/shared/serve_seats/qwen38.rs owns the slot decision, and run() calls it once after the folder rule. Draft38Off::Slots in crates/levers/src/lib.rs carries the slot count into the load line. docs/serving.md, the lever registry entry for BLOOMERY_DRAFT and the seat's module documentation state the rule as it now works.

The cost is on servers with --parallel 2 or more: they no longer get the C@2 greedy gain, which was 45.86 to 67.66 tok/s (+47.52%). That default can be revisited now that the batch-aware draft width in #690 has merged.

Release notes: Fixed: a Qwen3.8 server with --parallel above 1 no longer turns its MTP draft on by default, which slowed sampled and id-banning requests.

Code shape

  • No second copy. draft_for_slots is the one owner of the slot decision, and run() calls it for every draft source.
  • Model code holds only architecture facts. The rule reads the slot count and the draft word. A common owner gained no per-model branch.
  • Dead code is gone. No flag, lever or mode is added. The gate's three servers share one environment helper, one refusal poll and one last-lines reader instead of three copies.
  • No silent failure. A draft that is off says why on the load draft=off line, and no refusal is added.
  • Comments state what is true now. The rewritten documentation describes the current behavior.
  • No relaxed gate. One gate server's setup changed, with a PIN(2026-10-23) comment. gate_qwen38_serve has a server that runs --parallel 2 with no draft word and used to check the drafted residency, the width chooser and the drafted rounds on it. That server now sets BLOOMERY_DRAFT=mtp, so it keeps the same drafting checks, and a new draft_unset_is_off_on_two_slots clause under the draft share clause holds the unset two-slot answer: a --parallel 2 server with the draft unset and BLOOMERY_MTP_WIDTH=fixed must stop before its plan record with the refusal naming the two slots. No band or tolerance moved.
  • cargo fmt is clean on what I touched.

Duplication found or removed (path:line), or "none": none.

What I ran

The rule gate on this head, run on an NVIDIA GeForce RTX 5090 (driver 595.99.02):

BLOOMERY_BOX_LOCAL=1 just gate-q38-serve-rules
test tests::an_unset_draft_drafts_on_one_slot_only ... ok
test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

an_unset_draft_drafts_on_one_slot_only pins the first boundary at two slots and also holds a set mtp, a set off and an earlier reason. It fails first when the slot condition in draft_for_slots moves from slots > 1 to slots > 2:

test tests::an_unset_draft_drafts_on_one_slot_only ... FAILED
test result: FAILED. 19 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

gate_qwen38_serve needs a 3090 and the reference build set, which I do not have, so I compiled the changed clauses with the workspace check (cargo check --workspace --all-targets with the GPU features) and did not run them. Their behavior is unverified here.

Throughput

On an NVIDIA GB10:

| NVIDIA-SMI 595.84                 Driver Version: 595.84         CUDA Version: 13.3     |
|   0  NVIDIA GB10                    On  |   0000000F:01:00.0 Off |                  N/A |

The checkpoint is nvidia/Qwen3.8-Flash-Next-FP4-Local at b9ce18a6887e18c089fdea8509a33e63429a3300, served directly from its folder with BLOOMERY_DRAFT unset. A request sends 4096 prompt ids and generates 128 ids with no RAM cache. Greedy groups use temperature 0 and sampled groups use temperature 0.8 with seed 7. The --parallel 4 servers use --ctx-size 16896. The metric is decode tok/s over the window in which all requests are generating.

"Before #682" is the build before #682 added the folder default, "Main" is main with it, and "This PR" is this head.

Measurement Before #682 Main This PR This PR vs before #682
C@4 sampled, decode tok/s 61.60 28.34 62.52 +1.49%
C@4 greedy, decode tok/s 64.23 56.50 63.20 -1.62%
C@1 greedy on --parallel 1, decode tok/s 30.09 52.34 52.56 +74.66%
C@1 greedy on --parallel 4, decode tok/s 30.09 52.34 29.63 -1.53%

C@4 sampled decode throughput changed by +1.49% against the build before #682 and rose from 28.34 to 62.52 tok/s against main.

On main, C@4 sampled decode fell by 54.00% against the build before #682, and C@4 greedy fell by 12.04%.

For the --parallel 1 row, the first two columns are the values from a --parallel 4 server. A one-slot server drafts as before, and its C@1 decode is 52.56 tok/s.

The greedy ids of the one-slot server with the draft on equal those of the four-slot server with it off.

Each value is a single observation without a confidence interval. Main and the build before #682 were measured in one session and this PR in another. The throughput runs used the folder server of an earlier head of this branch, whose folder rule is the one on this head. Differences between sessions are about 1.7%, so the -1.62%, -1.53% and +1.49% rows are within that.

What I ran into

This does not block the PR. I did not time a GGUF split server at --parallel 2 or more. The rule applies to it because the same step path runs its rounds, and the serve gate clauses above are the only check of it, which I could not run.

Hardware

One NVIDIA DGX Spark (GB10), driver 595.84, CUDA 13.3, for the throughput runs. One NVIDIA GeForce RTX 5090, driver 595.99.02, for the rule gate.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

A drafted load runs a round of sampled or id-banning requests a slot at a
time, where a plain load runs the round as one pass. With the unset draft
rule picking the checkpoint folder's MTP layer, a --parallel 4 server of
Qwen3.8-Flash-Next-FP4-Local on a GB10 decoded four sampled 4096-id
requests at 28.3 tok/s over their all-active window against 61.6 on the
plain load, and four greedy ones at 56.5 against 64.2.

Unset, the rule now drafts on a one-slot load and leaves the draft off on
more, its load draft=off record naming the slots. The rule is the same
for a GGUF draft file and a checkpoint folder's MTP layer, since both
step their rounds the same way. BLOOMERY_DRAFT=mtp still drafts on any
slot count, and a folder without the layer keeps its own rule.

gate_qwen38_serve's server of the seat's defaults at --parallel 2 now
sets BLOOMERY_DRAFT=mtp, keeping the drafted residency, rounds and width
chooser it checks, and the draft share clause holds the unset draft off
on two slots of the GGUF split.
@github-actions github-actions Bot added documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 22, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: The slot rule preserves explicit draft settings, earlier off reasons, and named refusals.

Non-blocking

⚠ Validate the final scope: crates/gpu-gates/src/bin/shared/serve_seats/qwen38.rs:1365 applies the rule to GGUF and folders. The body says GGUF is unchanged and names a helper and test absent from this head.
Update the description and FAIL-first output. Attach just gate-gpu-qwen38-serve output and a same-lease GGUF greedy/sampled A/B on the contributor's card, with both commit hashes, model and commands.
For a lone greedy request on a multi-slot server, disabling MTP replaces a pass of up to four verify rows with one target row per step. The supplied folder measurements do not establish that tradeoff for GGUF.

Checked

Duplicates: 6 new items checked (2 functions, 3 closures, 1 enum variant); no duplicate owner found. Dryer reported 0 pairs; gpu-gates was checked manually with Grep.
Complexity: draft_slot_share 36 → 41 adds a refusal case and shares setup/polling; Draft38Off::fmt 17 → 18 adds one harmless match arm.
Silent failure: 2 record-read fallbacks followed; malformed or absent records produce an error or a failed gate clause.
Tests: static mutation review only. At qwen38.rs:948, replacing slots > 1 with false, changing it to >= 1, or dropping the explicit-word guard fails the new unit assertions. Dropping the call at line 1365 fails the new GGUF refusal clause. Reverting the gate's explicit mtp setting fails its real-tier chooser assertion.
Gates: no tolerance moved. The changed residency-server setup has a dated PIN and replacement coverage for the unset two-slot rule.
Adversarial paths: zero slots are refused; explicit MTP still checks the context window; existing folder/media restrictions and MTP-only lever refusals remain.
Escape catalog: no C1–C4 pattern matched.

Notes

Dryer did not scan gpu-gates; its changed code was checked manually.
No tests ran during this review. The body reports a host rule gate, without a complete GPU gate run and both tested commit hashes; GPU evidence is incomplete.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_serve_qwen38.rs, crates/gpu-gates/src/bin/gate_qwen38_serve.rs, crates/gpu-gates/src/bin/shared/serve_seats/qwen38.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@juliankang4 juliankang4 changed the title qwen38: keep a folder's own MTP draft off by default under --parallel above 1 qwen38: keep the unset MTP draft off under --parallel above 1 Oct 23, 2026
@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 093f765 into midagedev:main Oct 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant