Skip to content

【Bug fix】Fix randn bug in large shape #70492

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

Merged
merged 3 commits into from
Dec 27, 2024

Conversation

Xing-lil
Copy link
Contributor

@Xing-lil Xing-lil commented Dec 26, 2024

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

  • Bug: paddle.randn produces zeros for shapes exceeding the int limit.
  • Solution: The randn gaussian_kernel follows different paths depending on the seed value:
    For seed == 0, convert int to int64_t in WriteData.
    For seed != 0, convert int to int64_t in both WriteData and IndexKernel.
    Add a test to check the value/mean/std for shape exceeds INT_MAX. If not fixed, the value will be 0.

Pcard-70448

Copy link

paddle-bot bot commented Dec 26, 2024

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

Copy link
Contributor

@liym27 liym27 left a comment

Choose a reason for hiding this comment

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

LGTM

@liym27 liym27 merged commit aa54376 into PaddlePaddle:develop Dec 27, 2024
29 checks passed
umiswing pushed a commit to umiswing/Paddle that referenced this pull request Jan 8, 2025
Xing-lil added a commit to Xing-lil/Paddle that referenced this pull request Jan 8, 2025
Xing-lil added a commit to Xing-lil/Paddle that referenced this pull request Jan 8, 2025
sneaxiy pushed a commit that referenced this pull request Jan 9, 2025
GuoxiaWang pushed a commit that referenced this pull request Jan 9, 2025
@Xing-lil Xing-lil changed the title Fix randn bug in large shape 【Bug fix】Fix randn bug in large shape May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants