Skip to content

tests: fix CUDA OOM in VidTok slicing/tiling tests - #14554

Merged
sayakpaul merged 2 commits into
mainfrom
fix-vidtok-slicing-tiling-oom
Aug 22, 2026
Merged

tests: fix CUDA OOM in VidTok slicing/tiling tests#14554
sayakpaul merged 2 commits into
mainfrom
fix-vidtok-slicing-tiling-oom

Conversation

@sayakpaul

@sayakpaul sayakpaul commented Aug 21, 2026

Copy link
Copy Markdown
Member

Fixes the three TestAutoencoderVidTokSlicingTiling failures in Torch CUDA Tests (models):

FAILED tests/models/autoencoders/test_models_autoencoder_vidtok.py::TestAutoencoderVidTokSlicingTiling::test_enable_disable_tiling      - torch.OutOfMemoryError
FAILED tests/models/autoencoders/test_models_autoencoder_vidtok.py::TestAutoencoderVidTokSlicingTiling::test_enable_disable_slicing     - torch.OutOfMemoryError
FAILED tests/models/autoencoders/test_models_autoencoder_vidtok.py::TestAutoencoderVidTokSlicingTiling::test_forward_with_norm_groups   - torch.OutOfMemoryError

TestAutoencoderVidTokSlicingTiling overrode test_enable_disable_tiling and
test_enable_disable_slicing with copies that ran their three forward passes
outside torch.no_grad(). The retained autograd graphs pushed each test to a
10.9 GiB peak on a 14.74 GiB T4, so with any memory left over from earlier
files in the same xdist worker the class OOM'd -- taking
test_forward_with_norm_groups down with it.

The mixin already implements both tests correctly (no_grad, plus torch.allclose
for the disable-comparison instead of the `.all() == .all()` idiom the copies
used, which compares two booleans and always passes). Drop the overrides and
inherit them.

Peak memory on a T4, measured per test:

  before   10937.3 MiB
  after     1666.5 MiB

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added tests size/M PR with diff < 200 LOC labels Aug 21, 2026
class TestAutoencoderVidTokSlicingTiling(AutoencoderVidTokTesterConfig, NewAutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderVidTok."""

def test_enable_disable_tiling(self):

@sayakpaul sayakpaul Aug 21, 2026

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.

Already tested in the base mixin and since these were not wrapped in torch.no_grad() these were causing OOMs.

@sayakpaul
sayakpaul requested a review from dg845 August 21, 2026 08:02

@dg845 dg845 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.

Thanks!

@sayakpaul
sayakpaul merged commit 58eb52c into main Aug 22, 2026
14 checks passed
@sayakpaul
sayakpaul deleted the fix-vidtok-slicing-tiling-oom branch August 22, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR with diff < 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants