Skip to content

Conversation

@ccsuzzh
Copy link
Contributor

@ccsuzzh ccsuzzh commented May 27, 2025

修复精度问题

paddle.unique_consecutive

修改历程:
根据ci_ce_cpu和ci_ce_gpu下的error log,发现导致accuracy error报错的原因是因为返回的inverse shape与torch不一致,在PaddleAPITest中重写paddle.unique_consecutive的转换rule进行修复,并且建议增加三个case:

paddle.unique_consecutive(x=Tensor([4, 1],"float64"), return_inverse=True, dtype="int32", )
paddle.unique_consecutive(x=Tensor([4, 1],"float64"), return_counts=True, dtype="int32", )
paddle.unique_consecutive(x=Tensor([4, 1],"float64"), return_inverse=True, return_counts=True, dtype="int32", )

测试结果

image

@paddle-bot
Copy link

paddle-bot bot commented May 27, 2025

Thanks for your contribution!

@cangtianhuang
Copy link
Collaborator

所以确定是:paddle api 与 torch api 设计上行为不一致,而不是 paddle api 精度有误

@ccsuzzh 同学谨慎判断,前者才需要在 PaddleAPITest 处进行行为对齐,后者则需要在 PaddlePaddle 主库中修复~

@ccsuzzh
Copy link
Contributor Author

ccsuzzh commented May 28, 2025

所以确定是:paddle api 与 torch api 设计上行为不一致,而不是 paddle api 精度有误

@ccsuzzh 同学谨慎判断,前者才需要在 PaddleAPITest 处进行行为对齐,后者则需要在 PaddlePaddle 主库中修复~

根据report路径下ci_ce_cpu和ci_ce_gpu下的error log和本地测试复现,return_inverse的值是正确的只是shape与torch对不上

Copy link
Collaborator

@cangtianhuang cangtianhuang 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 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label May 29, 2025
Copy link
Collaborator

@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

@wanghuancoder wanghuancoder merged commit c80d491 into PFCCLab:main May 29, 2025
@ccsuzzh ccsuzzh deleted the unique_consecutive branch June 3, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants