Skip to content

[CI]【Hackathon 10th Spring No.45】SM70/SM75 compile guards follow-up - #7331

Closed
r-cloudforge wants to merge 1 commit into
PaddlePaddle:developfrom
CloudForge-Solutions:task/045-t4-v100-compile-guards-part2-v2
Closed

[CI]【Hackathon 10th Spring No.45】SM70/SM75 compile guards follow-up#7331
r-cloudforge wants to merge 1 commit into
PaddlePaddle:developfrom
CloudForge-Solutions:task/045-t4-v100-compile-guards-part2-v2

Conversation

@r-cloudforge

Copy link
Copy Markdown

Motivation

PR #6488 (merged as -part) introduced T4/V100 compile support but left two registration blocks in cpp_extensions.cc unguarded:

  1. 5 cutlass/FP8 ops (lines 1635–1673): .cu sources compile only at SM≥75, but registration is unconditional → linker error on V100 (SM70)
  2. 7 tail MoE/MLA ops (lines 1890–1925): sources compile only at SM≥80, registration unconditional → linker error on SM70/SM75

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 / #endif around 5 cutlass/FP8 ops. Add #ifdef ENABLE_SM80_EXT_OPS / #endif around 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_OPS and ENABLE_SM80_EXT_OPS are both in cc_compile_args (host compiler visibility — required for .cc files).

Wholesale version tested on Baidu AI Studio V100 (pipeline p-1051a228d3c7).

Checklist

  • 4 additive lines, 0 deletions — minimal diff
  • Pre-commit hooks pass (clang-format)
  • Guards use macros visible to host compiler (cc_compile_args)
  • Correct SM tier: cutlass→SM75, MoE→SM80

@paddle-bot

paddle-bot Bot commented Apr 10, 2026

Copy link
Copy Markdown

Thanks for your contribution!

@paddle-bot paddle-bot Bot added the contributor External developers label Apr 10, 2026
@CLAassistant

CLAassistant commented Apr 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

@r-cloudforge

Copy link
Copy Markdown
Author

@luotao1 请问方便 review 一下吗?谢谢!

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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() 函数)不影响功能,宏定义位置保持不变且正确。

@CloudForge-Solutions CloudForge-Solutions closed this by deleting the head repository Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants