Repository navigation
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — searched open+closed issues and PRs for usage-alignment / cache-diff alignment work: no prior matching optimization. The only related history is #1269, which introduced the backward scan this PR replaces (origin of the code, not a parallel fix). 标签建议: Review① Direction (original issue #6721). Correct, and it fixes the root cause, not a symptom. The producer of the quadratic work is ② Regression review. The diff touches one function in one offline-diagnostic module; nothing else in the 3-file diff. I verified behavior preservation, not just "tests pass":
③ Code. Two lines of logic + one comment. The added comment ("Both inputs are sorted by time, so each request need only be visited once") documents the precondition the new code leans on — good, since the old code silently leaned on ④ Test quality. These are real tests: public ⑤/⑤b Diff & code cleanliness. 3 files, +151/−3, every line on-topic; no whitespace churn, no lockfile, no version bump. Naming clear, no dead code, no new style. Pass. Findings (non-blocking)
CI status (verified live, single fetch)Static gates green on the pushed head: static-gates (ubuntu 24 + windows 22), architecture-docs, lock-sync, test-import-graph, version-guard, unused-exports, mysql-contract all 结构化八问
判定:可合——rebase 到当前 master 后、CI test 分片转绿即可合并。 |
c8b86a3 to
e23468a
Compare
(ai: vllm-qwen/qwen3.8-27b) CI update (verified live): 47/48 checks green on head
Verdict unchanged: mergeable after rebase to current master + this shard re-run green. |
|
Rebased onto master The main CI run was cancelled before the required lanes completed: Could you rerun the required CI on |
(ai: vllm-qwen/qwen3.8-27b) Before re-running CI I checked the current state of master, and there's something you should know first: this PR's change is already on master, so a rerun on
So I'm not re-running CI on 八问(本轮结论):
结论:PR 工作已在 master( |
…i#6722) into batch7-wave7
Closes #6721
Problem
The cache-diff report aligns each usage log sample by scanning backward from the last request. A long retained request/log history therefore performs requests × samples timestamp comparisons, even though both lists have already been sorted. This delays the offline diagnostic that identifies cache misses and their source.
Change
Advance one request cursor through the sorted timestamps while visiting usage samples. Each sample still belongs to the last request at or before its timestamp plus the existing 50 ms allowance. Equal-time requests, stable equal-time log ordering, the first sample used by a request, and missing samples retain their existing behavior. The timestamp-alignment step now takes O(requests + samples) work.
This change is confined to the offline cache report. It adds no configuration, storage format, dependency, kernel change, or request-pipeline behavior.
Current revision and validation
Rebased onto master
a8bbb8d23108ba9148d09512927041364625d910ine23468ac8c0162b646105f9fea135f20aafaa719, preserving the original regression and benchmark files and the upstream #6691 root-array correction.On this exact revision,
npm run typecheckandnpm run buildpass. All 50 tests across cache-usage alignment, cache-diff, root-array lookup, and Unicode suites pass with 0 failures or skips underTZ=UTC.The main CI run was cancelled before the required test lanes completed. The local results above do not establish a green full-suite CI result.
Original verification
runDiff()with real dump/log files. They cover out-of-order log input, multiple samples per request, the exact 50 ms boundary and its rejected neighbor, duplicate dump timestamps, equal-time sample stability, session filtering, early/late samples, empty logs, and gaps.npm run typecheck, separate strict TypeScript checking of the benchmark script,npm run build, andgit diff --checkpass.Measurement
scripts/bench-cache-usage-alignment.tscreates 10,000 actual request dump files and 100,000 usage log samples, then calls the full public report path. Each process performs one complete warmup; fixture construction, assertions, and hashing stay outside the measured interval.Three sequential alternating base/fix pairs on Node 24.22.1:
All six complete reports have the same SHA-256 (
a0c63e939f3ec3333e8d56e207f9f41976b35b0d0078b57b0d423bbaa6c25aa0) after replacing only the temporary directory/log paths. The benchmark checks every pair's usage fields before hashing. These figures describe this synthetic filesystem workload; other report stages still sort and read files.Reproduce one warmup plus one measurement at either revision:
History check
Reviewed all 127 Afloat16 issues and the separate 111-entry actual PR patch index, including current-batch cache-report changes. Actual #1269 introduces the existing backward scan; #5487 changes streaming log retention, #6496/#6517 fix Unicode byte offsets, and #6691 locates root message arrays. None changes usage alignment. Focused all-state issue/PR searches found no previous matching optimization.
Original benchmark base: master
3858b6956abab52da781c2436c0245586ce18358, package 0.1.214. Full-suite status comes from hosted CI on the pushed head.