Skip to content

【Hackathon 10th Spring No.51】Apply yaml-cpp GCC 15 compatibility patch - part 5#79233

Merged
swgu98 merged 1 commit into
PaddlePaddle:developfrom
gouzil:codex/yaml-cpp-gcc15-patch
Jun 4, 2026
Merged

【Hackathon 10th Spring No.51】Apply yaml-cpp GCC 15 compatibility patch - part 5#79233
swgu98 merged 1 commit into
PaddlePaddle:developfrom
gouzil:codex/yaml-cpp-gcc15-patch

Conversation

@gouzil

@gouzil gouzil commented Jun 3, 2026

Copy link
Copy Markdown
Member

Copilot AI 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.

Pull request overview

This PR applies a minimal downstream patch to the vendored yaml-cpp submodule to address GCC 15 compilation issues, by ensuring required fixed-width integer types are available during compilation. The patch is wired into Paddle’s third-party build via ExternalProject_Add() so it is automatically applied during dependency preparation.

Changes:

  • Add a yaml-cpp patch that includes <cstdint> in src/emitterutils.cpp (GCC 15 compatibility).
  • Update the yaml-cpp external CMake build to apply the patch during the PATCH_COMMAND step.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
patches/yaml-cpp/emitterutils.cpp.patch Introduces a small upstream-style patch adding <cstdint> include to fix GCC 15 build issues.
cmake/external/yaml.cmake Adds a PATCH_COMMAND to automatically apply the yaml-cpp patch during the external project build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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.

🤖 Paddle-CI-Agent | pr_review | 2026-06-03 23:32:24

📋 Review 摘要

PR 概述:为 yaml-cpp 应用 GCC 15 兼容性补丁,在 emitterutils.cpp 中添加 #include <cstdint>
变更范围cmake/external/patches/yaml-cpp/
影响面 TagBuild

问题

未发现阻塞性问题。PR 规范问题在下面章节报,不要在这里重复。

补充说明(可维护性 P2)YAML_PATCH_COMMAND 使用 git checkout -- . 重置 yaml-cpp 工作目录后再 apply 本补丁。若后续需添加第二个 patch 文件,必须将新 patch 命令追加到同一条指令链git apply patch1 && git apply patch2),否则 git checkout -- . 会在第二个 patch 执行前清除第一个 patch 的效果。建议在注释中明确说明此约束,以降低未来维护风险。

📝 PR 规范检查

标题使用了 Hackathon 任务编号前缀,缺少 Paddle 标准 [Tag] 格式,建议修改为如下形式:

标题建议(可直接复制):

  • [Build] Apply yaml-cpp GCC 15 compatibility patch (Hackathon 10th Spring No.51 - part 5)
PR 描述建议(点击展开,可直接复制)
### PR Category
Environment Adaptation

### PR Types
Devs

### Description
为 yaml-cpp 添加 GCC 15 兼容性补丁:在 `src/emitterutils.cpp` 中补充 `#include <cstdint>` 头文件。

GCC 15 移除了部分隐式传递的标准头文件包含(见 gcc commit 3a817a4),导致 `uint8_t` 等类型不再通过其他头文件间接可用,编译报错。由于 yaml-cpp 上游尚未修复该问题(见 yaml-cpp#1307),暂以补丁方式解决,后续待上游更新后移除。

相关链接:
- https://github.com/jbeder/yaml-cpp/issues/1307
- https://gcc.gnu.org/cgit/gcc/commit/?id=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
- PaddlePaddle/Paddle#79229

### 是否引起精度变化

总体评价

变更精简正确,#include <cstdint> 修复符合 GCC 15 标准变更预期,CMake patch 机制通过 git checkout -- . 保证幂等性。建议在注释中记录多 patch 场景的维护约束,并修正 PR 标题格式。

@ShigureNyako

Copy link
Copy Markdown
Contributor

CI triage 一下(head: fb301d72c2725f4fcabf78c513b91a1b5b108364):

当前还有一个 Coverage test 仍在进行中,为避免重复 CI spam,我暂时没有再发 /re-run all-failed。另外 REVIEW_REQUIRED 是 approval 状态,和本次 CI triage 结论分开看。

@paddle-bot paddle-bot Bot added the contributor External developers label Jun 3, 2026
@PaddlePaddle-bot

PaddlePaddle-bot commented Jun 3, 2026

Copy link
Copy Markdown

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-06-04 18:22:24

CI报告基于以下代码生成(30分钟更新一次):
PR commit: fb301d7 | Merge base: 4f3edc9 (branch: develop)


1 Required任务 : 76/77 通过

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
138(60) 78 76 1 0 0 1
任务 错误类型 置信度 日志
Coverage test 环境问题:FlashMask CI 缺少 NVSHMEM 依赖 Job

2 失败详情

🔴 Coverage test — 环境问题(置信度: 高)

失败用例:

用例 错误摘要
test_flashmask_ci.py::test_flashmask 等 680 个参数化用例 libflashmaskv2.so 依赖的 nvshmem_bootstrap_uid.so.3 缺失;部分大 shape 用例同时出现 MemoryError

关键日志:

RuntimeError: (PreconditionNotMet) The third-party dynamic library (libflashmaskv2.so)
that Paddle depends on is not configured correctly.
(error code is nvshmem_bootstrap_uid.so.3: cannot open shared object file: No such file or directory)
FAILED test_flashmask_ci.py::test_flashmask[...] - RuntimeError: (PreconditionNotMet) ...
FAILED test_flashmask_ci.py::test_flashmask[...] - MemoryError:
=========== 680 failed, 119 passed, 17 skipped in 2264.26s (0:37:44) ===========
  • 根因摘要: FlashMask CI 运行环境缺少 NVSHMEM 依赖
    test/test_flashmask_ci/test_flashmask_ci.py 调用 paddle.nn.functional.flashmask_attention,运行时加载 libflashmaskv2.so 失败,缺失的是容器/镜像动态库 nvshmem_bootstrap_uid.so.3。PR 仅修改 cmake/external/yaml.cmake 和 yaml-cpp patch 文件,不涉及 FlashMask、CUDA/NVSHMEM 或该测试路径。

修复建议:

  1. 环境问题,请 rerun;若复现,请修复 Coverage/FA Test 镜像中的 NVSHMEM 安装或 LD_LIBRARY_PATH 配置,确保 libflashmaskv2.so 可解析 nvshmem_bootstrap_uid.so.3
  2. MemoryError 用例可同步检查该 runner 的 GPU/显存资源是否被占用或不足。

关联变更: 未发现关联;本 PR 变更 cmake/external/yaml.cmakepatches/yaml-cpp/emitterutils.cpp.patch 与 FlashMask 测试无直接代码路径交集。

@ShigureNyako

Copy link
Copy Markdown
Contributor

/re-run all-failed

@ShigureNyako

Copy link
Copy Markdown
Contributor

@SigureMo 我重新看了这条稳定失败:

我已单独开修复 PR:#79240。它只移除这段过宽的非 XPU WITH_NVSHMEM=OFF override,保留原有 WITH_GPU + WITH_DISTRIBUTE + sm90 约束,也不恢复 GPU DeepEP。#79233 本身的 yaml-cpp patch 仍看不出和这个 Coverage 失败有直接关系。

@swgu98 swgu98 merged commit 542447e into PaddlePaddle:develop Jun 4, 2026
146 of 151 checks passed
@SigureMo SigureMo deleted the codex/yaml-cpp-gcc15-patch branch June 4, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers skip-ci: h-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants