[GH-ISSUE #3785] [Other] --kv fp16 is documented as valid but rejected by setup.py, and strata launch masks it as exit 6 #1595

Closed
opened 2026-11-04 01:52:29 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @simlu on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3785

Strata bug report — --kv fp16 is documented but rejected by setup.py, and strata launch masks it as exit 6

Mapped to the bug_report.yml form so it is ready to paste. Title prefix [Other]
(setup and installation). All code claims verified against the source on main;
reproduction was done on the reporter's machine.


Title

[Other] --kv fp16 is documented as valid but rejected by setup.py, and strata launch masks it as exit 6

Area

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

Desktop app, Terminal or source?

Docker


What happened

I set KV: fp16 in the container environment (as docs/DOCKER.md instructs) for a
strata:0.2.2-cuda13 image. The container crashed within a second with the generic
"The model could not be installed." / exit code 6 and an empty error. Running
setup.py directly in the container revealed the real cause: --kv fp16 is an invalid
argparse choice.

Expected: the documented KV: fp16 should be accepted (or at minimum the error
should say fp16 is not a valid --kv value).

Actual: setup.py rejects --kv fp16 at argparse time, and strata launch
swallows the usage error (it is not a [X]-prefixed line) and reports only the generic
"could not be installed" / exit 6 with no error text — so the real cause is invisible.


Smallest steps or command that reproduce it

Docker compose (the minimal trigger — KV: fp16 alone is enough):

llama-qwen-flash:
  image: ghcr.io/niko1221/strata:0.2.2-cuda13
  environment:
    MODEL: UD-Q6_K_XL
    FAMILY: unsloth
    MODEL_PATH: /models
    CONTEXT: 196608
    VISION: "on"
    KV: fp16            # <-- the trigger
    PRESET: qwen-flash

docker compose up llama-qwen-flash → crash:

Starting Strata: UD-Q6_K_XL from /models (preset 'qwen-flash').
    Checking the engine for this computer…
    Engine 0.1.47 (cuda) is installed.
    Preparing unsloth UD-Q6_K_XL from your model files…
    Getting your model ready
strata: The model could not be installed. Run it again: finished steps are skipped.
[X] strata launch stopped with code 6 (the lines above say why). The container ends. Fix that and start it again: finished steps are not repeated, and an interrupted download continues where it stopped. 6
llama-qwen-flash exited with code 6

To see the real error, bypass the launcher and run setup.py directly in the container:

docker compose --profile extra run --rm --entrypoint bash llama-qwen-flash
# inside the container:
export STRATA_CONTROL_INSTALL=1 STRATA_INSTALL_DIR=/opt/strata PYTHONNOUSERSITE=1 STRATA_NEED_ENGINE=1
SRC="$(dirname "$(find /opt/strata -name setup.py 2>/dev/null | head -1)")"
export PYTHONPATH="$SRC"; cd "$SRC"
PYBIN="$( [ -x /opt/strata/terminal/python/bin/python3 ] && echo /opt/strata/terminal/python/bin/python3 || echo python3 )"
"$PYBIN" setup.py --yes --no-start --family unsloth --model UD-Q6_K_XL \
  --context 196608 --vision yes --kv fp16 \
  --data-dir /data/Strata-data --set-default-data-dir --gguf-dir /models

That prints:

setup.py: error: argument --kv: invalid choice: 'fp16' (choose from int8, q4_0, k8v4)

Omitting --kv lets the same setup.py run complete end-to-end (it defaults to int8
for a 196608 context). Removing KV: fp16 from the compose lets the container start.


Reproduction status

Reproduced locally (on the reporter's machine; both the crash with KV: fp16 and the
successful run without it)


Strata version

Strata 0.2.2 · engine 0.1.47 (image ghcr.io/niko1221/strata:0.2.2-cuda13)


Graphics card, memory and system

NVIDIA RTX 3090 ×4 (24 GB) · 192 GB DDR4 · Linux


Model, size and settings

UD-Q6_K_XL (unsloth, Q6_K_XL) · 196608 context · pictures on (VISION: on)


Logs

(sanitized — no credentials)

Container output:

Starting Strata: UD-Q6_K_XL from /models (preset 'qwen-flash').
    Checking the engine for this computer…
    Engine 0.1.47 (cuda) is installed.
    Preparing unsloth UD-Q6_K_XL from your model files…
    Getting your model ready
strata: The model could not be installed. Run it again: finished steps are skipped.
[X] strata launch stopped with code 6 (the lines above say why). The container ends. Fix that and start it again: finished steps are not repeated, and an interrupted download continues where it stopped. 6
llama-qwen-flash exited with code 6

setup.py (direct):

setup.py: error: argument --kv: invalid choice: 'fp16' (choose from int8, q4_0, k8v4)

Root cause (verified against source on main)

setup.py's argparse for --kv (line 7818) lists only ["int8", "q4_0", "k8v4"] —
fp16 is omitted:

ap.add_argument("--kv", choices=["int8", "q4_0", "k8v4"],
                help="KV cache precision above 8K context: int8 (default), q4_0 (half the memory, a little less "
                     "precise) or k8v4 (hybrid: INT8 K + 4-bit V, 816 B/cell)")

But fp16 is a real, supported KV cache format elsewhere in the same file:

  • setup.py:8458 — kv = "fp16" if ctx <= 8192 else (a.kv or "int8") — fp16 is the
    default for contexts ≤ 8192.
  • setup.py:6787 — UD_FIT_KV_BYTES = {"fp16": 2112, "int8": 1056, "q4_0": 576, "k8v4": 816} —
    fp16 has a per-token memory budget, like the accepted formats.
  • strata_cli/launch/runner.py:146 / :197 — the start path normalizes KV with
    want_kv = s.kv or ("int8" if (s.context or 32768) > 8192 else "fp16"), so fp16 is
    fully handled at launch/start time.

So the engine and the launcher both understand fp16; only the setup.py argparse
choices list omits it. The fix is a one-word addition.

Why the real error is hidden (runner.py)

  1. runner.py:749 spawns setup.py with argv = [self.python, str(cat.src / "setup.py"), *self.setup_args()].
  2. runner.py:592-593 forwards the launcher's --kv verbatim:
    if s.kv: args += ["--kv", s.kv] — so --kv fp16 reaches setup.py.
  3. runner.py:800-815: on a non-zero exit the runner scans the output in reverse for a
    line beginning with [X]. An argparse usage error is not an [X] line, so err
    stays empty, and it raises LaunchError("The model could not be installed." + ..., hint, 6).

The Checking the engine / Engine … is installed / Preparing … from your model files
lines in the output are the runner's own pre-setup emits (runner.py:448, :454,
:747), which is why a user sees "progress" and then an instant crash.

Proposed fix

Add fp16 to the --kv choices at setup.py:7818:

ap.add_argument("--kv", choices=["int8", "q4_0", "k8v4", "fp16"],
                help="KV cache precision: int8 (default), q4_0 (half the memory), "
                     "k8v4 (hybrid: INT8 K + 4-bit V) or fp16 (full precision)")

Note: setup.py:8458 only ever picks fp16 for ctx <= 8192, so accepting an explicit
--kv fp16 above 8K may also need the ctx > 8192 branch to respect it.


  • #2787 — "[Feature request] 16-bit KV cache option above 8K context". Its body states
    the same gap: "Today the choices there are int8 (default), k8v4 and q4_0; full
    precision is used only up to 8K."
    It was closed by a maintainer on 2026-10-19 as
    part of a bulk 0.2.0-beta tracker reset ("Closed here does not mean rejected"), not as
    resolved; a commenter confirmed --kv fp16 already runs at long context on CUDA.
    Filed separately because this is a concrete reproducible bug (not a feature request);
    happy to fold it into #2787 if the maintainers prefer one thread.
  • #3182 — "[Other] setup: say that --kv, --context and --vision are not applied when
    starting an installed model" (open). Related UX gap around --kv, but a different
    issue (silent flag-drop, not argparse rejection).
  • #3467 — "[TUI] 'Model could not be installed...' on 0.2.1" (open). A different
    could not be installed report (0.2.1, clean-install error); not this bug (no KV
    involvement).

Notes / workaround

  • KV cache format is a serve-time setting (the model's conversation memory), not a
    prepare-step setting — but setup.py's argparse still validates it, so an invalid
    value aborts the install.
  • Workaround on 0.2.2: KV: int8, KV: k8v4, or KV: q4_0, or omit KV (defaults to
    int8 for context > 8192). Do not use KV: fp16 until the choices list is fixed.
  • Unrelated but present in the same setup (separate issue): a Strata container needs a
    /data volume (-v strata-data:/data) or the entrypoint warns the model/settings are
    lost; and if the model files are mounted :ro, setup re-hashes the shards on every
    restart because it cannot write its .done marks.
Originally created by @simlu on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3785 # Strata bug report — `--kv fp16` is documented but rejected by `setup.py`, and `strata launch` masks it as exit 6 > Mapped to the `bug_report.yml` form so it is ready to paste. Title prefix `[Other]` > (setup and installation). All code claims verified against the source on `main`; > reproduction was done on the reporter's machine. --- ## Title `[Other] --kv fp16 is documented as valid but rejected by setup.py, and strata launch masks it as exit 6` ## Area `[Other] (anything else, including setup and installation)` ## Desktop app, Terminal or source? `Docker` --- ## What happened I set `KV: fp16` in the container environment (as `docs/DOCKER.md` instructs) for a `strata:0.2.2-cuda13` image. The container crashed within a second with the generic **"The model could not be installed."** / **exit code 6** and an empty error. Running `setup.py` directly in the container revealed the real cause: `--kv fp16` is an invalid argparse choice. **Expected:** the documented `KV: fp16` should be accepted (or at minimum the error should say `fp16` is not a valid `--kv` value). **Actual:** `setup.py` rejects `--kv fp16` at argparse time, and `strata launch` swallows the usage error (it is not a `[X]`-prefixed line) and reports only the generic "could not be installed" / exit 6 with no error text — so the real cause is invisible. --- ## Smallest steps or command that reproduce it Docker compose (the minimal trigger — `KV: fp16` alone is enough): ```yaml llama-qwen-flash: image: ghcr.io/niko1221/strata:0.2.2-cuda13 environment: MODEL: UD-Q6_K_XL FAMILY: unsloth MODEL_PATH: /models CONTEXT: 196608 VISION: "on" KV: fp16 # <-- the trigger PRESET: qwen-flash ``` `docker compose up llama-qwen-flash` → crash: ``` Starting Strata: UD-Q6_K_XL from /models (preset 'qwen-flash'). Checking the engine for this computer… Engine 0.1.47 (cuda) is installed. Preparing unsloth UD-Q6_K_XL from your model files… Getting your model ready strata: The model could not be installed. Run it again: finished steps are skipped. [X] strata launch stopped with code 6 (the lines above say why). The container ends. Fix that and start it again: finished steps are not repeated, and an interrupted download continues where it stopped. 6 llama-qwen-flash exited with code 6 ``` To see the real error, bypass the launcher and run `setup.py` directly in the container: ```bash docker compose --profile extra run --rm --entrypoint bash llama-qwen-flash # inside the container: export STRATA_CONTROL_INSTALL=1 STRATA_INSTALL_DIR=/opt/strata PYTHONNOUSERSITE=1 STRATA_NEED_ENGINE=1 SRC="$(dirname "$(find /opt/strata -name setup.py 2>/dev/null | head -1)")" export PYTHONPATH="$SRC"; cd "$SRC" PYBIN="$( [ -x /opt/strata/terminal/python/bin/python3 ] && echo /opt/strata/terminal/python/bin/python3 || echo python3 )" "$PYBIN" setup.py --yes --no-start --family unsloth --model UD-Q6_K_XL \ --context 196608 --vision yes --kv fp16 \ --data-dir /data/Strata-data --set-default-data-dir --gguf-dir /models ``` That prints: ``` setup.py: error: argument --kv: invalid choice: 'fp16' (choose from int8, q4_0, k8v4) ``` Omitting `--kv` lets the same `setup.py` run complete end-to-end (it defaults to `int8` for a 196608 context). Removing `KV: fp16` from the compose lets the container start. --- ## Reproduction status `Reproduced locally` (on the reporter's machine; both the crash with `KV: fp16` and the successful run without it) --- ## Strata version `Strata 0.2.2 · engine 0.1.47` (image `ghcr.io/niko1221/strata:0.2.2-cuda13`) --- ## Graphics card, memory and system NVIDIA RTX 3090 ×4 (24 GB) · 192 GB DDR4 · Linux --- ## Model, size and settings `UD-Q6_K_XL` (unsloth, Q6_K_XL) · 196608 context · pictures on (`VISION: on`) --- ## Logs (sanitized — no credentials) Container output: ``` Starting Strata: UD-Q6_K_XL from /models (preset 'qwen-flash'). Checking the engine for this computer… Engine 0.1.47 (cuda) is installed. Preparing unsloth UD-Q6_K_XL from your model files… Getting your model ready strata: The model could not be installed. Run it again: finished steps are skipped. [X] strata launch stopped with code 6 (the lines above say why). The container ends. Fix that and start it again: finished steps are not repeated, and an interrupted download continues where it stopped. 6 llama-qwen-flash exited with code 6 ``` `setup.py` (direct): ``` setup.py: error: argument --kv: invalid choice: 'fp16' (choose from int8, q4_0, k8v4) ``` --- ## Root cause (verified against source on `main`) `setup.py`'s argparse for `--kv` (line 7818) lists only `["int8", "q4_0", "k8v4"]` — `fp16` is omitted: ```python ap.add_argument("--kv", choices=["int8", "q4_0", "k8v4"], help="KV cache precision above 8K context: int8 (default), q4_0 (half the memory, a little less " "precise) or k8v4 (hybrid: INT8 K + 4-bit V, 816 B/cell)") ``` But `fp16` is a real, supported KV cache format elsewhere in the same file: - `setup.py:8458` — `kv = "fp16" if ctx <= 8192 else (a.kv or "int8")` — fp16 is the **default** for contexts ≤ 8192. - `setup.py:6787` — `UD_FIT_KV_BYTES = {"fp16": 2112, "int8": 1056, "q4_0": 576, "k8v4": 816}` — fp16 has a per-token memory budget, like the accepted formats. - `strata_cli/launch/runner.py:146` / `:197` — the start path normalizes KV with `want_kv = s.kv or ("int8" if (s.context or 32768) > 8192 else "fp16")`, so fp16 is fully handled at launch/start time. So the engine and the launcher both understand fp16; only the `setup.py` argparse `choices` list omits it. The fix is a one-word addition. ## Why the real error is hidden (runner.py) 1. `runner.py:749` spawns `setup.py` with `argv = [self.python, str(cat.src / "setup.py"), *self.setup_args()]`. 2. `runner.py:592-593` forwards the launcher's `--kv` verbatim: `if s.kv: args += ["--kv", s.kv]` — so `--kv fp16` reaches `setup.py`. 3. `runner.py:800-815`: on a non-zero exit the runner scans the output in reverse for a line beginning with `[X]`. An argparse usage error is not an `[X]` line, so `err` stays empty, and it raises `LaunchError("The model could not be installed." + ..., hint, 6)`. The `Checking the engine` / `Engine … is installed` / `Preparing … from your model files` lines in the output are the runner's own pre-setup emits (`runner.py:448`, `:454`, `:747`), which is why a user sees "progress" and then an instant crash. ## Proposed fix Add `fp16` to the `--kv` choices at `setup.py:7818`: ```python ap.add_argument("--kv", choices=["int8", "q4_0", "k8v4", "fp16"], help="KV cache precision: int8 (default), q4_0 (half the memory), " "k8v4 (hybrid: INT8 K + 4-bit V) or fp16 (full precision)") ``` Note: `setup.py:8458` only ever picks fp16 for `ctx <= 8192`, so accepting an explicit `--kv fp16` above 8K may also need the `ctx > 8192` branch to respect it. --- ## Related discussion - **#2787** — "[Feature request] 16-bit KV cache option above 8K context". Its body states the same gap: *"Today the choices there are `int8` (default), `k8v4` and `q4_0`; full precision is used only up to 8K."* It was **closed** by a maintainer on 2026-10-19 as part of a bulk 0.2.0-beta tracker reset ("Closed here does not mean rejected"), not as resolved; a commenter confirmed `--kv fp16` already runs at long context on CUDA. Filed separately because this is a concrete reproducible bug (not a feature request); happy to fold it into #2787 if the maintainers prefer one thread. - **#3182** — "[Other] setup: say that --kv, --context and --vision are not applied when starting an installed model" (open). Related UX gap around `--kv`, but a different issue (silent flag-drop, not argparse rejection). - **#3467** — "[TUI] 'Model could not be installed...' on 0.2.1" (open). A different `could not be installed` report (0.2.1, clean-install error); **not** this bug (no KV involvement). --- ## Notes / workaround - KV cache format is a serve-time setting (the model's conversation memory), not a prepare-step setting — but `setup.py`'s argparse still validates it, so an invalid value aborts the install. - Workaround on 0.2.2: `KV: int8`, `KV: k8v4`, or `KV: q4_0`, or omit `KV` (defaults to `int8` for context > 8192). Do not use `KV: fp16` until the choices list is fixed. - Unrelated but present in the same setup (separate issue): a Strata container needs a `/data` volume (`-v strata-data:/data`) or the entrypoint warns the model/settings are lost; and if the model files are mounted `:ro`, setup re-hashes the shards on every restart because it cannot write its `.done` marks.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 23, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6354939573 --> @github-actions[bot] commented on GitHub (Oct 23, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 23, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6355155701 --> @github-actions[bot] commented on GitHub (Oct 23, 2026): Thanks, this follows the format now.
Author
Owner

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

Thank you. Fixed in 0.2.5: setup accepts --kv fp16, as https://github.com/Niko1221/Strata/blob/main/docs/DOCKER.md says, and strata launch now shows setup's own error line instead of only "could not be installed". The 0.2.2-cuda13 image you used has the old setup; the 0.2.7 images (for example 0.2.7-cuda13) have the fix.

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.5

<!-- gh-comment-id:6491890889 --> @Niko1221 commented on GitHub (Oct 29, 2026): Thank you. Fixed in 0.2.5: setup accepts `--kv fp16`, as https://github.com/Niko1221/Strata/blob/main/docs/DOCKER.md says, and `strata launch` now shows setup's own error line instead of only "could not be installed". The `0.2.2-cuda13` image you used has the old setup; the 0.2.7 images (for example `0.2.7-cuda13`) have the fix. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.5
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#1595
No description provided.