Revert "[TD] More synonyms, new heuristic for test_public_bindings (#130397)"

This reverts commit d8a35d5722.

Reverted https://github.com/pytorch/pytorch/pull/130397 on behalf of https://github.com/clee2000 due to broke lint, probably a landrace ([comment](https://github.com/pytorch/pytorch/pull/130397#issuecomment-2243518651))
This commit is contained in:
PyTorch MergeBot 2024-07-22 18:03:21 +00:00
parent 56bb047449
commit 44e689d947
3 changed files with 0 additions and 39 deletions

View File

@ -23,7 +23,6 @@ from tools.testing.target_determination.heuristics.previously_failed_in_pr impor
PreviouslyFailedInPR,
)
from tools.testing.target_determination.heuristics.profiling import Profiling
from tools.testing.target_determination.heuristics.public_bindings import PublicBindings
if TYPE_CHECKING:
@ -44,5 +43,4 @@ HEURISTICS: list[HeuristicInterface] = [
Profiling(),
LLM(),
Filepath(),
PublicBindings(),
]

View File

@ -25,8 +25,6 @@ keyword_synonyms: dict[str, list[str]] = {
"decomp": ["decomposition", "decompositions"],
"numpy": ["torch_np", "numpy_tests"],
"ops": ["opinfo"],
"hop": ["higher_order_op"],
"aot": ["flex_attention", "autograd"],
}
not_keyword = [

View File

@ -1,35 +0,0 @@
from __future__ import annotations
from typing import Any
from warnings import warn
from tools.testing.target_determination.heuristics.interface import (
HeuristicInterface,
TestPrioritizations,
)
from tools.testing.target_determination.heuristics.utils import query_changed_files
from tools.testing.test_run import TestRun
class PublicBindings(HeuristicInterface):
# Literally just a heuristic for test_public_bindings. Pretty much anything
# that changes the public API can affect this testp
test_public_bindings = "test_public_bindings"
def __init__(self, **kwargs: dict[str, Any]) -> None:
super().__init__(**kwargs)
def get_prediction_confidence(self, tests: list[str]) -> TestPrioritizations:
test_ratings = {}
try:
changed_files = query_changed_files()
except Exception as e:
warn(f"Can't query changed test files due to {e}")
changed_files = []
if any(
file.startswith("torch/") and file.endswith(".py") for file in changed_files
):
test_ratings[TestRun(self.test_public_bindings)] = 1.0
return TestPrioritizations(tests, test_ratings)