Skip to content

Conversation

@ooooo-create
Copy link
Contributor

@ooooo-create ooooo-create commented Jan 6, 2026

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

Copilot AI review requested due to automatic review settings January 6, 2026 05:49
@paddle-bot
Copy link

paddle-bot bot commented Jan 6, 2026

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

Copilot AI left a 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_flags function from cpp_extension.py to extension_utils.py
  • Removed redundant CUDA architecture parsing logic from normalize_extension_kwargs function
  • Updated imports: removed unused copy from extension_utils.py, removed unused warnings and collections from cpp_extension.py, added paddle import to extension_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-commenter
Copy link

Codecov Report

❌ Patch coverage is 78.43137% with 11 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@7800d7e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...thon/paddle/utils/cpp_extension/extension_utils.py 78.43% 11 Missing ⚠️

❌ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ooooo-create
Copy link
Contributor Author

/skip-ci coverage 自定义算子流程在覆盖率中采集不到

@SigureMo SigureMo merged commit a31aab9 into PaddlePaddle:develop Jan 7, 2026
126 of 135 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants