-
Notifications
You must be signed in to change notification settings - Fork 584
fix(pt): throw errors for GPU tensors and the CPU OP library #4582
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
fix(pt): throw errors for GPU tensors and the CPU OP library #4582
Conversation
@iProzd has triggered a situtation where he used the CUDA-compiled PyTorch along with CPU version of customized OP libraries, and then the OP gave incorrect results since it didn't do any computation. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
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.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- source/op/pt/tabulate_multi_device.cc: Language not supported
📝 WalkthroughWalkthroughThe changes add error handling in several functions of the multi-device operation module. When a function is called with a GPU tensor while GPU support is disabled, the code now throws a runtime error with an explicit message. For CPU tensors, the existing execution path remains intact, ensuring standard computation without interruption. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Operation
Caller->>Operation: Call TabulateFusionSeX(...)
alt Input tensor is on GPU and GPU support disabled
Operation-->>Caller: Throw runtime_error("GPU support not enabled")
else Input tensor is on CPU
Operation-->>Caller: Compute result normally
end
Suggested labels
Suggested reviewers
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (19)
🔇 Additional comments (2)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #4582 +/- ##
==========================================
- Coverage 84.61% 84.60% -0.01%
==========================================
Files 680 680
Lines 64467 64473 +6
Branches 3538 3538
==========================================
- Hits 54547 54546 -1
- Misses 8780 8786 +6
- Partials 1140 1141 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…eling#4582) In another OP which is not in this PR, @iProzd has triggered a situation where he used the CUDA-compiled PyTorch along with the CPU version of customized OP libraries. Then the OP gave incorrect results since it didn't do any computation. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved error messaging for scenarios where GPU operations are attempted without proper support, ensuring you receive clear notifications while CPU functionality remains unaffected. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> (cherry picked from commit f01fa53)
In another OP which is not in this PR, @iProzd has triggered a situation where he used the CUDA-compiled PyTorch along with the CPU version of customized OP libraries. Then the OP gave incorrect results since it didn't do any computation.
Summary by CodeRabbit