-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[CUDAExtension] Refactor the CUDA architecture flag retrieval function #77216
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
[CUDAExtension] Refactor the CUDA architecture flag retrieval function #77216
Conversation
Signed-off-by: ooooo <[email protected]>
|
你的PR提交成功,感谢你对开源项目的贡献! |
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.
Pull request overview
This PR refactors the CUDA architecture flag retrieval functionality by relocating the _get_cuda_arch_flags function from cpp_extension.py to extension_utils.py, where it is more logically placed alongside other CUDA-related utility functions.
Key changes:
- Moved
_get_cuda_arch_flagsfunction fromcpp_extension.pytoextension_utils.py - Removed redundant CUDA architecture parsing logic from
normalize_extension_kwargsfunction - Updated imports: removed unused
copyfromextension_utils.py, removed unusedwarningsandcollectionsfromcpp_extension.py, addedpaddleimport toextension_utils.py
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| python/paddle/utils/cpp_extension/extension_utils.py | Adds _get_cuda_arch_flags function implementation with CUDA architecture detection logic; removes copy import; adds paddle import; updates function calls to use _get_cuda_arch_flags; removes duplicate architecture parsing code from normalize_extension_kwargs |
| python/paddle/utils/cpp_extension/cpp_extension.py | Removes _get_cuda_arch_flags function and its unused imports (warnings, collections) |
| python/paddle/utils/cpp_extension/init.py | Updates export to import _get_cuda_arch_flags from extension_utils instead of cpp_extension |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (78.43%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #77216 +/- ##
==========================================
Coverage ? 78.43%
==========================================
Files ? 1
Lines ? 51
Branches ? 0
==========================================
Hits ? 40
Misses ? 11
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/skip-ci coverage 自定义算子流程在覆盖率中采集不到 |
PR Category
Execute Infrastructure
PR Types
Improvements
Description
之前 Paddle 自定义算子机制适配 dlink 的时候调用了 prepare_unix_cudaflags 来处理 cuda_arch_flags 的逻辑,但是里面调用的 get_cuda_arch_flags 是历史遗留原因写一个 todo, 返回了空列表,导致 nvcc dlink 阶段没有指定 cuda arch