-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Refactor torch.*solve tests #25733
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
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
test/test_torch.py
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it would matter all that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
Changelog:
Test Plan:
Clears one point specified in the discussion in #24333.