[CI]【Hackathon 10th Spring No.45】SM70/SM75 compile guards follow-up - #7331
Closed
r-cloudforge wants to merge 1 commit into
Closed
[CI]【Hackathon 10th Spring No.45】SM70/SM75 compile guards follow-up#7331r-cloudforge wants to merge 1 commit into
r-cloudforge wants to merge 1 commit into
Conversation
|
Thanks for your contribution! |
Author
|
@luotao1 请问方便 review 一下吗?谢谢! |
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 AI Code Review |
2026-04-14 19:46 CST
📋 Review 摘要
PR 概述:为 SM70/SM75 架构添加编译保护宏,避免链接未编译的 kernel 函数
变更范围:custom_ops/gpu_ops/cpp_extensions.cc、custom_ops/setup_ops.py
影响面 Tag:[CI] [OP]
问题
未发现阻塞性问题。
总体评价
这是一个最小化、正确的修复。PR 通过添加 #ifdef ENABLE_SM75_EXT_OPS 和 #ifdef ENABLE_SM80_EXT_OPS 保护宏,成功解决了 V100 (SM70) 和其他架构上因无条件注册未编译 kernel 导致的链接错误问题。宏定义在 setup_ops.py 中正确配置,确保了 host 和 device 编译器都能正确处理条件编译。setup_ops.py 的代码清理(删除 get_compile_parallelism() 函数)不影响功能,宏定义位置保持不变且正确。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
PR #6488 (merged as
-part) introduced T4/V100 compile support but left two registration blocks incpp_extensions.ccunguarded:.cusources compile only at SM≥75, but registration is unconditional → linker error on V100 (SM70)This is a minimal, additive-only fix — 4 lines added, 0 lines removed. See PR #6941 for a full wholesale replacement alternative.
Modifications
custom_ops/gpu_ops/cpp_extensions.cc: Add#ifdef ENABLE_SM75_EXT_OPS/#endifaround 5 cutlass/FP8 ops. Add#ifdef ENABLE_SM80_EXT_OPS/#endifaround 7 tail MoE ops.No changes to
setup_ops.py— keeps #6488's code as-is.Usage or Command
No user-facing changes. Build correctly gates ops per SM tier after this fix.
Accuracy Tests
Guard macro verified in
setup_ops.py:ENABLE_SM75_EXT_OPSandENABLE_SM80_EXT_OPSare both incc_compile_args(host compiler visibility — required for.ccfiles).Wholesale version tested on Baidu AI Studio V100 (pipeline
p-1051a228d3c7).Checklist
cc_compile_args)