-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix groupnorm int32 index overflow #1845
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,10 +89,10 @@ def verify_group_norm(self, | |
dx_tst, dw_tst, db_tst = [t.grad.clone() for t in [x, weight, bias]] | ||
|
||
# compare | ||
torch.testing.assert_close(y_tst, y_ref, atol=4e-2, rtol=0) | ||
torch.testing.assert_close(dx_tst, dx_ref, atol=4e-2, rtol=0) | ||
torch.testing.assert_close(dw_tst, dw_ref, atol=4e-2, rtol=0) | ||
torch.testing.assert_close(db_tst, db_ref, atol=4e-2, rtol=0) | ||
torch.testing.assert_close(y_tst, y_ref, atol=7e-2, rtol=0) | ||
torch.testing.assert_close(dx_tst, dx_ref, atol=7e-2, rtol=0) | ||
torch.testing.assert_close(dw_tst, dw_ref, atol=7e-2, rtol=0) | ||
torch.testing.assert_close(db_tst, db_ref, atol=7e-2, rtol=0) | ||
|
||
def test_fp16_one_pass_algo(self): | ||
self.verify_group_norm(cuda_group_norm_nhwc_one_pass, act="") | ||
|
@@ -177,6 +177,7 @@ def test_16_groups(self): | |
[8, 1920, 32, 32], | ||
[8, 1920, 16, 16], | ||
[8, 2560, 8, 8], | ||
[1, 128, 16128, 1200], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems to require about 50 GB, how about checking the memory size like
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've checked seriously, this tensor gots 128 * 16128 * 1200=2,477,260,800 elements, about 5GB. This kernel will take about 10GB, so this check seems not so necessary ? |
||
] | ||
for sz in sizes: | ||
n, c, h, w = sz | ||
|
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.
is this for the large tensor?
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, float reduction accuracy error would grow up with larger tensor