[tests] skip parallelism tests for some models. by sayakpaul · Pull Request #14505 · huggingface/diffusers · GitHub
Skip to content

[tests] skip parallelism tests for some models. - #14505

Merged
sayakpaul merged 5 commits into
mainfrom
parallelism-fix
Aug 18, 2026
Merged

sayakpaul merged 5 commits into
mainfrom
parallelism-fix

Conversation

@sayakpaul

@sayakpaul sayakpaul commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

Fixes #14485. I know that fixing by skipping sounds meh but I am following what many other model tests are already doing. I think it's better treat this case by case as the issues arise. Skipping them is still transparent (as long as the reason is well documented).

Additionally, fixing tests/models/autoencoders/test_models_autoencoder_kl_ltx2_audio.py::TestAutoencod erKLLTX2AudioMemory::test_layerwise_casting_memory. There's a failing path that's never reached on a T4, hence this passed.

@github-actions github-actions Bot added tests fixes-issue size/S PR with diff < 50 LOC labels Aug 17, 2026
@sayakpaul

Copy link
Copy Markdown
Member Author

@github-actions

github-actions Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

❌ pytest tests/models/autoencoders/test_models_autoencoder_kl_ltx2_audio.py::TestAutoencoderKLLTX2AudioMemory::test_layerwise_casting_memory failed on GPU — view logs.

@sayakpaul

Copy link
Copy Markdown
Member Author

/diffusers-bot pytest tests/models/autoencoders/test_models_autoencoder_kl_ltx2_audio.py::TestAutoencoderKLLTX2AudioMemory::test_layerwise_casting_memory

@github-actions

github-actions Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ pytest tests/models/autoencoders/test_models_autoencoder_kl_ltx2_audio.py::TestAutoencoderKLLTX2AudioMemory::test_layerwise_casting_memory passed on GPU — view logs.

@sayakpaul

Copy link
Copy Markdown
Member Author

/diffusers-bot pytest tests/models/autoencoders/test_models_autoencoder_kl_ltx2_audio.py::TestAutoencoderKLLTX2AudioMemory::test_layerwise_casting_memory

@github-actions

github-actions Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ pytest tests/models/autoencoders/test_models_autoencoder_kl_ltx2_audio.py::TestAutoencoderKLLTX2AudioMemory::test_layerwise_casting_memory passed on GPU — view logs.

@sayakpaul
sayakpaul requested a review from dg845 August 17, 2026 15:56
Comment on lines +115 to +120
@pytest.mark.skip(
"`forward` runs through the `apply_forward_hook`-decorated `encode` and `decode`, and that decorator's "
"`pre_forward` call clears the input device accelerate's `AlignDevicesHook` recorded for the caller, so the "
"output comes back on the last device of the split rather than the input device and the comparison raises. "
"`test_cpu_offload` covers split placement instead — there every submodule executes on the same device."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My understanding (with help from Claude) is that the @apply_forward_hook / AlignDevicesHook interaction bug described above happens in general and is not limited to the Minimax-H3 video VAE. Claude flags several other autoencoders that use @apply_forward_hook on forward and therefore test_model_parallelism also fails for them:

  • pytest tests/models/autoencoders/test_models_autoencoder_kl.py::TestAutoencoderKL::test_model_parallelism
  • pytest tests/models/autoencoders/test_models_autoencoder_kl_cogvideox.py::TestAutoencoderKLCogVideoX::test_model_parallelism
  • pytest tests/models/autoencoders/test_models_ltx2_diffusion_decoder.py::TestLTX2VideoDiffusionDecoderModel::test_model_parallelism

I have confirmed these tests fail locally with the same error (base_model_output on cuda:0, new_output on cuda:1). So I think we can also consider skipping these tests for now for the same reason.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah makes sense. Addressed.

Comment on lines +96 to +97

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we're increasing num_frames from 8 to 512 here, are the TestAutoencoderKLLTX2AudioMemory tests still reasonably light?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is.

Comment thread tests/models/autoencoders/test_models_autoencoder_kl_ltx2_audio.py Outdated

@dg845 dg845 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR! Left some comments.

@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/S PR with diff < 50 LOC labels Aug 18, 2026
@sayakpaul
sayakpaul requested a review from dg845 August 18, 2026 07:41

@dg845 dg845 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@sayakpaul
sayakpaul merged commit 356c2fc into main Aug 18, 2026
13 of 14 checks passed
@sayakpaul
sayakpaul deleted the parallelism-fix branch August 18, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes-issue size/M PR with diff < 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tests] fix parallelism tests from #14464

2 participants