forked from easybuilders/easybuild-easyconfigs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from lexming/20240122121636_new_pr_PyTorch212_p…
…atch Two more patches for PyTorch-2.1.2-foss-2023a-CUDA-12.1.1.eb
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
easybuild/easyconfigs/p/PyTorch/PyTorch-2.1.0_disable-cudnn-tf32-for-too-strict-tests.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Disallow TF32 on tests with thresholds too strict for this data type. Nvidia | ||
GPUs with TF32 support default to this data type instead of regular FP32 to | ||
improve performance at the expense of precision. | ||
author: Alex Domingo (Vrije Universiteit Brussel) | ||
--- test/test_nn.py.orig 2024-01-15 14:07:35.421908795 +0100 | ||
+++ test/test_nn.py 2024-01-15 14:54:00.867537101 +0100 | ||
@@ -3762,6 +3761,7 @@ | ||
self.assertEqual(weight_data, all_vars[4].data) | ||
|
||
@unittest.skipIf(not TEST_CUDNN, 'CUDNN not available') | ||
+ @torch.backends.cudnn.flags(enabled=True, allow_tf32=False) | ||
def test_cudnn_weight_tying(self): | ||
rnns = [ | ||
nn.LSTM(10, 20, batch_first=True, bidirectional=True), | ||
@@ -4461,6 +4461,7 @@ | ||
self._test_RNN_cpu_vs_cudnn(1) | ||
|
||
@unittest.skipIf(not TEST_CUDNN, "needs cudnn") | ||
+ @torch.backends.cudnn.flags(enabled=True, allow_tf32=False) | ||
def test_RNN_cudnn_weight_norm(self): | ||
input_size = 10 | ||
hidden_size = 6 | ||
@@ -4492,6 +4493,7 @@ | ||
check_weight_norm(nn.LSTM(input_size, hidden_size, num_layers, proj_size=3), 'weight_hr_l0') | ||
|
||
@unittest.skipIf(not TEST_CUDA, 'CUDA not available') | ||
+ @torch.backends.cudnn.flags(enabled=True, allow_tf32=False) | ||
def test_partial_flat_weights(self): | ||
input_size = 10 | ||
hidden_size = 6 | ||
--- test/jit/test_freezing.py.orig 2024-01-15 14:38:11.054125484 +0100 | ||
+++ test/jit/test_freezing.py 2024-01-15 14:49:41.689011617 +0100 | ||
@@ -2733,7 +2733,11 @@ | ||
else: | ||
FileCheck().check("aten::cudnn_convolution_relu").run(frozen_mod.graph) | ||
|
||
- self.assertEqual(mod_eager(inp), frozen_mod(inp)) | ||
+ if not TEST_WITH_ROCM: | ||
+ with torch.backends.cudnn.flags(enabled=True, allow_tf32=False): | ||
+ self.assertEqual(mod_eager(inp), frozen_mod(inp)) | ||
+ else: | ||
+ self.assertEqual(mod_eager(inp), frozen_mod(inp)) | ||
|
||
@unittest.skipIf(not (TEST_CUDNN or TEST_WITH_ROCM), "requires CUDNN") | ||
def test_freeze_conv_relu_fusion_not_forward(self): | ||
--- ../PyTorch/2.1.2/foss-2023a-CUDA-12.1.1/pytorch-v2.1.2/test/nn/test_convolution.py 2023-12-15 03:03:27.000000000 +0100 | ||
+++ test/nn/test_convolution.py 2024-01-15 15:03:15.606208376 +0100 | ||
@@ -518,7 +518,7 @@ | ||
# Covering special case when group > 1, input-channel / group < 16 and output-channel is multiple of 16 | ||
# See also https://github.com/pytorch/pytorch/pull/18463#issuecomment-476563686 | ||
# and https://github.com/pytorch/pytorch/pull/18463#issuecomment-477001024 | ||
- @torch.backends.cudnn.flags(enabled=True, benchmark=False) | ||
+ @torch.backends.cudnn.flags(enabled=True, benchmark=False, allow_tf32=False) | ||
def test_Conv2d_groups_nobias_v2(self): | ||
torch.manual_seed(123) | ||
dev_dtypes = [("cpu", torch.float)] |
19 changes: 19 additions & 0 deletions
19
easybuild/easyconfigs/p/PyTorch/PyTorch-2.1.0_skip-test-linalg-svd-complex.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Skip test_python_ref_meta__refs_linalg_svd_cpu_complex | ||
Result varies depending on underlying device | ||
see https://github.com/pytorch/pytorch/issues/105068 | ||
author: Alex Domingo (Vrije Universiteit Brussel) | ||
--- test/test_ops.py.orig 2024-01-16 15:37:02.596411122 +0100 | ||
+++ test/test_ops.py 2024-01-16 15:39:02.824489395 +0100 | ||
@@ -311,6 +311,12 @@ | ||
return out | ||
return x | ||
|
||
+ # Skip test_python_ref_meta__refs_linalg_svd_cpu_complex | ||
+ # Result varies depending on underlying device | ||
+ # see https://github.com/pytorch/pytorch/issues/105068 | ||
+ if op.name == '_refs.linalg.svd' and dtype in (torch.complex64, torch.complex128): | ||
+ self.skipTest("Unreliable on certain devices, see issue #105068") | ||
+ | ||
# TODO: iterate over requires_grad true/false | ||
for sample in op.reference_inputs(device, dtype, requires_grad=False): | ||
result = op(sample.input, *sample.args, **sample.kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters