Refactor torch.*solve tests#25733
Conversation
Changelog: - De-duplicate the code in tests for torch.solve, torch.cholesky_solve, torch.triangular_solve - Skip tests explicitly if requirements aren't met for e.g., if NumPy / SciPy aren't available in the environment - Add generic helpers for these tests in test/common_utils.py Test Plan: - All tests should pass to confirm that the change is not erroneous
b049ba7 to
ad763e0
Compare
ad763e0 to
e740e98
Compare
| b, A, L = cholesky_solve_test_helper((n,), (n, k), cast, upper) | ||
| x = torch.cholesky_solve(b, L, upper=upper) | ||
| b_ = torch.matmul(A, x) | ||
| self.assertEqual(b_, b) |
There was a problem hiding this comment.
In the original test we are checking that the delta is less than 1e-12, should we keep that?
There was a problem hiding this comment.
I don't think it would matter all that much.
There was a problem hiding this comment.
I don't have context on why the original error bound was 1e-12 so I'm a little hesitant to remove it. Does the test still pass with the 1e-12?
There was a problem hiding this comment.
I’ll re-add it to the tests, push and await CI signal. Hope that is fine.
|
Failures are unrelated, and previously failing ROCm test has passed now |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Any chance this has caused spurious failures? I see things like https://circleci.com/gh/pytorch/pytorch/2760063?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link/console: not sure if it's related. |
|
I see no reason why that test would fail. I'll re-open the PR, rebase on master and wait on CI. |
|
I found out the source of the error: it's 276bde3 which enable non default stream testing. I'll skip the test appropriately. |
Summary: Changelog: - De-duplicate the code in tests for torch.solve, torch.cholesky_solve, torch.triangular_solve - Skip tests explicitly if requirements aren't met for e.g., if NumPy / SciPy aren't available in the environment - Add generic helpers for these tests in test/common_utils.py Pull Request resolved: pytorch#25733 Test Plan: - All tests should pass to confirm that the change is not erroneous Clears one point specified in the discussion in pytorch#24333. Differential Revision: D17315330 Pulled By: zou3519 fbshipit-source-id: c72a793e89af7e2cdb163521816d56747fd70a0e
Changelog:
Test Plan:
Clears one point specified in the discussion in #24333.