Pull requests / #683
#683 setup: a re-run of setup carries over the hand-edited config blocks (#629)
closed · @hireymage · 0 コメント · GitHub で見る
Setup & installServer & APIAMD / HIPNVIDIA / CUDAModels & quantsSecurityDocumentationWindows
本文
## What was broken (#629) A fresh re-run of setup — `START-HERE.bat --yes --family qwen --model IQ3_S --gpus 0,1 --context 131072`, or answering the setup questions again to change the context length or the size — regenerated `strata-<model>.json` from scratch and quietly dropped everything the generator does not write itself: - the hand-edited `sampling`, `mcp_servers` and `mcp` blocks that [DETAILS.md](docs/DETAILS.md) documents in the same file; - hand-set keys inside `vision` (`cuda_device` from the #408 workflow) and inside `env` (the `STRATA_*` values from DETAILS.md's table). The install was fine afterwards: the engine ran. What was lost was visible only later — MCP tools gone, sampling back to defaults, and no message anywhere explaining the loss. ## What it does now `setup.py` regenerates the config the same way, then reads the earlier `strata-<model>.json` (whole-or-nothing, atomic-write semantics per #459) and carries over: - **hand-authored top-level blocks** — anything outside the keys setup's generator can write — verbatim, and names them: `[ok] carried over from the earlier strata-q2_0.json: mcp; mcp_servers; sampling`; - **inside `env` and `vision`, only the hand keys survive**: `cuda_device`, `backend`, `STRATA_SPLIT_OWN` and friends; what setup recomputes per install (`exe`, `mmproj`, `max_tokens`, the HIPBLASLt tuning table, `STRATA_RESIDENT_PIN`) is regenerated; - **what the generator owns is not carried** — `host`, `api_key`, `backend`, the engine args — because this run's choices decide those (and secrets are never carried over); - **engine flags the new args dropped are warned about, not merged**: `[!] this run's engine args do not carry the earlier config's flags: --my-tuning (add them back by hand if you meant them)`. A flags list is not merged by hand; a re-run that drops `--vram-reserve-mib` or `--my-flag` says so instead of inventing an argument order; - **a block this run drops is warned about too**: a re-run without `--vision` that leaves an old `vision` block behind prints `[!] this run drops the earlier config's vision block ...`. An unreadable or missing earlier file means a plain fresh install, exactly as before. ## Tests `tools/test_setup_choices.py` gains `ConfigPreserve` (8 tests, `python -m unittest tools.test_setup_choices`), riding the golden `install()` harness (no GPU, no network, mocked PC) so the real `setup.main()` path is covered, including the seeded `strata-q2_0.json` before the re-run: - the three documented blocks are carried verbatim and named; - `cuda_device`/`backend`/`STRATA_SPLIT_OWN` survive; the generator's own keys are regenerated (`max_tokens`, its own env values); - `host`/`api_key`/`backend` are never carried, and nothing hand-set lost → no warning; - dropped flags warned, args not merged; - a dropped `vision` block warned; - no earlier file / corrupt earlier file → unchanged fresh install. Plus an end-to-end golden-harness run confirming the carried config, and one sentence in `docs/DETAILS.md` next to the `mcp_servers` documentation: > A re-run of setup keeps blocks like these (and other keys it does not write itself) and says so in its output; it rewrites only the settings the choices it asks for decide. ## Notes - Only the fresh-construction `write_config` site in `setup.main()` can wipe the file (every other site loads the config and mutates it), so the carry-over hooks in exactly one place — the one `write_config` call that builds `cfg` from scratch. - The golden byte-for-byte baseline (`tools/test_setup_golden.json`) is untouched: a first install (no earlier file) produces the same config as before. The golden tests fail identically on clean `upstream/main` without this change (46 failures, pre-existing on `main`, unrelated).
関連リンク
インストール・モデル・リリースへの站内リンク。