-
Notifications
You must be signed in to change notification settings - Fork 2k
[TRTLLM-9467][fix] Fix PP+CP combination with helix parallelism #10312
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes add context-parallel (CP) broadcast functionality to distributed communicator classes, extend request queue broadcasting logic to support CP groups, and parameterize integration tests with new generation parallelism configurations while updating test registry entries. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Files:
**/*.{cpp,h,cu,cuh,py}📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Files:
🧠 Learnings (15)📚 Learning: 2025-09-09T09:40:45.658ZApplied to files:
📚 Learning: 2025-09-17T02:48:52.732ZApplied to files:
📚 Learning: 2025-08-06T13:58:07.506ZApplied to files:
📚 Learning: 2025-11-27T09:23:18.742ZApplied to files:
📚 Learning: 2025-07-28T17:06:08.621ZApplied to files:
📚 Learning: 2025-10-22T06:53:47.017ZApplied to files:
📚 Learning: 2025-08-26T09:49:04.956ZApplied to files:
📚 Learning: 2025-08-14T06:36:40.701ZApplied to files:
📚 Learning: 2025-08-13T11:07:11.772ZApplied to files:
📚 Learning: 2025-09-17T06:01:01.836ZApplied to files:
📚 Learning: 2025-12-12T03:27:18.859ZApplied to files:
📚 Learning: 2025-12-12T03:27:08.565ZApplied to files:
📚 Learning: 2025-08-19T12:45:11.997ZApplied to files:
📚 Learning: 2025-08-26T06:07:02.166ZApplied to files:
📚 Learning: 2025-08-28T10:22:02.288ZApplied to files:
🧬 Code graph analysis (2)tensorrt_llm/_torch/distributed/communicator.py (3)
tensorrt_llm/_torch/pyexecutor/executor_request_queue.py (2)
⏰ 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)
🔇 Additional comments (7)
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. Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #30046 [ run ] triggered by Bot. Commit: |
96e915c to
db62a2b
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #30049 [ run ] triggered by Bot. Commit: |
|
PR_Github #30049 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #30058 [ run ] triggered by Bot. Commit: |
658663e to
cc1bb16
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #30059 [ run ] triggered by Bot. Commit: |
9ea59ed to
b50bc7d
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #30069 [ run ] triggered by Bot. Commit: |
|
PR_Github #30069 [ run ] completed with state |
|
PR_Github #30059 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #30090 [ run ] triggered by Bot. Commit: |
|
PR_Github #30090 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #30101 [ run ] triggered by Bot. Commit: |
665a5e3 to
fc12245
Compare
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
fc12245 to
24ec122
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #30116 [ run ] triggered by Bot. Commit: |
|
|
||
| # Broadcast within first tp group before send/recv chain to other tp groups | ||
| if self.dist.tp_size > 1 and self.dist.is_first_pp_rank: | ||
| payloads = self.dist.tp_broadcast(payloads, root=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto tuner also uses tp_broadcast, see
TensorRT-LLM/tensorrt_llm/_torch/autotuner.py
Line 1509 in 46e4af5
| cache_data = self._dist.tp_broadcast(obj=cache_data, root=root) |
tp_cp_broadcast to Distributed and replace all existed usage of tp_broadcast to tp_cp_broadcast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. 4b406b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed Distributed doesn't have parallelism-specific broadcasts like tp_broadcast, for e.g.. So, limited my change to updating MPIDist and TorchDist. Also, updated tests.
|
PR_Github #30116 [ run ] completed with state |
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
4b406b9 to
708dd1d
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #30200 [ run ] triggered by Bot. Commit: |
|
PR_Github #30200 [ run ] completed with state
|
hyukn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
| cache_data = self.profiling_cache.get_specific_custom_op(custom_op) | ||
| root = 0 | ||
| cache_data = self._dist.tp_broadcast(obj=cache_data, root=root) | ||
| cache_data = self._dist.tp_cp_broadcast(obj=cache_data, root=root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. I think there should be no tunable op at this moment during context parallel phase. However, I wonder if all the ranks share the same shapes of input tensors? Because if particular shapes for some ranks exist, the tuner cache from rank 0 might not be sufficient for them.
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
2e8cfdf to
746512c
Compare
Description
This MR fixes a hang issue when pipeline parallelism and context (helix) parallelism are working together.
Background:
Root cause:
executor_request_queue.py, requests are only broadcast to TP groups, but not CP groups.Fix:
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...Provide a user friendly way for developers to interact with a Jenkins server.
Run
/bot [-h|--help]to print this help message.See details below for each supported subcommand.
Details
run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]Launch build/test pipelines. All previously running jobs will be killed.
--reuse-test (optional)pipeline-id(OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.--disable-reuse-test(OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.--disable-fail-fast(OPTIONAL) : Disable fail fast on build/tests/infra failures.--skip-test(OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.--stage-list "A10-PyTorch-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.--gpu-type "A30, H100_PCIe"(OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.--test-backend "pytorch, cpp"(OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.--only-multi-gpu-test(OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.--add-multi-gpu-test(OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.--post-merge(OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".--detailed-log(OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.--debug(OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in thestage-listparameter to access the appropriate container environment. Note: Does NOT update GitHub check status.For guidance on mapping tests to stage names, see
docs/source/reference/ci-overview.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip testing for latest commit on pull request.
--comment "Reason for skipping build/test"is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.reuse-pipeline
reuse-pipelineReuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.