Repository navigation
gpu-gates: preserve whole GLM pass wall in throughput - #723
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The remaining finding concerns stale test evidence; no must-fix finding remains.
Non-blocking
⚠ Refresh the test evidence: crates/gpu-gates/src/bin/shared/gen_time.rs:126. This module has three tests compiled into generate_glm5next, and no --test gen_time target exists. The PR body reports four tests from different hashes. Run just gate-ds41-place at this head and update the transcript so the regression evidence is reproducible.
Checked
Duplicates: 10 new or moved items; the extraction replaces the inline GLM owner and reuses the existing quantile helper. No dryer pairs supplied.
Complexity: crapper flagged no function.
Silent failure: 2 truncation sites followed. Runtime token accounting and CLI guards prevent missing timed rows and empty counted samples.
Tests: static mutation analysis in gen_time.rs: dividing by kept at line 38 fails the last-pass assertion; omitting crossing-pass wall at line 35 fails the warm-boundary assertion; using delivered-token rate at line 65 or first-token warmth at line 76 fails the record assertions. Rust tests were not run.
Gates: none relaxed; no PIN moved. The existing gate-ds41-place recipe selects all three new tests.
Escape catalog: C1–C4 do not match.
Notes
dryer did not run; diagnostics reports no changed Rust file under crates/, although both changed paths are there.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/generate_glm5next.rs, crates/gpu-gates/src/bin/shared/gen_time.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. |
GLM MTP 생성 시간 집계가 마지막 pass의 시간을 일부 버리던 결함을 고쳐, 처리량 숫자가 pass 전체 시간을 쓰도록 합니다.
Part of #565. Tracked in #699.
What and why
The drafted GLM generation CLI (
generate_glm5next) could drop part of a pass's wall time from its timing lines. When the-ntoken limit cut the last window, the sink divided that window's wall by all the rows it kept, then stored only the rows that fit under the limit. The part of the wall that belonged to the cut rows disappeared. A pass that straddled the--warmboundary lost time in the same way, andtime passmarked it warm if its last token was warm. The summary rate and theSMOKEfooter therefore mixed two units: positions the passes advanced and tokens the CLI delivered. The sink came in with 98f784b.The sink now stores each pass's token IDs and positions apart from its full wall. The aggregation and record assembly moved into
shared/gen_time.rs, which the CLI and a host test both compile, so the test exercises the production code and no copy of it.time stepspreads a pass's whole wall over the tokens it delivered. A pass that crosses the warm boundary puts its full wall on the counted tokens and zero on its warm ones, so both the all-step sum and the counted-step sum keep the pass wall.time passis marked warm only when every token of the pass is warm.mtp summarydivides all advanced positions by all pass wall time.SMOKEfooter divides the tokens delivered after--warmby the full wall of every pass that delivered one of them.Token 0 still belongs to the prompt time, output tokens and the token limit are unchanged, and the plain and slots paths are untouched. Inference, draft selection, launches and token IDs are unchanged. What changes is the time attribution, the warm flag and the throughput in these records.
Release notes: Fixed: the GLM drafted generation timing records keep the whole wall time of the last and warm-boundary passes.
Code shape
shared/gen_time.rs. The CLI's earlier inline version is removed, and the test includes the same file instead of repeating it.generate_glm5next.rsare removed.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.rustfmt --check --edition 2024on the three changed files andgit diff --checkare clean; clippy has not been run on this head.Duplication found or removed (
path:line), or "none": none found. The inline aggregation incrates/gpu-gates/src/bin/generate_glm5next.rsmoved intocrates/gpu-gates/src/bin/shared/gen_time.rs. The Qwen path already sums whole pass walls and counts--warmin passes, so it follows a different contract and is not changed here.What I ran
The tested head is
12fba900f74c2998da4e620a1859ae06a6189555, based on648dd751d9ed25f9a18d8a404e5f08e3fb52e512. The tests use synthetic pass data (one pass of 10 ms and one of 40 ms), so they need no model or GPU. They ran on an RTX 5090 machine on the CPU.bash tools/gate.sh -p bloomery-gpu-gates --test gen_time -- --nocapturefailed on the real assertions:test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s, exit 101. The last delivered step was 20 ms where 40 ms was expected, the counted wall was 20 ms instead of 40 ms, and the summary rate was 66.67 instead of 60.0..flag("warm", *at <= warm)changed to.flag("warm", *at - kept < warm),bash tools/gate.sh -p bloomery-gpu-gates --test gen_time -- drafted_pass_is_warm_only_when_all_its_tokens_are_warm --nocapturefailed:test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.00s, exit 101. The second pass was marked warm.bash tools/gate.sh -p bloomery-gpu-gates --test gen_time -- --nocapture:test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s.mtp summaryattok/s(positions)=60.00(three positions over 50 ms) andSMOKEattok/s(positions)=40.00for two delivered tokens. With one counted token the footer readsmean_ms=40.0000and 25.00 tokens/s. They are fixture arithmetic and carry no model speed claim.The four tests cover the last pass wall when the token limit cuts a pass and when it fits exactly, a pass that straddles the warm boundary, the warm flag of each pass, and the summary and footer records read back through the existing record parser.
The machine was an RTX 5090 host, and
nvidia-smireported this before the run:NVIDIA GeForce RTX 5090, driver 595.99.02, CUDA 12.0
just gate-ds41-placenot run here: it needs the CLI built with the GLM feature, and that CLI's own test module includes the new tests, so the gate runs them.Not run: clippy,
t0, and the CLI built with the GLM feature. No CUDA kernel, launch or device arithmetic changed, so I ran no GPU gate, no model generation and no timing comparison.Reproduction
The second command runs the warm-flag test alone.
What I ran into
This does not block the PR. The Qwen drafted path counts
--warmin passes and the GLM path counts it in generated tokens. I kept both, because each already matches its own record format.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.