Skip to content

Commit ed88f03

Browse files
ci(jax): take a subset by running the script that holds it
ROCm/jax split the multi-accelerator tests into ci/run_pytest_rocm_multi.sh rather than adding a variable that picks a subset, so --test-subset now says which script to run. A ref without that script cannot run the subset on its own, and saying so beats falling back to the whole suite on a runner that was taken for the subset. The environment the two scripts share moved to ci/utilities/rocm_test_env.sh, which is sourced when it is there. A ref from before the split is still read from the marked section of its one script, since the release branches take this one at a time.
1 parent 687bd9e commit ed88f03

6 files changed

Lines changed: 227 additions & 187 deletions

File tree

.github/workflows/multi_arch_build_linux_jax_wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ on:
2323
default: ""
2424
test_scope:
2525
description: >-
26-
"short" runs the single-accelerator tests on the 1-GPU runner,
27-
"full" adds the multi-accelerator tests on the multi-GPU runner, and
28-
"auto" picks from release_type.
26+
"short" runs the suite on the 1-GPU runner, which is the
27+
single-accelerator tests, "full" adds the multi-accelerator tests on
28+
the multi-GPU runner, and "auto" picks from release_type.
2929
type: string
3030
default: "auto"
3131
python_version:

.github/workflows/test_multi_arch_linux_jax_wheels.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ on:
6464
type: string
6565
test_subset:
6666
description: >-
67-
Accelerator subset to run: "all", "single" or "multi". "multi" needs
68-
test_runs_on to be a multi-GPU runner.
67+
Accelerator subset to run: "all", or "multi" for the multi-accelerator
68+
tests alone, which needs test_runs_on to be a multi-GPU runner.
6969
required: false
7070
type: string
7171
default: "all"
@@ -131,8 +131,8 @@ on:
131131
default: "linux-gfx942-1gpu-ccs-csp-ossci-rocm"
132132
test_subset:
133133
description: >-
134-
Accelerator subset to run: "all", "single" or "multi". "multi" needs
135-
test_runs_on to be a multi-GPU runner.
134+
Accelerator subset to run: "all", or "multi" for the multi-accelerator
135+
tests alone, which needs test_runs_on to be a multi-GPU runner.
136136
type: string
137137
default: "all"
138138
permissions:

build_tools/github_actions/configure_jax_test_matrix.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
77
The suite splits in two by the "multiaccelerator" pytest marker. Only that
88
subset needs more than one GPU, and it is a small part of the run, so the two go
9-
to different runners: the single-accelerator tests to the family's 1-GPU runner
10-
and the multi-accelerator tests to its multi-GPU runner.
9+
to different runners: the family's 1-GPU runner takes the suite, which on one
10+
GPU is the single-accelerator tests, and its multi-GPU runner takes the
11+
multi-accelerator script.
1112
1213
Multi-GPU runners are scarce, so the second job is only worth its queue slot
1314
when full testing is asked for. Short testing, which is what a pull request
14-
gets, runs the single-accelerator subset alone.
15+
gets, runs the suite on the 1-GPU runner alone.
1516
"""
1617

1718
import argparse
@@ -35,9 +36,8 @@
3536
TEST_SCOPES = [SCOPE_AUTO, SCOPE_SHORT, SCOPE_FULL]
3637
FULL_SCOPE_RELEASE_TYPES = ["nightly", "prerelease"]
3738

38-
# Mirrors JAXCI_ROCM_TEST_SUBSET in ROCm/jax ci/envs/default.env, which is what
39-
# run_jax_tests.py passes these to.
40-
SUBSET_SINGLE = "single"
39+
# --test-subset of run_jax_tests.py, which is which ROCm/jax suite script runs.
40+
SUBSET_ALL = "all"
4141
SUBSET_MULTI = "multi"
4242

4343

@@ -79,7 +79,7 @@ def build_test_matrix(
7979

8080
single_runner = entry.get("test-runs-on")
8181
if single_runner:
82-
include.append({"test_subset": SUBSET_SINGLE, "test_runs_on": single_runner})
82+
include.append({"test_subset": SUBSET_ALL, "test_runs_on": single_runner})
8383
else:
8484
print(f"No {platform} test runner for {target}, so no tests will run")
8585

build_tools/github_actions/tests/configure_jax_test_matrix_test.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,33 @@ def matrix(self, target="gfx94X-dcgpu", platform="linux", scope="short") -> dict
5858
target=target, platform=platform, scope=scope
5959
)
6060

61-
def test_short_scope_runs_only_the_single_accelerator_subset(self):
61+
def test_short_scope_runs_only_the_single_gpu_job(self):
62+
# On one GPU the suite is the single-accelerator tests.
6263
matrix = self.matrix(scope="short")
6364

64-
self.assertEqual(subsets(matrix), ["single"])
65-
self.assertEqual(runner_for(matrix, "single"), GFX94X_SINGLE_GPU)
65+
self.assertEqual(subsets(matrix), ["all"])
66+
self.assertEqual(runner_for(matrix, "all"), GFX94X_SINGLE_GPU)
6667

6768
def test_full_scope_adds_the_multi_accelerator_subset(self):
6869
matrix = self.matrix(scope="full")
6970

70-
self.assertEqual(subsets(matrix), ["single", "multi"])
71-
self.assertEqual(runner_for(matrix, "single"), GFX94X_SINGLE_GPU)
71+
self.assertEqual(subsets(matrix), ["all", "multi"])
72+
self.assertEqual(runner_for(matrix, "all"), GFX94X_SINGLE_GPU)
7273
self.assertEqual(runner_for(matrix, "multi"), GFX94X_MULTI_GPU)
7374

7475
def test_the_outer_family_key_resolves_too(self):
7576
matrix = self.matrix(target="gfx94x", scope="full")
7677

77-
self.assertEqual(runner_for(matrix, "single"), GFX94X_SINGLE_GPU)
78+
self.assertEqual(runner_for(matrix, "all"), GFX94X_SINGLE_GPU)
7879
self.assertEqual(runner_for(matrix, "multi"), GFX94X_MULTI_GPU)
7980

8081
def test_a_family_without_a_multi_gpu_runner_skips_that_subset(self):
8182
# Those tests need several GPUs, and a 1-GPU runner would skip every one
8283
# of them while reporting a pass.
8384
matrix = self.matrix(target="gfx1151", platform="windows", scope="full")
8485

85-
self.assertEqual(subsets(matrix), ["single"])
86-
self.assertEqual(runner_for(matrix, "single"), "windows-gfx1151-gpu-rocm")
86+
self.assertEqual(subsets(matrix), ["all"])
87+
self.assertEqual(runner_for(matrix, "all"), "windows-gfx1151-gpu-rocm")
8788

8889
def test_an_unknown_family_is_an_error(self):
8990
with self.assertRaises(ValueError):
@@ -117,7 +118,7 @@ def test_the_matrix_a_workflow_consumes(self):
117118
json.loads(outputs["matrix"]),
118119
{
119120
"include": [
120-
{"test_subset": "single", "test_runs_on": GFX94X_SINGLE_GPU},
121+
{"test_subset": "all", "test_runs_on": GFX94X_SINGLE_GPU},
121122
{"test_subset": "multi", "test_runs_on": GFX94X_MULTI_GPU},
122123
]
123124
},
@@ -128,7 +129,7 @@ def test_a_pull_request_gets_one_job_on_the_single_gpu_runner(self):
128129

129130
self.assertEqual(
130131
json.loads(outputs["matrix"]),
131-
{"include": [{"test_subset": "single", "test_runs_on": GFX94X_SINGLE_GPU}]},
132+
{"include": [{"test_subset": "all", "test_runs_on": GFX94X_SINGLE_GPU}]},
132133
)
133134

134135
def test_an_unknown_release_type_is_rejected(self):

0 commit comments

Comments
 (0)