Skip to content

Commit

Permalink
[TD] Enable td on cpu windows (#125049)
Browse files Browse the repository at this point in the history
yolo

Also
* Ensure that at least 1 test always gets run (`//` does truncation which results in 0 if you have too few tests discovered)
* Don't run test removal on slow tests - I'm not touching that yet

I am avoid everything other than pull + trunk workflows, so not doing this on windows CUDA, which runs on periodic
Pull Request resolved: #125049
Approved by: https://github.com/huydhn, https://github.com/ZainRizvi
  • Loading branch information
clee2000 authored and pytorchmergebot committed Apr 29, 2024
1 parent 8ee6105 commit 4d717cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
IS_CI,
IS_LINUX,
IS_MACOS,
IS_WINDOWS,
parser as common_parser,
retry_shell,
set_cwd,
Expand Down Expand Up @@ -1192,9 +1193,12 @@ def parse_args():
and os.getenv("TEST_CONFIG") == "distributed"
and TEST_CUDA
)
or (IS_WINDOWS and not TEST_CUDA)
)
and os.getenv("BRANCH", "") != "main"
and not strtobool(os.environ.get("NO_TD", "False")),
and not strtobool(os.environ.get("NO_TD", "False"))
and "slow" not in os.getenv("TEST_CONFIG", "")
and "slow" not in os.getenv("BUILD_ENVIRONMENT", ""),
)
parser.add_argument(
"additional_unittest_args",
Expand Down
3 changes: 2 additions & 1 deletion tools/testing/target_determination/heuristics/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def get_top_per_tests(self, n: int) -> Tuple[List[TestRun], List[TestRun]]:
"""Divides list of tests into two based on the top n% of scores. The
first list is the top, and the second is the rest."""
tests = [x[1] for x in self._traverse_scores()]
return tests[: n * len(tests) // 100], tests[n * len(tests) // 100 :]
index = n * len(tests) // 100 + 1
return tests[:index], tests[index:]

def get_info_str(self, verbose: bool = True) -> str:
info = ""
Expand Down

0 comments on commit 4d717cd

Please sign in to comment.