[PR #5028] [CLOSED] [TUI] launch: --set mmap-experts=off reaches strata-dsv41 as a word instead of being dropped (#5027) #5290

Closed
opened 2026-11-07 16:34:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5028
Author: @erikash
Created: 11/2/2026
Status: ❌ Closed

Base: main ← Head: launch-dsv41-mmap-experts


📝 Commits (1)

  • 2b6d3e4 launch: --set mmap-experts=on|off|auto reaches strata-dsv41 as a word instead of being dropped or left bare (#5027)

📊 Changes

4 files changed (+40 additions, -10 deletions)

View changed files

📝 strata_cli/launch/runner.py (+6 -2)
📝 strata_cli/launch/settings.py (+3 -2)
📝 strata_control/tune_knobs.py (+11 -6)
📝 tests/terminal/test_launch.py (+20 -0)

📄 Description

Problem and result

Fixes #5027. With DeepSeek, strata launch --set mmap-experts=off (Docker: STRATA_SET="mmap-experts=off") never reached strata-dsv41. The launcher treats --mmap-experts as a bare switch for every engine (tune_knobs.BOOL_FLAGS), so off removed the flag, and strata-dsv41 kept its own default: experts read in place from the model files. strata-dsv41 reads --mmap-experts on|off|auto with a word (src/dsv41/ds4_main.cpp).

Before: the DeepSeek engine line had no --mmap-experts. After: it carries --mmap-experts off (or on / auto as typed). The Qwen engine is unchanged: --mmap-experts stays a bare switch there.

Issue #5027. Same kind of bug as #3959 (--dspark, fixed with WORD_VALUE_FLAGS) and #4359 (--vision in the app's launcher). This is a focused fix, with no change to any default.

Approach

derive_config already knows the engine from cfg["arch"]. For deepseek41 it takes --mmap-experts out of the bool flags and treats it as a word-valued option, like --dspark. as_argv_changes takes the word-flag set as an optional argument, and tune_knobs.apply_to_argv and _value_count take the bool-flag set as one. Each defaults to the current module constant, so every other caller (autotune, presets, the app) behaves exactly as before. Replacing a --mmap-experts on that is already in the args removes its word too, instead of leaving a stray on.

Validation

Passed:

  • python -m pytest tests/terminal/test_launch.py -k mmap_experts (macOS, Python 3.14.7, this branch at 2b6d3e4): the new test passes. The same test against c62d5e3a (v0.2.9) without the fix fails.
  • python -m pytest tests/terminal (macOS, Python 3.14.7, requirements.txt and requirements-monitor.txt installed), run on c62d5e3a and on this branch: 85 failed / 1967 passed on c62d5e3a, 84 failed / 1969 passed on this branch. This branch has no failure that c62d5e3a lacks. The one difference is test_bench_standard.py::RunTests::test_a_request_that_never_finishes_times_out, which failed on c62d5e3a and passed here; it does not touch this code. The 84 shared failures are mostly test_updater, test_engine_component and test_engine_manifest, and they fail the same way without this change.
  • Inside ghcr.io/niko1221/strata:0.2.9-cuda13 (its Python 3.12), I ran derive_config on the run config the launch wrote for IST-DAS-2.25bpw, with STRATA_SET="mmap-experts=off cpu-threads=48 ssd-cache=0 dspark=on experts=5". Unchanged files: no --mmap-experts. These three files mounted over the image's copies: ... --dspark-conf 0.65 --mmap-experts off --cpu-threads 48 --ssd-cache 0 --dspark on --experts 5.
  • That exact engine line, served from the image on an RTX 3090 24 GB with 157 GiB RAM (Ubuntu 26.04 VM, Docker; engine 0.1.55-linux-x86_64-cuda-cuda13), gave 41.0-42.6 tok/s on code. The line the unchanged launcher builds gave 25.4-26.6 tok/s. All the numbers are in #5027. For that run I started serve/server.py by hand with the edited run config; the launcher itself did not start it.

Failed:

  • None observed that this change introduces (see the suite comparison above).

Not run:

  • A full strata launch start with these files in place on hardware. The engine line was checked through derive_config, and the engine was run with the same line, but not the two together in one start.
  • Windows and the desktop app. The app has its own JavaScript launcher (#4359); I did not check whether it has the same problem with --mmap-experts.
  • --set mmap-experts=on and =auto on hardware. They are covered only by the unit test.
  • No CUDA, HIP, SYCL or Metal build: the change is Python only.

Limits

Only --mmap-experts is handled. I did not audit the other BOOL_FLAGS against strata-dsv41's parser.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W5GzYGCSrroAWwvNd7b7CE


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/5028 **Author:** [@erikash](https://github.com/erikash) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `launch-dsv41-mmap-experts` --- ### 📝 Commits (1) - [`2b6d3e4`](https://github.com/Niko1221/Strata/commit/2b6d3e4de08614f3d5aed30574e2ca4df228b5e7) launch: --set mmap-experts=on|off|auto reaches strata-dsv41 as a word instead of being dropped or left bare (#5027) ### 📊 Changes **4 files changed** (+40 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `strata_cli/launch/runner.py` (+6 -2) 📝 `strata_cli/launch/settings.py` (+3 -2) 📝 `strata_control/tune_knobs.py` (+11 -6) 📝 `tests/terminal/test_launch.py` (+20 -0) </details> ### 📄 Description ## Problem and result Fixes #5027. With DeepSeek, `strata launch --set mmap-experts=off` (Docker: `STRATA_SET="mmap-experts=off"`) never reached strata-dsv41. The launcher treats `--mmap-experts` as a bare switch for every engine (`tune_knobs.BOOL_FLAGS`), so `off` removed the flag, and strata-dsv41 kept its own default: experts read in place from the model files. strata-dsv41 reads `--mmap-experts on|off|auto` with a word (`src/dsv41/ds4_main.cpp`). Before: the DeepSeek engine line had no `--mmap-experts`. After: it carries `--mmap-experts off` (or `on` / `auto` as typed). The Qwen engine is unchanged: `--mmap-experts` stays a bare switch there. ## Related discussion Issue #5027. Same kind of bug as #3959 (`--dspark`, fixed with `WORD_VALUE_FLAGS`) and #4359 (`--vision` in the app's launcher). This is a focused fix, with no change to any default. ## Approach `derive_config` already knows the engine from `cfg["arch"]`. For `deepseek41` it takes `--mmap-experts` out of the bool flags and treats it as a word-valued option, like `--dspark`. `as_argv_changes` takes the word-flag set as an optional argument, and `tune_knobs.apply_to_argv` and `_value_count` take the bool-flag set as one. Each defaults to the current module constant, so every other caller (autotune, presets, the app) behaves exactly as before. Replacing a `--mmap-experts on` that is already in the args removes its word too, instead of leaving a stray `on`. ## Validation **Passed:** - `python -m pytest tests/terminal/test_launch.py -k mmap_experts` (macOS, Python 3.14.7, this branch at 2b6d3e4): the new test passes. The same test against c62d5e3a (v0.2.9) without the fix fails. - `python -m pytest tests/terminal` (macOS, Python 3.14.7, `requirements.txt` and `requirements-monitor.txt` installed), run on c62d5e3a and on this branch: 85 failed / 1967 passed on c62d5e3a, 84 failed / 1969 passed on this branch. This branch has no failure that c62d5e3a lacks. The one difference is `test_bench_standard.py::RunTests::test_a_request_that_never_finishes_times_out`, which failed on c62d5e3a and passed here; it does not touch this code. The 84 shared failures are mostly `test_updater`, `test_engine_component` and `test_engine_manifest`, and they fail the same way without this change. - Inside `ghcr.io/niko1221/strata:0.2.9-cuda13` (its Python 3.12), I ran `derive_config` on the run config the launch wrote for IST-DAS-2.25bpw, with `STRATA_SET="mmap-experts=off cpu-threads=48 ssd-cache=0 dspark=on experts=5"`. Unchanged files: no `--mmap-experts`. These three files mounted over the image's copies: `... --dspark-conf 0.65 --mmap-experts off --cpu-threads 48 --ssd-cache 0 --dspark on --experts 5`. - That exact engine line, served from the image on an RTX 3090 24 GB with 157 GiB RAM (Ubuntu 26.04 VM, Docker; engine 0.1.55-linux-x86_64-cuda-cuda13), gave 41.0-42.6 tok/s on code. The line the unchanged launcher builds gave 25.4-26.6 tok/s. All the numbers are in #5027. For that run I started `serve/server.py` by hand with the edited run config; the launcher itself did not start it. **Failed:** - None observed that this change introduces (see the suite comparison above). **Not run:** - A full `strata launch` start with these files in place on hardware. The engine line was checked through `derive_config`, and the engine was run with the same line, but not the two together in one start. - Windows and the desktop app. The app has its own JavaScript launcher (#4359); I did not check whether it has the same problem with `--mmap-experts`. - `--set mmap-experts=on` and `=auto` on hardware. They are covered only by the unit test. - No CUDA, HIP, SYCL or Metal build: the change is Python only. ## Limits Only `--mmap-experts` is handled. I did not audit the other `BOOL_FLAGS` against strata-dsv41's parser. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01W5GzYGCSrroAWwvNd7b7CE --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:34:06 +07:00
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#5290
No description provided.