| commit | 07ec95b17cea4fd180953692f61dca366f07aef2 | [log] [tgz] |
|---|---|---|
| author | Zain Rizvi <ZainR@meta.com> | Fri Sep 29 03:29:04 2023 +0000 |
| committer | PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> | Fri Sep 29 03:29:08 2023 +0000 |
| tree | c0f573eb07c2b5a1cb3e3a6cc0a788b3fe08545c | |
| parent | 3dc479e70b3d41dd5b09e9cfef8f5a993c05626e [diff] |
TD: Fix sorting bug for historical correlations heuristic (#110257) Fix bug where the historical correlations heuristic currently sorts heuristics in the opposite order, ranking the least relevant tests most highly <!-- copilot:poem --> ### <samp>🤖 Generated by Copilot at 70333d1</samp> > _`test_files` sorted_ > _by ratings, high to low_ > _a faster spring test_ Pull Request resolved: https://github.com/pytorch/pytorch/pull/110257 Approved by: https://github.com/clee2000
diff --git a/tools/testing/target_determination/heuristics/correlated_with_historical_failures.py b/tools/testing/target_determination/heuristics/correlated_with_historical_failures.py index c5a7bbf..32534e1 100644 --- a/tools/testing/target_determination/heuristics/correlated_with_historical_failures.py +++ b/tools/testing/target_determination/heuristics/correlated_with_historical_failures.py
@@ -47,5 +47,5 @@ for file in changed_files: for test_file, score in test_file_ratings.get(file, {}).items(): ratings[test_file] += score - prioritize = sorted(ratings, key=lambda x: ratings[x]) + prioritize = sorted(ratings, key=lambda x: -ratings[x]) return prioritize