Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions tests/models/autoencoders/test_models_autoencoder_vidtok.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,60 +113,6 @@ def test_layerwise_casting_training(self):
class TestAutoencoderVidTokSlicingTiling(AutoencoderVidTokTesterConfig, AutoencoderTesterMixin):
"""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.

init_dict = self.get_init_dict()
inputs_dict = self.get_dummy_inputs()

torch.manual_seed(0)
model = self.model_class(**init_dict).to(torch_device)

torch.manual_seed(0)
output_without_tiling = model(**inputs_dict, generator=torch.manual_seed(0))[0]

torch.manual_seed(0)
model.enable_tiling()
output_with_tiling = model(**inputs_dict, generator=torch.manual_seed(0))[0]

assert (
output_without_tiling.detach().cpu().numpy() - output_with_tiling.detach().cpu().numpy()
).max() < 0.5, "VAE tiling should not affect the inference results"

torch.manual_seed(0)
model.disable_tiling()
output_without_tiling_2 = model(**inputs_dict, generator=torch.manual_seed(0))[0]

assert (
output_without_tiling.detach().cpu().numpy().all() == output_without_tiling_2.detach().cpu().numpy().all()
), "Without tiling outputs should match with the outputs when tiling is manually disabled."

def test_enable_disable_slicing(self):
init_dict = self.get_init_dict()
inputs_dict = self.get_dummy_inputs()

torch.manual_seed(0)
model = self.model_class(**init_dict).to(torch_device)
inputs_dict.update({"return_dict": False})

torch.manual_seed(0)
output_without_slicing = model(**inputs_dict, generator=torch.manual_seed(0))[0]

torch.manual_seed(0)
model.enable_slicing()
output_with_slicing = model(**inputs_dict, generator=torch.manual_seed(0))[0]

assert (
output_without_slicing.detach().cpu().numpy() - output_with_slicing.detach().cpu().numpy()
).max() < 0.5, "VAE slicing should not affect the inference results"

torch.manual_seed(0)
model.disable_slicing()
output_without_slicing_2 = model(**inputs_dict, generator=torch.manual_seed(0))[0]

assert (
output_without_slicing.detach().cpu().numpy().all()
== output_without_slicing_2.detach().cpu().numpy().all()
), "Without slicing outputs should match when slicing is manually disabled."

def test_forward_with_norm_groups(self):
"""VidTok uses layernorm instead of groupnorm."""
init_dict = self.get_init_dict()
Expand Down
Loading