From 3221ed5b0e4fa6abe6f62820232932244d388e95 Mon Sep 17 00:00:00 2001 From: Jakob Schiotz Date: Sat, 11 Nov 2023 21:21:27 +0100 Subject: [PATCH] Remove patch for GCC bug fixed in #19180 --- ...orkaround-gcc12-avx512-optimizer-bug.patch | 57 ------------------- .../p/PyTorch/PyTorch-2.1.0-foss-2023a.eb | 3 - 2 files changed, 60 deletions(-) delete mode 100644 easybuild/easyconfigs/p/PyTorch/PyTorch-2.0.1_workaround-gcc12-avx512-optimizer-bug.patch diff --git a/easybuild/easyconfigs/p/PyTorch/PyTorch-2.0.1_workaround-gcc12-avx512-optimizer-bug.patch b/easybuild/easyconfigs/p/PyTorch/PyTorch-2.0.1_workaround-gcc12-avx512-optimizer-bug.patch deleted file mode 100644 index ecebd21ea53..00000000000 --- a/easybuild/easyconfigs/p/PyTorch/PyTorch-2.0.1_workaround-gcc12-avx512-optimizer-bug.patch +++ /dev/null @@ -1,57 +0,0 @@ -GCC 12 has a regression causing misoptimization of AVX2 code on AVX512 targets (e.g. via -march=native) -See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112443 - -Workaround this by using code similar to that in the AVX 512 class `vec512` "converting" the mask first. -Condition it on the AVX512VL compiler feature. - -Author: Alexander Grund (TU Dresden) - -diff --git a/aten/src/ATen/cpu/vec/vec256/vec256_int.h b/aten/src/ATen/cpu/vec/vec256/vec256_int.h -index 81e9d687d10..10070109dd3 100644 ---- a/aten/src/ATen/cpu/vec/vec256/vec256_int.h -+++ b/aten/src/ATen/cpu/vec/vec256/vec256_int.h -@@ -71,7 +71,13 @@ public: - } - static Vectorized blendv(const Vectorized& a, const Vectorized& b, - const Vectorized& mask) { -- return _mm256_blendv_epi8(a.values, b.values, mask.values); -+#ifdef __AVX512VL__ -+ auto msb_one = _mm256_set1_epi8(0xFF); -+ auto mask_ = _mm256_cmpeq_epi8(mask, msb_one); -+ return _mm256_blendv_epi8(a, b, mask_); -+#else -+ return _mm256_blendv_epi8(a, b, mask); -+#endif - } - template - static Vectorized arange(int64_t base = 0, step_t step = static_cast(1)) { -@@ -183,7 +189,13 @@ public: - } - static Vectorized blendv(const Vectorized& a, const Vectorized& b, - const Vectorized& mask) { -- return _mm256_blendv_epi8(a.values, b.values, mask.values); -+#ifdef __AVX512VL__ -+ auto msb_one = _mm256_set1_epi8(0xFF); -+ auto mask_ = _mm256_cmpeq_epi8(mask, msb_one); -+ return _mm256_blendv_epi8(a, b, mask_); -+#else -+ return _mm256_blendv_epi8(a, b, mask); -+#endif - } - template - static Vectorized arange(int32_t base = 0, step_t step = static_cast(1)) { -@@ -593,7 +605,13 @@ public: - } - static Vectorized blendv(const Vectorized& a, const Vectorized& b, - const Vectorized& mask) { -- return _mm256_blendv_epi8(a.values, b.values, mask.values); -+#ifdef __AVX512VL__ -+ auto msb_one = _mm256_set1_epi8(0xFF); -+ auto mask_ = _mm256_cmpeq_epi8(mask, msb_one); -+ return _mm256_blendv_epi8(a, b, mask_); -+#else -+ return _mm256_blendv_epi8(a, b, mask); -+#endif - } - template - static Vectorized arange(T base = 0, step_t step = static_cast(1)) { diff --git a/easybuild/easyconfigs/p/PyTorch/PyTorch-2.1.0-foss-2023a.eb b/easybuild/easyconfigs/p/PyTorch/PyTorch-2.1.0-foss-2023a.eb index 026b6680516..d58ab35fd9a 100644 --- a/easybuild/easyconfigs/p/PyTorch/PyTorch-2.1.0-foss-2023a.eb +++ b/easybuild/easyconfigs/p/PyTorch/PyTorch-2.1.0-foss-2023a.eb @@ -29,7 +29,6 @@ patches = [ 'PyTorch-2.0.1_skip-failing-gradtest.patch', 'PyTorch-2.0.1_skip-test_shuffle_reproducibility.patch', 'PyTorch-2.0.1_skip-tests-skipped-in-subprocess.patch', - 'PyTorch-2.0.1_workaround-gcc12-avx512-optimizer-bug.patch', 'PyTorch-2.0.1_workaround-gcc12-destructor-exception-bug.patch', 'PyTorch-2.1.0_disable-gcc12-warning.patch', 'PyTorch-2.1.0_fix-vsx-vector-shift-functions.patch', @@ -75,8 +74,6 @@ checksums = [ '7047862abc1abaff62954da59700f36d4f39fcf83167a638183b1b7f8fec78ae'}, {'PyTorch-2.0.1_skip-tests-skipped-in-subprocess.patch': '166c134573a95230e39b9ea09ece3ad8072f39d370c9a88fb2a1e24f6aaac2b5'}, - {'PyTorch-2.0.1_workaround-gcc12-avx512-optimizer-bug.patch': - '831496b3a2d6bfdfb2b29bbbd96d8dfdff307d48a78d1f974eb882b90a12a9a8'}, {'PyTorch-2.0.1_workaround-gcc12-destructor-exception-bug.patch': '198f2244b7415958f96a2c248bab33491a95454091889824d98b0d4a55f114f3'}, {'PyTorch-2.1.0_disable-gcc12-warning.patch': 'c858b8db0010f41005dc06f9a50768d0d3dc2d2d499ccbdd5faf8a518869a421'},