Repository navigation
app: compare all and selected logits through the same host read boundary - #978
Conversation
…streaming only the new text
…in a shared round
There was a problem hiding this comment.
Verdict: CLEAN: No behavior regression or new quality defect was established in the changed code.
Non-blocking
⚠ Make the logits timing reproducible: crates/app/src/lib.rs:1127 exercises a three-float buffer and prints no mixed-logits timings. The PR attributes the vocabulary-sized, 32-round benchmark output to this test. Supply the actual benchmark source and command, with both measured commit hashes. This makes the claimed host-copy saving reproducible.
Checked
Duplicates: 20 new functions, types, constants and statics checked; no new duplicate owner. Dryer reported zero pairs. The gate transport overlap predates this extraction.
Complexity: CallRead::advance is new at 24 (function header, active value, following tag stages); ChatParser::stream 3→9 adds snapshot/advance dispatch; step_slots_rounds 14→19 adds selective reads; gate run 46→51 adds arm dispatch; slots_rounds_run_one_pass 41→42 mostly moves the existing arm body.
Silent failure: 10 added or relocated fallback sites followed. Active cursor state guarantees the function name; invalid typed values reach the complete parser's named errors. Record fallbacks reach checks or diagnostics.
Tests: mutation review only. Removing the skipped-row return or NaN check breaks the new row test; dropping name/index validation or close-state clearing breaks the advance test. Re-sending complete argument prefixes breaks the long-string equality/allocation assertions. Rewinding the non-string search before its value start breaks the empty-boolean chunking case.
Gates: the unsafe-count increase has a dated PIN and reason. The parser allocation gate has reported FAIL-first evidence. No existing tolerance or clause was relaxed.
Adversarial checks: fragmented UTF-8 and delimiters, a cut inside a call, several calls per push, mixed requests across reordered passes, and staging refresh at the first requested row were traced. Device fault readback still rejects invalid head computation before greedy ids return.
Escape catalog: no C1–C4 pattern matched.
Notes
Static review; no build or GPU gate was run here. The posted GPU run lacks both measured commit hashes, so gpu.json records incomplete evidence.
Card check: needs-gpu. This pull request changes crates/app/src/lib.rs, crates/gpu-gates/src/bin/gate_qwen3_serve.rs, crates/gpu-gates/src/bin/shared/serve_seats/rounds.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. |
Qwen 긴 문자열 인자는 새로 온 부분만 파싱해 보내고, 섞인 슬롯 round는 logits가 필요한 슬롯의 행만 host로 읽도록 고쳤습니다.
What and why
Two host-side costs grow with the work they should not scale with.
QwenScan::pushkeeps its publicProgresssnapshot contract;ChatParseruses an internal path that builds no snapshot.Session::step_slots_roundsread and NaN-checked the logits of every row in a round. It now takes one request flag per entry and reads and checks only the rows that were asked for, so a greedy slot sharing a round with a sampled slot no longer reads logits it never uses. The shared device staging transfer is unchanged; the saved work is the host copy and the NaN scan of the unrequested rows.GPU kernels and the greedy ids do not change. The numbers below are host boundaries (the parser, and the copy and NaN check after staging), not end-to-end decode speed.
Release notes: Fixed: long streamed Qwen tool-call string arguments no longer take quadratic host work, and a mixed greedy and sampled round reads only the logits it needs.
Code shape
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, I named it below.tools/check-comments.sh).PIN(YYYY-MM-DD):and its reason.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none":crates/gpu-gates/src/bin/gate_qwen3_serve.rs:1953has request wrappers close togate_qwen38_serve.rs:1888and:1992. They share the gate'sstreamed_body; the two gates return different result types (the Qwen3.8 one counts draft tokens), so I left them separate.What I ran
Parser, before the fix (test added alone on the base), 114,000 byte string sent in 3,000 fragments:
Parser, after the fix:
host_us=4922400host_us=14574These are single debug-build runs of the same test, a parser boundary and not a decode speed.
Logits host read, 2 slots, vocabulary 151,936, mean of 32 rounds after one warm-up, both arms through the same row function and the same copy and NaN check:
all_host_us=112.938selected_host_us=56.636cargo clippy -p bloomery-serve --lib --no-depsreports no warnings, and the 24 callstream and qwenxml functional tests pass.Real GPU gate, a greedy slot and a seed 42 sampled slot decoded alone and together on the Qwen3.6 35B-A3B Q4_K_M GGUF through the real
bloomery-serve:Real binary, streamed against non-streamed tool call with a 4,864 byte string argument whose schema pins the exact content (
bloomery-serve --model qwen38on the Qwen3.8 Flash Next FP4 checkpoint,BLOOMERY_DRAFT=off,BLOOMERY_SCHEMAJUMP=off,--ctx 8192 --parallel 1):The streamed fragments joined equal the non-streamed
argumentsstring byte for byte.Hardware (if the change is for a machine)
Mixed-slot gate and logits host read:
Real-binary tool stream:
The parser tests ran on CPU only.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.