Skip to content

[CI] Add ATen ops signature static check#79304

Open
youge325 wants to merge 4 commits into
PaddlePaddle:developfrom
youge325:fix/aten-compat-signature-all
Open

[CI] Add ATen ops signature static check#79304
youge325 wants to merge 4 commits into
PaddlePaddle:developfrom
youge325:fix/aten-compat-signature-all

Conversation

@youge325

Copy link
Copy Markdown
Contributor

PR Category

Execute Infrastructure

PR Types

Improvements

Description

本 PR 新增 ATen ops 兼容头文件函数签名静态检查,并修复现有 compat ATen ops 头文件中与 libtorch 2.9.1 public API 不一致的签名。

主要改动:

  • 新增 tools/check_aten_ops_signature.py 和单测,并在 ci/static_check.sh 中安装 torch==2.9.1 CPU wheel 后执行检查。
  • 对齐现有 compat ATen ops 头文件的 public 签名,包括默认参数、const/ref 修饰、TensorList 相关类型和 sparse_coo_tensor is_coalesced 参数。
  • 将非 libtorch public 的 helper 或扩展入口移出 public namespace at top-level,保留必要内部实现逻辑。
  • 更新相关 C++ compat 测试,改为使用 libtorch 公开签名入口。

本地验证:

  • python tools/test_check_aten_ops_signature.py
  • python -m py_compile tools/check_aten_ops_signature.py tools/test_check_aten_ops_signature.py
  • python tools/check_aten_ops_signature.py --paddle-root . --torch-include-dir /home/may/libtorch/include --all
  • pre-commit run --files
  • ninja -C build ATen_index_test ATen_squeeze_test ATen_std_var_test ATen_expand_test ATen_split_test ATen_record_stream_test ATen_rename_test c10_layout_test -j16
  • ctest -R '^(ATen_index_test|ATen_squeeze_test|ATen_std_var_test|ATen_expand_test|ATen_split_test|ATen_record_stream_test|ATen_rename_test|c10_layout_test)$' --output-on-failure -j16
  • python -m pip install --dry-run torch==2.9.1 --index-url https://download.pytorch.org/whl/cpu

是否引起精度变化

Copilot AI review requested due to automatic review settings June 11, 2026 07:51

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

PaddlePaddle-bot

This comment was marked as outdated.

@codecov-commenter

codecov-commenter commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@886db26). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #79304   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         4           
  Lines              ?        52           
  Branches           ?         0           
===========================================
  Hits               ?        52           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

PaddlePaddle-bot commented Jun 13, 2026

Copy link
Copy Markdown

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-06-21 00:43:42 UTC+08:00

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


1 Required任务 : 41/48 通过

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
80(0) 80 73 4 2 0 1
任务 错误类型 置信度 日志
Coverage build PR问题 Job
Check approval 需要 Approval Job
Model-Benchmark / Benchmark test 环境问题 Job
CE-Framework / Test 环境问题 Job

2 失败详情

🔴 Coverage build — PR问题(置信度: 高)

错误类型: PR问题 | 置信度: 高
分析器: 通用分析(fallback)
失败用例: 无(coverage build 审批检查)

用例 错误摘要
Check coverage build size requires approval coverage build 体积增长超过 3G,缺少指定 RD approval,脚本 exit 6

关键日志:

-- Build files have been written to: /paddle/prec_build
This PR make the release paddlepaddle coverage build size growth exceeds 3 G ...
Then you must have one RD (swgu98 (Recommend) or luotao1 or risemeup1) approval for this PR
##[error]Process completed with exit code 6.
  • 根因摘要: coverage build 体积增长触发审批门禁
    ci/coverage_build_size_approval.sh 在 develop 分支比较 coverage build 体积,增长超过 3G 时要求 swgu98/luotao1/risemeup1 中至少一人 approval;当前日志显示缺少该审批并退出 6。PR 大量修改/新增 compat ATen 头文件、测试和静态检查脚本,触发了 coverage build 体积门禁。

修复建议:

  1. 在 PR 描述中说明 coverage build 体积增长原因,并请 swgu98(推荐)/luotao1/risemeup1 任一审批;若体积增长非预期,进一步压缩新增 build 产物。

关联变更: ci/static_check.shpaddle/phi/api/include/compat/ATen/**test/cpp/compat/**

🔴 Check approval — 需要 Approval(置信度: 高)

错误类型: 需要 Approval | 置信度: 高
分析器: 内置审批检查
失败用例: 无(人工审批门禁)

用例 错误摘要
Check approval 该 Job 需要人工 Approval,完成审批后 CI 才会继续执行

关键日志:

[FAILURE]: Process completed with exit code 6.
  • 根因摘要: PR 缺少人工 Approval
    该失败为 Approval workflow 的内置门禁,不是测试或编译错误。

修复建议:

  1. 请通过人工审批。

关联变更: 审批门禁,未指向具体源码文件。

🔴 Model-Benchmark / Benchmark test — 环境问题(置信度: 高)

错误类型: 环境问题 | 置信度: 高
分析器: 通用分析(fallback)
失败用例: 按外部 benchmark 用例聚类

用例 错误摘要
PaddleX_semantic_segmentation_Deeplabv3-R50_bs4_fp32_DP_dynamic_N1C1 PaddleX 未注册 Deeplabv3-R50;结果上传脚本调用不存在的 BOS API

关键日志:

selected_cases:PaddleX_semantic_segmentation_Deeplabv3-R50_bs4_fp32_DP_dynamic_N1C1
KeyError: 'Deeplabv3-R50'
AttributeError: 'BosClient' object has no attribute 'put_super_obejct_from_file'. Did you mean: 'put_super_object_from_file'?
Sorry, some models failed to run, Please check the result_html.html.
##[error]Process completed with exit code 10.
  • 根因摘要: 外部 Model-Benchmark/PaddleX 用例配置异常
    失败发生在 /workspace/PaddleX 的模型注册查询和 /workspace/PaddleTest/tools/bos_tools.py 的 BOS 上传逻辑。PR 变更文件集中在 ATen compat 头文件、ci/static_check.sh 和相关 compat 测试,未修改 Model-Benchmark/PaddleX 逻辑;该失败与本 PR 代码关联度低。

修复建议:

  1. 环境问题,请 rerun;若复现,请 Model-Benchmark 维护方修正 Deeplabv3-R50 用例注册/选择配置,并更新 bos_tools.py 的 BOS API 调用。

关联变更: 未发现与本 PR 变更文件直接相关。

🔴 CE-Framework / Test — 环境问题(置信度: 中)

错误类型: 环境问题 | 置信度: 中
分析器: 通用分析(fallback)
失败用例: 无(下载制品阶段失败)

用例 错误摘要
Download Paddle and PaddleTest PaddleTest.tar.gz 下载后解压 exit 2,未进入测试执行

关键日志:

wget -q --tries=5 --no-proxy https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz --no-check-certificate
tar -zvxf PaddleTest.tar.gz 1>/dev/null 2>&1
Downloading PaddleTest.tar.gz
Extracting PaddleTest.tar.gz
##[error]Process completed with exit code 2.
  • 根因摘要: 外部 PaddleTest 制品下载/解压异常
    Job 在 Download Paddle and PaddleTest 步骤失败,尚未安装 Paddle 或执行 CE 测试;tar 的 stderr 被重定向,日志未给出更细的压缩包错误。PR 改动不涉及 PaddleTest 下载脚本或 CE 测试逻辑,因此更符合环境/外部制品异常。

修复建议:

  1. 环境问题,请 rerun;若连续复现,请检查 PaddleTest.tar.gz 源文件完整性和 runner 到 BOS 的下载链路。

关联变更: 未发现与本 PR 变更文件直接相关。

@youge325 youge325 force-pushed the fix/aten-compat-signature-all branch from 5612d76 to 1efedac Compare June 14, 2026 02:25
PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

@youge325 youge325 force-pushed the fix/aten-compat-signature-all branch from 1efedac to eb9a0cd Compare June 19, 2026 03:52
PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

@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-20 22:38:19

📋 Review 摘要

PR 概述:新增 ATen ops 兼容头文件签名静态检查,并对齐一批 compat ATen 入口签名。
变更范围ci/static_check.shtools/check_aten_ops_signature.pypaddle/phi/api/include/compat/ATen/**test/cpp/compat/**
影响面 Tag[Execute Infrastructure] [User Experience]

问题

未发现新的阻塞性问题。历史问题状态见下,PR 规范问题在下面章节报,不在这里重复。

历史 Findings 修复情况

Finding 问题 状态
F1 只收集新增 header,CI 未传 --all ⚠️ 仍存在
F2 transpose 维度参数在范围检查前收窄为 int ✅ 已修复

📝 PR 规范检查

标题 Tag [CI] 不在当前模板枚举中,建议使用:

  • [Execute Infrastructure] Add ATen ops signature static check

PR 描述结构符合模板,是否引起精度变化 已填写为

总体评价

本轮按风险优先审查了 CI 接入、checker 核心解析、transpose 收窄修复,以及索引/稀疏/record_stream 等 compat 入口变更;未全量覆盖其余机械签名调整。历史 F1 仍需要修复,否则新增静态检查在 CI 中仍无法覆盖本 PR 修改的既有 compat 头文件;历史 F2 已由当前 diff 修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants