[AMD] ci: run vetted nested multimodal_gen unit tests on AMD (#31483)

This commit is contained in:
Michael
2026-08-06 09:39:33 +08:00
committed by GitHub
parent d9b1cba255
commit d90ef69802
2 changed files with 58 additions and 10 deletions
+29 -7
View File
@@ -75,8 +75,11 @@ _MM_GEN_SUBDIR_BACKENDS = {
# CUDA-only for now (previously matched no rule and were dropped entirely).
"single_test_file": ("CUDA",),
"single_test_file/component_accuracy": ("CUDA",),
# Nested unit suites run only on the CUDA lane today (they are not part of
# the AMD `unit` suite that multimodal-gen-unit-test-amd executes).
# Nested unit suites are enabled on AMD incrementally, per file (only the
# files that pass on ROCm as-is; see _MM_GEN_FILE_BACKENDS below and
# gpu_cases _AMD_READY_NESTED_UNIT_TESTS). The subdir default stays the
# pre-existing CUDA tag for files not yet enabled on AMD (follow-up PRs
# move each file to AMD as it lands).
"unit/realtime": ("CUDA",),
"unit/sana_wm": ("CUDA",),
"unit/progressive_resolution": ("CUDA",),
@@ -84,6 +87,22 @@ _MM_GEN_SUBDIR_BACKENDS = {
"unit/musa/layers": ("MUSA",),
}
# Per-file backend overrides (checked before the subdir rule). Used to enable
# individual nested unit/ files on AMD incrementally, as each is verified to
# pass on ROCm. The CUDA lane does not collect these nested files (see
# gpu_cases._discover_unit_tests), so they are AMD-only here.
_MM_GEN_FILE_BACKENDS = {
"unit/realtime/test_causal_denoising.py": ("AMD",),
"unit/realtime/test_output_materialization.py": ("AMD",),
"unit/realtime/test_realtime_consistency_harness.py": ("AMD",),
"unit/realtime/test_realtime_control_signals.py": ("AMD",),
"unit/realtime/test_realtime_output_transport.py": ("AMD",),
"unit/realtime/test_realtime_vae.py": ("AMD",),
"unit/sana_wm/test_streaming_cached.py": ("AMD",),
"unit/sana_wm/test_streaming_stage.py": ("AMD",),
"unit/sana_wm/test_streaming_vae.py": ("AMD",),
}
# Filenames that match `test_*.py` by convention but contain no real tests
# (utility / fixture modules). Skipped before classification.
_MM_GEN_HELPER_FILENAMES = frozenset({"test_utils.py"})
@@ -147,11 +166,14 @@ def collect_multimodal_gen_tests(
stem_tokens = set(filename_only[:-3].split("_"))
nightly = "nightly" in stem_tokens
backends: tuple[str, ...] = ()
for token, override in _MM_GEN_FILENAME_BACKEND_TOKENS.items():
if token in stem_tokens:
backends = override
break
# Precedence: explicit per-file override, then filename token, then
# the subdir default.
backends: tuple[str, ...] = _MM_GEN_FILE_BACKENDS.get(rel.as_posix(), ())
if not backends:
for token, override in _MM_GEN_FILENAME_BACKEND_TOKENS.items():
if token in stem_tokens:
backends = override
break
if not backends:
backends = _MM_GEN_SUBDIR_BACKENDS.get(subdir, ())