diff --git a/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a-CUDA-11.3.1.eb b/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a-CUDA-11.3.1.eb index cecec914c702..dbc5b0c5bfdf 100644 --- a/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a-CUDA-11.3.1.eb +++ b/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a-CUDA-11.3.1.eb @@ -33,6 +33,7 @@ patches = [ 'PyTorch-1.10.0_skip_failing_ops_tests.patch', 'PyTorch-1.10.0_skip_nan_tests_openblas.patch', 'PyTorch-1.10.0_skip_cmake_rpath.patch', + 'PyTorch-1.10.0_replace-highlight-assert-tests-regex.patch', ] checksums = [ None, # can't add proper SHA256 checksum, because source tarball is created locally after recursive 'git clone' @@ -63,6 +64,8 @@ checksums = [ '7d3f83e3056d9e47a460790313238f28708beb596cafaa7ae55e374d368bbedf', # PyTorch-1.10.0_skip_cmake_rpath.patch 'ac05943bb205623f91ef140aa00869efc5fe844184bd666bebf5405808610448', + # PyTorch-1.10.0_replace-highlight-assert-tests-regex.patch + 'e20972f465f6a42a95a61fd981889663c7ed6c3ad831ccd6d485919bd3a6c8e4', ] osdependencies = [OS_PKG_IBVERBS_DEV] diff --git a/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a.eb b/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a.eb index c05632ab43ff..5d64d6ea60b9 100644 --- a/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a.eb +++ b/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0-foss-2021a.eb @@ -30,6 +30,7 @@ patches = [ 'PyTorch-1.10.0_increase_zero_optimizer_test_tolerance.patch', 'PyTorch-1.10.0_skip_failing_ops_tests.patch', 'PyTorch-1.10.0_skip_nan_tests_openblas.patch', + 'PyTorch-1.10.0_replace-highlight-assert-tests-regex.patch', ] checksums = [ None, # can't add proper SHA256 checksum, because source tarball is created locally after recursive 'git clone' @@ -57,6 +58,8 @@ checksums = [ '399af94ffcef4a6db5226552c46f11e9b0f0f371b2d7924b9e5764d2281581ab', # PyTorch-1.10.0_skip_nan_tests_openblas.patch '7d3f83e3056d9e47a460790313238f28708beb596cafaa7ae55e374d368bbedf', + # PyTorch-1.10.0_replace-highlight-assert-tests-regex.patch + 'e20972f465f6a42a95a61fd981889663c7ed6c3ad831ccd6d485919bd3a6c8e4', ] osdependencies = [OS_PKG_IBVERBS_DEV] diff --git a/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0_replace-highlight-assert-tests-regex.patch b/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0_replace-highlight-assert-tests-regex.patch new file mode 100644 index 000000000000..4435724fa83f --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0_replace-highlight-assert-tests-regex.patch @@ -0,0 +1,42 @@ +replace assertions by highlight on JIT tests to regular expression match +workaround for issue: https://github.com/pytorch/pytorch/issues/72516 +author: Alex Domingo (Vrije Universiteit Brussel) +--- a/test/jit/test_builtins.py ++++ b/test/jit/test_builtins.py +@@ -86,14 +86,14 @@ + + self.checkScript(fn, ([1, 2, 3],)) + +- with self.assertRaisesRegexWithHighlight(RuntimeError, "undefined value", "a"): ++ with self.assertRaisesRegex(RuntimeError, "undefined value a"): + @torch.jit.script + def fn(x): + a = x ** 2 + del a + return a + +- with self.assertRaisesRegexWithHighlight(RuntimeError, "undefined value", "a"): ++ with self.assertRaisesRegex(RuntimeError, "undefined value a"): + @torch.jit.script + def fn(x): + a = x ** 2 +@@ -101,7 +101,7 @@ + del a + return a + +- with self.assertRaisesRegexWithHighlight(RuntimeError, "undefined value", "b"): ++ with self.assertRaisesRegex(RuntimeError, "undefined value b"): + @torch.jit.script + def fn(x): + a = x ** 2 +--- a/test/test_jit.py ++++ b/test/test_jit.py +@@ -13161,7 +13161,7 @@ dedent """ + if isinstance(t, tuple): + a, b = t + return a + b +- with self.assertRaisesRegexWithHighlight(RuntimeError, "Provided tuple is not fully defined/refined", "t"): ++ with self.assertRaisesRegex(RuntimeError, "Provided tuple is not fully defined/refined"): + s = torch.jit.script(fn) + + def test_augmented_assign(self):