8000 [Not to be merged] Update to compile and run test_torch with 3.13t by albanD · Pull Request #130689 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Not to be merged] Update to compile and run test_torch with 3.13t #130689

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 11 additions & 10 deletions .ci/docker/requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ optree==0.13.0
#test_pointwise_ops.py, test_dtensor_ops.py, test_torchinductor.py, test_fx.py,
#test_fake_tensor.py, test_mps.py

pillow==10.3.0
pillow==10.3.0 ; python_version <= "3.12"
#Description: Python Imaging Library fork
#Pinned versions: 10.3.0
#test that import:
Expand Down Expand Up @@ -223,7 +223,7 @@ pygments==2.15.0
#test that import:

scikit-image==0.19.3 ; python_version < "3.10"
scikit-image==0.22.0 ; python_version >= "3.10"
scikit-image==0.20.0 ; python_version >= "3.10" and python_version <= "3.12"
#Description: image processing routines
#Pinned versions:
#test that import: test_nn.py
Expand All @@ -235,6 +235,7 @@ scikit-image==0.22.0 ; python_version >= "3.10"

scipy==1.10.1 ; python_version <= "3.11"
scipy==1.12.0 ; python_version == "3.12"
scipy>1.14 ; python_version == "3.13"
# Pin SciPy because of failing distribution tests (see #60347)
#Description: scientific python
#Pinned versions: 1.10.1
Expand All @@ -247,7 +248,7 @@ scipy==1.12.0 ; python_version == "3.12"
#Pinned versions:
#test that import:

tb-nightly==2.13.0a20230426
tb-nightly==2.13.0a20230426 ; python_version <= "3.12"
#Description: TensorBoard
#Pinned versions:
#test that import:
Expand All @@ -263,7 +264,7 @@ typing-extensions
#Pinned versions:
#test that import:

unittest-xml-reporting<=3.2.0,>=2.0.0
unittest-xml-reporting<=3.2.0,>=2.0.0 ; python_version <= "3.12"
#Description: saves unit test results to xml
#Pinned versions:
#test that import:
Expand Down Expand Up @@ -303,37 +304,37 @@ z3-solver==4.12.2.0
#Pinned versions:
#test that import:

tensorboard==2.13.0
tensorboard==2.13.0 ; python_version <= "3.12"
#Description: Also included in .ci/docker/requirements-docs.txt
#Pinned versions:
#test that import: test_tensorboard

pywavelets==1.4.1 ; python_version < "3.12"
pywavelets==1.5.0 ; python_version >= "3.12"
pywavelets==1.5.0 ; python_version == "3.12"
#Description: This is a requirement of scikit-image, we need to pin
# it here because 1.5.0 conflicts with numpy 1.21.2 used in CI
#Pinned versions: 1.4.1
#test that import:

lxml==5.0.0
lxml==5.0.0 ; python_version <= "3.12"
#Description: This is a requirement of unittest-xml-reporting

# Python-3.9 binaries

PyGithub==2.3.0
PyGithub==2.3.0 ; python_version <= "3.12"

sympy==1.12.1 ; python_version == "3.8"
sympy==1.13.1 ; python_version >= "3.9"
#Description: Required by coremltools, also pinned in .github/requirements/pip-requirements-macOS.txt
#Pinned versions:
#test that import:

onnx==1.16.1
onnx==1.16.1 ; python_version <= "3.12"
#Description: Required by mypy and test_public_bindings.py when checking torch.onnx._internal
#Pinned versions:
#test that import:

onnxscript==0.1.0.dev20240817
onnxscript==0.1.0.dev20240817 ; python_version <= "3.12"
#Description: Required by mypy and test_public_bindings.py when checking torch.onnx._internal
#Pinned versions:
#test that import:
Expand Down
13 changes: 9 additions & 4 deletions test/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2891,7 +2891,12 @@ def test_diff(self, device, dtype):

# if the given input arg is not a list, it returns a list of single element: [arg]
def _wrap_to_list(self, input_array):
return input_array if isinstance(input_array, list) else [input_array]
if isinstance(input_array, list):
return input_array
elif isinstance(input_array, tuple):
return list(input_array)
else:
return [input_array]

# To ensure inf, -inf, and nan values do not cause divergence between Numpy and PyTorch.
# There are two types of possible divergence:
Expand Down Expand Up @@ -3029,7 +3034,7 @@ def test_gradient_type_promotion(self, device):
# Result is given just as real number and all the imaginary parts to be equal to zero.
self.assertEqual(expected[i].imag, torch.zeros(actual[i].shape), exact_dtype=False)
else:
actual, expected = self._inf_nan_preprocess(list(actual), expected)
actual, expected = self._inf_nan_preprocess(list(actual), self._wrap_to_list(expected))
self.assertEqual(actual, expected, equal_nan=True, exact_dtype=False)

@onlyNativeDeviceTypes
Expand Down Expand Up @@ -7559,10 +7564,10 @@ def test_sobolengine_distribution(self, scramble=False):
torch.mean(sample, dim=0), torch.full((d,), 0.5), atol=2, rtol=2
)
torch.testing.assert_close(
5E5C np.percentile(sample, 25, axis=0), np.repeat(0.25, d), atol=2, rtol=2
np.percentile(sample, 25, axis=0), np.repeat(0.25, d), atol=2, rtol=2, check_dtype=False
)
torch.testing.assert_close(
np.percentile(sample, 75, axis=0), np.repeat(0.75, d), atol=2, rtol=2
np.percentile(sample, 75, axis=0), np.repeat(0.75, d), atol=2, rtol=2, check_dtype=False
)

@skipIfTorchDynamo("np.float64 restored as float32 after graph break.")
Expand Down
Loading
0