Skip to content
Open
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
32 changes: 32 additions & 0 deletions end_to_end/tpu/run_wan_stack_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Runs the tests of the Wan fast-inference kernels and serving path on a TPU VM
# (validated on v6e-8 and tpu7x-8), including the Pallas kernel grids and
# multi-device ring/Ulysses tests that GitHub Actions skips (they check
# GITHUB_ACTIONS=true) to keep CI short.
#
# Usage, from the repo root of an installed checkout:
# bash end_to_end/tpu/run_wan_stack_tests.sh [extra pytest args, e.g. -x --durations=20]
set -euo pipefail
cd "$(dirname "$0")/../.."
unset GITHUB_ACTIONS
T=src/maxdiffusion/tests
TESTS=(
# Fixed-m custom splash kernel and ring (feat/fixed-m-kernel)
"$T/custom_splash_fixed_m_test.py"
"$T/ring_fixed_m_test.py"
)
PYTHONPATH="src${PYTHONPATH:+:$PYTHONPATH}" exec "${PYTHON:-python3}" -m pytest -q -rs "${TESTS[@]}" "$@"
3 changes: 2 additions & 1 deletion src/maxdiffusion/configs/ltx2_3_video.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ hardware: 'tpu'
skip_jax_distributed_system: False
# Supported attention kernels:
# dot_product, flash, tokamax_flash, tokamax_ring, tokamax_ring_custom,
# ulysses, ulysses_custom, ulysses_custom_fixed_m, ulysses_ring,
# ulysses, ulysses_custom, ulysses_custom_fixed_m,
# ulysses_custom_fixed_m_per_q_block, ulysses_ring,
# ulysses_ring_custom, ulysses_ring_custom_fixed_m, ulysses_ring_custom_bidir,
# and cudnn_flash_te (GPU only).
attention: 'flash'
Expand Down
3 changes: 2 additions & 1 deletion src/maxdiffusion/configs/ltx2_video.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ hardware: 'tpu'
skip_jax_distributed_system: False
# Supported attention kernels:
# dot_product, flash, tokamax_flash, tokamax_ring, tokamax_ring_custom,
# ulysses, ulysses_custom, ulysses_custom_fixed_m, ulysses_ring,
# ulysses, ulysses_custom, ulysses_custom_fixed_m,
# ulysses_custom_fixed_m_per_q_block, ulysses_ring,
# ulysses_ring_custom, ulysses_ring_custom_fixed_m, ulysses_ring_custom_bidir,
# and cudnn_flash_te (GPU only).
attention: 'flash'
Expand Down
550 changes: 454 additions & 96 deletions src/maxdiffusion/kernels/custom_splash_attention.py

Large diffs are not rendered by default.

330 changes: 259 additions & 71 deletions src/maxdiffusion/kernels/splash_attention/ring_attention_kernel.py

Large diffs are not rendered by default.

342 changes: 266 additions & 76 deletions src/maxdiffusion/models/attention_flax.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/maxdiffusion/models/ltx2/attention_ltx2.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ def __init__(
"ulysses_ring_custom_bidir",
"ulysses_custom",
"ulysses_custom_fixed_m",
"ulysses_custom_fixed_m_per_q_block",
)
cross_attention_uses_local_kv = not is_self_attention and (
cross_attention_remapped_to_flash or attention_kernel in ("flash", "tokamax_flash", "cudnn_flash_te")
Expand Down
Loading
Loading