-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[0-size Tensor No.45、48、298、99、310、124] Add 0-size Tensor support for dist/diagonal/kthvalue/logaddexp #73027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
CI不是修改代码错误 |
|
|
||
| class TestDistOp_ZeroSize(TestDistOp): | ||
| def init_case(self): | ||
| self.x_shape = (0, 1, 5, 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单测是否可以增加一个x 或 y 只有一个为0 size Tensor的case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
| phi::Full<T, Context>( | ||
| dev_ctx, phi::IntArray(common::vectorize(output->dims())), NAN, output); | ||
| phi::Full<int64_t, Context>( | ||
| dev_ctx, phi::IntArray(common::vectorize(indices->dims())), 0, indices); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output设置为nan没问题。indices设置为0,这个和torch对比过了吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indices 类型是int64_t, int64_t类型没有nan
|
其他修改没有问题了 |
|
https://github.com/PaddlePaddle/Paddle/pull/73027/commits CLA签署有问题,里面有commit是Your Name提交的 |
|
/re-run all-failed |
|
@luotao1 CI已完成 |
DanielSun11
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wanghuancoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个修改了DistInferMeta,但没有修改符号推导,请 @luotao1 协调云飞帮忙确认一下。
PR Category
Execute Infrastructure
PR Types
Improvements
Description
paddle.dist
修改前向,反向,GPU反向和CPU反向相同
infermeta 删除numel为0判断,symbolic_shape中没有对应代码
Paddle/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.cc
Line 718 in cdb4299
kernel 修改 cpu/gpu,前向和反向返回填充0
PaddleAPITest 测试已修复cuda error, 返回是torch error

paddle.diagonal

修改前向和反向,前向返回填充0
infermeta 没有修改
kernel 修改 cpu/gpu/stride
PaddleAPITest 测试已修复cuda error, 返回是torch error
paddle.kthvalue
修改前向和反向
infermeta中有axis维度不能为0的检查,和torch检查相同,没有修改
kernel 修改cpu/gpu
PaddleAPITest 已修改cuda error

torch axis维度检查
paddle.logaddexp 是python端算子,原有错误为subtract算子错误,subtract已修复,
当前PR是增加单测
PaddleAPITest 测试没有cuda error,paddle error 为测试用例形状 broadcast 错误,x, y为0的维度对应的其他值不能大于1
