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
CUDA BFloat16 gelu, hardswish, hardsigmoid #44997
Conversation
💊 CI failures summary and remediationsAs of commit 977b89a (more details on the Dr. CI page):
🕵️ 3 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages: pytorch_linux_xenial_py3_clang5_asan_build (1/3)Step: "Build" (full log | diagnosis details | 🔁 rerun)
|
Codecov Report
@@ Coverage Diff @@
## master #44997 +/- ##
==========================================
- Coverage 68.31% 68.19% -0.12%
==========================================
Files 410 410
Lines 53582 53232 -350
==========================================
- Hits 36602 36303 -299
+ Misses 16980 16929 -51
Continue to review full report at Codecov.
|
test/test_torch.py
Outdated
inputValues = [-1000, -4, -3, -2, 0, 2, 3, 4, 1000] | ||
inputValues = [-1000, -4, -3, -2, 0, 2, 3, 4] | ||
if dtype != torch.bfloat16: | ||
inputValues.append(1000) |
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.
what's up with this? Error too large?
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.
Yes
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.
So maybe switching to acc_t for internal computations will actually make it ok?
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.
Do you know if backward for hardswish and hardsigmoid is tested anywhere? Aha, looks like it is tested in test_nn, but only with gradcheck and only for float64. Ok, whatever.
if (self_val < neg_three) { | ||
return zero; | ||
} else if (self_val <= three) { | ||
return grad_val * ((self_val / three) + one_half); |
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.
unrelated to this PR, but I wonder if computations here should be done in accscalar_t
test/test_torch.py
Outdated
inputValues = [-1000, -4, -3, -2, 0, 2, 3, 4, 1000] | ||
inputValues = [-1000, -4, -3, -2, 0, 2, 3, 4] | ||
if dtype != torch.bfloat16: | ||
inputValues.append(1000) |
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.
So maybe switching to acc_t for internal computations will actually make it ok?
test/test_torch.py
Outdated
inputValues = [-1000, -4, -3, -2, 0, 2, 3, 4, 1000] | ||
inputValues = [-1000, -4, -3, -2, 0, 2, 3, 4] | ||
if dtype != torch.bfloat16: | ||
inputValues.append(1000) |
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.
Do you know if backward for hardswish and hardsigmoid is tested anywhere? Aha, looks like it is tested in test_nn, but only with gradcheck and only for float64. Ok, whatever.
ping @ngimel |
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.
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
No description provided.