[TD] Historical edited files and profiling heuristics (#111510)

Adds files for the heuristics and run them in trial mode.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111510
Approved by: https://github.com/ZainRizvi
This commit is contained in:
Catherine Lee
2023-10-25 19:54:13 +00:00
committed by PyTorch MergeBot
parent 36b3e1789a
commit b33220063d
9 changed files with 125 additions and 35 deletions

View File

@ -24,7 +24,8 @@ TEST_TIMES_FILE = "test-times.json"
TEST_CLASS_TIMES_FILE = "test-class-times.json"
TEST_FILE_RATINGS_FILE = "test-file-ratings.json"
TEST_CLASS_RATINGS_FILE = "test-class-ratings.json"
TD_HEURISTIC_PROFILING_FILE = "td_heuristic_profiling.json"
TD_HEURISTIC_HISTORICAL_EDITED_FILES = "td_heuristic_historical_edited_files.json"
FILE_CACHE_LIFESPAN_SECONDS = datetime.timedelta(hours=3).seconds
@ -136,6 +137,22 @@ def get_test_class_ratings() -> Dict[str, Any]:
)
def get_td_heuristic_historial_edited_files_json() -> Dict[str, Any]:
return get_from_test_infra_generated_stats(
"td_heuristic_historical_edited_files.json",
TD_HEURISTIC_HISTORICAL_EDITED_FILES,
"Couldn't download td_heuristic_historical_edited_files.json, not reordering...",
)
def get_td_heuristic_profiling_json() -> Dict[str, Any]:
return get_from_test_infra_generated_stats(
"td_heuristic_profiling.json",
TD_HEURISTIC_PROFILING_FILE,
"Couldn't download td_heuristic_profiling.json not reordering...",
)
def get_from_test_infra_generated_stats(
from_file: str, to_file: str, failure_explanation: str
) -> Dict[str, Any]: