[Build] Keep NVSHMEM available for FlashMask#79240
Conversation
|
自查完成:
@SigureMo 麻烦帮忙看一下。这个修复对应 #79233 里 CI-H / Coverage test 的 |
| # DeepEP GPU retired, force disable NVSHMEM for non-XPU builds | ||
| if(NOT WITH_XPU) | ||
| set(WITH_NVSHMEM OFF) | ||
| endif() |
There was a problem hiding this comment.
是否可以,在 XPU OR FA 的场景下开启,感觉不用 FA 的场景也不用 nvshmem
There was a problem hiding this comment.
已按这个方向收窄:
- 先预计算本次构建是否会启用 FlashAttention。
- 非 XPU 下,
WITH_NVSHMEM=ON只有在WITH_GPU + WITH_DISTRIBUTE + sm90 + FlashAttention都满足时才保留;不用 FA 的非 XPU 场景会继续关掉 NVSHMEM。 - XPU 场景不走这个非 XPU gate。
external/nvshmem仍然在external/flashattn前 include,避免 FA overlap 依赖extern_nvshmem时顺序出问题。
也确认没有恢复 GPU DeepEP。
b0fa228 to
472247a
Compare
|
/re-run all-failed |
There was a problem hiding this comment.
Pull request overview
This PR adjusts Paddle’s third-party CMake dependency logic to avoid incorrectly forcing WITH_NVSHMEM=OFF in non-XPU builds, so that FlashMask/FlashAttention overlap scenarios (e.g., H-Coverage) can still pull in NVSHMEM when explicitly requested.
Changes:
- Introduces
FLASHATTN_ENABLEDas a precomputed flag and defersexternal/flashattninclusion until after NVSHMEM handling. - Narrows the non-XPU NVSHMEM “force-off” gate to only disable NVSHMEM when GPU + distributed + sm90 + FlashAttention conditions aren’t met.
- Preserves the intended include ordering:
external/nvshmembeforeexternal/flashattn.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Do not force-disable NVSHMEM for all non-XPU builds after GPU DeepEP retirement. H-Coverage still passes WITH_NVSHMEM=ON for FlashMask V3, and libflashmaskv2 requires NVSHMEM runtime libraries. Co-authored-by: Codex <noreply@openai.com>
472247a to
8ed0a10
Compare
|
/re-run all-failed |
|
merge 下最新 develop 吧,build 一直挂 |
Co-authored-by: Codex <noreply@openai.com>
|
已 merge 最新 本次 merge 带入了
新一轮 CI 已开始,继续看 Linux-build 结果。 |
|
/re-run all-failed |
|
@ShigureNyako build挂了,看下为什么 |
|
看了当前失败的 关键信息:
结论:这是 |
|
@swgu98 我看了当前这次 失败点在 CI 后处理切分/切分前切分支时, 这条更像 runner 工作区 / submodule 状态污染;日志里没有看到 |
|
@ShigureNyako 你真的 merge 最新 develop 了吗?ShigureNyako/Paddle@fix/keep-nvshmem-for-flashmask...PaddlePaddle:Paddle:develop 显示 4 behind! |
|
另外没事不要 force push,都看不到你的改动 |
|
已同步,这次使用普通 merge/push,没有 force push。 刚才 本地检查:
另外收到,后续非必要不再 force push,避免影响看 diff。 |
|
/re-run all-failed |
|
@ShigureNyako 看起来不是 merge 能解决的,看来是 #79230 引入的问题,定位下问题并解决下吧,不然永远合入不了 |
|
收到,我先不改 gloo 相关文件,等 @gouzil 通知。 后续等 PFCCLab/gloo 侧 patch 准备好后,我再只做对应的同步动作:清理 Paddle repo 内的 gloo patch,并更新 |
|
更新一下当前 head
我先不改 gloo 相关内容,也不继续 rerun,等 #79245 进展后再同步/复查。 |
|
从 CMake 配置语义上看,这个方向还可以再收一下:用户显式传入的 当前 PR 相比 #79170 已经明显收窄了影响范围,能恢复 FlashMask / H-Coverage 需要 NVSHMEM 的场景,作为止血修复是合理的。但现在非 XPU 下仍然会根据 我倾向于把“用户是否请求 NVSHMEM”和“当前构建是否满足 NVSHMEM 支持条件”分开处理:
也就是说,这个 PR 现在作为修复 FlashMask 缺 NVSHMEM 的补丁可以接受,但从长期可维护性看,更合理的是尊重用户显式 CMake 参数:能构建就按用户要求构建,不能构建就明确失败并说明原因。 |
|
@ShigureNyako 狗子已经合入了,拉新吧,并且关注下我的评论,我建议你不要太hack过CI,尊重用户的cmake参数,不要盲目nvshmem设为OFF(虽然原本就这么乱写的) |
|
#79245 已合入,我已用普通 merge/push 同步最新 同步后本 PR 相对最新 本地检查:
新一轮 CI 已重新开始,继续看结果。 |
Avoid silently turning a user-provided WITH_NVSHMEM=ON into OFF when the non-XPU NVSHMEM support conditions are not met. Keep the existing internal fallback behavior for non-explicit requests, and report an explicit CMake error for unsupported user requests. Co-authored-by: Codex <noreply@openai.com>
|
@swgu98 已按你的 CMake 语义意见处理,并且 #79245 合入后也已经拉了最新 这次补充改动只在
本地检查通过:
新 commit 导致之前 approve 被 dismiss 了,新一轮 CI 已开始,麻烦再看一下。 |
你怎么比我家猫还人机 @swgu98 |
|
/re-run all-failed |
|
Model-Benchmark rerun 也看过了,当前失败仍是同一个外部 PaddleX benchmark/harness 问题,不是这个 PR 的 NVSHMEM/CMake 变更导致的。 日志里失败点在 这次 rerun job 是: 本 PR 当前相对 develop 的有效改动仍只在 |
|
Coverage test 已完成且通过了;当前 head 剩余失败是:
Linux-DCU 这边日志看起来也是无关 flaky / harness 行为:初始阶段有 Model-Benchmark 的复现问题前面已留证,是外部 PaddleX benchmark/harness 的 我这边尝试过直接 rerun Linux-DCU job,但 GitHub Actions 权限不允许;PR 的 rerun workflow 也没有单独 DCU 入口。因此等 Coverage 结束后,对当前剩余 failed checks 统一做一次 all-failed rerun。 /re-run all-failed |
|
最终同步一下当前 head
本 PR 当前没有新的 NVSHMEM / CMake / FlashMask 相关失败,可以合入了。 |
PR Category
Environment Adaptation
PR Types
Bug fixes
Description
修复 #79170 合入后 H-Coverage / FlashMask V3 仍需要 NVSHMEM 的场景。
#79170 已经在 DeepEP 相关 CMake 入口禁用了 GPU DeepEP;但它额外在
cmake/third_party.cmake中对所有非 XPU 构建强制WITH_NVSHMEM=OFF。这会覆盖 H-Coverage 显式传入的-DWITH_NVSHMEM=ON,导致extern_nvshmem不再进入 third_party 依赖,而libflashmaskv2.so运行时仍需要 NVSHMEM 相关动态库。在 #79233 的 CI-H / Coverage test 中可复现:
本 PR 将 FlashAttention 是否会启用先计算出来,再用于收窄 NVSHMEM gate:
WITH_GPU + WITH_DISTRIBUTE + sm90 + FlashAttention同时满足时,显式WITH_NVSHMEM=ON才会保留。external/nvshmem仍在external/flashattn之前引入,保证 FlashAttention 开启 overlap 时可以依赖extern_nvshmem。相关上下文:
run.sh返回码覆盖是否引起精度变化
否
验证
git diff --checkcmake-format --check cmake/third_party.cmakecmake/third_party.cmakepassed, includingcmake-formatandCMake Lintexternal/nvshmem仍早于external/flashattn,FlashAttention 只 include 一次,且未恢复 GPU DeepEP未运行完整 H-Coverage;该验证需要 CI 环境。