Repository navigation
qwen38: a selecting layer keeps its raw indexer keys in a ring of eleven rows, not a plane of the context - #969
Conversation
…ven rows, not a plane of the context The pool pass reads a launch's own keys from the key projection and the keys before it from the ring, and runs before the append, which writes the launch's last eleven keys. The ring is a checkpoint store beside the conv and PLE rings, so a cut or a resume to a point finds the keys of its incomplete pool; a saved state no longer carries the raw keys by position. runtime::stores counts the ring (index_ring_rows) and the plan, the checkpoint price and the gates follow it.
There was a problem hiding this comment.
Verdict: CLEAN: No must-fix findings remain; the two evidence requests are advisory.
Non-blocking
⚠ Complete the prefill performance proof: crates/gpu/src/qsa.rs:604.
For a pool wholly inside a prefill launch, key-input reads rise from 1,024 to 2,048 B and add 512 f32-to-f16 conversions [derived: four rows of 128 values]. The reported decode A/B does not time this path. Supply same-card prefill A/B at P=512 and 4096 and base/head PTX register/shared-memory columns to check occupancy.
⚠ Complete the reproducible GPU evidence: crates/gpu/src/arch/qwen3moe/wide38.rs:2705.
The gate build command contains ...; the body gives card details in prose and omits exact model paths. Attach the complete build/gate commands and output, literal nvidia-smi line, model paths, and corresponding base/head hashes. These make the reported runs reproducible; the supplied excerpt does not satisfy the GPU evidence list.
Checked
Duplicates: dryer's conv/index-ring pair shares short sizing arithmetic for different stores; a shared wrapper would add an element.
Complexity: supplied diagnostics report pool_check 28→68, qsa_pool 8→13 and sel_flash_check 107→111. The pool kernel adds count guards.
Silent failure: pool count guards raise PoolSelect and return before writing an invalid pool.
Tests: pool_check checks host equality, one-row/seven-row equivalence and count/position-gap faults. The PR reports an f16-rounding FAIL-first.
Gates: the diff adds dated reasons for changed memory, placement and unsafe-count pins.
Escape catalog: neither advisory finding matches C1–C4.
Notes
Validation was static and used the supplied diagnostics. Rust builds and GPU gates were not run during validation.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen35moe_attn.rs, crates/gpu-gates/src/bin/gate_qwen38_serve.rs, crates/gpu-gates/src/bin/gate_qwen38_twocard.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)
|
The review is done and the contribution check passed, so I'm merging this. |
Qwen3.8의 선택 레이어가 원시 인덱서 키를 컨텍스트 길이만큼 쌓지 않고 11행 링에만 두어, 컨텍스트 262,144에서 슬롯당 768 MiB를 줄이고 출력은 그대로입니다.
What and why
A Qwen3.8 selecting layer used to keep every raw indexer key of the context in a plane (
ctx × 128f16 values), although the pool kernel reads only the last three keys before a launch. The layer now keeps those keys in a ring of eleven rows (3 keys of a pool not yet complete plus an 8-row pass) and the pool kernel reads the launch's own keys from the key projection.Store38is the one store of both seats (FP4-Local and NVFP4 folders, and the GGUF file), so all of them get it.Per slot and selecting layer the store loses
ctx × 256bytes and gains11 × 128 × 2 = 2,816bytes. With 12 selecting layers a slot saves12 × 256 × (ctx − 11)bytes: 805,272,576 bytes (768 MiB) at the default context of 262,144. Decode and prefill speed and the generated text do not change.Release notes: Changed: Qwen3.8 uses 768 MiB less GPU memory per slot at the default context, with identical output.
Code shape
runtime::stores::index_ring_rows, andqsa::RING_ROWSis held to it by a const assertion inscratch38, the same pattern as the conv ring and the PLE ring.Spans::by_position(raw, ..)) and the raw term ofseq_positional_bytesare removed.PoolSelectand writes no pool; every appended key is still checked for a non-finite value.krand ring arguments.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none added. Existing, unchanged by this PR:slot_digestincrates/gpu-gates/src/bin/gate_qwen38_twocard.rs:1148andcrates/gpu-gates/src/bin/gate_qwen4exp_e2e.rs:4624.What I ran
All runs: NVIDIA GB10, driver 595.84, CUDA 13.3.1 (
nvidia-smi). Memory, output equality, speed andgate_qwen4exp_e2e: base5e743ada812e7377054e4d8a8756b7c466c833ae, head9f1286a122a552d27936db5b7e665aab2ca3e593.gate_qwen35moe_attn: base686e8cc5ffb0cb20027fe315bd0dfb2863b17c0b, head69387e07f0d16dd9a950655bd5e06836559d5cac.Memory. Real
bloomery-serve, default flags, context 262,144, one slot, MTP draft on, base and head, FP4-Local and NVFP4 folders. The saving equals the formula above.store_bytesresident_bytesstore_bytesresident_bytesOutput equality. The same serve run sends short and 12,123-token prompts, a live-slot cut and a saved-state restore to the base and the head build:
Speed.
run.py short --item opt-qsa-rawkey-ring --select fp4l-off,fp4l-mtp, three rounds a side, FP4-Local folder, base against head, greedy output equal (greedy_equal: True). No difference is measurable: each one is below the run-to-run resolution and the round ranges overlap.Gates. Both on the same card, through
tools/box.sh:The pool clause feeds the current launch's keys as f32 values between two f16 values. With the pool kernel's f16 round-trip removed, the same gate fails:
The kernel gate's
counts 4 and 13 in one launchclause and the one-row launch clause are new, andgate_qwen4exp_e2echecks the ring's live slots and the(kp)prefix restore, so the new key ring is exercised through the pool kernel, the checkpoint cut and restore, and the store byte formula.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.