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.
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.
Incomplete GPU retry patterns
Medium Severity
rerun_errorsaddsSTATUS_ALLOC_FAILEDbut still omits thetorch.testing.assert_closewrapper text. OOMs raised insideassert_closesurface asRuntimeError: Comparing...withOutOfMemoryErroronly on__cause__, which--only-rerunnever inspects, so that failure shape still skips retries and can fail a healthy branch under GPU memory pressure.Reviewed by Cursor Bugbot for commit 7ce6dae. Configure here.
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.
The analysis is accurate, but this is a deliberate scope boundary rather than an oversight, and adding the wrapper text would make the filter worse rather than better.
The gap is real and described in the PR body under "Not addressed here", and it is the half of #6917 that is intentionally left open. The reason it is not closed here is that the only available handle is the wrapper text itself, and that text says nothing about memory pressure:
The message carries only the tensor pair repr and boilerplate.
torch.testingemits it for any exception it does not expect during a comparison, so matching it would also retry genuine defects, a dtype bug surfacing as aTypeError, an unsupported layout raisingNotImplementedError, and so on. A deterministic bug would still fail all five attempts, so it would not be hidden, but a nondeterministic one would be silently retried into green, which is precisely what a narrow--only-rerunexists to prevent. Trading a false negative on OOM for a false positive on real bugs is the wrong direction.An earlier revision of this PR did include that pattern and it was removed for this reason.
I verified the resulting behaviour against synthetic failures for each shape. Retried: a directly raised
OutOfMemoryError, andCUBLAS_STATUS_ALLOC_FAILED. Not retried: an OOM wrapped byassert_close, a plain failing assertion, an ordinaryassert_closevalue mismatch, and aTypeErrorraised inside a comparison.The correct place to fix the remaining shape is
pytest-rerunfailures, which matches only the outermost exception:If that walked
__cause__and__context__, the existingOutOfMemoryErrorpattern would match the wrapped case on its own, with no ambiguity and no need for a wrapper-text heuristic. #6917 stays open to track that.