Skip to content

test new unittests on develop branch#79418

Open
Manfredss wants to merge 3 commits into
PaddlePaddle:developfrom
Manfredss:test_new_unittest
Open

test new unittests on develop branch#79418
Manfredss wants to merge 3 commits into
PaddlePaddle:developfrom
Manfredss:test_new_unittest

Conversation

@Manfredss

Copy link
Copy Markdown
Contributor

PR Category

Operator Mechanism

PR Types

Not User Facing

Description

test if the added unittests on can pass on develop branch without patch_compat enhancement
related pr: #79391

是否引起精度变化

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

发现一个会导致新增 UT 在 setup 阶段直接失败的阻塞问题,细节已放在行级评论中。

  • P3 优先级:P3 非行级:PR 标题/描述不在 changed diff 中。当前标题和描述更像临时验证说明(“test new unittests on develop branch”),如果这个 PR 准备合入 develop,建议改成正式测试意图,例如“Add compat internal composite API tests”,并在描述里明确新增覆盖点、依赖的 compat 机制以及本地/CI 测试计划;如果只是验证用 PR,建议在描述中明确不作为正式合入内容。
Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.



def setUpModule():
paddle.enable_compat(level=2)

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.

P0 优先级:P0

这里会让新增测试在模块 setup 阶段直接失败。当前 python/paddle/compat/proxy.pyenable_compat 的签名只有 scope/blocked_modules/backend/silent 等关键字参数,没有 level,而 test/compat/CMakeLists.txt 会通过 test_*.py glob 自动注册这个文件;因此运行该 UT 时会先抛出 TypeError: enable_compat() got an unexpected keyword argument 'level',后面的断言都不会执行。

请把 level=2 对应的 top-level paddle.* caller-aware compat 实现随这个 PR 一起引入,或者把这组测试改成当前 develop 已存在的 API 语义。示例修复方向:

# 方案一:先在实现侧支持该测试依赖的 API,并保证 level=2 会切换外部 paddle.* 表面
def enable_compat(
    *,
    level: int | None = None,
    scope: _ScopeType = None,
    blocked_modules: _ScopeType = None,
    backend: Literal["torch"] = "torch",
    silent: bool = False,
) -> None:
    ...

# 方案二:如果本 PR 只验证当前 develop,移除 level=2 假设,改用现有 paddle.compat.* / torch proxy 入口重写断言。

PaddlePaddle-bot

This comment was marked as outdated.

@PaddlePaddle-bot

PaddlePaddle-bot commented Jul 5, 2026

Copy link
Copy Markdown

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-07-08 00:10:35 UTC+08:00

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


1 Required任务 : 31/32 通过

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
123(72) 51 50 1 0 0 0
任务 错误类型 置信度 日志
Fleet Unit test (single card) 环境问题:代理 Bad Gateway Job

2 失败详情

🔴 Fleet Unit test (single card) — 环境问题(置信度: 高)

分析器: 通用分析(fallback)
失败用例: 无,安装阶段失败,测试未执行

用例 错误摘要
Install PaddleFleet 下载 yq_linux_amd64 时代理隧道返回 Bad Gateway,SSL 连接建立失败

关键日志:

2026-07-07T15:42:08Z https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
2026-07-07T15:42:08Z Connecting to 180.76.138.26:18801... connected.
2026-07-07T15:42:13Z Proxy tunneling failed: Bad GatewayUnable to establish SSL connection.
2026-07-07T15:42:13Z ##[error]Process completed with exit code 4.
  • 根因摘要: CI 代理隧道异常导致依赖下载失败
    失败发生在 Install PaddleFleet 步骤,Download paddle.tar.gz and install paddle whlSingle card test 均被跳过,因此没有进入 Fleet 单测执行。PR 仅新增 test/compat/test_compat_internal_composites.py,与安装阶段从 GitHub 下载 yq 的代理/SSL 失败无直接关联。

修复建议:

  1. 环境问题,请 rerun;若持续复现,建议检查 CI 代理 180.76.138.26:18801 或将 yq_linux_amd64 下载源改为 CI 可达镜像/缓存。

关联变更: test/compat/test_compat_internal_composites.py;失败点在安装依赖阶段,未运行该新增测试。

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

新提交已把 paddle.enable_compat(level=2) 改为当前接口支持的 paddle.enable_compat(),上一轮指出的 setup 阶段失败问题在代码层面已解决。本轮没有新增行级意见;CI 仍在运行中,建议等相关测试完成后再合入。

  • P3 优先级:P3 非行级:PR 标题/描述不在 changed diff 中。标题和描述仍偏向临时验证说明(“test new unittests on develop branch”),如果这个 PR 准备正式合入,建议改成例如 [Operator Mechanism] Add compat internal composite tests,并在描述中说明当前覆盖的是 enable_compat() 默认 torch import proxy 下 Paddle composite API 保持 native 行为,而不是 level=2/top-level paddle.* alias 行为。
Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

PaddlePaddle-bot

This comment was marked as outdated.

@paddle-bot paddle-bot Bot added the contributor External developers label Jul 5, 2026
@Manfredss

Copy link
Copy Markdown
Contributor Author

/re-run all-failed

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

已复查最新提交:上一轮指出的 enable_compat(level=2) 阻塞问题仍已解决;本次变更删除了此前 CI 报告中触发 XPU 失败的 nanquantile 用例。本轮没有新增行级意见,当前 CI 还在运行中,建议等相关检查完成后再合入。

  • P3 优先级:P3 非行级:PR 标题/描述不在 changed diff 中。标题和描述仍偏向临时验证说明(“test new unittests on develop branch”)。如果这个 PR 准备正式合入,建议改成例如 [Operator Mechanism] Add compat internal composite tests,并在描述中说明当前覆盖的是 enable_compat() 默认 torch import proxy 下 Paddle composite API 保持 native 行为。
Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

@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-07-07 15:23:16

📋 Review 摘要

PR 概述:新增 compat internal composite 回归测试,验证默认 paddle.enable_compat() 不影响 paddle.* composite 的 native 行为。
变更范围test/compat/test_compat_internal_composites.py
影响面 TagOperator Mechanism

问题

级别 文件 概述
🟡 建议 test/compat/test_compat_internal_composites.py:53 split-family 部分用 zip 比较但没有断言输出分片数量,可能漏掉少返回/多返回结果

📝 PR 规范检查

标题缺少来自模板枚举的 Tag,建议改为以下完整标题:

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

  • [Operator Mechanism] Add compat internal composite tests
PR 描述建议(点击展开,可直接复制)
### PR Category
Operator Mechanism

### PR Types
Not User Facing

### Description
Add compat internal composite regression tests on develop branch to verify that `paddle.enable_compat` keeps internal composite Paddle API calls on native behavior. Covered call chains include split-family APIs, quantile/sort, nan_to_num/equal/where, histogram_bin_edges/min/max, and nll_loss/equal.

related pr: https://github.com/PaddlePaddle/Paddle/pull/79391

### 是否引起精度变化

总体评价

新增测试覆盖目标明确,但 split-family 的输出数量断言需要补强,否则测试可能漏掉分片数量错误。PR 标题/描述仍未按历史规范建议更新。

def test_vsplit(self):
x = np.arange(48, dtype="float32").reshape([4, 4, 3])
outs = paddle.vsplit(paddle.to_tensor(x), 2)
for o, r in zip(outs, np.array_split(x, 2, axis=0)):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 建议 这里直接用 zip(outs, np.array_split(...)) 会截断到较短序列,缺少对返回分片数量的校验。

如果 paddle.vsplit 少返回或多返回分片,只要已有前缀内容碰巧一致,这个测试仍可能通过;hsplitdsplit 里也有同样模式。

建议修复方式:先保存期望结果并断言长度,再逐项比较,例如:

expected = np.array_split(x, 2, axis=0)
self.assertEqual(len(outs), len(expected))
for o, r in zip(outs, expected):
    np.testing.assert_array_equal(o.numpy(), r)

@Manfredss

Copy link
Copy Markdown
Contributor Author

/re-run all-failed

1 similar comment
@Manfredss

Copy link
Copy Markdown
Contributor Author

/re-run all-failed

@paddle-bot

paddle-bot Bot commented Jul 14, 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.

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.

3 participants