Skip to content

Reduce WanAnimate TorchAO test input sizes to prevent OOM - #13541

Merged
sayakpaul merged 7 commits into
huggingface:mainfrom
jiqing-feng:torchao-fix-wananimate-oom
May 8, 2026
Merged

Reduce WanAnimate TorchAO test input sizes to prevent OOM#13541
sayakpaul merged 7 commits into
huggingface:mainfrom
jiqing-feng:torchao-fix-wananimate-oom

Conversation

@jiqing-feng

Copy link
Copy Markdown
Contributor

What does this PR do?

Shrinks dummy inputs in TestWanAnimateTransformer3DTorchAo to avoid OOM on devices without FlashAttention (e.g. XPU, which falls back to math SDPA and materializes the full O(S²) attention matrix).

Reduced hidden_states spatial from 64×64 to 16×16 and frames from 21 to 5, bringing self-attention sequence length from 21,504 to 320. Face frame count adjusted from 77 to 13 to satisfy the temporal alignment constraint with the face encoder's stride-2 convolutions.

Shrink dummy inputs to avoid OOM on devices without FlashAttention.
Reduce hidden_states spatial from 64x64 to 16x16 and frames from 21 to 5,
bringing self-attention sequence length from 21,504 to 320.
@github-actions github-actions Bot added tests size/S PR with diff < 50 LOC and removed size/S PR with diff < 50 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/S PR with diff < 50 LOC labels Apr 22, 2026
@jiqing-feng

Copy link
Copy Markdown
Contributor Author

The failed test seems no related to my changes.

@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/S PR with diff < 50 LOC labels Apr 28, 2026
@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/S PR with diff < 50 LOC labels May 1, 2026
@dg845
dg845 requested review from DN6 and sayakpaul May 1, 2026 05:01
@jiqing-feng

Copy link
Copy Markdown
Contributor Author

The previous failed CI are not related to my changes.

@jiqing-feng

Copy link
Copy Markdown
Contributor Author

Hi @sayakpaul . The 2 failed CI jobs (LoRA tests with PEFT main, PyTorch Example CPU tests) are unrelated to this PR. This PR only modifies test input sizes in test_models_transformer_wan_animate.py, while the failures are in LoRA/PEFT integration tests and example scripts respectively. These appear to be pre-existing flaky tests on main.

@sayakpaul
sayakpaul merged commit d773308 into huggingface:main May 8, 2026
12 of 13 checks passed
ADJB1212 pushed a commit to ADJB1212/diffusers that referenced this pull request May 12, 2026
…e#13541)

Shrink dummy inputs to avoid OOM on devices without FlashAttention.
Reduce hidden_states spatial from 64x64 to 16x16 and frames from 21 to 5,
bringing self-attention sequence length from 21,504 to 320.

Co-authored-by: dg845 <58458699+dg845@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
@jiqing-feng
jiqing-feng deleted the torchao-fix-wananimate-oom branch May 27, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR with diff < 50 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants