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

Support PyTorch 2.4.1 #1655

Merged
merged 15 commits into from
Oct 21, 2024
Merged
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ body:
description: What version of Heat are you running?
options:
- main (development branch)
- 1.5.x
- 1.4.x
- 1.3.x
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- 'torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2'
- 'torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2'
- 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1'
- 'torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0'
- 'torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1'
exclude:
- py-version: '3.12'
pytorch-version: 'torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2'
Expand Down
29 changes: 15 additions & 14 deletions heat/core/tests/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,20 +581,21 @@ def test_rand(self):
# Assert that no value appears more than once
self.assertTrue((counts == 1).all())

# Two large arrays that were created after each other don't share any values
b = ht.random.rand(14, 7, 3, 12, 18, 42, split=5, comm=ht.MPI_WORLD, dtype=ht.float64)
c = np.concatenate((a.flatten(), b.numpy().flatten()))
_, counts = np.unique(c, return_counts=True)
self.assertTrue((counts == 1).all())

# Values should be spread evenly across the range [0, 1)
mean = np.mean(c)
median = np.median(c)
std = np.std(c)
self.assertTrue(0.49 < mean < 0.51)
self.assertTrue(0.49 < median < 0.51)
self.assertTrue(std < 0.3)
self.assertTrue(((0 <= c) & (c < 1)).all())
if not (torch.cuda.is_available() and torch.version.hip):
# Two large arrays that were created after each other don't share any values
b = ht.random.rand(14, 7, 3, 12, 18, 42, split=5, comm=ht.MPI_WORLD, dtype=ht.float64)
c = np.concatenate((a.flatten(), b.numpy().flatten()))
_, counts = np.unique(c, return_counts=True)
self.assertTrue((counts == 1).all())

# Values should be spread evenly across the range [0, 1)
mean = np.mean(c)
median = np.median(c)
std = np.std(c)
self.assertTrue(0.49 < mean < 0.51)
self.assertTrue(0.49 < median < 0.51)
self.assertTrue(std < 0.3)
self.assertTrue(((0 <= c) & (c < 1)).all())

# No arguments work correctly
ht.random.seed(seed)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
install_requires=[
"mpi4py>=3.0.0",
"numpy>=1.22.0, <2",
"torch>=2.0.0, <2.4.1",
"torch>=2.0.0, <2.4.2",
"scipy>=1.10.0",
"pillow>=6.0.0",
"torchvision>=0.15.2, <0.19.1",
"torchvision>=0.15.2, <0.19.2",
],
extras_require={
"docutils": ["docutils>=0.16"],
Expand Down
Loading