Commit 03bf20c
authored
[autorevert] implement actions layer and logging (#7169)
This pull request:
* introduces a final "Signal Actions" layer (responsible for executing
side effects of processed Signals, like restarts and reverts)
* changes the main entry point for the PyTorch auto-revert Lambda to use
the new signals-based autorevert flow by default.
* for observability, two CH tables are added:
* `autorevert_events_v2`
* `autorevert_state`
See [the
spec](https://github.com/pytorch/test-infra/blob/ff2645443aafb0209d7f546302a5c09d8243cb31/aws/lambda/pytorch-auto-revert/SIGNAL_ACTIONS.md)
for more details.
### Testing
Tested locally (only restart & state logging):
```
HOURS=18 WORKFLOWS=Lint,trunk,pull,inductor python -m pytorch_auto_revert
INFO:root:[v2] Start: workflows=Lint,trunk,pull,inductor hours=18 repo=pytorch/pytorch dry_run=False
INFO:root:[v2] Run timestamp (CH log ts) = 2025-09-16T15:51:18.656175
INFO:pytorch_auto_revert.signal_extraction_datasource:[extract] Fetching jobs: repo=pytorch/pytorch workflows=Lint,trunk,pull,inductor lookback=18h
INFO:pytorch_auto_revert.signal_extraction_datasource:[extract] Jobs fetched: 6738 rows in 45.70s
INFO:pytorch_auto_revert.signal_extraction_datasource:[extract] Fetching tests for 414 job_ids (20 failed jobs) in batches
INFO:pytorch_auto_revert.signal_extraction_datasource:[extract] Test batch 1/1 (size=414)
INFO:pytorch_auto_revert.signal_extraction_datasource:[extract] Tests fetched: 231 rows for 414 job_ids in 1.95s
INFO:root:[v2] Extracted 19 signals
INFO:root:[v2][signal] wf=trunk key=inductor/test_cudagraph_trees.py::test_graph_partition outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=trunk key=test_transformers.py::test_fused_sdp_priority_order_use_compile_False_cuda outcome=Ineligible(reason=<IneligibleReason.NO_SUCCESSES: 'no_successes'>, message='no successful commits present in window')
INFO:root:[v2][signal] wf=trunk key=export/test_hop.py::test_retrace_export_local_map_hop_simple_cuda_float32 outcome=Ineligible(reason=<IneligibleReason.NO_SUCCESSES: 'no_successes'>, message='no successful commits present in window')
INFO:root:[v2][signal] wf=trunk key=inductor/test_cudagraph_trees_expandable_segments.py::test_forward_backward_not_called_backend_inductor outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=trunk key=export/test_hop.py::test_pre_dispatch_export_local_map_hop_simple_cuda_float32 outcome=Ineligible(reason=<IneligibleReason.NO_SUCCESSES: 'no_successes'>, message='no successful commits present in window')
INFO:root:[v2][signal] wf=trunk key=export/test_hop.py::test_serialize_export_local_map_hop_simple_cuda_float32 outcome=Ineligible(reason=<IneligibleReason.NO_SUCCESSES: 'no_successes'>, message='no successful commits present in window')
INFO:root:[v2][signal] wf=trunk key=export/test_hop.py::test_aot_export_local_map_hop_simple_cuda_float32 outcome=Ineligible(reason=<IneligibleReason.NO_SUCCESSES: 'no_successes'>, message='no successful commits present in window')
INFO:root:[v2][signal] wf=trunk key=inductor/test_cudagraph_trees_expandable_segments.py::test_graph_partition outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=trunk key=inductor/test_cudagraph_trees.py::test_forward_backward_not_called_backend_inductor outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=trunk key=distributed/tensor/debug/test_debug_mode.py::test_debug_mode_backward outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=Lint key=lintrunner-noclang / linux-job outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=pull key=linux-jammy-py3.10-clang12 / test outcome=Ineligible(reason=<IneligibleReason.FLAKY: 'flaky'>, message='signal is flaky (mixed outcomes on same commit)')
INFO:root:[v2][signal] wf=trunk key=win-vs2022-cpu-py3 / test outcome=Ineligible(reason=<IneligibleReason.FLAKY: 'flaky'>, message='signal is flaky (mixed outcomes on same commit)')
INFO:root:[v2][signal] wf=inductor key=unit-test / inductor-test / test outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=trunk key=win-vs2022-cpu-py3 / build outcome=RestartCommits(commit_shas={'814338826e0b5cd065f8278c4b9487f13e16a5c7'})
INFO:root:[v2][signal] wf=inductor key=inductor-cpu-test / test outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=trunk key=win-vs2022-cuda12.6-py3 / build outcome=RestartCommits(commit_shas={'814338826e0b5cd065f8278c4b9487f13e16a5c7'})
INFO:root:[v2][signal] wf=inductor key=unit-test / inductor-cpu-build / build outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2][signal] wf=pull key=linux-jammy-py3.13-clang12 / test outcome=Ineligible(reason=<IneligibleReason.FIXED: 'fixed'>, message='signal appears recovered at head')
INFO:root:[v2] Candidate action groups: 1
INFO:root:[v2][action] preparing to execute ActionGroup(type='restart', commit_sha='814338826e0b5cd065f8278c4b9487f13e16a5c7', workflow_target='trunk', sources=[SignalMetadata(workflow_name='trunk', key='win-vs2022-cpu-py3 / build'), SignalMetadata(workflow_name='trunk', key='win-vs2022-cuda12.6-py3 / build')])
INFO:root:[v2][action] restart: skipping pacing (delta_sec=-24852)
INFO:root:[v2] Executed action groups: 0
INFO:root:[v2] State logged
```1 parent e181662 commit 03bf20c
File tree
10 files changed
+806
-8
lines changed- aws/lambda/pytorch-auto-revert
- pytorch_auto_revert
- testers
- tests
- clickhouse_db_schema
- misc.autorevert_events_v2
- misc.autorevert_state
10 files changed
+806
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
Lines changed: 41 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
| |||
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
| |||
189 | 201 | | |
190 | 202 | | |
191 | 203 | | |
192 | | - | |
| 204 | + | |
| 205 | + | |
193 | 206 | | |
194 | | - | |
195 | | - | |
196 | 207 | | |
197 | | - | |
| 208 | + | |
198 | 209 | | |
199 | | - | |
| 210 | + | |
| 211 | + | |
200 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
201 | 235 | | |
202 | 236 | | |
203 | 237 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
Lines changed: 162 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
0 commit comments