-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Add tests for bfloat16 math functions on CUDA #57984
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
Conversation
🔗 Helpful links
❌ 5 New FailuresAs of commit 0b0a0c7 (more details on the Dr. CI page): Expand to see more
🕵️ 5 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
aten/src/ATen/test/cuda_half_test.cu
Outdated
@@ -51,7 +51,7 @@ __device__ void test(){ | |||
assert(::abs(::acosh(Half(1.0)) - ::acosh(1.0f)) <= threshold); | |||
assert(::abs(::acosh(Half(1.0)) - ::acosh(1.0f)) <= threshold); | |||
assert(::abs(::asinh(Half(1.0)) - ::asinh(1.0f)) <= threshold); | |||
assert(::abs(::atanh(Half(1.0)) - ::atanh(1.0f)) <= threshold); | |||
assert(::abs(::atanh(Half(0.5)) - ::atanh(0.5f)) <= threshold); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did this pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. Very strange.
|
||
using namespace at; | ||
|
||
__device__ void test(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a templated test rather than copy-paste? You can have BFloat16, __nb_bfloat16, __float2bfloat16 and their half counterparts as template parameters, is there anything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Fixed.
This seems fine. @ngimel do you want to make the final call? |
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow For more information, please take a look at the CI Flow Wiki. |
@ngimel This was not merged because a CUDA 11.0 bug causes internal build failure. Is the internal build still using CUDA 11.0 today? |
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
removing |
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
@pytorchbot rebase |
@pytorchbot successfully started a rebase job. Check the current status here |
Rebase failed due to Command
Raised by https://github.com/pytorch/pytorch/actions/runs/2708457304 |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/57984
Note: Links to docs will display an error until the docs builds have been completed. ❌ 6 Failures, 1 PendingAs of commit 2a79341: The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
/easycla As part of the transition to the PyTorch Foundation, this project now requires contributions be covered under the new CLA. See #85559 for additional details. This comment will trigger a new check of this PR. If you are already covered, you will simply see a new "EasyCLA" check that passes. If you are not covered, a bot will leave a new comment with a link to sign. |
@pytorchbot rebase |
@pytorchbot successfully started a rebase job. Check the current status here |
Rebase failed due to Command
Raised by https://github.com/pytorch/pytorch/actions/runs/3527515860 |
@ngimel @zasdfgbnm Do we still want to merge this? |
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
I copy paste
cuda_half_test.cu
tocuda_bfloat16_test.cu
and change it to test bfloat16. It do find a few issues:CUDA_VERSION
sometimes doesn't work on c10 (I don't know the reason), I changed it to use__CUDACC_VER_MAJOR__
insteadoperator __nv_bfloat16()
ofc10::BFloat16
should not be explicit-D__CUDA_NO_BFLOAT16_OPERATORS__
to be consistent with half behaviorassert(::abs(::atanh(Half(1.0)) - ::atanh(1.0f)) <= threshold);
in the test, this doesn't make sense, becauseatanh(1)
is inf.