Skip to content

setup: UD-Q4_K_XL / UD-IQ4_XS keep their RAM budget on a layer split (#642) - #1564

Closed
ShevchenkoVadim wants to merge 1 commit into
Niko1221:mainfrom
ShevchenkoVadim:setup-budget-on-split
Closed

ShevchenkoVadim wants to merge 1 commit into
Niko1221:mainfrom
ShevchenkoVadim:setup-budget-on-split

Conversation

@ShevchenkoVadim

Copy link
Copy Markdown
Contributor

Title

Issue: related to #1145 (the comment there: setup is stale for UD-IQ4_XS on several GPUs, a hand-built config was needed)

Summary

Since engine 0.1.40 (fe9c10c, #848) the resident RAM copy works on a layer split - every stage's cache is left out of it and the rest is ranked by the whole expert profile - and --resident-budget-gib runs through the same code (pin_cache_complement), so the engine no longer refuses the budget on a split. split_mmap() got the matching setup exemption in 43c8cfa, but the RAM budget's setup paths still assume the old engine (#498): a start of a UD-Q4_K_XL / UD-IQ4_XS config on several GPUs deletes --resident-budget-gib and asks for ~135 GB of RAM, and --gpus at setup drops the budget too.

This keeps the budget on a split from RESIDENT_SPLIT_ENGINE, gated exactly like #642. The recommendations do not change (golden configs unchanged): one GPU stays the default; the split is used only when asked for.

What changed

Extra Notes

  • Tests: python -m unittest discover -s tools -p "test_setup_*.py" on Linux (the strata Docker image, STRATA_EXECV unset): 421 tests; the 2 failures in test_setup_engine_hash are the same on main without this change (no ready-made 0.1.41 engine to download from the test box).

  • Measured on real hardware, engine 0.1.41, this branch's setup.py starting the config: RTX 3090 (PCIe x16) + RTX 3080 Ti (x4), i9-14900K, 91 GB RAM, UD-Q4_K_XL, budget 64 GiB, 262K context, --no-prefill-borrow --prefill 4096, images on:

    3090 alone 3090 + 3080 Ti, budget kept
    layers / GPU cache 0-47 / 3,886 slots 0-1 on the x4 card (678 slots), 2-47 on the 3090 (4,182)
    experts in RAM 60.4 GiB 57.6 GiB, no file-tier reads per request
    decode, 2,000 tokens 38.4 tok/s 45.0 / 45.1 tok/s (two runs)
    20K prompt ~18 s ~18 s

    Answers checked by hand (arithmetic, a list, an image). Before this change the same config on two cards lost its budget at every start.

  • Resident RAM mode on a layer split — 3 GPUs, UD-IQ4_XS, 40 GB RAM (engine 0.1.40) #1145 ran --resident-budget-gib 18 on a 3-GPU split with engine 0.1.40 for 2 hours without crashes, NaN windows or stalls - the engine side of this.

  • Not changed: the default stays one GPU for these models. On this box the split was +17% decode; whether two cards should become the recommendation (as A dual-GPU fork for 32 GB PCs (resident mode on a layer split, pipelined windows) #642 did for the low-RAM mode) is your call.

🤖 Generated with Claude Code

…iko1221#642)

Engine 0.1.40 (fe9c10c, Niko1221#848) keeps the resident RAM copy on a layer split -
every stage's cache left out of it, the rest ranked by the whole expert
profile - and --resident-budget-gib runs through the same code
(pin_cache_complement), so the old engine refusal of the budget on a split is
gone. setup.py's split_mmap() got the matching exemption (43c8cfa), but the
budget's three paths still assumed the old engine (Niko1221#498):

- split_budget(): a start of a budget config on several GPUs deleted
  --resident-budget-gib (and asked for ~135 GB of RAM below that);
- offer_together(): a budget config was offered both cards only with ~135 GB
  of RAM, and "on both it has no budget";
- unsloth_together() / q4_split at install: --gpus, or "2" when asked, dropped
  the budget, and an explicit --resident-budget-gib kept one GPU.

From RESIDENT_SPLIT_ENGINE the budget is kept in all three, at any RAM. The
recommendations stay as they were (the golden configs are unchanged): one GPU
by default at install, "n" by default when a start offers both cards, --yes
alone one GPU; the split is taken only when asked for.

Tests: the Niko1221#498 tests run with MIN_ENGINE pinned before RESIDENT_SPLIT_ENGINE
(as test_setup_risk's StartOnSeveralGpus does for Niko1221#642), three new ones run the
kept budget; tools/test_setup_*.py on Linux: 421 tests, the 2 failures of
test_setup_engine_hash are the same without this change (no ready-made 0.1.41
engine to download in the test box).

Measured with engine 0.1.41 on an RTX 3090 (x16) + RTX 3080 Ti (x4), 91 GB of
RAM, UD-Q4_K_XL, budget 64 GiB: the auto split gives the x4 card layers 0-1
(678 slots) and the 3090 layers 2-47 (4,182 slots); 57.6 GiB of experts in RAM,
no file-tier reads per request; decode 45.0 / 45.1 tok/s (two runs) against
38.4 on the 3090 alone, a 20K prompt in ~18 s on both. Answers checked by hand.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Niko1221

Copy link
Copy Markdown
Owner

Thank you, ported with your authorship and your measurements (UD-Q4_K_XL on a 3090 plus a 3080 Ti, 45 tok/s against 38 on the 3090 alone). With an engine that keeps the resident RAM copy on a layer split, setup now keeps the RAM budget on several GPUs at any RAM; one GPU stays the recommendation. Your new tests are in, and the older #498 tests are pinned to the engine they describe.

@Niko1221

Copy link
Copy Markdown
Owner

Thanks for the pull request.

Your change is already in main for 0.2.0-beta, with your credit, so there is nothing left for you to do here. We're closing it because we're resetting the tracker for 0.2.0-beta: there are more than 1,300 open issues and pull requests, and we're closing everything that isn't being worked on right now.

If part of your work did not make it in and you want it considered, open a new pull request on top of main that follows CONTRIBUTING.md, or comment /reopen after fixing the title area prefix and the template.

@Niko1221 Niko1221 closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants