Skip to content

update disagg slurm scripts #6248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lingjiew
Copy link

@lingjiew lingjiew commented Jul 22, 2025

Tested the scripts and fix some issues.
These scripts works on Qwen3 as well.

Summary by CodeRabbit

  • Chores
    • Updated script to launch the server process directly without invoking an extra shell.
    • Modified configuration files to use a nested structure for specifying cache data type settings.

Copy link

coderabbitai bot commented Jul 22, 2025

Walkthrough

The changes update a SLURM script to invoke the trtllm-serve command directly, removing the preceding bash. Additionally, a Python script is modified to restructure the configuration dictionary for kv_cache, nesting the dtype under a new kv_cache_config key instead of using a flat key.

Changes

File(s) Change Summary
docs/source/scripts/disaggregated/disaggr_torch.slurm Removed bash from the command launching trtllm-serve, now invoking the server directly.
docs/source/scripts/disaggregated/gen_yaml.py Changed kv_cache config from 'kv_cache_dtype': 'fp8' to 'kv_cache_config': {'dtype': 'fp8'}.

Estimated code review effort

2 (~12 minutes)

Poem

In the warren of code, a script hops anew,
No more "bash" to start, just "serve" will do!
Configs now nestle, dtype tucked in tight,
Rabbits delight in structure just right.
With a twitch of the nose, and a hop of the key,
These tidy changes bring code jubilee!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 docstrings to generate docstrings for this 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

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b85ab13 and 73b1b0a.

📒 Files selected for processing (2)
  • docs/source/scripts/disaggregated/disaggr_torch.slurm (1 hunks)
  • docs/source/scripts/disaggregated/gen_yaml.py (2 hunks)
🔇 Additional comments (2)
docs/source/scripts/disaggregated/gen_yaml.py (1)

200-202: LGTM - Consistent kv_cache configuration restructuring for generation servers.

The configuration change is applied consistently to both context and generation servers, maintaining structural coherence.

docs/source/scripts/disaggregated/disaggr_torch.slurm (1)

99-99: Verify trtllm-serve availability in container image

I didn’t find any trtllm-serve installation steps in Dockerfiles or build scripts, though it’s registered as a CLI entry point in setup.py:247. Please confirm that:

  • The container image used on Qwen3 installs the tensorrt_llm package (so that trtllm-serve is on $PATH).
  • trtllm-serve runs successfully in that environment with the disaggregated flags.

If it’s missing, add the appropriate pip install . or package installation step to your Dockerfile or build pipeline.

Comment on lines +177 to +179
'kv_cache_config': {
'dtype': 'fp8'
},
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

LGTM - Consistent kv_cache configuration restructuring for context servers.

The change from 'kv_cache_dtype': 'fp8' to 'kv_cache_config': {'dtype': 'fp8'} aligns with the updated TensorRT-LLM serving API structure.

Please verify that this configuration format change is compatible with the target TensorRT-LLM version and that existing deployments using the old format have been updated accordingly.


🏁 Script executed:

#!/bin/bash
# Description: Check for any remaining usage of the old kv_cache_dtype format
# Expected: No occurrences of the old format should remain

echo "Searching for old kv_cache_dtype format..."
rg -n "kv_cache_dtype" --type py

echo "Searching for new kv_cache_config format to confirm consistency..."
rg -A 3 "kv_cache_config" --type py

Length of output: 186878


Incomplete Migration of kv_cache_dtype to Nested kv_cache_config

The search revealed numerous remaining references to the old flat kv_cache_dtype format across core scripts, examples, tests, and CLI definitions. Updating only docs/source/scripts/disaggregated/gen_yaml.py will break those workflows. Please either provide backward-compatibility logic or fully migrate all usages to the nested format.

Key areas to address:

  • Core quantization tool: tensorrt_llm/quantization/quantize_by_modelopt.py
  • C++ engine build helper: cpp/tests/resources/scripts/build_gptj_engines.py
  • Example Gen-YAML scripts: examples/wide_ep/slurm_scripts/gen_yaml.py
  • CLI argument definitions and validation: tensorrt_llm/llmapi/llm_args.py & examples/quantization/quantize.py
  • All examples under examples/llm-api/ and examples/llm-eval/
  • Integration and unit tests referencing --kv_cache_dtype= or kv_cache_dtype in code

Suggested action:

  1. Replace every kv_cache_dtype occurrence with kv_cache_config: { dtype: … } in those files, or
  2. Retain a temporary fallback that maps the old key to the new nested structure.
🤖 Prompt for AI Agents
In docs/source/scripts/disaggregated/gen_yaml.py around lines 177 to 179, the
migration from the flat kv_cache_dtype to the nested kv_cache_config structure
is incomplete and inconsistent across the codebase. To fix this, update all
references to kv_cache_dtype in the listed core scripts, examples, CLI
definitions, and tests to use the nested kv_cache_config dictionary with a dtype
key. Alternatively, implement backward-compatibility logic that detects the old
kv_cache_dtype format and converts it to the new nested structure to avoid
breaking existing workflows.

@lingjiew
Copy link
Author

@Shixiaowei02 @qiaoxj07 Could you help to review this PR? Seems like I don't have permission to add reviewers.

@Shixiaowei02
Copy link
Collaborator

@Shixiaowei02 @qiaoxj07 Could you help to review this PR? Seems like I don't have permission to add reviewers.

Sure, thanks

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.

2 participants