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

[bf16] add bf16 kernel: elementwise_max #39461

Merged
merged 11 commits into from
Feb 21, 2022

Conversation

zhangbo9674
Copy link
Contributor

PR types

New features

PR changes

OPs

Describe

elementwise_max添加 bf16 kernel

@paddle-bot-old
Copy link

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



@unittest.skipIf(
core.is_compiled_with_cuda() and get_cuda_runtime_version() < 11000,
Copy link
Contributor

Choose a reason for hiding this comment

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

not core.is_compiled_with_cuda() or core.cudnn_version() < 8100

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because support cpu bf16 kernel, so change to "core.is_compiled_with_cuda() and core.cudnn_version() < 8100"

@@ -272,7 +274,7 @@ def convert_float_to_uint16(float_list, data_format="NCHW"):
def convert_uint16_to_float(in_list):
in_list = np.asarray(in_list)
out = np.vectorize(
lambda x: struct.unpack('<f', struct.pack('<I', x << 16))[0],
lambda x: struct.unpack('<f', struct.pack('<I', np.uint32(x) << np.uint32(16)))[0],
Copy link
Contributor

Choose a reason for hiding this comment

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

why update this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solve the window-openblas ci error

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@zhangbo9674 zhangbo9674 merged commit 9301633 into PaddlePaddle:develop Feb 21, 2022
@zhangbo9674 zhangbo9674 deleted the dev/bf16_op_5 branch March 2, 2023 02:59
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.

3 participants