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

[Windows][ARC][UT] test_weight_norm.py::TestNNMethod::test_weight_norm_different_type failed with error AssertionError: Tensor-likes are not close! #1401

Open
huaiyuzh opened this issue Feb 24, 2025 · 0 comments
Assignees
Labels
os: Windows Windows Platform

Comments

@huaiyuzh
Copy link
Contributor

[Windows][ARC][UT] tests/gpu/examples/test_weight_norm.py::TestNNMethod::test_weight_norm_different_type failed with error AssertionError: Tensor-likes are not close!

[Error Details]

================= Session test_weight_norm.py =================
test_weight_norm.py::TestNNMethod::test_weight_norm_different_type, FAILED, E AssertionError: Tensor-likes are not close!, 1.980

self = <test_weight_norm.TestNNMethod testMethod=test_weight_norm_different_type>

def test_weight_norm_different_type(self):
    v = torch.randn(8193  8193).requires_grad_(True)
    g = torch.randn(8193).to(torch.float).requires_grad_(True)
    gw = torch.randn(8193  8193)
    w  n = torch._weight_norm_interface(v  g  dim=0)
    w.backward(gw)
    v_xpu = v.detach().clone().to("xpu").requires_grad_(True)
    g_xpu = g.detach().clone().to("xpu").requires_grad_(True)
    w_xpu  n_xpu = torch._weight_norm_interface(v_xpu  g_xpu  dim=0)
    w_xpu.backward(gw.to("xpu"))
    self.assertEqual(w  w_xpu.cpu()  atol=1e-3  rtol=1e-5)
    self.assertEqual(n  n_xpu.cpu()  atol=1e-1  rtol=1e-5)
    self.assertEqual(v.grad  v_xpu.grad.cpu()  atol=1e-3  rtol=1e-5)
  self.assertEqual(g.grad  g_xpu.grad.cpu()  atol=1e-3  rtol=1e-5)

E AssertionError: Tensor-likes are not close!
E
E Mismatched elements: 1 / 8193 (0.0%)
E Greatest absolute difference: 0.5634427070617676 at index (3813 ) (up to 0.001 allowed)
E Greatest relative difference: 2.646775960922241 at index (3813 ) (up to 1e-05 allowed)
E
E To execute this test run the following from the base repo dir:
E python test_weight_norm.py TestNNMethod.test_weight_norm_different_type
E
E This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

test_weight_norm.py:204: AssertionError

@EikanWang EikanWang added the os: Windows Windows Platform label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: Windows Windows Platform
Projects
None yet
Development

No branches or pull requests

3 participants