[PR #5099] [Engine] Overlap split-arena expert refills across decode windows (experimental) #5309

Open
opened 2026-11-07 16:34:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5099
Author: @brokenarrow2099
Created: 11/3/2026
Status: 🔄 Open

Base: main ← Head: perf/split-arena-cross-window-refill


📝 Commits (1)

  • bb68d50 engine: add experimental cross-window split-arena refills

📊 Changes

5 files changed (+347 additions, -0 deletions)

View changed files

➕ docs/validation/split-arena-refill-20261103/README.md (+185 -0)
➕ docs/validation/split-arena-refill-20261103/VALIDATION.md (+73 -0)
➕ docs/validation/split-arena-refill-20261103/evidence.tar.gz (+0 -0)
➕ docs/validation/split-arena-refill-20261103/recheck.py (+23 -0)
📝 src/program/generate.cpp (+66 -0)

📄 Description

Problem and result

The serial layer-split RAM-arena path rejects --adapt-async 1, leaving adaptive expert refills on a blocking path. On two RTX 3080 20 GiB cards with a Q6 model, dual-request batches spent about 4.9 ms per decode window waiting for refill events.

This opt-in prototype submits refills on each owning GPU and lets one subsequent verification window compute before publishing the completed residency. In the archived six-case experiment, refill wait fell to 0.25–0.27 ms/window and decode throughput increased by 2.32–9.49%; prefill was effectively unchanged. These are bounded community measurements with important controls and confounders, not production qualification.

Draft: teardown guarantees and backend/runtime coverage remain incomplete. No default behavior changes and no permanent production deployment are proposed.

No prior maintainer scope agreement. This is a bounded, compiler- and environment-gated prototype submitted for feedback on scope, teardown, and the minimum validation needed before merging. No matching split-arena cross-window refill PR was found in the submission-time search.

Approach

  • Reuse the asynchronous tier state machine for the eligible serial split-arena case. At a global window gap, mark evictions nonresident on all GPUs before overwriting slots, then submit H2D refills on the owning cards' streams.
  • Let the next verification window use CPU fallback for missing experts. Publish incoming residency only after all used device events complete. Keep CUDA submissions on the main thread to avoid helper-thread/host-doorbell interactions.
  • Gate with STRATA_SPLIT_ARENA_ASYNC_EXPERIMENT=1 as a compiler definition and STRATA_SPLIT_ARENA_ASYNC=1 at runtime. There is no new CMake option. Exclude HIP, gfx906, and Metal; SYCL uses separate migrated sources.
  • Require serve mode, multiple GPUs, RAM arena, one batch group, no multi-window pipeline/peer/remote helper, and STRATA_ADAPT_NOWAIT=0, STRATA_ADAPT_LAG=1. Existing adaptive-round/swap checks still apply.
  • Keep unrelated CPU kernels and tuning experiments out of this patch.

Measured source base: 99866a47a2b8a21b131aad162a584ee9da92f8f0 (engine 0.1.55 / app 0.2.9). Submission bb68d509894b5b47e18fa86749f37175f1c24757 adds backend guard exclusions to the measured patch. CUDA-enabled preprocessing is identical to the measured source; macro-disabled preprocessing is identical to the original source.

Full methodology, configuration, results and limitations, submission checks, and sanitized raw evidence are included in the branch. The archive contains reports, raw records and SSE outputs, failed attempts, thermal/PMU observations, build provenance and original analysis/controller scripts; it excludes models, binaries and credentials.

Historical measurements

Two 20 GiB RTX 3080s at 280 W each; Xeon E5-2696 v4, 16 expert workers; Qwen3.8-Flash-Next Unsloth UD-Q6_K_XL; three configured slots at 262144 context; layer split 23, 5624 expert-cache slots; KV int8, resident KV 32768; MTP 4; STRATA_ROUTE_RESIDENT=0.1. The detailed document records all retained tuning, projection and affinity settings.

Input per request Active requests A decode tok/s B decode tok/s Change A prefill tok/s B prefill tok/s
8000 1 50.60 55.40 +9.49% 805.74 806.45
8000 2 52.38 53.82 +2.76% 807.77 809.56
60000 1 52.70 56.20 +6.64% 2011.98 2013.39
60000 2 51.28 55.17 +7.57% 1982.23 1980.22
160000 1 51.80 53.00 +2.32% 2335.04 2335.89
160000 2 49.02 51.95 +5.97% 2310.72 2309.41

Each request generated exactly 1536 tokens. Single-request decode uses the native rate; dual-request decode is aggregate throughput in a trimmed interval with both slots decoding and no prompt read. Cold prefill used separate one-output-token probes (serial for the dual case), then cooled cached-context decode. This is not continuous cold-prefill-plus-decode or simultaneous dual-cold TTFT. One A/B pair per case, no statistical-significance claim. Prefill changed by at most 0.23%.

Control caveat: both arms used the same experimental binary with NOWAIT=0,LAG=1; only the refill runtime gate changed. Unmodified SM86 production uses NOWAIT=1,LAG=2. This does not establish improvement over untouched production defaults. Routing, generated outputs, MTP acceptance and cache history differed and can affect throughput. Reduced refill wait was partly offset by increased run time.

The earlier A1/B1/A2 short campaign showed dual means 57.89 → 60.40 tok/s (+4.34%), with a small sample and MTP confounding. Accepted long requests reached 63 °C, 64 °C including restore, with zero recorded IMC thermal events; the interrupted 65 °C campaign is preserved and excluded. That cancellation threshold was an operational guard, not an established thermal wall.

Validation

Passed:

  • python3 docs/validation/split-arena-refill-20261103/recheck.py (Python 3.12+): all archived SHA-256 checks and both original accounting analyses pass; the six long comparisons regenerate. This does not validate model behavior.
  • git diff --check: clean before commit.
  • Debian 12 / GCC 12 / CUDA 13.1 builder: fresh submitted generate.cpp host translation-unit object compilation with the historical CUDA flags; enabled preprocessing matches measured source and disabled preprocessing matches baseline. Three probes verify the backend guard exclusions. This is not a full new CUDA link or GPU run.
  • CPU-native configure/build with GCC 15.2, CUDA/HIP/SYCL off, native experts/tests/conversation tests on, recorded GGML checkout. CTest completed with 80 passed, 4 skipped, 1 failed; failure/skips are below, not a green suite.
  • Historical measured CUDA engine and K-quant library compiled/linked; a separate 256-window diagnostic reported zero residency mismatches/stale CPU activation reports. Synchronizing diagnostics were disabled for performance runs. This is a bounded bookkeeping check, not numerical/semantic parity.

Exact build commands, hashes, logs, and the successful/unsuccessful configurations are in VALIDATION.md and the archive. No new model requests or production restarts were performed for this submission.

Failed:

  • CPU-native isa_guard_check: wide-ISA instructions in iq512_reference_gu_rows / iq512x_rows are not allowed by the checker list. CPU code, CMake and checker are unchanged from base; a separate pristine-baseline full suite was not rerun, so this is not a complete regression diagnosis.
  • Earlier native-experts-off CPU build: unresolved AVX1 symbols in several pool/expert tests; CTest recorded 52 passed / 7 not run. Retained separately.
  • Four CPU-native skips: expert_multi_test, native_hadamard_test, tq_cpu_parity, tq_cpu_parity_avx2; not counted as passes.
  • Rejected benchmark preflights and the thermally interrupted campaign are retained, excluded from accepted averages.

Not run:

  • Full new CUDA link/model execution after guard hardening; HIP/gfx906/SYCL/Metal builds; Windows runtime; mixed or more than two GPUs.
  • Numerical/KL or semantic-quality evaluation; sustained soak; cancellation/EOF during refill and injected CUDA faults.
  • Repeated A/B against untouched SM86 production defaults, pipelined groups or multimodal execution.

Limits

Unconfirmed static-analysis teardown concern: the added all-card drain runs through adapt_quiesce, while some direct error returns and EOF exits bypass that function. The source arena is destroyed before later-device stages. Possible implicit synchronization from CUDA host unregister/staging is not established as an all-path guarantee. No corruption was reproduced. Add/verify an experiment-only all-owning-stream scope drain and exercise EOF/fault exits before merge/deployment.

Keep this PR Draft pending that follow-up and agreement on backend/runtime checks. Pageable host copies can reduce overlap; CUDA event waits can hang on device failure, so trials need an independent watchdog. This legacy community measurement is not an approved result under the draft standard protocol. Preparation used AI assistance; executed checks, static analysis and missing coverage are separated above.


🔄 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/5099 **Author:** [@brokenarrow2099](https://github.com/brokenarrow2099) **Created:** 11/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `perf/split-arena-cross-window-refill` --- ### 📝 Commits (1) - [`bb68d50`](https://github.com/Niko1221/Strata/commit/bb68d509894b5b47e18fa86749f37175f1c24757) engine: add experimental cross-window split-arena refills ### 📊 Changes **5 files changed** (+347 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docs/validation/split-arena-refill-20261103/README.md` (+185 -0) ➕ `docs/validation/split-arena-refill-20261103/VALIDATION.md` (+73 -0) ➕ `docs/validation/split-arena-refill-20261103/evidence.tar.gz` (+0 -0) ➕ `docs/validation/split-arena-refill-20261103/recheck.py` (+23 -0) 📝 `src/program/generate.cpp` (+66 -0) </details> ### 📄 Description ## Problem and result The serial layer-split RAM-arena path rejects `--adapt-async 1`, leaving adaptive expert refills on a blocking path. On two RTX 3080 20 GiB cards with a Q6 model, dual-request batches spent about 4.9 ms per decode window waiting for refill events. This opt-in prototype submits refills on each owning GPU and lets one subsequent verification window compute before publishing the completed residency. In the archived six-case experiment, refill wait fell to 0.25–0.27 ms/window and decode throughput increased by 2.32–9.49%; prefill was effectively unchanged. These are bounded community measurements with important controls and confounders, not production qualification. **Draft:** teardown guarantees and backend/runtime coverage remain incomplete. No default behavior changes and no permanent production deployment are proposed. ## Related discussion No prior maintainer scope agreement. This is a bounded, compiler- and environment-gated prototype submitted for feedback on scope, teardown, and the minimum validation needed before merging. No matching split-arena cross-window refill PR was found in the submission-time search. ## Approach - Reuse the asynchronous tier state machine for the eligible serial split-arena case. At a global window gap, mark evictions nonresident on all GPUs before overwriting slots, then submit H2D refills on the owning cards' streams. - Let the next verification window use CPU fallback for missing experts. Publish incoming residency only after all used device events complete. Keep CUDA submissions on the main thread to avoid helper-thread/host-doorbell interactions. - Gate with `STRATA_SPLIT_ARENA_ASYNC_EXPERIMENT=1` as a compiler definition and `STRATA_SPLIT_ARENA_ASYNC=1` at runtime. There is no new CMake option. Exclude HIP, gfx906, and Metal; SYCL uses separate migrated sources. - Require serve mode, multiple GPUs, RAM arena, one batch group, no multi-window pipeline/peer/remote helper, and `STRATA_ADAPT_NOWAIT=0`, `STRATA_ADAPT_LAG=1`. Existing adaptive-round/swap checks still apply. - Keep unrelated CPU kernels and tuning experiments out of this patch. Measured source base: `99866a47a2b8a21b131aad162a584ee9da92f8f0` (engine 0.1.55 / app 0.2.9). Submission `bb68d509894b5b47e18fa86749f37175f1c24757` adds backend guard exclusions to the measured patch. CUDA-enabled preprocessing is identical to the measured source; macro-disabled preprocessing is identical to the original source. Full [methodology, configuration, results and limitations](https://github.com/brokenarrow2099/Strata/blob/bb68d509894b5b47e18fa86749f37175f1c24757/docs/validation/split-arena-refill-20261103/README.md), [submission checks](https://github.com/brokenarrow2099/Strata/blob/bb68d509894b5b47e18fa86749f37175f1c24757/docs/validation/split-arena-refill-20261103/VALIDATION.md), and [sanitized raw evidence](https://github.com/brokenarrow2099/Strata/blob/bb68d509894b5b47e18fa86749f37175f1c24757/docs/validation/split-arena-refill-20261103/evidence.tar.gz) are included in the branch. The archive contains reports, raw records and SSE outputs, failed attempts, thermal/PMU observations, build provenance and original analysis/controller scripts; it excludes models, binaries and credentials. ### Historical measurements Two 20 GiB RTX 3080s at 280 W each; Xeon E5-2696 v4, 16 expert workers; Qwen3.8-Flash-Next Unsloth UD-Q6_K_XL; three configured slots at 262144 context; layer split 23, 5624 expert-cache slots; KV int8, resident KV 32768; MTP 4; `STRATA_ROUTE_RESIDENT=0.1`. The detailed document records all retained tuning, projection and affinity settings. | Input per request | Active requests | A decode tok/s | B decode tok/s | Change | A prefill tok/s | B prefill tok/s | | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | 8000 | 1 | 50.60 | 55.40 | +9.49% | 805.74 | 806.45 | | 8000 | 2 | 52.38 | 53.82 | +2.76% | 807.77 | 809.56 | | 60000 | 1 | 52.70 | 56.20 | +6.64% | 2011.98 | 2013.39 | | 60000 | 2 | 51.28 | 55.17 | +7.57% | 1982.23 | 1980.22 | | 160000 | 1 | 51.80 | 53.00 | +2.32% | 2335.04 | 2335.89 | | 160000 | 2 | 49.02 | 51.95 | +5.97% | 2310.72 | 2309.41 | Each request generated exactly 1536 tokens. Single-request decode uses the native rate; dual-request decode is aggregate throughput in a trimmed interval with both slots decoding and no prompt read. Cold prefill used separate one-output-token probes (serial for the dual case), then cooled cached-context decode. This is not continuous cold-prefill-plus-decode or simultaneous dual-cold TTFT. One A/B pair per case, no statistical-significance claim. Prefill changed by at most 0.23%. **Control caveat:** both arms used the same experimental binary with `NOWAIT=0,LAG=1`; only the refill runtime gate changed. Unmodified SM86 production uses `NOWAIT=1,LAG=2`. This does not establish improvement over untouched production defaults. Routing, generated outputs, MTP acceptance and cache history differed and can affect throughput. Reduced refill wait was partly offset by increased run time. The earlier A1/B1/A2 short campaign showed dual means 57.89 → 60.40 tok/s (+4.34%), with a small sample and MTP confounding. Accepted long requests reached 63 °C, 64 °C including restore, with zero recorded IMC thermal events; the interrupted 65 °C campaign is preserved and excluded. That cancellation threshold was an operational guard, not an established thermal wall. ## Validation **Passed:** - `python3 docs/validation/split-arena-refill-20261103/recheck.py` (Python 3.12+): all archived SHA-256 checks and both original accounting analyses pass; the six long comparisons regenerate. This does not validate model behavior. - `git diff --check`: clean before commit. - Debian 12 / GCC 12 / CUDA 13.1 builder: fresh submitted `generate.cpp` host translation-unit object compilation with the historical CUDA flags; enabled preprocessing matches measured source and disabled preprocessing matches baseline. Three probes verify the backend guard exclusions. This is not a full new CUDA link or GPU run. - CPU-native configure/build with GCC 15.2, CUDA/HIP/SYCL off, native experts/tests/conversation tests on, recorded GGML checkout. CTest completed with **80 passed, 4 skipped, 1 failed**; failure/skips are below, not a green suite. - Historical measured CUDA engine and K-quant library compiled/linked; a separate 256-window diagnostic reported zero residency mismatches/stale CPU activation reports. Synchronizing diagnostics were disabled for performance runs. This is a bounded bookkeeping check, not numerical/semantic parity. Exact build commands, hashes, logs, and the successful/unsuccessful configurations are in `VALIDATION.md` and the archive. No new model requests or production restarts were performed for this submission. **Failed:** - CPU-native `isa_guard_check`: wide-ISA instructions in `iq512_reference_gu_rows` / `iq512x_rows` are not allowed by the checker list. CPU code, CMake and checker are unchanged from base; a separate pristine-baseline full suite was not rerun, so this is not a complete regression diagnosis. - Earlier native-experts-off CPU build: unresolved AVX1 symbols in several pool/expert tests; CTest recorded 52 passed / 7 not run. Retained separately. - Four CPU-native skips: `expert_multi_test`, `native_hadamard_test`, `tq_cpu_parity`, `tq_cpu_parity_avx2`; not counted as passes. - Rejected benchmark preflights and the thermally interrupted campaign are retained, excluded from accepted averages. **Not run:** - Full new CUDA link/model execution after guard hardening; HIP/gfx906/SYCL/Metal builds; Windows runtime; mixed or more than two GPUs. - Numerical/KL or semantic-quality evaluation; sustained soak; cancellation/EOF during refill and injected CUDA faults. - Repeated A/B against untouched SM86 production defaults, pipelined groups or multimodal execution. ## Limits **Unconfirmed static-analysis teardown concern:** the added all-card drain runs through `adapt_quiesce`, while some direct error returns and EOF exits bypass that function. The source arena is destroyed before later-device stages. Possible implicit synchronization from CUDA host unregister/staging is not established as an all-path guarantee. No corruption was reproduced. Add/verify an experiment-only all-owning-stream scope drain and exercise EOF/fault exits before merge/deployment. Keep this PR Draft pending that follow-up and agreement on backend/runtime checks. Pageable host copies can reduce overlap; CUDA event waits can hang on device failure, so trials need an independent watchdog. This legacy community measurement is not an approved result under the draft standard protocol. Preparation used AI assistance; executed checks, static analysis and missing coverage are separated above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5309
No description provided.