[GH-ISSUE #1853] Feature Request: API for temporary VRAM offloading (sleep/wake endpoints) for single-GPU orchestration #731

Closed
opened 2026-11-04 01:45:25 +07:00 by bsakaguchi · 7 comments
Owner

Originally created by @Mikhai133 on GitHub (Oct 10, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1853

TL;DR
Requesting a pair of HTTP endpoints — POST /release_memory_occupation and POST /resume_memory_occupation — that would allow Strata to gracefully free GPU VRAM (by paging weights to Host RAM) without killing the process. This would enable zero-restart, low-latency GPU handoff between Strata and other engines (like ComfyUI) on a single GPU, dramatically improving UX for single-GPU workstations.
Context & Problem Statement
I run a local AI stack orchestrating two engines on the same GPU (RTX 5090, 32 GB):
ComfyUI for image/video generation (LTX-2.5, Qwen-Image-Edit, etc.).
Strata for LLM inference (planning to migrate to Strata + Qwen3.8-Flash-Next-125B).
My manager service arbitrates the GPU. Before a ComfyUI job, it needs the LLM engine to sleep. When SGLang is used, this relies on its memory-occupation API (release_memory_occupation), which takes under 5 seconds because it moves weights to host RAM.
Currently, Strata has no equivalent. The only way to free VRAM for ComfyUI is to kill the process and restart it. While cold starts have improved massively in v0.1.40/41 (~70s for Q2_0 262K context, thank you!), a process restart is still an order of magnitude slower than a RAM-to-VRAM wake cycle. In reverse handoffs, an external report measured ~5 minutes to fully hand the GPU back to an LLM engine using process-level control.
On a 32GB card, this is the difference between "chat feels instant" and "chat feels like a batch job". Tools like T8mars/Comfyui-Strata-T8 exist but rely on process killing, meaning every transition costs a full cold start.
Proposed Solution
Add optional endpoints to the Strata server (e.g., gated behind STRATA_ENABLE_MEMORY_OCCUPATION_API=1):

  1. POST /release_memory_occupation
    Behavior: Move all resident hot-experts, KV-cache, and vision encoder weights from VRAM to Host RAM (not disk). Keep the process alive. Flush the CUDA allocator pool so nvidia-smi shows freed VRAM. Block incoming inference requests with 503 Service Unavailable.
    Optional Payload: Allow surgical offloading.
    {
    "offload_targets": ["experts", "vision", "kv_cache"],
    "keep_in_vram_mib": 2048
    }
    Return: 200 OK once VRAM is freed (or 503 if it cannot be freed within a timeout).
  2. POST /resume_memory_occupation
    Behavior: Move weights back from RAM to VRAM. Recompute the optimal resident-expert set. Unblock inference.
    Return: 200 OK once ready to serve.
  3. GET /memory_occupation_state (Optional but helpful)
    Return: {"status": "parked", "vram_used_mib": N, "ram_pinned_mib": N, "ready_for_inference": false}. Allows orchestrators to make decisions without scraping nvidia-smi.
    Technical Considerations / Implementation Ideas
    Since Strata's core architecture already handles hot/cold expert paging, this shouldn't require rewriting the inference engine. It could be implemented as a "forced parking" mode over the existing memory manager:
    Pinned Memory: Allocate a pool of Page-Locked (Pinned) Memory in Host RAM at startup. Using DMA for PCIe transfers could drop the offload/restore times for a 125B MoE model to just a few seconds on PCIe 4.0/5.0.
    MoE Manager Hook: A global is_parked flag that intercepts the scheduler, forcing all hot experts to be marked as cold and paged to the RAM pool.
    KV-Cache: Either copy KV blocks to RAM, or optionally quantize them on the fly (e.g., FP8/INT8) to halve the PCIe transfer time before parking.
    Alternatives Considered
    Process-level handoff (Process Kill): Works (e.g., T8mars nodes), but every transition triggers a 70s+ cold start.
    Reduced Residency (--vram-reserve-mib, --resident-experts): Helps for light ComfyUI workloads, but breaks down completely when ComfyUI needs 20+ GB for video generation models.
    Two GPUs: The correct long-term answer, but not an option for the vast majority of single-GPU users.
    OS-level SIGSTOP: Doesn't work because the NVIDIA driver holds the CUDA context and VRAM allocations until the process dies or explicitly calls cudaFree.
    Environment
    Hardware: RTX 5090 (32 GB VRAM), 128 GB Host RAM
    OS: Linux (Ubuntu 24.04)
    Strata Version: v0.1.41
    I am more than happy to test a beta build, provide detailed timing numbers, or help profile the PCIe transfer bottlenecks if this aligns with your roadmap. Thanks for the incredible work on v0.1.40/41 — the CPU-assisted prefill and multi-GPU concurrency improvements are excellent!
Originally created by @Mikhai133 on GitHub (Oct 10, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1853 TL;DR Requesting a pair of HTTP endpoints — POST /release_memory_occupation and POST /resume_memory_occupation — that would allow Strata to gracefully free GPU VRAM (by paging weights to Host RAM) without killing the process. This would enable zero-restart, low-latency GPU handoff between Strata and other engines (like ComfyUI) on a single GPU, dramatically improving UX for single-GPU workstations. Context & Problem Statement I run a local AI stack orchestrating two engines on the same GPU (RTX 5090, 32 GB): ComfyUI for image/video generation (LTX-2.5, Qwen-Image-Edit, etc.). Strata for LLM inference (planning to migrate to Strata + Qwen3.8-Flash-Next-125B). My manager service arbitrates the GPU. Before a ComfyUI job, it needs the LLM engine to sleep. When SGLang is used, this relies on its memory-occupation API (release_memory_occupation), which takes under 5 seconds because it moves weights to host RAM. Currently, Strata has no equivalent. The only way to free VRAM for ComfyUI is to kill the process and restart it. While cold starts have improved massively in v0.1.40/41 (~70s for Q2_0 262K context, thank you!), a process restart is still an order of magnitude slower than a RAM-to-VRAM wake cycle. In reverse handoffs, an external report measured ~5 minutes to fully hand the GPU back to an LLM engine using process-level control. On a 32GB card, this is the difference between "chat feels instant" and "chat feels like a batch job". Tools like T8mars/Comfyui-Strata-T8 exist but rely on process killing, meaning every transition costs a full cold start. Proposed Solution Add optional endpoints to the Strata server (e.g., gated behind STRATA_ENABLE_MEMORY_OCCUPATION_API=1): 1. POST /release_memory_occupation Behavior: Move all resident hot-experts, KV-cache, and vision encoder weights from VRAM to Host RAM (not disk). Keep the process alive. Flush the CUDA allocator pool so nvidia-smi shows freed VRAM. Block incoming inference requests with 503 Service Unavailable. Optional Payload: Allow surgical offloading. { "offload_targets": ["experts", "vision", "kv_cache"], "keep_in_vram_mib": 2048 } Return: 200 OK once VRAM is freed (or 503 if it cannot be freed within a timeout). 2. POST /resume_memory_occupation Behavior: Move weights back from RAM to VRAM. Recompute the optimal resident-expert set. Unblock inference. Return: 200 OK once ready to serve. 3. GET /memory_occupation_state (Optional but helpful) Return: {"status": "parked", "vram_used_mib": N, "ram_pinned_mib": N, "ready_for_inference": false}. Allows orchestrators to make decisions without scraping nvidia-smi. Technical Considerations / Implementation Ideas Since Strata's core architecture already handles hot/cold expert paging, this shouldn't require rewriting the inference engine. It could be implemented as a "forced parking" mode over the existing memory manager: Pinned Memory: Allocate a pool of Page-Locked (Pinned) Memory in Host RAM at startup. Using DMA for PCIe transfers could drop the offload/restore times for a 125B MoE model to just a few seconds on PCIe 4.0/5.0. MoE Manager Hook: A global is_parked flag that intercepts the scheduler, forcing all hot experts to be marked as cold and paged to the RAM pool. KV-Cache: Either copy KV blocks to RAM, or optionally quantize them on the fly (e.g., FP8/INT8) to halve the PCIe transfer time before parking. Alternatives Considered Process-level handoff (Process Kill): Works (e.g., T8mars nodes), but every transition triggers a 70s+ cold start. Reduced Residency (--vram-reserve-mib, --resident-experts): Helps for light ComfyUI workloads, but breaks down completely when ComfyUI needs 20+ GB for video generation models. Two GPUs: The correct long-term answer, but not an option for the vast majority of single-GPU users. OS-level SIGSTOP: Doesn't work because the NVIDIA driver holds the CUDA context and VRAM allocations until the process dies or explicitly calls cudaFree. Environment Hardware: RTX 5090 (32 GB VRAM), 128 GB Host RAM OS: Linux (Ubuntu 24.04) Strata Version: v0.1.41 I am more than happy to test a beta build, provide detailed timing numbers, or help profile the PCIe transfer bottlenecks if this aligns with your roadmap. Thanks for the incredible work on v0.1.40/41 — the CPU-assisted prefill and multi-GPU concurrency improvements are excellent!
Author
Owner

@GonzMartinez commented on GitHub (Oct 10, 2026):

There's already something like this but for only one GPU. I sloped it to two GPUs, next week i'll raise a pr. My use case is the same as you describe, leaving room for qwen image without killing strata and it is working well although i didn't use it extensively.

<!-- gh-comment-id:6099316876 --> @GonzMartinez commented on GitHub (Oct 10, 2026): There's already something like this but for only one GPU. I sloped it to two GPUs, next week i'll raise a pr. My use case is the same as you describe, leaving room for qwen image without killing strata and it is working well although i didn't use it extensively.
Author
Owner

@Mikhai133 commented on GitHub (Oct 10, 2026):

This is fantastic news — and especially that your use case matches mine almost exactly (leaving VRAM headroom for Qwen-Image / LTX-2.5 while Strata stays alive).

Two quick questions while you're still shaping the PR, so I can pre-wire my orchestrator to match your API on day one:

Endpoint shape. Are you exposing it as POST /release_memory_occupation + POST /resume_memory_occupation (SGLang-compatible), or something Strata-specific? If it's the latter, what are the paths and payloads? I'd rather adopt your naming than have you accommodate mine.

What gets parked where. On release, do the experts/KV/vision weights stay in host RAM (fast resume, SGLang-style), or get written back to disk? And on resume, does the resident-expert set get recomputed from scratch, or does it restore the previous hot set?

Not asking for guarantees — just enough to know whether my wake path should budget 5 seconds or 50.

Offer: if you push the branch (even as a draft PR or a WIP tag), I'll wire it into my proxy and run it against a 5090 / 32 GB / 192 GB RAM on Ubuntu 24.04. I can share concrete latency numbers for both directions (ComfyUI→Strata and Strata→ComfyUI) within a day or two of getting a build. Happy to be an early test case — the more eyes on the two-GPU path before merge, the better.

Thanks again for the speed on this.

<!-- gh-comment-id:6099514189 --> @Mikhai133 commented on GitHub (Oct 10, 2026): This is fantastic news — and especially that your use case matches mine almost exactly (leaving VRAM headroom for Qwen-Image / LTX-2.5 while Strata stays alive). Two quick questions while you're still shaping the PR, so I can pre-wire my orchestrator to match your API on day one: Endpoint shape. Are you exposing it as POST /release_memory_occupation + POST /resume_memory_occupation (SGLang-compatible), or something Strata-specific? If it's the latter, what are the paths and payloads? I'd rather adopt your naming than have you accommodate mine. What gets parked where. On release, do the experts/KV/vision weights stay in host RAM (fast resume, SGLang-style), or get written back to disk? And on resume, does the resident-expert set get recomputed from scratch, or does it restore the previous hot set? Not asking for guarantees — just enough to know whether my wake path should budget 5 seconds or 50. Offer: if you push the branch (even as a draft PR or a WIP tag), I'll wire it into my proxy and run it against a 5090 / 32 GB / 192 GB RAM on Ubuntu 24.04. I can share concrete latency numbers for both directions (ComfyUI→Strata and Strata→ComfyUI) within a day or two of getting a build. Happy to be an early test case — the more eyes on the two-GPU path before merge, the better. Thanks again for the speed on this.
Author
Owner

@GonzMartinez commented on GitHub (Oct 10, 2026):

I won't have access to the pc for some days, so I can't push till monday night. The endpoint I used already existed, I don't remember the exact name. You tell it how much VRAM you want to free on a specific GPU (its single GPU in upstream). I assume the experts go to RAM since it works quite fast to reclaim. Since I had not planned to post it yet I didn't review the code lol. My setup is similar to yours but with 2x3090s

<!-- gh-comment-id:6099620586 --> @GonzMartinez commented on GitHub (Oct 10, 2026): I won't have access to the pc for some days, so I can't push till monday night. The endpoint I used already existed, I don't remember the exact name. You tell it how much VRAM you want to free on a specific GPU (its single GPU in upstream). I assume the experts go to RAM since it works quite fast to reclaim. Since I had not planned to post it yet I didn't review the code lol. My setup is similar to yours but with 2x3090s
Author
Owner

@Mikhai133 commented on GitHub (Oct 10, 2026):

We implemented memory switching by changing the GPU ownership between Strata and ComfyUI.

Strata runs locally on port 8080.

The following options are enabled in the config:

vram_elastic: true
slot_save_path
--session-save-reclaim
--session-min-free-mib
Before a ComfyUI task, the manager calls sleep_agent_for_job().

For regular tasks — image, edit, short video:

http
POST /v1/vram
{"reserve_mib": 26000}
Strata shrinks, and ComfyUI gets the main VRAM.

After the task:

http
POST /v1/vram
{"reserve_mib": null}
For heavy tasks — long video, avatar quality, upscale ×1.8+:

http
POST /v1/vram {"reserve_mib": null}
POST /slots/0?action=save
POST /unload
... ComfyUI runs ...

http
POST /load
POST /slots/0?action=restore
After any ComfyUI task, the manager calls wake_agent_after_job().

The vision_proxy checks Strata’s state before the user’s request and wakes it up via:

/v1/vram, if the agent was compressed;
/load + /slots/0?action=restore, if the agent was unloaded.
Shell scripts for starting and stopping control the Strata process via the PID file and port 8080.

The watchdog restarts run-iq3_xxs.sh if the process crashes or the HTTP service stops responding.

For ComfyUI, the manager injects memory for diffusion.

Although SGLang’s speed with Qwen3.8‑27B‑NVFP4 was higher — both in model response time and in container‑switching speed — I’m confident that over time we’ll be able to find another solution or optimize this to achieve hot switching. My DDR5 and PCI‑E5 hardware is capable of more.

<!-- gh-comment-id:6102440537 --> @Mikhai133 commented on GitHub (Oct 10, 2026): We implemented memory switching by changing the GPU ownership between Strata and ComfyUI. Strata runs locally on port 8080. The following options are enabled in the config: vram_elastic: true slot_save_path --session-save-reclaim --session-min-free-mib Before a ComfyUI task, the manager calls sleep_agent_for_job(). For regular tasks — image, edit, short video: http POST /v1/vram {"reserve_mib": 26000} Strata shrinks, and ComfyUI gets the main VRAM. After the task: http POST /v1/vram {"reserve_mib": null} For heavy tasks — long video, avatar quality, upscale ×1.8+: http POST /v1/vram {"reserve_mib": null} POST /slots/0?action=save POST /unload ... ComfyUI runs ... http POST /load POST /slots/0?action=restore After any ComfyUI task, the manager calls wake_agent_after_job(). The vision_proxy checks Strata’s state before the user’s request and wakes it up via: /v1/vram, if the agent was compressed; /load + /slots/0?action=restore, if the agent was unloaded. Shell scripts for starting and stopping control the Strata process via the PID file and port 8080. The watchdog restarts run-iq3_xxs.sh if the process crashes or the HTTP service stops responding. For ComfyUI, the manager injects memory for diffusion. Although SGLang’s speed with Qwen3.8‑27B‑NVFP4 was higher — both in model response time and in container‑switching speed — I’m confident that over time we’ll be able to find another solution or optimize this to achieve hot switching. My DDR5 and PCI‑E5 hardware is capable of more.
Author
Owner

@NerdyShawn commented on GitHub (Oct 11, 2026):

Same single-GPU arbitration problem, but our two engines are both Strata servers (two 24 GiB quants on a 5090, :8080/:8081), orchestrated by reciprocal /unload hooks in each server's before_load. Evidence that kill-and-reload handoff works but is expensive and has a sharp edge:

  • First swap after the peer goes quiet: 29.8–30.6 s cold (weights from OS page cache), warm swap-back 13.4–13.7 s.
  • Preempting the peer mid-28k-prefill: 50.7 s for the preempting turn.
  • The /unload {"status":"busy"} answer during an active turn is advisory only — ensure_loaded ignores the hook's exit code and loads anyway, which co-loads two 24 GiB quants and kills one engine (exit code 1). We documented the whole failure mode in #1997 (ignored before_load failure → co-load crash) and shipped a poll-until-truly-unloaded hook as the workaround.

Two design inputs for the PR you're shaping:

  1. Would POST /v1/vram with {"reserve_mib": ...} (vram_elastic, semantics now documented per #1034) be the non-kill primitive for dual-Strata handoff — sleep weights to RAM in both directions, process stays alive, no engine-restart cliff? If yes, that removes our worst failure mode entirely and seems strictly better than /unload for orchestration; we'd happily switch our hooks to it.
  2. Whatever API shape lands, the "free VRAM" call should block or report progress, never answer success-shaped refusals. A caller cannot distinguish "you may load now" from "I'm busy" unless the contract is explicit — that ambiguity is exactly what made the naive hook crash-prone.

We have a SOAK_MINUTES=3 contention-replay harness (chatter + big-prefill sessions + parallel bursts against the lane pair) and can smoke-test the new endpoint against it before you finalize semantics, if a second integration data point beyond the ComfyUI case is useful.

<!-- gh-comment-id:6113856370 --> @NerdyShawn commented on GitHub (Oct 11, 2026): Same single-GPU arbitration problem, but our two engines are **both Strata servers** (two 24 GiB quants on a 5090, `:8080`/`:8081`), orchestrated by reciprocal `/unload` hooks in each server's `before_load`. Evidence that kill-and-reload handoff *works* but is expensive and has a sharp edge: - First swap after the peer goes quiet: **29.8–30.6 s** cold (weights from OS page cache), warm swap-back **13.4–13.7 s**. - Preempting the peer **mid-28k-prefill**: 50.7 s for the preempting turn. - The `/unload` `{"status":"busy"}` answer during an active turn is **advisory only** — `ensure_loaded` ignores the hook's exit code and loads anyway, which co-loads two 24 GiB quants and kills one engine (`exit code 1`). We documented the whole failure mode in #1997 (ignored `before_load` failure → co-load crash) and shipped a poll-until-truly-unloaded hook as the workaround. Two design inputs for the PR you're shaping: 1. Would `POST /v1/vram` with `{"reserve_mib": ...}` (vram_elastic, semantics now documented per #1034) be the **non-kill primitive for dual-Strata handoff** — sleep weights to RAM in both directions, process stays alive, no engine-restart cliff? If yes, that removes our worst failure mode entirely and seems strictly better than `/unload` for orchestration; we'd happily switch our hooks to it. 2. Whatever API shape lands, the "free VRAM" call should **block or report progress, never answer success-shaped refusals**. A caller cannot distinguish "you may load now" from "I'm busy" unless the contract is explicit — that ambiguity is exactly what made the naive hook crash-prone. We have a `SOAK_MINUTES=3` contention-replay harness (chatter + big-prefill sessions + parallel bursts against the lane pair) and can smoke-test the new endpoint against it before you finalize semantics, if a second integration data point beyond the ComfyUI case is useful.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156233644 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Author
Owner

@kamedesuyo commented on GitHub (Oct 25, 2026):

I'd like to help with an opt-in implementation of this, following the scope-agreement requirement in CONTRIBUTING. The existing expert-cache resize in #533 is useful, but it does not release the dense weights, active session buffers, or draft/head allocations.

Local evidence: on Windows 11, an RTX 5060 Ti 16 GB, 96 GB host RAM, Qwen3.8-Flash-Next IQ3_S, 262144 context / int8 KV / 32768 resident cells, the current --vram-elastic shrink leaves 7,450 MiB free out of 16,311 MiB. The expert cache reaches its 1,024 MiB floor. This is a local zapabob 0.3.1 build reporting engine 0.1.49.2, not a benchmark of current upstream main. I inspected upstream 4b9e05a2a806a3fe24f7b2560d98626c37dade35 (engine 0.1.51); I have not yet built or run that revision.

I also built and ran a standalone CUDA Driver VMM probe, independently of Strata, on both GPUs in this machine. It reserves an address range, maps 64 MiB, creates a graph containing a kernel that changes every word, copies the data to host RAM, unmaps/releases the physical allocation, and restores into the same reserved address. It also allocates and overwrites another 64 MiB region while the first is asleep. The original graph is then replayed without reinstantiation.

GPU cycles sleep (ms) wake (ms) verification
RTX 5060 Ti 3 8.12–8.50 7.08–7.39 every byte equal after restore; original address and graph reused
RTX 4060 3 14.85–15.07 14.82–14.90 same checks passed

MSVC 19.43 / CUDA 12.4 Driver API headers, a small PTX kernel JIT-compiled by the installed driver. Wrong-context wake was refused and a subsequent wake in the correct context succeeded. These are 64 MiB mechanism tests only: they do not establish full-engine correctness, multi-GiB latency, or the amount of VRAM Strata could release. The 4060's driver free-memory counter increased by 64 MiB each cycle; the 5060 Ti counter also includes unrelated desktop/device activity and is not a per-process measurement.

Proposed first scope:

  • One NVIDIA GPU and one request at a time, explicitly enabled at startup; no changed defaults and no layer split, peer/helper cache, or resident low-RAM mode initially.
  • Keep the process, host expert arena, and parked conversations alive. Move the remaining GPU allocations behind explicit VMM ownership, preserving their virtual addresses. Reuse experts from the existing RAM arena rather than duplicating the entire GPU cache in RAM.
  • Quiesce prefill, verification, and adaptive copies under the service FIFO before parking. Do not announce readiness for another engine until the release has completed. Do not resume inference until every required allocation has been restored.
  • Keep host backups on a failed wake, allow retry, and reject insufficient host memory before discarding GPU state. CUDA context/library allocations may remain; no promise of zero VRAM use.
  • Validate a same-day default-path control, token/cache continuity, repeated cycles, failure recovery, released VRAM, and host-memory peak before calling this usable. Reusing the existing conversation parking code and avoiding copies of immutable weights are possibilities, not demonstrated results yet.

Would this narrower scope be acceptable as an extension of the current VRAM controls, or is there an existing branch we should collaborate on? I can prepare a draft PR after agreeing the allocation/lifecycle boundary. No full-engine implementation or performance claim is being submitted here. Design/code preparation was assisted by Codex; the probe results above came from actual runs on the stated hardware.

<!-- gh-comment-id:6401153511 --> @kamedesuyo commented on GitHub (Oct 25, 2026): I'd like to help with an opt-in implementation of this, following the scope-agreement requirement in CONTRIBUTING. The existing expert-cache resize in #533 is useful, but it does not release the dense weights, active session buffers, or draft/head allocations. **Local evidence:** on Windows 11, an RTX 5060 Ti 16 GB, 96 GB host RAM, Qwen3.8-Flash-Next IQ3_S, 262144 context / int8 KV / 32768 resident cells, the current `--vram-elastic` shrink leaves 7,450 MiB free out of 16,311 MiB. The expert cache reaches its 1,024 MiB floor. This is a local zapabob 0.3.1 build reporting engine 0.1.49.2, not a benchmark of current upstream main. I inspected upstream `4b9e05a2a806a3fe24f7b2560d98626c37dade35` (engine 0.1.51); I have not yet built or run that revision. I also built and ran a **standalone CUDA Driver VMM probe**, independently of Strata, on both GPUs in this machine. It reserves an address range, maps 64 MiB, creates a graph containing a kernel that changes every word, copies the data to host RAM, unmaps/releases the physical allocation, and restores into the same reserved address. It also allocates and overwrites another 64 MiB region while the first is asleep. The original graph is then replayed without reinstantiation. | GPU | cycles | sleep (ms) | wake (ms) | verification | | --- | ---: | ---: | ---: | --- | | RTX 5060 Ti | 3 | 8.12–8.50 | 7.08–7.39 | every byte equal after restore; original address and graph reused | | RTX 4060 | 3 | 14.85–15.07 | 14.82–14.90 | same checks passed | MSVC 19.43 / CUDA 12.4 Driver API headers, a small PTX kernel JIT-compiled by the installed driver. Wrong-context wake was refused and a subsequent wake in the correct context succeeded. These are **64 MiB mechanism tests only**: they do not establish full-engine correctness, multi-GiB latency, or the amount of VRAM Strata could release. The 4060's driver free-memory counter increased by 64 MiB each cycle; the 5060 Ti counter also includes unrelated desktop/device activity and is not a per-process measurement. Proposed first scope: - One NVIDIA GPU and one request at a time, explicitly enabled at startup; no changed defaults and no layer split, peer/helper cache, or resident low-RAM mode initially. - Keep the process, host expert arena, and parked conversations alive. Move the remaining GPU allocations behind explicit VMM ownership, preserving their virtual addresses. Reuse experts from the existing RAM arena rather than duplicating the entire GPU cache in RAM. - Quiesce prefill, verification, and adaptive copies under the service FIFO before parking. Do not announce readiness for another engine until the release has completed. Do not resume inference until every required allocation has been restored. - Keep host backups on a failed wake, allow retry, and reject insufficient host memory before discarding GPU state. CUDA context/library allocations may remain; no promise of zero VRAM use. - Validate a same-day default-path control, token/cache continuity, repeated cycles, failure recovery, released VRAM, and host-memory peak before calling this usable. Reusing the existing conversation parking code and avoiding copies of immutable weights are possibilities, not demonstrated results yet. Would this narrower scope be acceptable as an extension of the current VRAM controls, or is there an existing branch we should collaborate on? I can prepare a draft PR after agreeing the allocation/lifecycle boundary. No full-engine implementation or performance claim is being submitted here. Design/code preparation was assisted by Codex; the probe results above came from actual runs on the stated hardware.
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#731
No description provided.