Skip to content

[Test] [AMD] diffusion: Make multimodal_gen unit tests ROCm-aware - #44599

Merged
yichiche merged 3 commits into
sgl-project:mainfrom
michaelzhang-ai:fix-rocm-diffusion-unit-tests
Oct 20, 2026
Merged

yichiche merged 3 commits into
sgl-project:mainfrom
michaelzhang-ai:fix-rocm-diffusion-unit-tests

Conversation

@michaelzhang-ai

@michaelzhang-ai michaelzhang-ai commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What

Seven multimodal_gen unit test files that landed recently fail on MI300 because they assume a CUDA host. Test-only changes; CUDA behavior of every test is unchanged.

Failing jobs: scheduled run on main, and the AMD jobs on #44421 (partition 0, 1, 2, 3).

Why, per test

  • test_flux3_prims_ts_config.py ([Feat] diffusion: support FLUX 3 Image Klein #44418): imports flashinfer.prims_ts at module level. ROCm images don't ship flashinfer, so collection errors and the whole unit-test step of that partition stops. Now pytest.importorskip.
  • test_rowwise_fp8.py::TestFp8LinearMethodRowwise ([Feat] diffusion: support FLUX 3 Image Klein #44418): hands Fp8LinearMethod.apply a raw OCP float8_e4m3fn weight. On ROCm, FP8 weights only reach apply after the loader converts them (fnuz / preshuffle), so aiter asserts and the hipBLASLt fallback returns HIPBLAS_STATUS_NOT_SUPPORTED. Skipped on ROCm.
  • test_qwen3_5_encoder.py::test_text_attention_default_and_explicit_selection[fa] ([Feat] diffusion: Add support for the MOSS-Image family #44325): the ROCm platform resolves FA to SDPA, so the backend assert fails. Skipped on ROCm, same as the Kandinsky6 FA case in [Test] [AMD] diffusion: Skip the Kandinsky6 FA dispatch test on ROCm #44421.
  • test_residual_gate_add2.py ([Feat] diffusion: support FLUX 3 Image Klein #44418): fp16 output of the scalar path (hidden 250) is not bit-identical to torch.addcmul on MI300. CUDA still asserts torch.equal; ROCm now uses assert_close with dtype defaults.
  • test_flux3_image_dit_quant.py ([Feat] diffusion: support FLUX 3 Image Klein #44418): building the tiny DiT constructs attention layers that read the SP group size, but the file never initializes one. It only passes when an earlier test in the same process left the group set up. Now uses the single_process_model_parallel fixture, as test_flux3_image_dit.py does. Three cases reach the flashinfer-backed PrimsTS weight pack and are skipped when flashinfer is absent.
  • test_moss_image_parallel.py ([Feat] diffusion: Add support for the MOSS-Image family #44325): runs two CPU workers with CUDA_VISIBLE_DEVICES="". On a ROCm build, importing sglang calls is_gfx1250_supported(), which reads GPU 0's properties and raises No CUDA GPUs are available. Skipped on ROCm.
  • test_kandinsky6_layerwise_offload.py[*-audio-vae] ([diffusion] model: support Kandinsky 6 #42743, also fails on main): the offloaded fp32 audio VAE differs from the resident run by up to ~1.2e-6. ROCm uses rtol=1e-4, atol=1e-5 for the forward outputs; the exact state_dict comparison after offload is unchanged.

Notes for the reviewer

  • The residual-gate kernel's docstring promises bit-identity with addcmul. That holds on CUDA but not on MI300 for fp16 in at least the scalar path. The kernel's ROCm behavior should get a look from its owner; this PR only stops the test from blocking ROCm CI.
  • is_gfx1250_supported() (and its gfx942/gfx95 siblings) query the device at import time, so importing sglang on a ROCm build with no visible GPU fails. That is a product issue outside this PR.
  • I did not confirm the cause of the audio VAE drift (likely conv algorithm selection, since the DiT components stay bit-exact).

Test plan

  • CUDA multimodal-gen-unit-test on the first commit: 5467 passed, 0 failed (job).
  • MI300 on the first commit: test_rowwise_fp8 skips its raw-FP8 case and the rest pass; the PrimsTS config file no longer stops partition 2, which surfaced the last two files above. The remaining failures in those jobs are the Kandinsky6 FA and FastH3 cases fixed by [Test] [AMD] diffusion: Skip the Kandinsky6 FA dispatch test on ROCm #44421.
  • MI300 on the second commit (partition 2): test_moss_image_parallel skips, and every test_flux3_image_dit_quant case passes or skips except the SwiGLU layout case, which the third commit skips for the same flashinfer reason. Partitions 0 and 3 are green. The other failures in partitions 1 and 2 are the Kandinsky6 FA and FastH3 cases fixed by [Test] [AMD] diffusion: Skip the Kandinsky6 FA dispatch test on ROCm #44421.

CI States

Latest PR Test (Base): ✅ Run #38972196077
Latest PR Test (Extra): ❌ Run #38972196181
Latest PR Test (AMD ROCm 10): ❌ Run #38972195799

- test_flux3_prims_ts_config: importorskip flashinfer, which ROCm does not ship
- test_rowwise_fp8: skip the raw OCP e4m3fn apply test on ROCm
- test_qwen3_5_encoder: skip the FA selection case on ROCm, where FA
  resolves to SDPA
- test_residual_gate_add2: keep bit-exactness on CUDA, use fp16/bf16
  tolerance on ROCm
- test_kandinsky6_layerwise_offload: small tolerance for the fp32 audio VAE
  forward on ROCm; weights are still compared exactly
- test_flux3_image_dit_quant: use the single_process_model_parallel fixture
  (building the DiT reads the SP group size) and skip the two cases that
  import the flashinfer-backed PrimsTS weight pack when flashinfer is absent
- test_moss_image_parallel: skip on ROCm, where importing sglang queries
  GPU 0 and fails with the GPUs hidden for the CPU workers
@github-actions github-actions Bot added the quant LLM Quantization label Oct 16, 2026
@michaelzhang-ai michaelzhang-ai changed the title [Test] [AMD] diffusion: Make five multimodal_gen unit tests ROCm-aware [Test] [AMD] diffusion: Make multimodal_gen unit tests ROCm-aware Oct 16, 2026
Its process_weights_after_loading packs the PrimsTS SwiGLU weight, which
imports flashinfer.

@yichiche yichiche left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion quant LLM Quantization run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants