#6388 [Other] Docker: a key taken out of STRATA_SET stays in the saved preset and still reaches the engine

open · @Maziar123 · 0 comentários · No GitHub

BenchmarksSetup & installMulti-GPUNVIDIA / CUDAModels & quantsLinux

Descrição

### Area

[Other]  (anything else, including setup and installation)

### Desktop app, Terminal or source?

Docker

### What happened

In the container, a key taken out of `STRATA_SET` is still passed to the engine on the next start. The entrypoint
saves `STRATA_SET` into the `/data` preset, and the saved preset never loses a key: each start adds to it.

Expected: the second start below passes only `--reserve-mib 600`. Got: it still passes `--experts 5`. The preset's
`extra` held `{"--cpu-threads":"0","--dspark":"auto","--experts":"5","--layer-split":"auto","--reserve-mib":"600"}`,
and `state/strata/launch/docker.choices.json` held the same keys. We first found it because an old `--cpu-threads 6`
stayed after the key was deleted. Later a benchmark switch reached starts that never set it, so those runs measured
two changes at once.

### Smallest steps or command that reproduce it

1. Start the container with `STRATA_SET="reserve-mib=600 experts=5"`.
2. Stop it. Start it again with the same `/data` folder and `STRATA_SET="reserve-mib=600"`.
3. Read the engine's start line, or `config/strata/launch-presets/docker.json` in `/data`.

### Reproduction status

Reproduced locally on the 0.2.8 image. The code path on current main is unconfirmed static analysis (I read the
code; I did not run main):

- `tools/docker/entrypoint.sh:240` turns each `STRATA_SET` pair into `--set KEY=VALUE`. Lines 260-262 then add
  `--preset "$PRESET"` and `--save-preset "$PRESET"` when the preset exists.
- `terminal/strata_cli/launch/cmd.py:218` loads the saved preset, and `:301-302` merges the new pairs into it:
  `s.extra = {**s.extra, **S.settings_from_pairs(a.set)}`. A key the new `STRATA_SET` leaves out keeps its old
  value, and the merged set is saved again.

The comment at `entrypoint.sh:26` says the settings are saved into the preset. It does not say that removing one
from `STRATA_SET` has no effect.

Suggested fix: when the container is given `STRATA_SET`, take it as the whole set, so `extra` starts from these
pairs instead of the saved preset. For example, the entrypoint could pass a launcher flag that makes `--set` replace
`extra`. A plain `strata launch --preset NAME --set ...` would keep today's merge, so the CLI default does not
change. Risk: anyone who relies on the merge loses settings that a later start leaves out of `STRATA_SET`.

Workaround today: name every key the folder has ever seen in each start. On 0.2.8, `KEY=off` drops the flag.
Another way is a separate `PRESET` name for each configuration.

### Strata version

Image `ghcr.io/niko1221/strata:0.2.8-cuda13` (seen); code read on main 3142b66 (0.2.17)

### Graphics card, memory and system

5 x Quadro RTX 8000 48 GB · 503 GiB RAM · Arch Linux, kernel 7.2, NVIDIA driver 615.71.09

### Model, size and settings

DeepSeek-V4.1-Flash, ISTA-DAS IST 2.25 bpw, 256K context, one container per profile on the same `/data` folder

No site

Links install, modelos, releases.