Skip to content
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

Add BF16 uniform random initializer #32468

Merged
merged 4 commits into from
Apr 29, 2021
Merged

Conversation

wozna
Copy link
Contributor

@wozna wozna commented Apr 22, 2021

PR types

New features

PR changes

OPs

Describe

This PR adds support for the BF16 datatype for the uniform_random operator.
Therefore, in the initializers that I use uniform_random_op, i.e. Uniform, Xavier (uniform) and MSRA (uniform), it will not be necessary to add the cast operators before and after the initializer if the input is BF16, which was changed in the file `initalizer.py

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

jczaja
jczaja previously approved these changes Apr 26, 2021
Copy link
Contributor

@jczaja jczaja 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

@arogowie-intel arogowie-intel left a comment

Choose a reason for hiding this comment

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

Good job. Please just take into account my one comment.

@wozna wozna requested a review from jczaja April 28, 2021 07:09
@wozna
Copy link
Contributor Author

wozna commented Apr 28, 2021

@luotao1 Could you please start your review?
There is an error in PR-CI-OP-benchmark: missing test script of "randint" and "uniform_random" for cuda file.
Should I cover it even if changes are connected only to CPU?

Copy link
Contributor

@luotao1 luotao1 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 f46f15a into PaddlePaddle:develop Apr 29, 2021
@luotao1
Copy link
Contributor

luotao1 commented Apr 29, 2021

Please cherry-pick into release/2.1

wozna added a commit to wozna/Paddle that referenced this pull request Apr 29, 2021
* Add bf16 uniform random initializer

* Remove duplicated section

* Change UT to CPU place only

* Put detail functions into anonymous namespace
lanxianghit pushed a commit that referenced this pull request Apr 29, 2021
* Add bf16 uniform random initializer

* Remove duplicated section

* Change UT to CPU place only

* Put detail functions into anonymous namespace
@wozna wozna deleted the bf16_uniform_r branch February 24, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants