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 and fix patches for PyTorch 1.9.0 on POWER #15919

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ checksums = [
'7a6e512274f0b8673f4f207a5bc53387d88be7e79833f42d20365668b2118071',
# PyTorch-1.9.0_avoid-failures-in-test_unary_ufuncs.patch
'f600e6831f8a03af007845687d1e0f65b2394ca89a9dab5178e2cdc9bd384d43',
'56a46c1690467a7fe7f6b904d152f8a3e2385305c5c29717f66b98b38022bf74', # PyTorch-1.9.0_fix-vsx-vector-functions.patch
'd1f85b2f0f03b500a61b2456d6ec63fccb62f7edc350a820553e2891ec23bf13', # PyTorch-1.9.0_fix-vsx-vector-functions.patch
# PyTorch-1.9.0_skip-lstm-serialization-test.patch
'0fc14e29bd7530bcc09f4212df3c846072b1313216da86b827e102b85d695f49',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ checksums = [
'8e8b417782e2f3004462c32338e12685e7296d15207f3e3087dcb8015e648f98', # PyTorch-1.9.0_fix-testnn-on-A100.patch
# PyTorch-1.9.0_fix-use-after-destruct-in-cudaipctypes.patch
'67960bf9140baf004b07e29f7c2b338e7bc4e4e4f2c931768be44f58526e605f',
'56a46c1690467a7fe7f6b904d152f8a3e2385305c5c29717f66b98b38022bf74', # PyTorch-1.9.0_fix-vsx-vector-functions.patch
'd1f85b2f0f03b500a61b2456d6ec63fccb62f7edc350a820553e2891ec23bf13', # PyTorch-1.9.0_fix-vsx-vector-functions.patch
# PyTorch-1.9.0_increase-test-cuda-tolerance.patch
'73de855ab1ed38043c7fb2a983927786b83d7547aefed926f19e554e2214838a',
# PyTorch-1.9.0_increase-tolerance-for-distributed-tests.patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ checksums = [
'8e8b417782e2f3004462c32338e12685e7296d15207f3e3087dcb8015e648f98', # PyTorch-1.9.0_fix-testnn-on-A100.patch
# PyTorch-1.9.0_fix-use-after-destruct-in-cudaipctypes.patch
'67960bf9140baf004b07e29f7c2b338e7bc4e4e4f2c931768be44f58526e605f',
'56a46c1690467a7fe7f6b904d152f8a3e2385305c5c29717f66b98b38022bf74', # PyTorch-1.9.0_fix-vsx-vector-functions.patch
'd1f85b2f0f03b500a61b2456d6ec63fccb62f7edc350a820553e2891ec23bf13', # PyTorch-1.9.0_fix-vsx-vector-functions.patch
# PyTorch-1.9.0_increase-test-cuda-tolerance.patch
'73de855ab1ed38043c7fb2a983927786b83d7547aefed926f19e554e2214838a',
# PyTorch-1.9.0_increase-tolerance-for-distributed-tests.patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,35 +160,6 @@ index 2a1a87aa72..5bcf818232 100644
}
Vec256<float> C10_ALWAYS_INLINE ceil() const {
return {vec_ceil(_vec0), vec_ceil(_vec1)};
@@ -593,27 +593,7 @@ class Vec256<float> {
}

Vec256<float> C10_ALWAYS_INLINE pow(const Vec256<float>& exp) const {
- auto x = *this;
- auto sign_bit = (*this) & sign_mask;
- // |b|
- auto exp_abs = exp.abs();
- auto exp_trunc = exp.trunc();
- Vec256<float> odd_mask;
- odd_mask._vecb0 = (vec_signed(exp._vec0) & vi_1) != vi_0;
- odd_mask._vecb1 = (vec_signed(exp._vec1) & vi_1) != vi_0;
- // using ln fuction
- auto temp = (abs().log() * exp).exp();
-
- // is odd or even check from Sleef
- auto is_int = (exp == exp_trunc) | (exp_abs >= vcheck);
- auto is_odd = odd_mask & is_int & (exp_abs < vcheck);
- // if even then then pow result should be absolute
- auto temp_sign = temp | sign_bit; // copy_sign
- auto out = blendv(temp, temp_sign, is_odd);
- // x<0 and y != N, then NAN
- auto out1 = blendv(out, v_nan, ((exp.floor() != exp) & (x < zero)));
- // y = 0 then 1
- return blendv(out1, one, (exp_abs == zero));
+ return {Sleef_powf4_u10vsx(_vec0, b._vec0), Sleef_powf4_u10vsx(_vec1, b._vec1)};
}

Vec256<float> fmod(const Vec256<float>& b) const {
@@ -653,8 +616,8 @@ class Vec256<float> {
DEFINE_MEMBER_OP(operator-, float, vec_sub)
DEFINE_MEMBER_OP(operator*, float, vec_mul)
Expand Down