Skip to content

Conversation

@tanmayv25
Copy link
Contributor

@tanmayv25 tanmayv25 commented Jul 25, 2025

Overview:

Follow-up PR to address TRTLLM support in dynamo package.

Summary by CodeRabbit

  • New Features

    • Expanded and clarified documentation for installing and using the "trtllm" engine, including prerequisites, container usage, and backend worker instructions.
  • Bug Fixes

    • Simplified and improved Docker container builds for sglang, vllm, and tensorrt_llm backends, including architecture-specific handling and streamlined dependency installation.
  • Chores

    • Removed obsolete requirements files and custom build scripts to streamline build and packaging.
    • Updated optional dependency groups in the project configuration for clearer backend selection.
    • Removed unused CLI script definitions and custom build hooks.
    • Cleaned up test files by removing unnecessary pytest markers.

grahamking and others added 23 commits July 22, 2025 16:12
- `dynamo-run` is now a dev tool, replaced by python-only UX.
- `mock_worker` always was a dev tool and should not be in the wheel.
- `metrics` will be in the container but not the wheel.
- `libdynamo_llm_capi.so` is no longer used, since vllm merged KV events
  upstream.

This is a nice change because packaging binaries in a Python wheel is a
pain. You have to worry about glibc versions and any other dylib
dependencies. And CUDA. And it bloats the wheel.
This reverts commit a989a8f.
Signed-off-by: Anant Sharma <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Walkthrough

This change set restructures optional dependency groups in pyproject.toml, removes the custom build hook and related hatch_build.py, and simplifies Dockerfile build steps by eliminating explicit C API binding and binary handling. Documentation is updated for TRT-LLM usage, and requirements files for sglang and vllm backends are deleted. Test files have pre-merge pytest markers removed.

Changes

File(s) Change Summary
pyproject.toml Restructured optional dependencies, removed "all" group, added specific groups, removed scripts and custom build hook.
hatch_build.py Removed file and its custom wheel build hook class.
Earthfile Stopped copying hatch_build.py in build target.
README.md Added detailed installation and usage instructions for TRT-LLM engine.
components/backends/sglang/requirements.txt, components/backends/vllm/requirements.txt Deleted backend requirements files.
container/Dockerfile.sglang, container/Dockerfile.tensorrt_llm, container/Dockerfile.vllm Simplified build steps, removed explicit C API binding and binary handling, adjusted package installs, added/changed binary copying, and introduced arch-specific logic.
deploy/sdk/src/dynamo/sdk/tests/test_e2e_args.py,
deploy/sdk/src/dynamo/sdk/tests/test_e2e_config.py,
deploy/sdk/src/dynamo/sdk/tests/test_link.py,
deploy/sdk/src/dynamo/sdk/tests/test_resources.py
Removed module-level pytest.mark.pre_merge markers and related imports.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Dockerfile
    participant WheelBuilder
    participant RuntimeImage

    User->>Dockerfile: Build container
    Dockerfile->>WheelBuilder: Build ai-dynamo wheel (no hatch_build.py)
    WheelBuilder-->>Dockerfile: Wheel with only Python packages
    Dockerfile->>RuntimeImage: Install ai-dynamo wheel, copy metrics binary
    RuntimeImage-->>User: Ready-to-use runtime (no C API bindings, simplified deps)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇
Hop, hop, the build is light,
No more custom hooks in sight!
Dockerfiles are clean and lean,
TRT-LLM docs are keen.
Wheels now roll with Python grace,
Binaries gone without a trace.
A tidy patch—let’s celebrate this space!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
container/Dockerfile.sglang (1)

119-120: Same duplication of -Ddisable_gds_backend=true as TRT-LLM image

See comment on TRT-LLM Dockerfile – consider a shared ARG or script.

Also applies to: 158-159

🧹 Nitpick comments (8)
pyproject.toml (2)

83-86: Duplicated uvloop entries across extras

Every optional group re-declares uvloop. When two extras are installed together, pip may pick incompatible versions if the dependency ever becomes range-bounded. Add a single root-level entry or use an internal table to centralise the requirement.


93-102: Static include list will miss future back-ends

Hard-coding every package path means adding a new backend requires touching pyproject.toml.
Hatchling supports globbing:

-    "components/backends/trtllm/src/dynamo",
-    "components/backends/sglang/src/dynamo",
-    "components/backends/vllm/src/dynamo"
+    "components/backends/*/src/dynamo"

Simplifies maintenance and avoids accidental omissions.

container/Dockerfile.tensorrt_llm (2)

109-120: disable_gds_backend flag duplicated – extract once

The if [ "$ARCH" = "arm64" ] block with -Ddisable_gds_backend=true appears twice (source build and wheel build).
Factor this into a build-arg or environment variable to avoid divergence.

Also applies to: 221-226


318-318: metrics binary copied manually – package it instead

Manually sprinkling cp target/release/metrics /usr/local/bin in multiple stages is brittle; any rename or new binary requires N Dockerfile edits.

Proposed fix (single wheel already produced for Rust bindings):

-    cp target/release/metrics /usr/local/bin
+    # Include metrics in the ai-dynamo wheel
+    maturin build --release -m lib/metrics/Cargo.toml --out /workspace/dist
+    uv pip install /workspace/dist/metrics*.whl

Keeps runtime images in sync and removes duplicate COPY commands.

Also applies to: 478-483

README.md (1)

187-196: Spelling & fenced-code nitpicks

  • “prerequites” / “prequisites” → prerequisites
  • Add language identifiers to fenced code blocks to satisfy markdown-lint.
-## Install prerequites
-```
+# ## Install prerequisites
+```bash

Minor, but improves docs polish.

container/Dockerfile.sglang (1)

368-369: Repeat manual copy of metrics binary

Same maintainability issue as in TRT-LLM Dockerfile – please package the binary or create a single COPY point.

Also applies to: 433-439

container/Dockerfile.vllm (2)

198-206: Consider hoisting the vLLM install into its own build stage for better layer caching

Re-building vLLM (or running pip install) each time unrelated Dockerfile lines change invalidates the cache and lengthens the build. A small two-stage pattern keeps layers reusable:

  1. Build/install vLLM in an as vllm stage.
  2. COPY --from=vllm /opt/vllm … (arm64) or COPY --from=vllm /venv /venv (x86).

This isolates the expensive step and improves CI turnaround time.


21-23: Version arg drift: keep single source of truth

ARG VLLM_VERSION="0.9.2" is hard-coded here while pyproject.toml now pins vllm==0.9.2 in the vllm optional group. Whenever one is bumped the other must be updated manually – an easy place for drift.

A small helper script or build-arg passthrough from the pyproject metadata (e.g., grep -Po '(?<=vllm==)[^"]+') would ensure they stay in sync.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2cb1c3 and 6aea572.

📒 Files selected for processing (13)
  • Earthfile (1 hunks)
  • README.md (2 hunks)
  • components/backends/sglang/requirements.txt (0 hunks)
  • components/backends/vllm/requirements.txt (0 hunks)
  • container/Dockerfile.sglang (5 hunks)
  • container/Dockerfile.tensorrt_llm (4 hunks)
  • container/Dockerfile.vllm (8 hunks)
  • deploy/sdk/src/dynamo/sdk/tests/test_e2e_args.py (0 hunks)
  • deploy/sdk/src/dynamo/sdk/tests/test_e2e_config.py (0 hunks)
  • deploy/sdk/src/dynamo/sdk/tests/test_link.py (0 hunks)
  • deploy/sdk/src/dynamo/sdk/tests/test_resources.py (0 hunks)
  • hatch_build.py (0 hunks)
  • pyproject.toml (1 hunks)
💤 Files with no reviewable changes (7)
  • deploy/sdk/src/dynamo/sdk/tests/test_e2e_config.py
  • deploy/sdk/src/dynamo/sdk/tests/test_e2e_args.py
  • components/backends/sglang/requirements.txt
  • deploy/sdk/src/dynamo/sdk/tests/test_resources.py
  • deploy/sdk/src/dynamo/sdk/tests/test_link.py
  • hatch_build.py
  • components/backends/vllm/requirements.txt
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~187-~187: Ensure spelling is correct
Context: ...ize=1g --ulimit memlock=-1` ## Install prerequites # Optional step: Only required for Blackwell and Grace Hopper pip3 install torch==2.7.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128 sudo apt-get -y install libopenmpi-dev > [!Tip] > You can learn more about these ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~196-~196: Ensure spelling is correct
Context: ...[!Tip] > You can learn more about these prequisites and known issues with TensorRT-LLM pip ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.17.2)
README.md

183-183: Blank line inside blockquote

(MD028, no-blanks-blockquote)


188-188: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


199-199: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


204-204: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (2)
pyproject.toml (1)

61-66: Pinning an RC build of tensorrt-llm is risky

1.0.0rc4 is a release-candidate. Down-stream users who install ai-dynamo[trtllm] will silently get a pre-release that can disappear or change APIs. Consider either:

-    "tensorrt-llm==1.0.0rc4"
+    # Prefer a stable official release; fall back to the rc only if no GA is available
+    "tensorrt-llm>=1.0.0,<2.0.0"

or publish explicit guidance that only the RC is supported.

Earthfile (1)

108-108: LGTM – removal of hatch_build.py references

Deleting the copy step keeps the build context minimal and matches the project’s move away from the custom build hook.

Signed-off-by: Anant Sharma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants