Skip to content

refactor: remove debug env switches from production code - #4396

Merged
jundot merged 7 commits into
mainfrom
env-cleanup
Oct 9, 2026
Merged

jundot merged 7 commits into
mainfrom
env-cleanup

Conversation

@jundot

@jundot jundot commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Production code read about 150 OMLX_* environment variables that only served A/B measurement, kill switches or tuning during development. This PR removes them and fixes each value at the default the code already used, so a server with none of them set behaves the same. Kernel choice now comes only from hardware gates, shape checks and model settings.

Changes

  • Tuning values (tile sizes, thresholds, timeouts, kernel variants) are module constants at their old defaults.
  • Kill switches that defaulted on are gone and their paths stay on. Runtime failure latches still turn a kernel off after a failed launch.
  • Opt-in paths with no other way to turn on are deleted: the Laguna fused gate/up banks, the MTP prime-window cap, the Inkling trunk-norm readout, the combined ANE down bank, the GDN fused g/beta and stub branches, manual CPU column shards and the launcher lease watchdog.
  • Switches that also have a model setting keep the setting (moe_expert_offload_enabled, moe_gate_up_fusion_enabled, qwen35_ane_prefill_enabled). Only the env override is gone.
  • OMLXConfig and its sub-configs in omlx/config.py were not used by the server. Only parse_size remains.
  • Docs that listed these variables as options are updated (MoE expert offload, RDMA links, Qwen ANE prefill, TESTING.md).
  • Tests patch module constants or gate functions instead of setting env vars. Tests that only covered env parsing are removed.

Still read from the environment

  • Server settings overrides in settings.py (OMLX_HOST, OMLX_PORT, ...) and OMLX_HEADLESS.
  • Values one oMLX process hands to another (OMLX_DECODE_BURST_*, OMLX_BASE_PATH, OMLX_MCP_CONFIG, OMLX_QWEN35_ANE_COMPILE_CACHE, ...).
  • External integration paths (OMLX_MCDMA_RPCD_SOCKET, OMLX_MCDMA_RPC_LIBRARY, OMLX_DSH_*).
  • OMLX_DISTRIBUTED_REQUEST_READ_TIMEOUT. Rank zero sends no keepalive for non-stream requests, so this is still the only way to allow one longer than 300s (Distributed request_read_timeout is hard-coded to 300s and prefill emits no heartbeats, so a long prefill gets killed #2712).
  • Build-time variables and variables only tests read.

Validation

Greedy smoke with Qwen3.6-35B-A3B-oQ4-mtp, main against this branch, an 8K-token prompt and a 1.6K-token code prompt, 256 tokens each, two rounds per arm:

Machine Lightning MTP Output vs main Decode tok/s, main / PR
M3 Ultra off identical 153.9 / 153.3 (8K), 165.6 / 166.4 (code)
M3 Ultra on varies between runs on main too 130.2 / 127.5 (8K), 187.1 / 187.1 (code)
M5 Max off identical 165.1 / 164.8 (8K), 175.8 / 178.0 (code)
M5 Max on identical on code, 8K varies on main too 153.7 / 153.7 (8K), 209.5 / 209.7 (code)

With MTP on, the draft depth follows measured step times, so main's own greedy output changes between rounds. Speed is the same.

@jundot
jundot merged commit 09d7e2d into main Oct 9, 2026
1 check passed
junmo-kim added a commit to junmo-kim/omlx that referenced this pull request Oct 9, 2026
jundot#4396 removed debug env switches from production code. Remove the
OMLX_MTP_COMMAND_BUFFER_CAPS override added here as well, so the raised
caps follow only the target type and the GPU gate.
jason5545 added a commit to jason5545/omlx that referenced this pull request Oct 10, 2026
衝突:scheduler 的 packed prefill 保留 pre_pool_bytes;server 用上游
_merge_chat_template_kwargs 後再套 sub-key enable_thinking 覆寫;
qwen4_exp 保留 float32 QSA 鍵庫、收上游批次 QSA 旗標並拿掉上游已移除的
三個 env 開關;moe_offload 與 QSA 測試兩邊都留。

上游 jundot#4396 移除 env 開關時一併刪掉 import os 與 moe_expert_offload._env_int,
本地開關仍在用:batch_generator、scheduler、process_memory_enforcer 補回
import os,_env_int 移進 deepseek_v4/moe_offload。test_server 的 jundot#4336 新測試
改為預期本地傳入的 request_policy。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant