[PR #1338] [CLOSED] perf: opt-in async refills from immutable Q8 secondary copies #3396

Closed
opened 2026-11-07 14:41:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 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+)

  • b77c90c cuda: add opt-in read-only Q8 miss cache with compact fill traversal
  • 7150182 docs: record focused qualification and measured results
  • db1e2e4 cuda: refill native async primary slots from immutable secondary copies
  • befb032 docs: record native async refill payload and request results
  • 468f01f Merge current main and preserve the opt-in read-only Q8 cache
  • e66f25c Merge refreshed read-only cache and port refills onto current async scheduling
  • 922d273 test: cover all-secondary refill completion before snapshot reuse
  • db5e8db fix: map snapshot invalid-argument errors in HIP compatibility headers
  • 654a037 docs: report refreshed refill checks and observed parity limits
  • 57b7da9 Record 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.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1338 **Author:** [@CC-David-CC](https://github.com/CC-David-CC) **Created:** 10/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `perf/q8-secondary-refill-main` --- ### 📝 Commits (10+) - [`b77c90c`](https://github.com/Niko1221/Strata/commit/b77c90ca3d210c842ff1ba26f03ddb2f4d9eecfb) cuda: add opt-in read-only Q8 miss cache with compact fill traversal - [`7150182`](https://github.com/Niko1221/Strata/commit/71501822fcc08a1cb2226f60dd41903796a2ca65) docs: record focused qualification and measured results - [`db1e2e4`](https://github.com/Niko1221/Strata/commit/db1e2e460ca11d4821077b445d095d5d6ee72043) cuda: refill native async primary slots from immutable secondary copies - [`befb032`](https://github.com/Niko1221/Strata/commit/befb0321d10c0d42ed52efc61c771539c76afb0a) docs: record native async refill payload and request results - [`468f01f`](https://github.com/Niko1221/Strata/commit/468f01f18d9277448f12d995af7ad2c4338c6fd1) Merge current main and preserve the opt-in read-only Q8 cache - [`e66f25c`](https://github.com/Niko1221/Strata/commit/e66f25c9b22d2b22a0f32f1d94f5891fc3a76c1d) Merge refreshed read-only cache and port refills onto current async scheduling - [`922d273`](https://github.com/Niko1221/Strata/commit/922d273bcb4d782705f636e51a9b1b11ccbcc4c5) test: cover all-secondary refill completion before snapshot reuse - [`db5e8db`](https://github.com/Niko1221/Strata/commit/db5e8db73d47302027cc1b40418bae8f3c6fd10e) fix: map snapshot invalid-argument errors in HIP compatibility headers - [`654a037`](https://github.com/Niko1221/Strata/commit/654a037e980e5c77897ae04b22b13d16c9ed56cd) docs: report refreshed refill checks and observed parity limits - [`57b7da9`](https://github.com/Niko1221/Strata/commit/57b7da931b30a79610abbbdcc033a5cc486a64ec) Record controlled tail-skip-off secondary refill comparisons ### 📊 Changes **68 files changed** (+51653 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `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_ </details> ### 📄 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](https://github.com/CC-David-CC/Strata-a5500/blob/217739d4/docs/experiments/secondary-refill-main/current-main-refresh/README.md). [Design and reproduction](https://github.com/CC-David-CC/Strata-a5500/blob/217739d4/docs/experiments/secondary-refill-main/README.md). 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:41:12 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3396
No description provided.