[PR #2861] [CLOSED] generate: STRATA_VRAM_RESERVE_MIB, a VRAM reserve per part #4301

Closed
opened 2026-11-07 15:34:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2861
Author: @gopinath87607
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: vram-reserve-per-part


📝 Commits (1)

  • 153cd16 generate: STRATA_VRAM_RESERVE_MIB, a VRAM reserve per part

📊 Changes

3 files changed (+83 additions, -12 deletions)

View changed files

📝 docs/DETAILS.md (+10 -0)
📝 docs/MULTI_GPU.md (+5 -0)
📝 src/program/generate.cpp (+68 -12)

📄 Description

What this changes

STRATA_VRAM_RESERVE_MIB="100,100,300,300" — an opt-in VRAM reserve per part of a layer split, in the split's
order, in MiB. Entry 0 is the first card and replaces --vram-reserve-mib; entry i is the i-th later card and
replaces --vram-reserve-later-mib for that card. A shorter list reuses its last number; extra numbers are
ignored. STRATA_GLM_RESERVE_MB is accepted as the same knob.

Today the flags give the first card its own number and every later card one shared number, which cannot express a
rig whose cards are not the same size or do not hold the same kind of layer. stage_room() now takes the part's
ordinal and prefers the list's entry for it; the split search, the stage sizing, the drafter reservation and the
LOW free-VRAM warning all go through it. When the list is active, the LOW line's suggested fix names the list entry
to raise instead of the flag the list overrides.

The start prints the reserve each part will use:

strata generate: VRAM reserves per part: CUDA0 700 MiB, CUDA1 700 MiB, ... (STRATA_VRAM_RESERVE_MIB)

From the Maya checkout (project-maya), Glm5Model::pool_reserve (STRATA_GLM_RESERVE_MB).

What it leaves alone

Unset, vram_reserve_parts_mib is empty, stage_room() takes the old flag path, the print block does not run, and
its stderr line is absent. The two flags decide exactly as before. This is by construction, not by a measurement.

Measurements

No speedup is claimed; this is a control knob. On the four-way Q8_0 rig this was written for (CUDA0/CUDA1 12 GB,
CUDA2/CUDA3 8 GB), a run's LOW lines showed CUDA1 with 511 MiB, CUDA2 with 388 MiB and CUDA3 with 1,156 MiB free.
CUDA3's one layer held all 512 profiled pairs of its layer, so its free VRAM cannot buy another expert there and
that is the card whose reserve can rise without losing cache. A per-card A/B (same split, same
STRATA_PREFILL_MAX, list against flags) is the test on a given rig; it has not been run.

Checks

  • Default path: unset = byte-identical by construction (empty list; stage_room() uses the old flags; no
    print).
  • Build: CUDA. generate.cpp is host-only code and this adds no device code; it compiles clean against this
    branch's headers with the build's own flags (-fsyntax-only; one pre-existing unused-variable warning in
    unrelated code). The development branch that also carries the change built fully with ninja (nvcc 13.2).
  • HIP / SYCL: not compiled here (no toolchain on the machine). generate.cpp carries no per-backend code, so
    both builds compile the same change.
  • On a start: the per-part reserve line above; an unset-vs-set A/B of a run's free VRAM and prompt rate is the
    test of whether a given per-card split pays.

🤖 Generated with Claude Code


🔄 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/2861 **Author:** [@gopinath87607](https://github.com/gopinath87607) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `vram-reserve-per-part` --- ### 📝 Commits (1) - [`153cd16`](https://github.com/Niko1221/Strata/commit/153cd16758d50f9289348cb5bf928cd2c8854e6b) generate: STRATA_VRAM_RESERVE_MIB, a VRAM reserve per part ### 📊 Changes **3 files changed** (+83 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+10 -0) 📝 `docs/MULTI_GPU.md` (+5 -0) 📝 `src/program/generate.cpp` (+68 -12) </details> ### 📄 Description ## What this changes `STRATA_VRAM_RESERVE_MIB="100,100,300,300"` — an opt-in VRAM reserve per part of a layer split, in the split's order, in MiB. Entry 0 is the first card and replaces `--vram-reserve-mib`; entry *i* is the *i*-th later card and replaces `--vram-reserve-later-mib` for that card. A shorter list reuses its last number; extra numbers are ignored. `STRATA_GLM_RESERVE_MB` is accepted as the same knob. Today the flags give the first card its own number and every later card one shared number, which cannot express a rig whose cards are not the same size or do not hold the same kind of layer. `stage_room()` now takes the part's ordinal and prefers the list's entry for it; the split search, the stage sizing, the drafter reservation and the LOW free-VRAM warning all go through it. When the list is active, the LOW line's suggested fix names the list entry to raise instead of the flag the list overrides. The start prints the reserve each part will use: strata generate: VRAM reserves per part: CUDA0 700 MiB, CUDA1 700 MiB, ... (STRATA_VRAM_RESERVE_MIB) From the Maya checkout (`project-maya`), `Glm5Model::pool_reserve` (`STRATA_GLM_RESERVE_MB`). ## What it leaves alone Unset, `vram_reserve_parts_mib` is empty, `stage_room()` takes the old flag path, the print block does not run, and its stderr line is absent. The two flags decide exactly as before. This is by construction, not by a measurement. ## Measurements No speedup is claimed; this is a control knob. On the four-way Q8_0 rig this was written for (CUDA0/CUDA1 12 GB, CUDA2/CUDA3 8 GB), a run's LOW lines showed CUDA1 with 511 MiB, CUDA2 with 388 MiB and CUDA3 with 1,156 MiB free. CUDA3's one layer held all 512 profiled pairs of its layer, so its free VRAM cannot buy another expert there and that is the card whose reserve can rise without losing cache. A per-card A/B (same split, same `STRATA_PREFILL_MAX`, list against flags) is the test on a given rig; it has not been run. ## Checks - **Default path:** unset = byte-identical by construction (empty list; `stage_room()` uses the old flags; no print). - **Build:** CUDA. `generate.cpp` is host-only code and this adds no device code; it compiles clean against this branch's headers with the build's own flags (`-fsyntax-only`; one pre-existing unused-variable warning in unrelated code). The development branch that also carries the change built fully with ninja (nvcc 13.2). - **HIP / SYCL:** not compiled here (no toolchain on the machine). `generate.cpp` carries no per-backend code, so both builds compile the same change. - **On a start:** the per-part reserve line above; an unset-vs-set A/B of a run's free VRAM and prompt rate is the test of whether a given per-card split pays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:42 +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#4301
No description provided.