Skip to content

scripts, examples: stop forcing the deprecated Miles router in launchers - #2015

Open
Shi-Dong wants to merge 2 commits into
mainfrom
shi/drop-miles-router-glm5-lora
Open

scripts, examples: stop forcing the deprecated Miles router in launchers#2015
Shi-Dong wants to merge 2 commits into
mainfrom
shi/drop-miles-router-glm5-lora

Conversation

@Shi-Dong

@Shi-Dong Shi-Dong commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

The Miles router is deprecated in favour of sgl-router, but 14 launcher recipes still passed --use-miles-router unconditionally, so every run started from them took the deprecated text-based routing path.

There was no way to opt out from the caller side:

  • --use-miles-router is declared action="store_true" with no negated form, so it cannot be switched off by appending anything to --extra-args / the trailing arg list.
  • None of the Python launchers expose a ScriptArgs field for it.

Editing the recipe was the only workaround. This PR drops the flag everywhere it was hard-coded, so router_manager falls through to the sgl-router branch.

scripts/ (2 files)run_glm5_1_744b_a40b_lora.py, run_glm5_2_744b_a40b_lora.py.

examples/ (13 files) — the LoRA recipes (dev.sh, run-kimi-k25-megatron-lora.sh, run-qwen2.5-0.5B-megatron-lora.sh, run-qwen2.5-3B-megatron-lora-disaggregated.sh, run-qwen2.5-3B-megatron-lora-disaggregated-multi-node.sh, run-qwen3-4b-megatron-lora-result.sh), the multi-LoRA driver (run_multi_lora.py), the four low-precision recipes, and the reproducibility recipe. The p2p profiling recipe also had a dead commented-out occurrence, removed so the flag does not read as an option worth re-enabling.

Deliberately out of scope

  • The argument itself. miles/utils/arguments.py and all router plumbing (router_manager.py, sglang_engine.py, dashboard/, router/) are untouched. Retiring the flag is a separate decision from unpinning the recipes.
  • Tests. tests/e2e/sglang/test_r3_router_equivalence.py exists specifically to compare Miles router against sgl-router, and the router/dashboard unit tests exercise the same code — removing the flag there would delete the coverage rather than modernise it. Three e2e tests pass it incidentally (tests/e2e/lora/test_lora_qwen2.5_0.5B.py, tests/e2e/megatron/test_quick_start_glm4_9B.py, tests/e2e/megatron/test_glm5_2_744b_a40b_5layer_nvfp4.py); happy to clean those up here if reviewers prefer tests in scope.
  • Docs. The /advanced/miles-router page documents R3 rollout routing replay, not this flag.

Test plan

  • grep -rn -- "use-miles-router" scripts/ examples/ returns no matches.
  • bash -n passes on all 12 edited shell recipes; the two edited Python launchers and the multi-LoRA driver still compile.
  • End-to-end GRPO LoRA run of the GLM-5.2 gsm8k example on 4x H200, before and after the change:
    python scripts/run_glm5_2_744b_a40b_lora.py train --model-name GLM-5.2_5layer --task gsm8k --num-gpus-per-node 4 --num-rollout 5
    Both complete all 5 rollouts and save adapters. After the change the Megatron arg dump reports use_miles_router ... False and router_manager logs Router launched at <host>:<port> from the sgl-router branch. Train/rollout logprob parity is unchanged (max abs diff 2.2e-4 against a mean logprob of -10.2).
  • The other 13 recipes are the same single-line deletion and were not individually run.

…LoRA launchers

Both launchers baked --use-miles-router into misc_args, so every run took the deprecated text-based router path instead of sgl-router. The flag is declared action="store_true" with no negated form, and neither launcher exposes a knob for it, so callers had no way to opt out short of editing the script. Dropping it lets the launchers use the sgl-router default like the rest of the scripts.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

The Miles router is deprecated in favour of sgl-router, but twelve example
launchers still passed --use-miles-router unconditionally. Because the flag
is store_true with no CLI opt-out, anyone copying these recipes was silently
pinned to the deprecated path with no way to override it from the command
line. Dropping the flag lets router_manager fall through to sgl-router.

Also removes a dead commented-out occurrence in the p2p profiling script so
the recipe does not read as if the router were an option worth re-enabling.
@Shi-Dong Shi-Dong changed the title scripts: stop forcing the deprecated Miles router in GLM-5.1/5.2 LoRA launchers scripts, examples: stop forcing the deprecated Miles router in launchers Jul 31, 2026
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