Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
test:
name: Run tests on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
Expand All @@ -48,10 +49,13 @@ jobs:
- name: Run tests
# --doctest-modules imports jax at collection time, before conftest's session
# fixture runs, so the device-count flags must be set in the environment here.
# JAXDECOMP_SKIP_PRIME_TESTS: the prime-sized FFTs deadlock XLA's CPU collective
# rendezvous on 4-core runners (thread starvation), see the conftest note.
env:
JAX_PLATFORM_NAME: cpu
XLA_FLAGS: "--xla_force_host_platform_device_count=8"
run: uv run pytest -v
JAXDECOMP_SKIP_PRIME_TESTS: '1'
run: uv run pytest -v --timeout=600 --timeout-method=thread

docs:
name: Build documentation
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ test = [
"pytest>=8.0.0",
"pytest-cov",
"pytest-mock",
"pytest-timeout",
"chex",
]
benchmark = [
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
setup_done = False
on_cluster = False

# XLA CPU collective starvation: on core-limited machines (e.g. 4-core CI runners), the
# prime-sized shapes exercise long-running all_to_all collectives that deadlock the XLA CPU
# rendezvous. CI sets JAXDECOMP_SKIP_PRIME_TESTS=1 to skip them; local machines and the
# cluster (where the tests pass and matter) run them by default.
skip_prime_tests = os.environ.get('JAXDECOMP_SKIP_PRIME_TESTS', '0') == '1'


def is_on_cluster():
global on_cluster
Expand Down
9 changes: 8 additions & 1 deletion tests/test_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
create_spmd_array,
initialize_distributed,
is_on_cluster,
skip_prime_tests,
)

initialize_distributed()
Expand Down Expand Up @@ -46,7 +47,13 @@
global_shapes = [
pytest.param((8, 16, 32), id='8x16x32'),
pytest.param((8, 8, 8), id='8x8x8'),
pytest.param((29 * size, 19 * size, 17 * size), id='prime_sizes'),
pytest.param(
(29 * size, 19 * size, 17 * size),
id='prime_sizes',
marks=pytest.mark.skipif(
skip_prime_tests, reason='prime shapes deadlock XLA CPU collectives on core-limited runners (JAXDECOMP_SKIP_PRIME_TESTS=1)'
),
),
] # Cubes, non-cubes and primes
local_transpose = [
pytest.param(True, id='local_transpose'),
Expand Down
13 changes: 12 additions & 1 deletion tests/test_transpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
create_spmd_array,
initialize_distributed,
is_on_cluster,
skip_prime_tests,
)

initialize_distributed()
Expand Down Expand Up @@ -45,7 +46,17 @@
pencil_2 = (size // (size // 2), size // 2) # 2x2 for V100 and 2x4 for A100

decomp = [(size, 1), (1, size), pencil_1, pencil_2]
global_shapes = [(8, 16, 32), (8, 8, 8), (29 * size, 19 * size, 17 * size)]
global_shapes = [
pytest.param((8, 16, 32), id='8x16x32'),
pytest.param((8, 8, 8), id='8x8x8'),
pytest.param(
(29 * size, 19 * size, 17 * size),
id='prime_sizes',
marks=pytest.mark.skipif(
skip_prime_tests, reason='prime shapes deadlock XLA CPU collectives on core-limited runners (JAXDECOMP_SKIP_PRIME_TESTS=1)'
),
),
]
# Cubes, non-cubes and primes
local_transpose = [
pytest.param(False, id='no_local_transpose'),
Expand Down
30 changes: 22 additions & 8 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading