Skip to content

Conversation

@co63oc
Copy link
Contributor

@co63oc co63oc commented Jun 6, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

[0-size Tensor No.106、115] Add 0-size Tensor support for slogdet/det

paddle.linalg.slogdet
slogdet前向返回维度是输入去掉结尾两个维度,然后在开头增加一个2,比如输入是[*, M, M] ,返回是[2, *],所以是判断*中是否包含0,并且输入的结尾两个维度需要相同,paddle和torch都有检查
反向是Alloc后return
前向GPU单独文件,其他在impl实现
infermeta没有修改
增加单测

PaddleAPITest测试,已修复cuda error问题,结尾两个维度需要相同,如果不同paddle和torch都有错误
image

paddle.linalg.det
前向和反向维度已设置,判断numel后Alloc返回
前向GPU单独文件,其他在impl实现
infermeta没有修改
增加单测

PaddleAPITest测试,已修复cuda error问题,结尾两个维度需要相同,如果不同paddle和torch都有错误
image

@paddle-bot
Copy link

paddle-bot bot commented Jun 6, 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 Jun 6, 2025
@co63oc co63oc changed the title CI测试不review slogdet [0-size Tensor No.106、115] Add 0-size Tensor support for slogdet/det Jun 6, 2025
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jun 9, 2025
@co63oc
Copy link
Contributor Author

co63oc commented Jun 10, 2025

@DanielSun11 CI已完成请review

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.

建议修改shape推导的部分。除此之外,单测还需要添加[*,M,M]中 M = 0的case。

dev_ctx.template Alloc<T>(out);
return;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

不建议在kernel中重新进行shape推导和Resize操作。如果可以请修改到infermeta中以及同步修改到符号推导中。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

原kernel是在结尾做的Resize,如果修改到infermeta,需要kernel都修改,改动较多
image

return;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

和paddle/phi/kernels/gpu/slogdeterminant_kernel.cu中的修改同理。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

原kernel是在结尾做的Resize,如果修改到infermeta,需要kernel都修改,改动较多

@co63oc
Copy link
Contributor Author

co63oc commented Jun 10, 2025

建议修改shape推导的部分。除此之外,单测还需要添加[*,M,M]中 M = 0的case。

已增加单测

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

@luotao1 luotao1 merged commit 238c658 into PaddlePaddle:develop Jun 11, 2025
50 checks passed
shanjiang7 pushed a commit to shanjiang7/Paddle that referenced this pull request Jun 12, 2025
@co63oc co63oc deleted the b68 branch June 30, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

4 participants