Skip to content

fix(bindings): keep mm-routing opt-in for the default wheel - #18199

Merged
alec-flowers merged 5 commits into
ai-dynamo:mainfrom
cipheraxat:fix/18132-mm-routing-opt-in
Nov 10, 2026
Merged

alec-flowers merged 5 commits into
ai-dynamo:mainfrom
cipheraxat:fix/18132-mm-routing-opt-in

Conversation

@cipheraxat

@cipheraxat cipheraxat commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Since #17496, every maturin build of lib/bindings/python compiles llm-multimodal and its image stack, even without --features mm-routing. Cold source builds went from about 11 minutes to over an hour (#18132).

Root cause: the SGLang and TRT-LLM sidecars enabled dynamo-llm/mm-routing directly on the dependency so their SBOMs would match the shared sidecar build. The bindings depend on both sidecars, and Cargo feature unification turned mm-routing on for the whole wheel.

Key Changes

  • lib/sidecar/{sglang,trtllm}/Cargo.toml: copy the vLLM sidecar's pattern. mm-routing is a default feature that forwards to dynamo-llm/mm-routing, instead of being hard-coded on the dependency.
  • lib/bindings/python/Cargo.toml: depend on both sidecars with default-features = false, and forward the bindings' own mm-routing to them.

What stays the same:

  • Sidecar binaries and their SBOMs: the vLLM, SGLang and TRT-LLM sidecars still enable mm-routing through their default features, and LPX inherits it from the TRT-LLM sidecar.
  • Release wheels and the dev container: they already pass --features mm-routing.

Validation

macOS arm64 host, Rust 1.96.1. Base origin/main 945f785, fix 74af3c4.

cd lib/bindings/python && cargo tree -e normal -i llm-multimodal base fix
default features present absent
--features mm-routing present present

The same holds with --target x86_64-unknown-linux-gnu, --target aarch64-unknown-linux-gnu and --target all, so the Linux-only dynamo-llm dependencies don't bring it back. The default wheel's Linux graph drops from 758 to 728 distinct crates; with --features mm-routing it is 758 again.

For each of -p dynamo-{vllm,sglang,trtllm,lpx}-sidecar, cargo tree -e normal -i llm-multimodal still finds the crate, so the per-crate cargo cyclonedx SBOMs are unchanged.

cargo clippy --locked --no-deps -p dynamo-sglang-sidecar -p dynamo-trtllm-sidecar --all-targets -- -D warnings   # pass
cargo check --locked -p dynamo-sglang-sidecar -p dynamo-trtllm-sidecar --no-default-features                       # pass
(cd lib/bindings/python && cargo check --locked)                                                                   # pass
pre-commit run --files <changed files>                                                                             # pass

Not covered: I did not time a cold aarch64 maturin build --release. The table shows that llm-multimodal is no longer in the default build graph.

Issues and Ongoing Work

Pull Request Checklist
  • I used Dynamo's /pr-checklist skill.

AI assistance was used to prepare this change. Every result above was run and checked.

Release note

Build only: the default ai-dynamo-runtime wheel no longer compiles llm-multimodal. Runtime behavior, sidecar binaries and their SBOMs are unchanged.

Since ai-dynamo#17496 the SGLang and TRT-LLM sidecars hard-enabled
dynamo-llm/mm-routing. The Python bindings depend on both, so feature
unification compiled llm-multimodal into every wheel, even without
`--features mm-routing`, and cold source builds went from ~11 min to
over an hour.

Give both sidecars the vLLM sidecar's pattern: `mm-routing` is a
default feature that forwards to dynamo-llm. The bindings depend on
them with default features off and forward their own `mm-routing`.
Sidecar binaries and their SBOMs still include it.

Fixes ai-dynamo#18132

Signed-off-by: cipheraxat <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cipheraxat
cipheraxat temporarily deployed to external_collaborator November 5, 2026 13:35 — with GitHub Actions Inactive
@cipheraxat
cipheraxat temporarily deployed to external_collaborator November 5, 2026 13:35 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

👋 Hi cipheraxat! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions Bot added fix external-contribution Pull request is from an external contributor labels Nov 5, 2026
@cipheraxat
cipheraxat marked this pull request as ready for review November 5, 2026 13:44
@cipheraxat
cipheraxat requested review from a team as code owners November 5, 2026 13:44
ai-dynamo#17496 let sidecar defaults enable mm-routing in every wheel through
Cargo feature unification, and no check caught it. Add a
rust-feature-builds step that fails when the default dynamo-py3
dependency graph contains llm-multimodal, and note in the bindings
manifest why the sidecar dependencies turn default features off.

Refs ai-dynamo#18132

Signed-off-by: cipheraxat <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The sidecar manifests now define default-enabled mm-routing features for SGLang and TRT-LLM. The Python bindings explicitly enable those features through their opt-in mm-routing feature and disable default features on those dependencies.

Changes

MM routing feature configuration

Layer / File(s) Summary
Sidecar feature declarations
lib/sidecar/sglang/Cargo.toml, lib/sidecar/trtllm/Cargo.toml, lib/sidecar/Dockerfile
SGLang and TRT-LLM expose default-enabled mm-routing features that forward to dynamo-llm/mm-routing. The Dockerfile comments describe the sidecar defaults and SBOMs.
Python wheel feature wiring
lib/bindings/python/Cargo.toml
The Python mm-routing feature now enables the SGLang and TRT-LLM sidecar features. Their dependencies disable default features.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 18457

No actionable merge-blocking risk was identified in the feature wiring.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: keeping mm-routing opt-in for the default Python wheel.
Linked Issues check Passed [#18132] The issue requires that the default Python wheel does not build llm-multimodal, and that the feature stays opt-in through mm-routing. At the reviewed head (18457d7), lib/sidecar/sglang/Car…
Out of Scope Changes check Passed All changed files relate to the issue. The lib/bindings/python/Cargo.toml change removes unconditional mm-routing from the sidecar dependencies and forwards the bindings' own mm-routing feature. The l…
Description check Passed The description includes all required sections: Overview, Key Changes, Validation, and Issues and Ongoing Work. It explains the change, reports validation results and limitations, links the issue, and…
Full details: Linked Issues check

Explanation

[#18132] The issue requires that the default Python wheel does not build llm-multimodal, and that the feature stays opt-in through mm-routing. At the reviewed head (18457d7), lib/sidecar/sglang/Cargo.toml and lib/sidecar/trtllm/Cargo.toml define a default-enabled mm-routing feature that forwards to dynamo-llm/mm-routing. Both sidecars no longer enable dynamo-llm/mm-routing on the dependency. lib/bindings/python/Cargo.toml depends on both sidecars with default-features = false. Its mm-routing feature forwards to dynamo-llm/mm-routing and to the three sidecar mm-routing features, so the feature is opt-in again at the bindings. The per-sidecar SBOM builds keep mm-routing through their defaults, as the issue's proposed fix 1 requires. The author's cargo tree table was run on macOS arm64. That run does not evaluate the Linux-only dynamo-llm dependency block, so the Linux graph is confirmed only by manifest reading and by the pre-regression baseline. The author did not time a cold aarch64 release build. The issue does not require this PR to tune build flags or opt-level (fix 2), so that remaining item is not a PR requirement.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the issue. The lib/bindings/python/Cargo.toml change removes unconditional mm-routing from the sidecar dependencies and forwards the bindings' own mm-routing feature. The lib/sidecar/sglang/Cargo.toml and lib/sidecar/trtllm/Cargo.toml changes add a default-enabled mm-routing feature that forwards to dynamo-llm/mm-routing. The lib/sidecar/Dockerfile change updates comments that describe the old feature setup, so it supports the same change. No unrelated code, dependency, or API change appears in the summary. The raw summary reports no public API declaration changes.

Full details: Description check

Explanation

The description includes all required sections: Overview, Key Changes, Validation, and Issues and Ongoing Work. It explains the change, reports validation results and limitations, links the issue, and includes the checklist. The checklist item is present but unchecked.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 945f785 and 18457d7.

Files selected for processing: 4

  • lib/bindings/python/Cargo.toml
  • lib/sidecar/Dockerfile
  • lib/sidecar/sglang/Cargo.toml
  • lib/sidecar/trtllm/Cargo.toml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@cipheraxat
cipheraxat temporarily deployed to external_collaborator November 5, 2026 13:50 — with GitHub Actions Inactive
Check `dynamo-llm feature "mm-routing"` across all targets, so the guard
still fires if the feature's crates are renamed or change. Also correct the
sidecar Dockerfile comment for LPX, which inherits mm-routing from TRT-LLM,
and shorten the sidecar feature comments.

Refs ai-dynamo#18132

Signed-off-by: cipheraxat <[email protected]>
@cipheraxat
cipheraxat temporarily deployed to external_collaborator November 5, 2026 14:13 — with GitHub Actions Inactive
The existing comment still holds: the SGLang and TRT-LLM manifests enable
mm-routing, now through their default features.

Refs ai-dynamo#18132

Signed-off-by: cipheraxat <[email protected]>
@cipheraxat
cipheraxat temporarily deployed to external_collaborator November 5, 2026 14:30 — with GitHub Actions Inactive
@krishung5

Copy link
Copy Markdown
Contributor

/ok to test 74af3c4

@devin-ai-integration

devin-ai-integration Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

❌ Dynamo PR CI failed — run 42748337869 (attempt 1) on 63aafe641a

Gate checks: ❌ backend-status-check · ✅ deploy-status-check · ✅ dynamo-status-check

Framework 1-GPU amd64 1-GPU arm64 Multi-GPU amd64
SGLang ❌ 1 ❌ 1 ❌ 1
TRT-LLM ✅ 1 ✅ 1 ❌ 1
Other Jobs
planner ❌ 1 ✅ 4

Failure details

5 jobs failed. In sglang-runtime / Test cuda13.0, amd64, 11 tests in tests/frontend/test_tool_calling_sglang_spec_decoding.py (plus 1 error) failed because the SGLang worker was killed with signal 9 (exit code -9) during startup. The other 4 jobs failed in Verify test stages completed: a pytest stage reported success but wrote no exit code, so no test assertion failure appears in their logs.

❌ sglang-runtime / Test cuda13.0, amd64: SGLang spec-decoding server exited with code -9 while waiting for health check

Job: sglang-runtime / Test cuda13.0, amd64 · Failed step: Run GPU tests (sequential) · Logs: gh run view --job 129608758965 -R ai-dynamo/dynamo --log-failed

        failure_reason = 'status code 503'
        self       = WorkerProcess(command=['python3', '-m', 'dynamo.sglang', '--model-path', 'Qwen/Qwen3-0.6B', ...
        timeout    = 600.0
tests/utils/managed_process.py:675: in _check_process_alive
    raise RuntimeError(
E   RuntimeError: Main server process exited with code -9 while waiting for health check
FAILED tests/frontend/test_tool_calling_sglang_spec_decoding.py::TestToolCallingMultiTurn::test_tool_result_is_consumed_and_final_answer_is_text - RuntimeError: Main server process exited with code -9 while waiting for health check
FAILED tests/frontend/test_tool_calling_sglang_spec_decoding.py::TestToolCallingProtocol::test_stream_has_required_chunk_shape - RuntimeError: ...
ERROR tests/frontend/test_tool_calling_sglang_spec_decoding.py::TestToolCallingSpecDecodingMetrics::test_speculation_active_during_tool_calls - RuntimeError: ...
==== 11 failed, 25 passed, 6 skipped, 6027 deselected in 409.52s (0:06:49) =====

All of the TestToolCallingMultiTurn / TestToolCallingProtocol tests, and test_speculation_active_during_tool_calls, fail the same way. The dynamo.sglang worker (Qwen/Qwen3-0.6B with speculative decoding) was SIGKILLed (exit -9) while /health was still returning 503, and each auto-retry hit the same error. The log does not show the reason for the SIGKILL; host OOM is a common cause. The earlier parallel stage passed (1812 passed).

❌ planner / CPU Test cpu, arm64: pre_merge_cpu reported success but recorded no exit code

Job: planner / CPU Test cpu, arm64 · Failed step: Verify test stages completed · Logs: gh run view --job 129608345206 -R ai-dynamo/dynamo --log-failed

[gw0] [ 99%] PASSED components/src/dynamo/profiler/tests/integration/test_profile_sla_dgdr.py::TestThoroughMocked::test_thorough_no_planner_with_load
...
❌ pre_merge_cpu: reported success but recorded no exit code.
##[error]A pytest stage did not record a passing result. See this step's log for the stage.
##[error]Process completed with exit code 1.
##[error]Executing the custom container implementation failed. Please contact your self hosted runner administrator.

In the log, the pre_merge_cpu pytest run reaches 99% with every test shown passing, but its .exitcode status file is empty, so the verification step fails. No test failure appears in the log; the pytest process apparently ended before it wrote its exit code.

❌ sglang-runtime / 2-GPU Test cuda13.0, amd64: pre_merge_gpu reported success but recorded no exit code

Job: sglang-runtime / 2-GPU Test cuda13.0, amd64 · Failed step: Verify test stages completed · Logs: gh run view --job 129608759109 -R ai-dynamo/dynamo --log-failed

⏭️  pre_merge_gpu_parallel: did not run
❌ pre_merge_gpu: reported success but recorded no exit code.
##[error]A pytest stage did not record a passing result. See this step's log for the stage.
##[error]Process completed with exit code 1.

The pre_merge_gpu stage step ended as success, but its status file has no exit code. --log-failed only contains the verify step; to see whether pytest finished, check the full job log (gh api repos/ai-dynamo/dynamo/actions/jobs/129608759109/logs).

❌ sglang-runtime / Test cuda13.0, arm64: pre_merge_cpu reported success but recorded no exit code

Job: sglang-runtime / Test cuda13.0, arm64 · Failed step: Verify test stages completed · Logs: gh run view --job 129608759128 -R ai-dynamo/dynamo --log-failed

❌ pre_merge_cpu: reported success but recorded no exit code.
⏭️  pre_merge_cpu_e2e: did not run
⏭️  pre_merge_gpu_parallel: did not run
⏭️  pre_merge_gpu: did not run
##[error]A pytest stage did not record a passing result. See this step's log for the stage.

This is the same verification failure as in the planner job, here for the pre_merge_cpu stage. The later stages did not run.

❌ trtllm-runtime / 2-GPU Test cuda13.1, amd64: pre_merge_gpu reported success but recorded no exit code

Job: trtllm-runtime / 2-GPU Test cuda13.1, amd64 · Failed step: Verify test stages completed · Logs: gh run view --job 129610304241 -R ai-dynamo/dynamo --log-failed

⏭️  pre_merge_gpu_parallel: did not run
❌ pre_merge_gpu: reported success but recorded no exit code.
##[error]A pytest stage did not record a passing result. See this step's log for the stage.
##[error]Process completed with exit code 1.

This is the same verification failure as in the SGLang 2-GPU job, for the pre_merge_gpu stage.

For agents
{"pr": 18199, "run_id": 42748337869, "run_attempt": 1, "head_sha": "63aafe641a6abaf3611110e5304fc2dd67efa4b1",
 "failures": [
  {"job": "sglang-runtime / Test cuda13.0, amd64", "job_id": 129608758965, "failed_step": "Run GPU tests (sequential)", "signature": "RuntimeError: Main server process exited with code -9 while waiting for health check", "tests": ["tests/frontend/test_tool_calling_sglang_spec_decoding.py::TestToolCallingMultiTurn", "tests/frontend/test_tool_calling_sglang_spec_decoding.py::TestToolCallingProtocol", "tests/frontend/test_tool_calling_sglang_spec_decoding.py::TestToolCallingSpecDecodingMetrics::test_speculation_active_during_tool_calls"], "log_cmd": "gh run view --job 129608758965 -R ai-dynamo/dynamo --log-failed"},
  {"job": "planner / CPU Test cpu, arm64", "job_id": 129608345206, "failed_step": "Verify test stages completed", "signature": "pre_merge_cpu: reported success but recorded no exit code", "tests": [], "log_cmd": "gh run view --job 129608345206 -R ai-dynamo/dynamo --log-failed"},
  {"job": "sglang-runtime / 2-GPU Test cuda13.0, amd64", "job_id": 129608759109, "failed_step": "Verify test stages completed", "signature": "pre_merge_gpu: reported success but recorded no exit code", "tests": [], "log_cmd": "gh run view --job 129608759109 -R ai-dynamo/dynamo --log-failed"},
  {"job": "sglang-runtime / Test cuda13.0, arm64", "job_id": 129608759128, "failed_step": "Verify test stages completed", "signature": "pre_merge_cpu: reported success but recorded no exit code", "tests": [], "log_cmd": "gh run view --job 129608759128 -R ai-dynamo/dynamo --log-failed"},
  {"job": "trtllm-runtime / 2-GPU Test cuda13.1, amd64", "job_id": 129610304241, "failed_step": "Verify test stages completed", "signature": "pre_merge_gpu: reported success but recorded no exit code", "tests": [], "log_cmd": "gh run view --job 129610304241 -R ai-dynamo/dynamo --log-failed"}
 ]}

Posted automatically by Devin for run 42748337869. Updated on every full-CI run of this PR.

@nv-tusharma nv-tusharma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build/dependency review: one suggestion on the CI step.

Comment thread .github/workflows/pre-merge.yml Resolved
The manifest changes fix the dependency graph; per review, the extra CI step isn't needed.

Signed-off-by: cipheraxat <[email protected]>
@cipheraxat
cipheraxat temporarily deployed to external_collaborator November 10, 2026 03:06 — with GitHub Actions Inactive
@alec-flowers

Copy link
Copy Markdown
Contributor

/ok to test 63aafe6

@alec-flowers
alec-flowers enabled auto-merge (squash) November 10, 2026 03:16
@alec-flowers
alec-flowers merged commit 227025e into ai-dynamo:main Nov 10, 2026
192 of 199 checks passed
ishandhanani added a commit to ishandhanani/dynamo that referenced this pull request Nov 10, 2026
- 84c3ecd fix(mocker): admit sequential disagg decode with transferred prompt KV (ai-dynamo#18384): one file, lib/llm/src/mocker.rs (+56), auto-merged and taken whole: the decode-side branch that submits through LiveEngine::submit_decode when the request carries a prefill_result, plus the test sequential_decode_starts_from_transferred_prompt_kv. The mocker frontend stays in lib/llm; the handoff path it calls stays in lib/mocker. No router-owned path.
- 227025e fix(bindings): keep mm-routing opt-in for the default wheel (ai-dynamo#18199): three manifests. lib/bindings/python/Cargo.toml auto-merged (the mm-routing feature now also enables the sglang and trtllm sidecars' mm-routing; both sidecar dependencies gain default-features = false; the split's router dependency list and feature wiring untouched). lib/sidecar/sglang/Cargo.toml auto-merged (upstream's [features] block with default = ["mm-routing"]; the split's dynamo-kv-events dev-dependency stays). lib/sidecar/trtllm/Cargo.toml conflicted on the [dependencies] hunk: resolved as upstream's [features] block and the bare dynamo-llm = { path = "../../llm", default-features = false } line with the SBOM comment dropped as upstream did, keeping the split's dynamo-kv-events = { workspace = true } in place of the pre-split dynamo-kv-router edge; the dev-dependencies dynamo-kv-hashing and dynamo-router-protocol are unchanged. No lockfile change; all four lockfiles pass --locked. The default bindings wheel resolves no dynamo-llm/mm-routing edge and --features mm-routing resolves one, as upstream intends.
- f4a437e ci: move Planner tests out of runtime CPU lanes (ai-dynamo#18351): ten files, auto-merged and taken whole: .github/workflows/dynamo-pipeline.yml and nightly-ci.yml (the new planner-test lane, the "(not planner or core)" marker filter on the runtime CPU lanes), container/Dockerfile.test (COPY of the replay and router retune tests), and pytest.mark.planner or pytest.mark.core added to seven Python test files under components/src/dynamo/planner/tests/unit, lib/bindings/python/tests/replay and tests/dependencies. No Rust, no Cargo.toml, no router-owned path.
- f42e5b1 fix(frontend): keep declared Responses tools in the prompt when allowed_tools restricts calls (ai-dynamo#18429): three lib/llm files, auto-merged and taken whole: lib/llm/src/protocols/openai/responses/template_tools.rs (the renderer reads the full declared tool catalog through template_catalog(); allowed_tools narrows only the backend view and call enforcement), its tests/tool_adaptation.rs, and the new integration test lib/llm/tests/responses_http_replay.rs. No router-owned path, no Cargo.toml.

Signed-off-by: Ishan Dhanani <[email protected]>

This branch was previously deployed

1 inactive deployment
external_collaborator — 63aafe64 Deployed Nov 10, 2026 by cipheraxat via ok-to-test #49138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions external-contribution Pull request is from an external contributor fix size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Python wheel always builds llm-multimodal since #17496 (mm-routing no longer opt-in), slowing cold source builds

5 participants