[https://nvbugs/5962106][fix] Exclude NCCL_SYMMETRIC from allreduce auto-tuner tactics#12709
[https://nvbugs/5962106][fix] Exclude NCCL_SYMMETRIC from allreduce auto-tuner tactics#12709nv-lschneider wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
Signed-off-by: Ludwig Schneider <lschneider@nvidia.com>
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tensorrt_llm/_torch/custom_ops/torch_custom_ops.py (1)
1805-1827:⚠️ Potential issue | 🔴 CriticalAlso clamp cache misses and persisted tactics to the new tactic set.
At Lines 1813-1819 you intentionally collapse the choices to
[NCCL]for large workspaces, but Line 1856 still hard-codesNCCL_SYMMETRICwhentactic == -1. During preparation, Line 1841 will now skip the symmetric-buffer preallocation for that path as well. So an uncached shape can still automatically take the very tactic this change is trying to exclude, including the large-workspace case you call out as a hang risk.tensorrt_llm/_torch/autotuner.py:553-575also reloads cached tactic IDs without revalidating them againstget_valid_tactics(), so staleNCCL_SYMMETRICentries bypass this filter too. Please make the miss path and cached-tactic validation derive fromvalid_strategiesinstead of hard-coding tactic8(for example, fall back withif tactic not in valid_tactics: tactic = valid_tactics[0]).Also applies to: 1837-1856
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tensorrt_llm/_torch/custom_ops/torch_custom_ops.py` around lines 1805 - 1827, The code narrows allowed strategies into valid_strategies but still hard-codes NCCL_SYMMETRIC/tactic == -1 (and tactic id 8) on the miss path and when reloading cached tactics, so update the miss and cache-reload paths to clamp tactic choices to the computed valid_strategies: wherever you see the fallback logic that sets tactic == -1 or uses literal id 8, replace it with a validation like "valid_tactics = get_valid_tactics(...); if tactic not in valid_tactics: tactic = valid_tactics[0]" (apply this in the preparation/miss path around the tactic selection and in the cached-tactic reload logic in the autotuner), ensuring both uncached misses and persisted cached IDs are validated against valid_strategies before proceeding.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@tensorrt_llm/_torch/custom_ops/torch_custom_ops.py`:
- Around line 1805-1827: The code narrows allowed strategies into
valid_strategies but still hard-codes NCCL_SYMMETRIC/tactic == -1 (and tactic id
8) on the miss path and when reloading cached tactics, so update the miss and
cache-reload paths to clamp tactic choices to the computed valid_strategies:
wherever you see the fallback logic that sets tactic == -1 or uses literal id 8,
replace it with a validation like "valid_tactics = get_valid_tactics(...); if
tactic not in valid_tactics: tactic = valid_tactics[0]" (apply this in the
preparation/miss path around the tactic selection and in the cached-tactic
reload logic in the autotuner), ensuring both uncached misses and persisted
cached IDs are validated against valid_strategies before proceeding.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ae5cd3c7-1ba4-49ee-bee3-e22e3810e8f9
📒 Files selected for processing (1)
tensorrt_llm/_torch/custom_ops/torch_custom_ops.py
|
/bot run --add-multi-gpu --disable-fail-fast |
|
PR_Github #41508 [ run ] triggered by Bot. Commit: |
|
PR_Github #41508 [ run ] completed with state
|
|
/bot run --add-multi-gpu --disable-fail-fast |
|
PR_Github #41552 [ run ] triggered by Bot. Commit: |
hyukn
left a comment
There was a problem hiding this comment.
Thanks @nv-lschneider. We can first bypass the issue in the bug, and then re-enable the tactic after #11589 lands to solve the issue.
|
PR_Github #41552 [ run ] completed with state
|
Summary by CodeRabbit
Description
This removes NCCL_SYMMETRIC from the auto-tuned tactics.
In some CPU starved platforms the auto tuner is unable to evaluate the memcpy + kernel workload for nccl_symmetric.
This is a temporary change until #11589 can be merged. Which removes the 2 part NCCL_SYMMETRIC execution.
See bugs for details.
May have to be cherry picked into release 1.3
Test Coverage
No specific test necessary.
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
To see a list of available CI bot commands, please comment
/bot help.