Repository navigation
qwen38: an image load drafts with MTP, its walks on each sequence's rotation table and a span's rows - #1015
Conversation
…otation table and a span's rows The media load refused the MTP draft because the draft's walks read the load's plain rotation table. They now read the table of the sequence they walk, as the target's do, and each sequence's captured walks move with it. A media prompt call under the draft runs through the body's own media call with the unit sink (Qwen38Model::prompt38_media_with), and the draft's store walks copy a span's rows over the embedding rows of its positions, the rows the target consumed there. Media rows outside a store walk, or of another width than the embedding's, are refused by name. The seat no longer turns the draft off or refuses BLOOMERY_DRAFT=mtp beside --mmproj; its media call goes through SlotDrafts::prefill_media. The shared window builds a call's span rows at the body's embedding width (MtpBody::embed_width), which Qwen3.8's four-stream hidden row is not.
There was a problem hiding this comment.
Verdict: CLEAN: The performance-evidence request is non-blocking; no must-fix items remain.
Non-blocking
⚠ Supply the dispatch performance proof: crates/gpu/src/arch/qwen3moe/mtp38.rs:2810.
Image prompt storage adds 10,240 host-to-device bytes per image position [derived: 2,560 f32 values], with one blocking copy per contiguous image run in each store block.
Provide the identical PTX scan for the host dispatch refactor and the same-lease A/B required by AGENTS.md's Measuring section. Include image prompt latency with MTP on/off and a base/head text control to establish the added copy cost.
Checked
Duplicates: dryer reported zero pairs; gpu-gates was outside its scan.
Complexity: media_prompt is a new setup/reference/draft pipeline at 27; hw_mtp_input_validity 24→31 adds metadata and media checks; refusals 13→16 adds refusal cases; store_rows 35→37 adds the media-copy loop.
Silent failure: call_rows rejects media outside store walks and incorrect embedding widths. enable_media rejects existing draft captures. These refusals propagate errors.
Tests: removing the mode or width guard fails the updated unit assertions. The media gate compares stored rows and drafted ids, checks image keys against text rotations, and requires a proposal. GPU tests were not rerun here.
Gates: no tolerance or acceptance threshold moved. The two removed media-refusal tests have a dated PIN and reason; the larger context and ubatch exercise a span across store blocks.
Escape catalog: no C1–C4 pattern matched.
Notes
The PR supplies functional gate commands and output for NVIDIA GB10, driver 595.84, with commit hashes and model identity. It supplies no PTX comparison or timed A/B.
Card check: gpu-evidence. This pull request changes crates/app/src/arch/qwen3moe/mtp.rs, crates/app/src/mtp.rs, crates/app/src/mtp/policy.rs … and carries a gate run on the author's card, which counts as verified.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
이미지(
--mmproj)를 싣고도 Qwen3.8 MTP draft가 동작하도록 했고, 이미지가 있는 요청의 출력이 draft 없는 경로와 같음을 GB10에서 확인했습니다.What and why
--mmprojbesideBLOOMERY_DRAFT=mtpwas refused by name, and an unset draft was turned off for the image load, because the draft's walks read the load's flat rotation table instead of each sequence's own. Now the draft's four walks read the live sequence's rotation table, and the draft's store walk writes a media span's rows (the image embeddings, 2560 values a row) in place of the token embeddings. The draft joins inside the existingmedia_callframe, so the first image key reads the prepared rotation. An image load drafts by the same rule as a text load. The prompt cache and snapshots still refuse a sequence that holds an image, and the Qwen3.5 seat keeps its refusal.Release notes: Added: MTP drafting on Qwen3.8 image loads (
--mmprojwithBLOOMERY_DRAFT=mtp).Code shape
media_call,CallRowsandSeqRope; the embedding width is read once throughMediaCarrier::width. The duplicated hidden-width accessorPolicy::hidden_widthis gone.Draft38Off::Mediaturn-off path on this seat, the two tests that pinned them andPolicy::hidden_widthare removed;docs/serving.mdand thedefaults-twins.tsvrow describe the current behavior.PIN(2026-10-30):note; no band or tolerance moved.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
Head
643873205f8a75b305a978dda9021b614020c6b0, base9d92cbc637a9a9ae7dae9881813cc9831e5cb38c. ModelQwen3.8-Flash-Next-FP4-Local(b9ce18a6887e18c089fdea8509a33e63429a3300) withmmproj-BF16.gguffromunsloth/Qwen3.8-Flash-Next-GGUF(766911a6b7369840a91dbcd95f9f997acaab6cd6).Boundary gate. The gate puts an image at call offset 0 after four text ids (72 image rows, so the draft's store crosses a 64-row block), under the
zyxtsection order. It compares each stored draft row with a replay of the token-7 embedding, checks that the image keys differ from the text rotations, and checks that drafted ids equal plain ids with a real proposal. Run on head4a4f860af37213a0f32805540efdbd4603cd5994(base9540dc3f605ac0206b4f395f8878b97b981c9ac0):Four changes to the code each make the same gate exit non-zero, so it covers the fix:
Real binary.
bloomery-servebuilt from this source,BLOOMERY_DRAFT=mtpagainstBLOOMERY_DRAFT=off, one 448x448 PNG with an image description request (temperature 0,max_tokens32, thinking off):The owning gate and a server run with text and two-slot requests, on head
c7acf1f9ad0ea4e8f61e04f7a9239874d9e673f0:No speed claim is made.
Hardware (if the change is for a machine)
One DGX Spark,
nvidia-smi --query-gpu=name,driver_version,memory.total:NVIDIA GB10, 595.84. All runs above used--arch sm_121a.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.