Skip python matmul benchmarks that fail due to OOM#3174
Merged
jacobhinkle merged 5 commits intomainfrom Oct 16, 2024
Merged
Conversation
zasdfgbnm
approved these changes
Oct 14, 2024
Collaborator
Author
|
!build --matmul-bench |
jacobhinkle
added a commit
that referenced
this pull request
Oct 21, 2024
Inspired by #3174 Previously we were manually resetting the cuda cache whenever the usage was above 80%. This is not ideal since we could have 79% usage and a test that requires 25% and that would fail. We also might clear the cache unnecessarily sometimes: e.g. we are using 81% but only need a few percent for the remainder of tests. This PR cleans this up by introducing a new test decorator @retry_on_oom_or_skip_test. This decorator must be placed innermost, underneath the other decorators. It will execute the test inside a try block. If the test fails due to torch.OutOfMemoryError, we clear the cuda cache and retry the test. If it fails again due to torch.OutOfMemoryError, then we skip the test.
jacobhinkle
added a commit
that referenced
this pull request
Oct 29, 2024
Inspired by #3174 This is an alternative to #3238. Previously we were manually resetting the cuda cache whenever the usage was above 80%. This is not ideal since we could have 79% usage and a test that requires 25% and that would fail. We also might clear the cache unnecessarily sometimes: e.g. we are using 81% but only need a few percent for the remainder of tests. This PR cleans this up by introducing a new test decorator `@retry_on_oom_or_skip_test`. This decorator must be placed innermost, underneath the other decorators. It will execute the test inside a try block. If the test fails due to `torch.OutOfMemoryError`, we clear the cuda cache and retry the test. If it fails again due to `torch.OutOfMemoryError`, then we skip the test. I updated the python benchmarks to apply this decorator automatically, and to remove the manual `clear_cuda_cache()` calls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm adding this skip so that we can soon expect to run python matmul benchmarks without any failures. Some of these tests use extreme sizes needing over 200GB of memory. Instead of removing these tests, I try to run all tests and skip the ones that fail due to torch OOM error.