Commit 0021389
authored
[autorevert] combine test outcomes across shards, prioritizing failures (#7428)
This PR changes the way how test outcome is aggregated across shards.
Ideally this aggregation should not happen (if we had a perfect shard
stripping logic), but this change should act as a "safety net" when:
* same test runs in multiple shards for some reason
* autorevert sharding stripping is imprecise
For the latter, we need a follow up PR to improve the sharding stripping
logic (but that is more involved).
More context:
- The extractor merges shards/partitions by a “base” job name that
strips the parentheses entirely (so “dynamo_wrapped, default, crossref”
all collapse to the same base):
- It builds one per-test outcome per (commit, workflow, base, wf_run_id,
attempt, test_id), but stores only the last seen job’s outcome
(overwriting any earlier job’s outcome for the same test group):
tests_by_group_attempt[key] = outcome uses no job_id in the key)
- In this run, the same test both failed (dynamo_wrapped shard) and
succeeded (default/crossref shards). Because the base collapses all
three into one, and the last-seen row may be from a successful
partition, the failure gets overwritten by success. That’s exactly what
the 2025‑10‑31 16:13:17 state shows:
- E.g. for pull:nn/test_pooling.py::test_max_pool_nan_inf_cpu_float32 at
commit 7d39401fa07e…, the state has status “success” with job_id
54151038879 or 54151220194 under run 18961825600.
- Base-name normalization merges different test partitions
(dynamo_wrapped/default/crossref) into one base, and only the last
per-test outcome seen is kept for a given run/attempt. This can
(non‑deterministically) hide failures when other partitions record a
success for the same test.
### Testing
```
python -m pytorch_auto_revert --dry-run autorevert-checker Lint trunk pull inductor --hours 18 --hud-html
```
Before:
[2025-10-31_16-13-17.html](https://github.com/user-attachments/files/23267036/2025-10-31_16-13-17.html)
After:
[2025-10-31T16-47-04.160494-00-00.html](https://github.com/user-attachments/files/23267038/2025-10-31T16-47-04.160494-00-00.html)1 parent fde861b commit 0021389
File tree
2 files changed
+159
-0
lines changed- aws/lambda/pytorch-auto-revert/pytorch_auto_revert
- tests
2 files changed
+159
-0
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
324 | 332 | | |
| 333 | + | |
| 334 | + | |
325 | 335 | | |
326 | 336 | | |
327 | 337 | | |
| |||
Lines changed: 149 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
528 | 677 | | |
529 | 678 | | |
530 | 679 | | |
0 commit comments