[bugfix] Fix CUDA_ERROR_INVALID_DEVICE in trtllm allreduce backend for multi-node setups#2686
[bugfix] Fix CUDA_ERROR_INVALID_DEVICE in trtllm allreduce backend for multi-node setups#2686esmeetu wants to merge 1 commit into
Conversation
Signed-off-by: esmeetu <jasonailu87@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical bug in the trtllm allreduce communication backend that caused CUDA_ERROR_INVALID_DEVICE errors in multi-node environments. The fix ensures that the IPC workspace for all-reduce fusion correctly identifies and utilizes the current CUDA device, preventing device mismatch issues during distributed operations. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request modifies device handling logic in the TensorRT-LLM all-reduce functionality. Import statements are reorganized, and the device selection mechanism for symmetric device memory allocation changes from using per-rank CUDA device indexing to using the current device. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
There was a problem hiding this comment.
Code Review
This pull request addresses a CUDA_ERROR_INVALID_DEVICE bug in the trtllm all-reduce backend for multi-node configurations. The fix involves replacing torch.device("cuda", tp_rank).index with torch.cuda.current_device() when creating a SymmDeviceMemory instance. This is the correct approach, as tp_rank can represent a global rank that is invalid as a local device index in a multi-node setting, while torch.cuda.current_device() correctly provides the local device index. The change is accurate and effectively resolves the issue.
|
resolved in #2662 |
📌 Description
🔍 Related Issues
🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
✅ Pre-commit Checks
pre-commitby runningpip install pre-commit(or used your preferred method).pre-commit install.pre-commit run --all-filesand fixed any reported issues.🧪 Tests
unittest, etc.).Reviewer Notes
Summary by CodeRabbit