[GH-ISSUE #974] Missing --kv-resident in generated args when --resident-budget-gib is set (tools/test_setup_unsloth.py) #425

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

Originally created by @AmjedMVP on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/974

Summary

On main (6f32ec0), two tools/test_setup_unsloth.py tests fail: when --resident-budget-gib is set, the generated engine args do not include --kv-resident, although the KV-streaming flag should be kept/implied (per DETAILS.md, KV streaming in WSL-capable setups comes out of the resident budget).

Environment

  • Ubuntu 26.04 LTS (WSL2), x86_64, Python 3.14.4, fresh clone @ 6f32ec0

Reproduce

python3 -m unittest tools/test_setup_unsloth.py -v
FAIL: test_budget_flag_with_kv_streaming_is_kept (__main__.Main.test_budget_flag_with_kv_streaming_is_kept)
    self.assertIn("--kv-resident", args)
AssertionError: '--kv-resident' not found in ['--pack', '/tmp/tmp39gne95o/data/packs/unsloth-ud-q4_k_xl', '--native', '/tmp/tmp39gne95o/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf', '--expert-profile', '/tmp/tmp39gne95o/data/expert-profile.bin', '--expert-cache', 'auto', '--prefill', 'auto', '--spec', '4', '--spec-min-p', '0.5', '--mtp', '/tmp/tmp39gne95o/data/mtp/rt', '--max-context', '131072', '--kv', 'int8', '--resident-budget-gib', '40']
FAIL: test_kv_streaming_comes_out_of_the_budget (__main__.Main.test_kv_streaming_comes_out_of_the_budget)
    self.assertIn("--kv-resident", args)

Two failures total; the rest of the suite (37 tests) passes.

Notes

The generated args do include --kv int8 and --resident-budget-gib 40, so only the --kv-resident flag goes missing in this path. Looks like a regression in the budget-flag handling (the flag was likely dropped when the budget override was wired in). Related context: on WSL we observed startup correctly prints WSL: KV streaming off (the driver pins only about 1 GB of RAM) — so the WSL off-path works; this failure is the non-WSL on-path.

Originally created by @AmjedMVP on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/974 ## Summary On `main` (6f32ec0), two `tools/test_setup_unsloth.py` tests fail: when `--resident-budget-gib` is set, the generated engine args do **not** include `--kv-resident`, although the KV-streaming flag should be kept/implied (per DETAILS.md, KV streaming in WSL-capable setups comes out of the resident budget). ## Environment - Ubuntu 26.04 LTS (WSL2), x86_64, Python 3.14.4, fresh clone @ `6f32ec0` ## Reproduce ```sh python3 -m unittest tools/test_setup_unsloth.py -v ``` ``` FAIL: test_budget_flag_with_kv_streaming_is_kept (__main__.Main.test_budget_flag_with_kv_streaming_is_kept) self.assertIn("--kv-resident", args) AssertionError: '--kv-resident' not found in ['--pack', '/tmp/tmp39gne95o/data/packs/unsloth-ud-q4_k_xl', '--native', '/tmp/tmp39gne95o/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf', '--expert-profile', '/tmp/tmp39gne95o/data/expert-profile.bin', '--expert-cache', 'auto', '--prefill', 'auto', '--spec', '4', '--spec-min-p', '0.5', '--mtp', '/tmp/tmp39gne95o/data/mtp/rt', '--max-context', '131072', '--kv', 'int8', '--resident-budget-gib', '40'] FAIL: test_kv_streaming_comes_out_of_the_budget (__main__.Main.test_kv_streaming_comes_out_of_the_budget) self.assertIn("--kv-resident", args) ``` Two failures total; the rest of the suite (37 tests) passes. ## Notes The generated args do include `--kv int8` and `--resident-budget-gib 40`, so only the `--kv-resident` flag goes missing in this path. Looks like a regression in the budget-flag handling (the flag was likely dropped when the budget override was wired in). Related context: on WSL we observed startup correctly prints `WSL: KV streaming off (the driver pins only about 1 GB of RAM)` — so the WSL off-path works; this failure is the non-WSL on-path.
Author
Owner

@talisp commented on GitHub (Oct 5, 2026):

A data point from a real (non-test) run: a 0.1.39 setup on Linux (UD-IQ4_XS, 251 GB RAM, KV streaming on, --context 262144 --kv int8) wrote both --kv-resident 32768 and --resident-budget-gib 55 into the generated args. So this may be specific to the test's environment (e.g. how the test decides KV streaming / RAM) rather than the generator itself.

<!-- gh-comment-id:6001503827 --> @talisp commented on GitHub (Oct 5, 2026): A data point from a real (non-test) run: a 0.1.39 setup on Linux (UD-IQ4_XS, 251 GB RAM, KV streaming on, `--context 262144 --kv int8`) wrote both `--kv-resident 32768` and `--resident-budget-gib 55` into the generated args. So this may be specific to the test's environment (e.g. how the test decides KV streaming / RAM) rather than the generator itself.
Author
Owner

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

Fixed in 0.1.40 (test only): inside WSL setup correctly leaves KV streaming off (the driver pins about 1 GB), and the two tests did not mock that. They run as on a normal PC now. Setup's behaviour is unchanged.

<!-- gh-comment-id:6010942509 --> @Niko1221 commented on GitHub (Oct 6, 2026): Fixed in 0.1.40 (test only): inside WSL setup correctly leaves KV streaming off (the driver pins about 1 GB), and the two tests did not mock that. They run as on a normal PC now. Setup's behaviour is unchanged.
Author
Owner

@AmjedMVP commented on GitHub (Oct 6, 2026):

Confirmed fixed — reran tools/test_setup_unsloth.py on 82f46a8 (WSL2 Ubuntu 26.04, Python 3.14.4): all 37 tests OK. Matches talisp's data point: the generator was fine, the two tests just weren't mocking the WSL KV-streaming-off detection. Thanks.

<!-- gh-comment-id:6014890415 --> @AmjedMVP commented on GitHub (Oct 6, 2026): Confirmed fixed — reran `tools/test_setup_unsloth.py` on `82f46a8` (WSL2 Ubuntu 26.04, Python 3.14.4): all 37 tests OK. Matches talisp's data point: the generator was fine, the two tests just weren't mocking the WSL KV-streaming-off detection. 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#425
No description provided.