[GH-ISSUE #4351] [Engine] Opt-in GPU expert-miss execution and cancellation recovery for DeepSeek #1921

Closed
opened 2026-11-04 01:55:20 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @moniljo on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4351

Area

[Engine] (speed, kernels, models, the server and API)

What do you want to do?

Would you welcome a focused, opt-in CUDA path that stages eligible nonresident DeepSeek experts from copied host RAM to the GPU for computation, together with the cancellation/recovery lifecycle needed to keep that path correct and fast? I am asking for scope agreement before preparing upstream patches, following CONTRIBUTING.md. No default change is proposed.

The use case is single-GPU, long-context coding on a 96 GB Blackwell PC with enough physical RAM for the exact model's remaining experts. Cancellation during prompt ingestion should leave the next request able to recover a healthy expert-pool layout and direct transfers, with recovery cost reported rather than hidden.

What do you do today instead?

I run a custom Strata build. The source-only recipe and README, setup commands, source/build identities, and experiment history are pinned to that commit. They include source overlays, fixtures, benchmark inputs/controllers, compact outcomes and raw receipt hashes. No weights, binaries, credentials or private conversations are uploaded.

The current prototype ports the custom work onto Strata v0.2.7 / engine 0.1.52, tag 5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d; tested executable SHA-256 is 4b3a7f1a29b1d860eb79363544acbe19d9b758345f4ec04dbad1a9db0609dd8b. It was built freshly from source, including the modified GGML dependency. The portable recipe reconstructs the tested source bytes and equivalent build options; it did not produce that private reference image, and identical binaries across different build paths are not claimed. This work was developed with Codex assistance; the measurements below come from retained completed runs.

Proposed first scope

  • An explicitly enabled GPU-miss path for the currently tested narrow geometry: DSpark windows of 1-4 tokens, up to 24 unique experts, existing expert kernels and bounded device staging. Preserve the existing route when a request is ineligible.
  • Optional direct H2D copies from registered copied-RAM spans. Validate the current allocation/domain/role/slot and full source span; retain separate direct, bounce and CPU-fallback counters. The tested DS4_PREFILL_REGISTER_RAM_MB=196608 is a 192 GiB host-registration cap, not VRAM or duplicated weights. Registration failure must remain a safe refusal/fallback.
  • A defined ownership lifecycle: drain workers, mailboxes, copy and compute streams before invalidating sources; physically unregister before maintenance; rebuild and publish only a valid epoch. Retain healthy state on an ordinary decode Stop. After an interrupted new prefill, restore the compact layout, pool and registrations before token mutation. The prototype reserves 512 MiB of recovery-only headroom and retains the normal anchor so repeated cancellation does not ratchet it down.

Cancellation recovery here belongs to this new custom path; I have not independently established the same bug in stock upstream. The prototype currently disables DS4_WARM and DS4_COPY_PIN to avoid competing producer/registration ownership. Integrating with upstream's existing store lifecycle needs review. I would keep the larger prefill/kernel/GGML changes, compatibility fixes, setup/UI and machine-specific launch/tunnel work outside this initial patch.

Environment and benchmark contract

Windows x64; one RTX PRO 6000 Blackwell Max-Q 96 GB / 300 W; Ryzen 9 7950X3D; nominal 256 GiB RAM (255.2 GiB reported); NVMe; CUDA 13.2; MSVC 14.44/compiler 19.44; SM120a. Exact OrcaRouter DeepSeek-V4.1-Flash-1017 abliterated Mix-256G originals plus lossless compatibility sidecars; all six trunk experts; total context 1,048,576; CPU 16; DSpark on/block 3/confidence 0.65; mmap off; SSD cache 0; prefill chunk 65,280. No smaller quantization or expert-count reduction was used.

The native workload has two fresh 999,764-token, zero-reuse seeds, thirteen followups per wave and an unrelated interlude in one owned process (29 GENs). Each followup reuses that full prefix and ends naturally. Decode is sum(emitted IDs - 1) / sum(last-ID time - first-ID time) over the original twelve tasks, including reasoning/control/EOS IDs; HTTP frames are not counted as tokens. TTFT is separate. Output lengths differ; these are not identical-output latency comparisons or standard-protocol/approved Strata benchmark results.

Measured results: two separate paired experiments

Experiment / arm Wave 1 decode, ID intervals/s Wave 2 decode, ID intervals/s Fresh seed TTFT, wave 1 / 2
Historical same-weight minimal-compatibility control 35.2192 35.3267 334.862 / 328.409 s
Historical custom V6b 38.4915 39.1636 329.164 / 330.404 s
Oct 27 previous custom build control 37.1561 38.7642 347.321 / 346.128 s
Oct 27 custom v0.2.7 port 36.6547 38.1305 351.162 / 352.900 s

The historical paired result measured +9.29% / +10.86% decode, with wave 2 TTFT slightly worse. Its control includes required compatibility changes; it is not an untouched official executable. That result supports the tested configuration, not an isolated gain for every component.

The v0.2.7 comparison was 1.35% / 1.63% slower in decode, with 1.11% / 1.96% higher TTFT, against the previous custom build. It met the predeclared local update bounds (at least 95% decode, at most 105% TTFT). There is no custom-versus-stock v0.2.7 performance result. These pairs must not be combined into a version-causal or universal speedup claim.

Passed, failed and not run

Passed, within the recorded scope: the fresh CUDA build; 133 numeric GPU cases and 96 guards; 1,248 IQ cases across eight fresh owned runs; native direct/retire/rearm/source-protection and exit-zero cleanup gates. The five loaded Stop modes cover setup twice, decode, active prefill, early rearm and initial prefill: six actual cancellations, 34 FIRST grades and 39 uncancelled rows. Each FIRST recovery met its 95% decode bound with direct work and zero observed bounce/CPU fallback. Initial-prefill cancellation uses a declared separate-process control; recovery remains inside FIRST TTFT, so the ratios do not establish a universal post-cancel speedup. A separate fresh near-1M API qualification passed exact-answer, natural SSE termination, tool-protocol and disconnect-recovery checks.

Failures retained:

  • Both the historical custom qualification and current port retain 25/26 raw grades, passed=false. A legacy account-balance response used attribute access that the unchanged dictionary-only worker rejected. The already-frozen explicit-dictionary version passed; the predeclared first-eleven-plus-v2 primary set passed 24/24. No raw grade, generated code or oracle was repaired.
  • Earlier bounce variants regressed to 13.66/14.09 versus 29.78 ID intervals/s on an 85K screen; a 96 GiB registration cap was also slower. Overlap was effectively tied with the simpler direct path and was not selected.
  • V5 cancellation recovery reached 3,037.2 MiB free after 30 registrations, below the unchanged 3,072 MiB floor. It correctly rolled registrations back to zero and used slower bounce copies. V6b's recovery-only headroom addresses that measured case, not every low-memory condition.
  • The first v0.2.7 long attempt failed before grading because its observer assumed the old registered-byte total. The corrected observer validates all current arenas and freezes their actual ledger before grading; engine, timing and oracle were unchanged. Actual registration bytes are placement-dependent, not a portable constant.
  • The linked history retains compiler/preflight failures, a historical native exit-1 failure with incomplete shutdown diagnosis, and earlier API exact-format failures. Longer shutdown grace does not establish that exit's cause. A later explicitly declared high-effort API preset passing is not a regrade of the earlier format failure. The experiment catalog indexes the earlier attempts and raw hashes.

Not run / limits: HIP compilation or execution, Linux CUDA, other GPUs/models, multi-GPU, batching, low-RAM acceptance, broad perplexity/model-quality acceptance, and the upstream standard benchmark protocol on these patches. CPU/GPU output bit identity is not claimed. Large page-locked host allocations consume real physical memory and driver resources; a page file is not a replacement. The current source bundle contains coupled optimizations; a minimal current-main patch still needs its own before/after and default-off validation. Missing backend checks would be disclosed in draft PRs.

Existing work and requested guidance

I searched open and closed issues/PRs. Relevant work includes #4286 (huge-page backing for the existing registered RAM store), #4199 (DeepSeek batching), and #4219 (Windows RTX PRO 6000 prompt-performance reports). The proposed copied-RAM-to-device staging path needs to align with that ownership/store work; these different models, settings and workloads are not comparable benchmark arms or proof of the same bug.

Would you prefer the first contribution to be a bounded CUDA staging/registration primitive with fixtures, or the complete opt-in single-request path including recovery? Which upstream store/worker interface should own the registration ledger, and what additional backend/quality gates would you require before review? I can prepare smaller patches after agreement and keep further evidence in this thread.

Originally created by @moniljo on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4351 ### Area [Engine] (speed, kernels, models, the server and API) ### What do you want to do? Would you welcome a focused, **opt-in CUDA path that stages eligible nonresident DeepSeek experts from copied host RAM to the GPU for computation**, together with the cancellation/recovery lifecycle needed to keep that path correct and fast? I am asking for scope agreement before preparing upstream patches, following CONTRIBUTING.md. No default change is proposed. The use case is single-GPU, long-context coding on a 96 GB Blackwell PC with enough physical RAM for the exact model's remaining experts. Cancellation during prompt ingestion should leave the next request able to recover a healthy expert-pool layout and direct transfers, with recovery cost reported rather than hidden. ### What do you do today instead? I run a custom Strata build. The source-only [recipe and README](https://github.com/moniljo/deepseek-uncensored-rtx6000/tree/5a26a9a2efc64e4fbcc5abf17c0d38299926c643), [setup commands](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/docs/setup.md), [source/build identities](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/docs/update-027.md), and [experiment history](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/docs/experiments.md) are pinned to that commit. They include source overlays, fixtures, benchmark inputs/controllers, compact outcomes and raw receipt hashes. No weights, binaries, credentials or private conversations are uploaded. The current prototype ports the custom work onto Strata **v0.2.7 / engine 0.1.52**, tag `5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d`; tested executable SHA-256 is `4b3a7f1a29b1d860eb79363544acbe19d9b758345f4ec04dbad1a9db0609dd8b`. It was built freshly from source, including the modified GGML dependency. The portable recipe reconstructs the tested source bytes and equivalent build options; it did not produce that private reference image, and identical binaries across different build paths are not claimed. This work was developed with Codex assistance; the measurements below come from retained completed runs. ### Proposed first scope - An explicitly enabled GPU-miss path for the currently tested narrow geometry: DSpark windows of 1-4 tokens, up to 24 unique experts, existing expert kernels and bounded device staging. Preserve the existing route when a request is ineligible. - Optional direct H2D copies from registered copied-RAM spans. Validate the current allocation/domain/role/slot and full source span; retain separate direct, bounce and CPU-fallback counters. The tested `DS4_PREFILL_REGISTER_RAM_MB=196608` is a **192 GiB host-registration cap**, not VRAM or duplicated weights. Registration failure must remain a safe refusal/fallback. - A defined ownership lifecycle: drain workers, mailboxes, copy and compute streams before invalidating sources; physically unregister before maintenance; rebuild and publish only a valid epoch. Retain healthy state on an ordinary decode Stop. After an interrupted new prefill, restore the compact layout, pool and registrations before token mutation. The prototype reserves 512 MiB of recovery-only headroom and retains the normal anchor so repeated cancellation does not ratchet it down. Cancellation recovery here belongs to this **new custom path**; I have not independently established the same bug in stock upstream. The prototype currently disables `DS4_WARM` and `DS4_COPY_PIN` to avoid competing producer/registration ownership. Integrating with upstream's existing store lifecycle needs review. I would keep the larger prefill/kernel/GGML changes, compatibility fixes, setup/UI and machine-specific launch/tunnel work outside this initial patch. ### Environment and benchmark contract Windows x64; one RTX PRO 6000 Blackwell Max-Q 96 GB / 300 W; Ryzen 9 7950X3D; nominal 256 GiB RAM (255.2 GiB reported); NVMe; CUDA 13.2; MSVC 14.44/compiler 19.44; SM120a. Exact OrcaRouter DeepSeek-V4.1-Flash-1017 abliterated **Mix-256G** originals plus lossless compatibility sidecars; all **six** trunk experts; total context **1,048,576**; CPU 16; DSpark on/block 3/confidence 0.65; mmap off; SSD cache 0; prefill chunk 65,280. No smaller quantization or expert-count reduction was used. The native workload has two fresh **999,764-token, zero-reuse** seeds, thirteen followups per wave and an unrelated interlude in one owned process (29 GENs). Each followup reuses that full prefix and ends naturally. Decode is `sum(emitted IDs - 1) / sum(last-ID time - first-ID time)` over the original twelve tasks, including reasoning/control/EOS IDs; HTTP frames are not counted as tokens. TTFT is separate. Output lengths differ; these are not identical-output latency comparisons or standard-protocol/approved Strata benchmark results. ### Measured results: two separate paired experiments | Experiment / arm | Wave 1 decode, ID intervals/s | Wave 2 decode, ID intervals/s | Fresh seed TTFT, wave 1 / 2 | |---|---:|---:|---:| | Historical same-weight minimal-compatibility control | 35.2192 | 35.3267 | 334.862 / 328.409 s | | Historical custom V6b | 38.4915 | 39.1636 | 329.164 / 330.404 s | | Oct 27 previous custom build control | 37.1561 | 38.7642 | 347.321 / 346.128 s | | Oct 27 custom v0.2.7 port | 36.6547 | 38.1305 | 351.162 / 352.900 s | The [historical paired result](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/evidence/qualification-v6b-q02.json) measured **+9.29% / +10.86% decode**, with wave 2 TTFT slightly worse. Its control includes required compatibility changes; it is not an untouched official executable. That result supports the tested configuration, not an isolated gain for every component. The [v0.2.7 comparison](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/evidence/update-027-native.json) was **1.35% / 1.63% slower in decode**, with **1.11% / 1.96% higher TTFT**, against the previous custom build. It met the predeclared local update bounds (at least 95% decode, at most 105% TTFT). **There is no custom-versus-stock v0.2.7 performance result.** These pairs must not be combined into a version-causal or universal speedup claim. ### Passed, failed and not run **Passed, within the recorded scope:** the fresh CUDA build; 133 numeric GPU cases and 96 guards; 1,248 IQ cases across eight fresh owned runs; native direct/retire/rearm/source-protection and exit-zero cleanup gates. The [five loaded Stop modes](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/evidence/update-027-recovery.json) cover setup twice, decode, active prefill, early rearm and initial prefill: six actual cancellations, 34 FIRST grades and 39 uncancelled rows. Each FIRST recovery met its 95% decode bound with direct work and zero observed bounce/CPU fallback. Initial-prefill cancellation uses a declared separate-process control; recovery remains inside FIRST TTFT, so the ratios do not establish a universal post-cancel speedup. A separate [fresh near-1M API qualification](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/evidence/update-027-api.json) passed exact-answer, natural SSE termination, tool-protocol and disconnect-recovery checks. **Failures retained:** - Both the historical custom qualification and current port retain **25/26 raw grades**, `passed=false`. A legacy account-balance response used attribute access that the unchanged dictionary-only worker rejected. The already-frozen explicit-dictionary version passed; the predeclared first-eleven-plus-v2 primary set passed **24/24**. No raw grade, generated code or oracle was repaired. - Earlier bounce variants regressed to 13.66/14.09 versus 29.78 ID intervals/s on an 85K screen; a 96 GiB registration cap was also slower. Overlap was effectively tied with the simpler direct path and was not selected. - V5 cancellation recovery reached 3,037.2 MiB free after 30 registrations, below the unchanged 3,072 MiB floor. It correctly rolled registrations back to zero and used slower bounce copies. V6b's recovery-only headroom addresses that measured case, not every low-memory condition. - The [first v0.2.7 long attempt](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/evidence/update-027-attempt01.json) failed before grading because its observer assumed the old registered-byte total. The corrected observer validates all current arenas and freezes their actual ledger before grading; engine, timing and oracle were unchanged. Actual registration bytes are placement-dependent, not a portable constant. - The linked history retains compiler/preflight failures, a historical native exit-1 failure with incomplete shutdown diagnosis, and earlier API exact-format failures. Longer shutdown grace does not establish that exit's cause. A later explicitly declared high-effort API preset passing is not a regrade of the earlier format failure. The [experiment catalog](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/evidence/experiment-catalog.json) indexes the earlier attempts and raw hashes. **Not run / limits:** HIP compilation or execution, Linux CUDA, other GPUs/models, multi-GPU, batching, low-RAM acceptance, broad perplexity/model-quality acceptance, and the upstream standard benchmark protocol on these patches. CPU/GPU output bit identity is not claimed. Large page-locked host allocations consume real physical memory and driver resources; a page file is not a replacement. The current source bundle contains coupled optimizations; a minimal current-main patch still needs its own before/after and default-off validation. Missing backend checks would be disclosed in draft PRs. ### Existing work and requested guidance I searched open and closed issues/PRs. Relevant work includes #4286 (huge-page backing for the existing registered RAM store), #4199 (DeepSeek batching), and #4219 (Windows RTX PRO 6000 prompt-performance reports). The proposed copied-RAM-to-device staging path needs to align with that ownership/store work; these different models, settings and workloads are not comparable benchmark arms or proof of the same bug. Would you prefer the first contribution to be a bounded CUDA staging/registration primitive with fixtures, or the complete opt-in single-request path including recovery? Which upstream store/worker interface should own the registration ledger, and what additional backend/quality gates would you require before review? I can prepare smaller patches after agreement and keep further evidence in this thread.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660284908 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1921
No description provided.