Skip to content

Conversation

@keivenchang
Copy link
Contributor

@keivenchang keivenchang commented Aug 14, 2025

Overview:

Add better messaging and checks (like maturin)

Details:

  • Memory Monitoring: Add ⚠️ warning symbols when OS or GPU memory usage reaches 90% or higher
  • CUDA: if CUDA is not available, add a ❌
  • Immediate Testing: Add PYTHONPATH-based testing option
  • Error Handling: Include safe error handling for memory percentage calculations

Where should the reviewer start?

  • Look at the output.
System info:
├─ OS: Ubuntu 24.04.1 LTS (Noble Numbat) (Linux 6.11.0-28-generic x86_64); Memory: 30.9/125.5 GiB; Cores: 32
├─ GPU: NVIDIA NVIDIA RTX 6000 Ada Generation (driver 570.133.07, CUDA 12.8); Power: 28.48/300.00 W; Memory: 2/49140 MiB
├─ CUDA: driver 570.133.07, CUDA 12.8
├─ Cargo (/usr/local/cargo/bin/cargo, cargo 1.87.0 (99624be96 2025-05-06))
   ├─ Cargo home directory: $HOME/dynamo/.build/.cargo (CARGO_HOME is set)
   └─ Cargo target directory: $HOME/dynamo/.build/target (CARGO_TARGET_DIR is set)
      ├─ Debug:   $HOME/dynamo/.build/target/debug (modified: 2025-08-14 16:47:13 PDT)
      ├─ Release: $HOME/dynamo/.build/target/release (modified: 2025-08-14 15:38:39 PDT)
      └─ Binary:  $HOME/dynamo/.build/target/debug/libdynamo_llm_capi.so (modified: 2025-08-14 16:45:31 PDT)
├─ Maturin (/opt/dynamo/venv/bin/maturin, maturin 1.9.3)
├─ Python: 3.12.3 (/opt/dynamo/venv/bin/python3); PYTHONPATH=:/home/ubuntu/dynamo/components/planner/src:
   └─ Torch: 2.7.1+cu126 (✅torch.cuda.is_available())
└─ Dynamo ($HOME/dynamo):
   └─ Runtime components (ai-dynamo-runtime 0.4.0):
      ├─ /opt/dynamo/venv/lib/python3.12/site-packages/ai_dynamo_runtime-0.4.0.dist-info (created: 2025-08-14 16:47:15 PDT)
      ├─ /opt/dynamo/venv/lib/python3.12/site-packages/ai_dynamo_runtime.pth (modified: 2025-08-14 16:47:15 PDT)
         └─ Points to: $HOME/dynamo/lib/bindings/python/src
      ├─ ✅ dynamo._core        $HOME/dynamo/lib/bindings/python/src/dynamo/_core.cpython-312-x86_64-linux-gnu.so (modified: 2025-08-14 16:47:15 PDT)
      ├─ ✅ dynamo.nixl_connect $HOME/dynamo/lib/bindings/python/src/dynamo/nixl_connect/__init__.py
      ├─ ✅ dynamo.llm          $HOME/dynamo/lib/bindings/python/src/dynamo/llm/__init__.py
      └─ ✅ dynamo.runtime      $HOME/dynamo/lib/bindings/python/src/dynamo/runtime/__init__.py
   └─ Framework components (ai-dynamo 0.4.0):
      ├─ /opt/dynamo/venv/lib/python3.12/site-packages/ai_dynamo-0.4.0.dist-info (created: 2025-08-14 16:47:16 PDT)
      ├─ /opt/dynamo/venv/lib/python3.12/site-packages/_ai_dynamo.pth (modified: 2025-08-14 16:47:16 PDT)
         └─ Points to: $HOME/dynamo/components/backends/vllm/src
      ├─ ✅ dynamo.frontend     $HOME/dynamo/components/frontend/src/dynamo/frontend/__init__.py
      ├─ ✅ dynamo.planner      $HOME/dynamo/components/planner/src/dynamo/planner/__init__.py
      ├─ ✅ dynamo.mocker       $HOME/dynamo/components/backends/mocker/src/dynamo/mocker/__init__.py
      ├─ ✅ dynamo.trtllm       $HOME/dynamo/components/backends/trtllm/src/dynamo/trtllm/__init__.py
      ├─ ✅ dynamo.vllm         $HOME/dynamo/components/backends/vllm/src/dynamo/vllm/__init__.py
      ├─ ✅ dynamo.sglang       $HOME/dynamo/components/backends/sglang/src/dynamo/sglang/__init__.py
      └─ ✅ dynamo.llama_cpp    $HOME/dynamo/components/backends/llama_cpp/src/dynamo/llama_cpp/__init__.py

Related Issues:

Summary by CodeRabbit

  • New Features
    • Added development and production build modes with a new --build-options CLI flag.
    • Enriched system info: maturin detection, improved GPU reporting (driver/CUDA fallback, power/memory with warnings), and structured output.
    • Absolute module paths shown with $HOME substitution; PYTHONPATH now displays a component count.
  • Changes
    • Removed the clear CUDA memory option.
    • Updated CLI flow: examples shown only when there are no failures; simplified summaries.
    • Replaced legacy build guidance with a clear two-mode build guide.
  • Documentation
    • Polished user help and build instructions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Walkthrough

Refactors deploy/dynamo_check.py: replaces legacy build guidance with development/production build modes, removes CUDA memory clearing, adds maturin detection, overhauls system/GPU info reporting, updates path displays, introduces --build-options CLI flag, removes --clear-cuda-memory, adjusts main flow to show build options or run checks accordingly.

Changes

Cohort / File(s) Summary of Changes
Dynamo check refactor and CLI flow
deploy/dynamo_check.py
- Introduced development/production build workflows via _show_build_options; removed dynamo_build.sh checks and _is_dynamo_build_available.
- Removed clear_cuda_memory attribute/flag; updated _print_system_info signature and logic to drop CUDA clearing.
- Enhanced system info: maturin detection; richer GPU info via nvidia-smi with fallbacks; improved formatting/conditions.
- Updated path display to absolute with $HOME substitution; PYTHONPATH summary count.
- CLI: added --build-options; removed --clear-cuda-memory; main flow updated to conditionally show build options or run checks.
- Output structure and help text streamlined.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant CLI as dynamo_check.py (CLI)
  participant DC as DynamoChecker
  participant Sys as System (nvidia-smi, Python, maturin)

  U->>CLI: Invoke with args
  CLI->>DC: init / parse args
  alt --build-options
    DC->>Sys: Detect maturin, env paths
    DC-->>U: Print development/production build steps
  else normal run
    DC->>Sys: Collect system info (maturin, Python, Torch)
    DC->>Sys: Query GPUs via nvidia-smi (with fallbacks)
    DC-->>U: Print formatted system/GPU info
    DC-->>U: Run checks and examples if no failures
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A rabbit taps the terminal key,
Builds in two modes, swift and free.
Maturin nods, GPUs gleam,
Paths made clear, a tidy stream.
Flags now fewer, flows refined—
Hop along, code, perfectly aligned. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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: 4

🧹 Nitpick comments (3)
deploy/dynamo_check.py (3)

755-757: Fix tree drawing: Python should close the System info block

Python is always the last top-level line in System info. Using “├─” based on has_cargo renders an open branch with no following sibling lines in this section.

Apply this diff:

-        more_after_python = bool(has_cargo)
-        print(f"{'├─' if more_after_python else '└─'} {python_line}")
+        # Python is the last top-level line in System info
+        print(f"└─ {python_line}")

911-914: Nice touch: PYTHONPATH preview with count

The preview string and count are useful. Consider quoting the variable in the example to avoid surprises with spaces/colons, but current output is still clear.

Example tweak (optional, outside selected lines):

  • export PYTHONPATH="...computed..." rather than without quotes.

1539-1564: CLI flow looks solid; minor improvement: DRY the build-options block

The --import-check-only and the standalone --build-options branches duplicate logic for computing and printing build options. Consider extracting a tiny helper to avoid divergence.

Example (outside this hunk):

  • def _maybe_show_build_options(self): compute pythonpath, validate workspace, and call _show_build_options or print the appropriate error.
    Then reuse it in both branches.
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 81c2780 and f7e3f94.

📒 Files selected for processing (1)
  • deploy/dynamo_check.py (15 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Test - dynamo
🔇 Additional comments (4)
deploy/dynamo_check.py (4)

610-618: Improve System info ordering consistency and clarity

  • You already include the GPU power/memory suffix in the GPU line; keeping CUDA as a dedicated next line is good. Maturin and Python then follow, which looks consistent.
  • Minor polish: with the above tree-connector fix, the section renders cleanly.

Also applies to: 725-763


1043-1052: Good: absolute path with $HOME replacement for workspace modules

Switching to absolute workspace paths improves clarity when multiple environments are active. Timestamps only for generated artifacts is also sound.


1298-1306: Re-check failure criteria after relaxing cargo from fatal to warning

Once cargo absence is no longer fatal (see earlier suggestion), any_failures should reflect import failures and explicit errors only. With the suggested change in _print_system_info, this block is already correct.

You can verify expected exit codes locally:

  • No cargo installed, all imports succeed: exit 0
  • Runtime okay, framework missing: exit 1 (build options printed)
  • Invalid --path: exit 1

1412-1426: Troubleshooting: good CUDA memory tips; keep them explicitly “manual”

Clarifying that CUDA cache clearing is manual (not automated) avoids confusion after removing --clear-cuda-memory. This section reads well.

@keivenchang keivenchang force-pushed the keivenchang/refactor__dynamo_check-better-instructions branch from f7e3f94 to d4d6d6e Compare August 15, 2025 00:10
@keivenchang keivenchang changed the title feat: add memory warnings and improve build instructions feat: improve dynamo_check.py messaging & instructions Aug 15, 2025
@keivenchang keivenchang force-pushed the keivenchang/refactor__dynamo_check-better-instructions branch from 949768d to f9048fa Compare August 20, 2025 06:24
…tting

- Add hostname to System info header
- Display git SHA (12 chars) and commit timestamp in Dynamo header
- Restructure Python section with Torch and PYTHONPATH as child elements
- Place Torch info before PYTHONPATH for better readability
- Add _get_git_info method to retrieve git commit metadata
@keivenchang keivenchang merged commit 770d63c into main Aug 21, 2025
10 of 12 checks passed
@keivenchang keivenchang deleted the keivenchang/refactor__dynamo_check-better-instructions branch August 21, 2025 22:26
hhzhang16 pushed a commit that referenced this pull request Aug 27, 2025
nv-anants pushed a commit that referenced this pull request Aug 28, 2025
KrishnanPrash pushed a commit that referenced this pull request Sep 2, 2025
Co-authored-by: Keiven Chang <[email protected]>
Signed-off-by: Krishnan Prashanth <[email protected]>
nnshah1 pushed a commit that referenced this pull request Sep 8, 2025
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.

5 participants