Skip to content

[Build] Avoid FlashAttention v3 for sm100 builds#79500

Merged
SigureMo merged 3 commits into
PaddlePaddle:developfrom
liuhao2638:develop
Jul 17, 2026
Merged

[Build] Avoid FlashAttention v3 for sm100 builds#79500
SigureMo merged 3 commits into
PaddlePaddle:developfrom
liuhao2638:develop

Conversation

@liuhao2638

Copy link
Copy Markdown
Contributor

PR Category

Environment Adaptation

PR Types

Bug fixes

Description

在 CUDA 12.3 到 13.0 的构建配置中,FlashAttention v3 原先对所有 CUDA_ARCH_BIN >= 90 的架构启用。对于 CUDA_ARCH_BIN=100,这会额外触发 v3 的 sm90 实例化编译,而该路径在 ARM64 + CUDA 13 环境中可能出现 nvcc 编译段错误。

本次修改将 v3 的启用条件收窄到 CUDA_ARCH_BIN == 90。这样编译 100 架构时不会启用 FlashAttention v3,但仍会通过后续 CUDA_ARCH_BIN >= 80 分支编译 v2 FlashAttention。

已执行检查:

  • pre-commit run --files cmake/third_party.cmake
  • pre-commit run --from-ref origin/develop --to-ref HEAD
  • git diff --check -- cmake/third_party.cmake

是否引起精度变化

否。该修改仅调整 FlashAttention v3 的构建开关条件,不修改算子实现或数值计算逻辑。

@paddle-bot

paddle-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

你的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.

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

发现一处需要修复后再合入的构建条件问题,细节已放在行级评论中。PR 标题和描述基本匹配变更;当前仍有部分 CI 任务在运行,本次结论主要基于代码审查。

Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

Comment thread cmake/third_party.cmake

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

已复查,作者在旧线程里的反馈是成立的:上一版建议会让全架构构建不再编译 FAv3。当前 head 仍需要修正这一点,具体修改建议已放在新的行级评论中。

Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

Comment thread cmake/third_party.cmake Outdated
Co-authored-by: risemeup1111 <13125134909@163.com>

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

已复查,上一轮关于全架构包的顾虑已在当前提交中修正,未发现新的阻塞问题。

Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

@SigureMo
SigureMo merged commit 8d917cd into PaddlePaddle:develop Jul 17, 2026
126 of 132 checks passed
SigureMo pushed a commit to risemeup1111/Paddle that referenced this pull request Jul 17, 2026
---------

Co-authored-by: risemeup1111 <13125134909@163.com>
sneaxiy pushed a commit that referenced this pull request Jul 20, 2026
#79500) (#79496)

* [Build] Compile FlashAttention on arm64 platforms (#79488)

---------

Co-authored-by: Claude <noreply@anthropic.com>

* [Build] Avoid FlashAttention v3 for sm100 builds (#79500)


---------

Co-authored-by: risemeup1111 <13125134909@163.com>

---------

Co-authored-by: liuhao2638 <2284903223@qq.com>
Co-authored-by: Claude <noreply@anthropic.com>
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