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

Bugs/1627 bug test vmap fails on multi node runs on hardware accelerators #1738

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions heat/core/tests/test_vmap.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import heat as ht
import torch
import os

from .test_suites.basic_test import TestCase

Expand Down Expand Up @@ -79,8 +80,6 @@ def func(x0, m=1, scale=2):
vfunc_torch = torch.vmap(func, (0,), (0,))
y0_torch = vfunc_torch(x0_torch, m=2, scale=3)

print(y0.resplit(None).larray, y0_torch)

self.assertTrue(torch.allclose(y0.resplit(None).larray, y0_torch))

def test_vmap_with_chunks(self):
Expand Down Expand Up @@ -123,7 +122,8 @@ def func(x0, x1, k=2, scale=1e-2):
y0_torch, y1_torch = vfunc_torch(x0_torch, x1_torch, k=5, scale=2.2)

self.assertTrue(torch.allclose(y0.resplit(None).larray, y0_torch))
self.assertTrue(torch.allclose(y1.resplit(None).larray, y1_torch))
tol = 1e-4
self.assertTrue(torch.allclose(y1.resplit(None).larray, y1_torch, atol=tol, rtol=tol))

def test_vmap_catch_errors(self):
# not a callable
Expand Down
Loading