[GH-ISSUE #447] --calibrate silently leaves the machine uncalibrated when the config uses --expert-cache-deviceN #206

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

Originally created by @DaRealDaHoodie on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/447

Environment

Engine 0.1.31, repo HEAD 9259cad (2026-10-01). Measured 2026-10-01 on:

  • RTX PRO 4500 Blackwell 32 GB (82 SM, CUDA arch 120) + RTX 3080 10 GB (68 SM, arch 86)
  • Threadripper PRO 5975WX, 499 GB RAM, Linux
  • model qwen3.8-flash-next-ud-q4_k_xl (Unsloth UD-Q4_K_XL split GGUF, 71.73 GiB routed experts
    loaded into the RAM arena), --max-context 262144 --kv int8 --spec 4 --mtp --expert-cache auto

--calibrate cannot calibrate a config that uses the helper-GPU expert tier

Symptom. ./setup.sh --calibrate on a config that uses --expert-cache-device1 prints one
warning and then starts the model as if nothing happened:

  Loading the model for the measurements ...
[strata] starting the engine: reading the model's weights ...
  [!]  the tuning did not finish (the engine exited before it was ready (see strata-ud-q4_k_xl.log)): the default settings stay
  [ok] GPUs: GPU 0 (NVIDIA RTX PRO 4500 Blackwell, 32 GB) together (layers split auto)

No calibration record is written, the config keeps its old flags, and a user who is not watching
the two lines above has an uncalibrated machine and no way to know it.

Cause. tools/calibrate.py:123 reads "the config has a gpu list" as "this model splits
layers across several cards":

if isinstance(cfg.get("gpu"), list) and "--layer-split" not in args:   # several cards: measured as it runs
    args += ["--layer-split", str(cfg.get("layer_split") or "auto")]

A gpu list does not imply a split. serve/server.py:engine_args() uses the correct test
(len(gpu_list(cfg)) > 1), and the helper-tier feature documented in docs/SECOND_GPU.md works
the other way round: the tier needs a card that runs no stage, so the config is one stage plus
a second visible card:

"gpu": [0],
"env": { "CUDA_VISIBLE_DEVICES": "0,1" },
"args": [ ..., "--expert-cache-device1", "1800" ]

The tuner's appended --layer-split auto puts both visible cards into stages, and the engine
rejects that combination before reading any weights (src/program/generate.cpp):

strata generate: --expert-cache-remote with a layer split needs a GPU that runs no stage (2 visible, 2 used by the split)

Amplifier. setup.py:1663-1667 turns that into a single ! line and continues, by design
("never stops an install"). Given that the whole point of the step is to leave the machine tuned,
it is worth printing the engine's own error (it is in the log, one line above the next start) or
repeating the warning in the All set. summary.

Suggested fix. Mirror engine_args():

if len(gpu_list(cfg)) > 1 and "--layer-split" not in args:

Workaround (no source change, and it also documents the intent in the config): pass the split
as empty, which is the engine's "no split" value — the parse block is gated on
if (!o.layer_split.empty()) (src/program/generate.cpp:1232), and --layer-split none is
rejected while --layer-split "" parses and moves on:

"args": [ ..., "--layer-split", "" ]

Evidence. Same command, before and after the workaround — model loads recorded in the config's
log (opened in append mode, serve/server.py:173), so a sweep that never started an engine leaves
no loads:

loads / serve starts in log record written
--calibrate, before 2 (both from ordinary starts) none
--calibrate, after 7 (the sweep ran) …|32GB|…qwen3.8-flash-next-ud-q4_k_xl|262144|text

The sweep then chose --pcie-frac 0.00 --spec-min-p 0.70 (102.4 tok/s), which is the result this
report is about: with the tier present the tuner can now measure the topology that actually runs.

Originally created by @DaRealDaHoodie on GitHub (Oct 2, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/447 ### Environment Engine 0.1.31, repo HEAD `9259cad` (2026-10-01). Measured 2026-10-01 on: - RTX PRO 4500 Blackwell 32 GB (82 SM, CUDA arch 120) + RTX 3080 10 GB (68 SM, arch 86) - Threadripper PRO 5975WX, 499 GB RAM, Linux - model `qwen3.8-flash-next-ud-q4_k_xl` (Unsloth UD-Q4_K_XL split GGUF, 71.73 GiB routed experts loaded into the RAM arena), `--max-context 262144 --kv int8 --spec 4 --mtp --expert-cache auto` --- ### `--calibrate` cannot calibrate a config that uses the helper-GPU expert tier **Symptom.** `./setup.sh --calibrate` on a config that uses `--expert-cache-device1` prints one warning and then starts the model as if nothing happened: ``` Loading the model for the measurements ... [strata] starting the engine: reading the model's weights ... [!] the tuning did not finish (the engine exited before it was ready (see strata-ud-q4_k_xl.log)): the default settings stay [ok] GPUs: GPU 0 (NVIDIA RTX PRO 4500 Blackwell, 32 GB) together (layers split auto) ``` No calibration record is written, the config keeps its old flags, and a user who is not watching the two lines above has an uncalibrated machine and no way to know it. **Cause.** `tools/calibrate.py:123` reads "the config has a `gpu` list" as "this model splits layers across several cards": ```python if isinstance(cfg.get("gpu"), list) and "--layer-split" not in args: # several cards: measured as it runs args += ["--layer-split", str(cfg.get("layer_split") or "auto")] ``` A `gpu` list does not imply a split. `serve/server.py:engine_args()` uses the correct test (`len(gpu_list(cfg)) > 1`), and the helper-tier feature documented in `docs/SECOND_GPU.md` works the other way round: the tier needs a card that runs **no** stage, so the config is one stage plus a second *visible* card: ```json "gpu": [0], "env": { "CUDA_VISIBLE_DEVICES": "0,1" }, "args": [ ..., "--expert-cache-device1", "1800" ] ``` The tuner's appended `--layer-split auto` puts both visible cards into stages, and the engine rejects that combination before reading any weights (`src/program/generate.cpp`): ``` strata generate: --expert-cache-remote with a layer split needs a GPU that runs no stage (2 visible, 2 used by the split) ``` **Amplifier.** `setup.py:1663-1667` turns that into a single `!` line and continues, by design ("never stops an install"). Given that the whole point of the step is to leave the machine tuned, it is worth printing the engine's own error (it is in the log, one line above the next start) or repeating the warning in the `All set.` summary. **Suggested fix.** Mirror `engine_args()`: ```python if len(gpu_list(cfg)) > 1 and "--layer-split" not in args: ``` **Workaround** (no source change, and it also documents the intent in the config): pass the split as empty, which is the engine's "no split" value — the parse block is gated on `if (!o.layer_split.empty())` (`src/program/generate.cpp:1232`), and `--layer-split none` is rejected while `--layer-split ""` parses and moves on: ```json "args": [ ..., "--layer-split", "" ] ``` **Evidence.** Same command, before and after the workaround — model loads recorded in the config's log (opened in append mode, `serve/server.py:173`), so a sweep that never started an engine leaves no loads: | | loads / serve starts in log | record written | | --- | --- | --- | | `--calibrate`, before | 2 (both from ordinary starts) | none | | `--calibrate`, after | 7 (the sweep ran) | `…\|32GB\|…qwen3.8-flash-next-ud-q4_k_xl\|262144\|text` | The sweep then chose `--pcie-frac 0.00 --spec-min-p 0.70` (102.4 tok/s), which is the result this report is about: with the tier present the tuner can now measure the topology that actually runs.
Author
Owner

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

Fixed in 0.1.35: --calibrate builds the engine's arguments the same way the server does (a layer split only with more than one GPU in the list, --expert-cache-device1 kept). When tuning fails, setup prints the engine's last error and repeats the warning in its summary. Thanks!

<!-- gh-comment-id:5948763613 --> @Niko1221 commented on GitHub (Oct 2, 2026): Fixed in [0.1.35](https://github.com/Niko1221/Strata/releases/tag/v0.1.35): `--calibrate` builds the engine's arguments the same way the server does (a layer split only with more than one GPU in the list, `--expert-cache-device1` kept). When tuning fails, setup prints the engine's last error and repeats the warning in its summary. Thanks!
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#206
No description provided.