Skip to content

Conversation

@co63oc
Copy link
Contributor

@co63oc co63oc commented May 21, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

如果不修改代码测试i0, i1, i0e, i1e没有问题,不确定是否继续修改
image
image

代码中size为0,所以没有影响
image

@paddle-bot
Copy link

paddle-bot bot commented May 21, 2025

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

@paddle-bot paddle-bot bot added the contributor External developers label May 21, 2025
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label May 21, 2025
@DanielSun11
Copy link
Contributor

#71542 修复了GPU kernel使用的ElementwiseKernel。请使用paddleAPITest复测一下修改后的CPU版本。

@co63oc
Copy link
Contributor Author

co63oc commented May 21, 2025

#71542 修复了GPU kernel使用的ElementwiseKernel。请使用paddleAPITest复测一下修改后的CPU版本。

i0, i1 不是 ElementwiseKernel的算子,是单独的kernel
测试CPU版本也没有问题
image

@DanielSun11
Copy link
Contributor

#71542 修复了GPU kernel使用的ElementwiseKernel。请使用paddleAPITest复测一下修改后的CPU版本。

i0, i1 不是 ElementwiseKernel的算子,是单独的kernel 测试CPU版本也没有问题 image

https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/gpu/i0_kernel.cu#L30. I0Kernel 调用的ElementwiseKernel。 I1Kernel 同理。GPU版本应该不需要修复了。请解决一下CI报错,非必要不要新增单测文件,CI容易不过而且还会增加CI的执行时间。

@co63oc
Copy link
Contributor Author

co63oc commented May 21, 2025

https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/gpu/i0_kernel.cu#L30. I0Kernel 调用的ElementwiseKernel。 I1Kernel 同理。GPU版本应该不需要修复了。请解决一下CI报错,非必要不要新增单测文件,CI容易不过而且还会增加CI的执行时间。

已修改CI已完成

@DanielSun11
Copy link
Contributor

PR-CI-Coverage 结果不正常,暂时不能豁免,需要完善一下:

  1. 新增的单测case通过指定在cpu跑试一下能够提高前向kernel的覆盖率。
  2. 单测中没有反向的过程,导致反向的kernel一点没覆盖到。

@co63oc
Copy link
Contributor Author

co63oc commented May 22, 2025

PR-CI-Coverage 结果不正常,暂时不能豁免,需要完善一下:

  1. 新增的单测case通过指定在cpu跑试一下能够提高前向kernel的覆盖率。
  2. 单测中没有反向的过程,导致反向的kernel一点没覆盖到。

已修改为OpTest类,check_grad检测反向, op_test.py中会列出place测试,这样可以测试到CPU环境
image

class TestI0eOp_ZeroSize(OpTest):
    def setUp(self) -> None:
        self.__class__.op_type = "i0e"
        self.op_type = "i0e"
        self.python_api = paddle.i0e
        self.init_config()
        x = np.random.randn(3, 4, 0)
        self.inputs = {'x': x.astype(self.dtype)}
        self.attrs = {}
        self.outputs = {'out': special.i0e(x)}

    def init_config(self):
        self.dtype = np.float32

    def test_check_output(self):
        self.check_output(check_dygraph=True)

    def test_check_grad(self):
        self.check_grad(['x'], 'out', check_dygraph=True)

Copy link
Contributor

@DanielSun11 DanielSun11 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

无需新建单测文件,将单测类合并进原来的单测文件就好

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 0829b98 into PaddlePaddle:develop May 23, 2025
53 of 54 checks passed
@co63oc co63oc deleted the fix95 branch May 25, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants