mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1338] [CLOSED] perf: opt-in async refills from immutable Q8 secondary copies #3396
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3396
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1338
Author: @CC-David-CC
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:perf/q8-secondary-refill-main📝 Commits (10+)
b77c90ccuda: add opt-in read-only Q8 miss cache with compact fill traversal7150182docs: record focused qualification and measured resultsdb1e2e4cuda: refill native async primary slots from immutable secondary copiesbefb032docs: record native async refill payload and request results468f01fMerge current main and preserve the opt-in read-only Q8 cachee66f25cMerge refreshed read-only cache and port refills onto current async scheduling922d273test: cover all-secondary refill completion before snapshot reusedb5e8dbfix: map snapshot invalid-argument errors in HIP compatibility headers654a037docs: report refreshed refill checks and observed parity limits57b7da9Record controlled tail-skip-off secondary refill comparisons📊 Changes
68 files changed (+51653 additions, -6 deletions)
View changed files
📝
CMakeLists.txt(+21 -2)➕
docs/experiments/compact-q8-main/README.md(+34 -0)➕
docs/experiments/compact-q8-main/reproduce/README.md(+5 -0)➕
docs/experiments/compact-q8-main/reproduce/case.py(+206 -0)➕
docs/experiments/compact-q8-main/reproduce/memory_samples.py(+33 -0)➕
docs/experiments/compact-q8-main/reproduce/plan.json(+141 -0)➕
docs/experiments/compact-q8-main/results.json(+932 -0)➕
docs/experiments/compact-q8-main/results.png(+0 -0)➕
docs/experiments/compact-q8-main/results.svg(+2732 -0)➕
docs/experiments/secondary-refill-main/README.md(+42 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/README.md(+125 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse.patch(+52 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse/comparison.json(+312 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse/plan.json(+128 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse/refill-i131072-t1-arm0/engine.txt(+641 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse/refill-i131072-t1-arm0/result.json(+1366 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse/refill-i131072-t1-arm1/engine.txt(+642 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse/refill-i131072-t1-arm1/result.json(+1373 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/sparse/status.json(+343 -0)➕
docs/experiments/secondary-refill-main/current-main-refresh/async-admission-diagnostics/trace.patch(+23 -0)...and 48 more files
📄 Description
Adds opt-in CUDA async primary-cache refills from immutable secondary expert copies. Snapshot observations are authorized only at completed verifier boundaries; refill D2D reads fence the next secondary-cache mutation. The existing worker handles H2D fallback and admission, including completion when every refill in a round came from the secondary cache. Default remains off.
Refreshed onto current main (
61b3fb5d) and #1336's cache foundation. The merge retains current async scheduling and adapts secondary copies to its owner/worker contract. The lifetime fixture alternates mixed H2D/D2D and all-secondary rounds. A missing HIP error alias used by the snapshot header was fixed in both compatibility headers.Requires
STRATA_Q8_ASYNC_REFILL=1,STRATA_Q8_CACHE_TAG_SNAPSHOT=1, an enabled Q8 secondary cache and native--adapt-async 1. Layer splits, pipeline windows, batched requests, helpers and device planning remain refused.Fresh RTX PRO 6000 Blackwell / Qwen3.8-Flash-Next Q8_0 / FP16 KV checks: default-off 8K/512 output matched main; 32K and 128K MTP-width-4 off/on pairs matched all 1024 output IDs. Width-1 off/on did not match, diverging at zero-based token 218 (32K) and 7 (128K). Same-arm repeats found variability in the 32K off arm, while both 128K arms matched themselves. These data do not establish a general parity guarantee or speedup. All twelve primary cases and four repeats completed their function checks; six STOP/drain/following-request checks passed, without a full internal-state digest claim.
CUDA read-only/compact/lifetime fixtures passed. Lifetime memcheck reported zero errors and racecheck zero hazards/errors/warnings. Refreshed HIP/SYCL builds passed; those builds establish compatibility, not feature runtime validation on other backends. Fresh full records, source/binary identities, descriptive timings and exactness limits. Design and reproduction. Historical results retain their original source/date and are not presented as current-main measurements.
A four-case follow-up disables approximate tail skipping (
STRATA_ROUTE_TAIL_SKIP=0) while preserving the same binary and other settings. The 32K width-1 off/on pair now matches all 1024 IDs; the 128K pair still differs at token 7. All four requests complete and pass their function checks. Tail skipping does not explain the remaining 128K result, and no unconditional exactness or speed claim follows.Sparse diagnostics reproduce the 128K difference and show different admission timing and swap plans during the 128-token function check before the benchmark. The benchmark comparison does not hold adaptive placement history fixed. Verbose logging makes outputs match, while disabling it on the same binary restores divergence; this is timing-sensitive evidence, not proof that every state defect is ruled out. Full six-case diagnostic records and minimal CUDA-only analysis patches are published. The feature remains experimental, without an unconditional exactness or speed claim.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.