[CI] Parity: fix flaky-test misattribution in log-based detection#3431
Open
ethanwee1 wants to merge 1 commit into
Open
[CI] Parity: fix flaky-test misattribution in log-based detection#3431ethanwee1 wants to merge 1 commit into
ethanwee1 wants to merge 1 commit into
Conversation
The log-based flaky detector inferred flakiness from the last individual "... PASSED" line seen before a "Test succeeded in new process" marker. That heuristic attaches the flaky flag to whatever test happened to pass most recently, which is often an unrelated test that passed normally much earlier in the shard -- not the test that actually crashed/failed and then passed on rerun. Concrete example (run 29255582284, mi350, inductor/test_compiled_autograd): test_wrap_recreates_contexts_for_repeated_runs passed normally at ~16% and was wrongly reported as flaky, while the test that truly failed-then-passed on rerun was FuncTorchHigherOrderOpTestsWithCompiledAutograd::test_jacfwd. run_test.py already prints an authoritative per-shard summary naming the exact tests: The following tests failed and then succeeded when run in a new process ['test/inductor/test_compiled_autograd.py::...::test_jacfwd'] Parse that line directly instead of guessing. Verified against the real ROCm and CUDA logs from the run above: test_wrap is no longer flagged and test_jacfwd is correctly reported on both platforms.
|
Jenkins build for d4754e65a316ed2984ec89f2a077f8e79d97b842 commit finished as FAILURE |
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.
Summary
The log-based flaky-test detector in
detect_log_failures.pymisattributes flakiness to the wrong test.It inferred flakiness from the last individual
... PASSEDline seen before aTest succeeded in new processmarker. That heuristic tags whichever test happened to pass most recently — usually an unrelated test that passed normally much earlier in the shard — rather than the test that actually crashed/failed and then passed on rerun.Concrete example
From autoparity run
29255582284(mi350,inductor/test_compiled_autograd):WrapTestClassTests::test_wrap_recreates_contexts_for_repeated_runspassed normally at ~16% into the shard (log line 4486), yet was reported as flaky.FuncTorchHigherOrderOpTestsWithCompiledAutograd::test_jacfwd(named on log line 5244).Fix
run_test.pyalready prints an authoritative per-shard summary naming the exact tests:Parse that line directly instead of guessing from nearby
PASSEDlines. Scoped entirely to the flaky-detection path; no other behavior changes.Links / evidence
In the raw ROCm log above: line 4486 is
... test_wrap_recreates_contexts_for_repeated_runs PASSED(normal pass), and line 5244 isThe following tests failed and then succeeded when run in a new process['...::test_jacfwd'](the real flaky test).Testing
1.
py_compile2. Regression check against the real logs from run 29255582284
Download the two upstream shard logs that produced the false positive (rocm job 86759068151, cuda job 86760098157) and run the parser directly:
Before this change (buggy heuristic):
After this change:
test_wrap_recreates_contexts_for_repeated_runs(which passed normally) is no longer flaggedtest_jacfwd(the test that actually failed-then-passed on rerun) is correctly reported on both rocm and cuda, with the correct test shardpy_compilepasses3. End-to-end
Ran a full parity dispatch on the fork with this change and confirmed
flaky_tests_mi350.csvreportstest_jacfwd(nottest_wrap_...) forinductor.test_compiled_autograd.Deployment status
Merged to the fork
ethanwee1/pytorch:mainso it is live on autoparity while this PR is under review. This PR remains the upstream landing target forROCm/pytorch:develop.