Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
torch_device,
)
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -99,7 +99,7 @@ class TestAsymmetricAutoencoderKLMemory(AsymmetricAutoencoderKLTesterConfig, Mem
"""Memory optimization tests for AsymmetricAutoencoderKL."""


class TestAsymmetricAutoencoderKLSlicingTiling(AsymmetricAutoencoderKLTesterConfig, NewAutoencoderTesterMixin):
class TestAsymmetricAutoencoderKLSlicingTiling(AsymmetricAutoencoderKLTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AsymmetricAutoencoderKL."""

@pytest.mark.skip("Unsupported test.")
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_cosmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -92,5 +92,5 @@ class TestAutoencoderKLCosmosMemory(AutoencoderKLCosmosTesterConfig, MemoryTeste
"""Memory optimization tests for AutoencoderKLCosmos."""


class TestAutoencoderKLCosmosSlicingTiling(AutoencoderKLCosmosTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLCosmosSlicingTiling(AutoencoderKLCosmosTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLCosmos."""
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SingleFileTesterMixin,
TrainingTesterMixin,
)
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_layerwise_casting_memory(self):
super().test_layerwise_casting_memory()


class TestAutoencoderDCSlicingTiling(AutoencoderDCTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderDCSlicingTiling(AutoencoderDCTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderDC."""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -124,7 +124,7 @@ class TestAutoencoderKLHunyuanVideoMemory(AutoencoderKLHunyuanVideoTesterConfig,
"""Memory optimization tests for AutoencoderKLHunyuanVideo."""


class TestAutoencoderKLHunyuanVideoSlicingTiling(AutoencoderKLHunyuanVideoTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLHunyuanVideoSlicingTiling(AutoencoderKLHunyuanVideoTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLHunyuanVideo."""

# Overwritten because the base test's block_out_channels doesn't account for the length of down_block_types.
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_kl.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
SingleFileTesterMixin,
TrainingTesterMixin,
)
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -203,7 +203,7 @@ class TestAutoencoderKLMemory(AutoencoderKLTesterConfig, MemoryTesterMixin):
"""Memory optimization tests for AutoencoderKL."""


class TestAutoencoderKLSlicingTiling(AutoencoderKLTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLSlicingTiling(AutoencoderKLTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKL."""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -107,7 +107,7 @@ class TestAutoencoderKLCogVideoXMemory(AutoencoderKLCogVideoXTesterConfig, Memor
"""Memory optimization tests for AutoencoderKLCogVideoX."""


class TestAutoencoderKLCogVideoXSlicingTiling(AutoencoderKLCogVideoXTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLCogVideoXSlicingTiling(AutoencoderKLCogVideoXTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLCogVideoX."""

# Overwritten because the base test's block_out_channels doesn't account for the length of down_block_types.
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_kl_kvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -79,5 +79,5 @@ class TestAutoencoderKLKVAEMemory(AutoencoderKLKVAETesterConfig, MemoryTesterMix
"""Memory optimization tests for AutoencoderKLKVAE."""


class TestAutoencoderKLKVAESlicingTiling(AutoencoderKLKVAETesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLKVAESlicingTiling(AutoencoderKLKVAETesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLKVAE."""
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
TrainingTesterMixin,
run_nondeterministic,
)
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -116,5 +116,5 @@ def test_layerwise_casting_training(self):
run_nondeterministic(super().test_layerwise_casting_training)


class TestAutoencoderKLKVAEVideoSlicingTiling(AutoencoderKLKVAEVideoTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLKVAEVideoSlicingTiling(AutoencoderKLKVAEVideoTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLKVAEVideo."""
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import is_flaky, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


class AutoencoderKLLTX2AudioTesterConfig(BaseModelTesterConfig):
Expand Down Expand Up @@ -104,5 +104,5 @@ def test_group_offloading_with_disk(self, tmp_path, record_stream, offload_type,
super().test_group_offloading_with_disk(tmp_path, record_stream, offload_type, atol=atol, rtol=rtol)


class TestAutoencoderKLLTX2AudioSlicingTiling(AutoencoderKLLTX2AudioTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLLTX2AudioSlicingTiling(AutoencoderKLLTX2AudioTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLLTX2Audio."""
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
TrainingTesterMixin,
run_nondeterministic,
)
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -183,5 +183,5 @@ class TestAutoencoderKLMiniMaxH3Attention(AutoencoderKLMiniMaxH3TesterConfig, At
"""Attention processor tests for the MiniMax-H3 video autoencoder."""


class TestAutoencoderKLMiniMaxH3SlicingTiling(AutoencoderKLMiniMaxH3TesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLMiniMaxH3SlicingTiling(AutoencoderKLMiniMaxH3TesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for the MiniMax-H3 video autoencoder."""
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -88,7 +88,5 @@ class TestAutoencoderKLTemporalDecoderMemory(AutoencoderKLTemporalDecoderTesterC
"""Memory optimization tests for AutoencoderKLTemporalDecoder."""


class TestAutoencoderKLTemporalDecoderSlicingTiling(
AutoencoderKLTemporalDecoderTesterConfig, NewAutoencoderTesterMixin
):
class TestAutoencoderKLTemporalDecoderSlicingTiling(AutoencoderKLTemporalDecoderTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLTemporalDecoder."""
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -105,5 +105,5 @@ class TestAutoencoderKLLTX2VideoMemory(AutoencoderKLLTX2VideoTesterConfig, Memor
"""Memory optimization tests for AutoencoderKLLTX2Video."""


class TestAutoencoderKLLTX2VideoSlicingTiling(AutoencoderKLLTX2VideoTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLLTX2VideoSlicingTiling(AutoencoderKLLTX2VideoTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLLTX2Video."""
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SingleFileTesterMixin,
TrainingTesterMixin,
)
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -110,7 +110,7 @@ class TestAutoencoderKLLTXVideo090Memory(AutoencoderKLLTXVideo090TesterConfig, M
"""Memory optimization tests for AutoencoderKLLTXVideo (0.9.0 config)."""


class TestAutoencoderKLLTXVideo090SlicingTiling(AutoencoderKLLTXVideo090TesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLLTXVideo090SlicingTiling(AutoencoderKLLTXVideo090TesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLLTXVideo (0.9.0 config)."""

@pytest.mark.skip("AutoencoderKLLTXVideo does not support `norm_num_groups` because it does not use GroupNorm.")
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_magvit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -99,7 +99,7 @@ class TestAutoencoderKLMagvitMemory(AutoencoderKLMagvitTesterConfig, MemoryTeste
"""Memory optimization tests for AutoencoderKLMagvit."""


class TestAutoencoderKLMagvitSlicingTiling(AutoencoderKLMagvitTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLMagvitSlicingTiling(AutoencoderKLMagvitTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLMagvit."""

@pytest.mark.skip("Unsupported test.")
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_mochi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -91,5 +91,5 @@ class TestAutoencoderKLMochiMemory(AutoencoderKLMochiTesterConfig, MemoryTesterM
"""Memory optimization tests for AutoencoderKLMochi."""


class TestAutoencoderKLMochiSlicingTiling(AutoencoderKLMochiTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLMochiSlicingTiling(AutoencoderKLMochiTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLMochi."""
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_oobleck.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
torch_device,
)
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -98,7 +98,7 @@ def test_layerwise_casting_memory(self):
super().test_layerwise_casting_memory()


class TestAutoencoderOobleckSlicingTiling(AutoencoderOobleckTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderOobleckSlicingTiling(AutoencoderOobleckTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderOobleck."""

def test_enable_disable_slicing(self):
Expand Down
4 changes: 0 additions & 4 deletions tests/models/autoencoders/test_models_autoencoder_rae.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ def generator(self):
def get_dummy_inputs(self):
return {"sample": torch.randn(2, 3, 32, 32, generator=self.generator, device="cpu").to(torch_device)}

# Bridge for AutoencoderTesterMixin which still uses the old interface
def prepare_init_args_and_inputs_for_common(self):
return self.get_init_dict(), self.get_dummy_inputs()

def _make_model(self, **overrides) -> AutoencoderRAE:
config = self.get_init_dict()
config.update(overrides)
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_tiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
torch_device,
)
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_layerwise_casting_memory(self):
super().test_layerwise_casting_memory()


class TestAutoencoderTinySlicingTiling(AutoencoderTinyTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderTinySlicingTiling(AutoencoderTinyTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderTiny."""

@pytest.mark.skip("Model does not yet support smaller resolution.")
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_vidtok.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
TrainingTesterMixin,
run_nondeterministic,
)
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_layerwise_casting_training(self):
run_nondeterministic(super().test_layerwise_casting_training)


class TestAutoencoderVidTokSlicingTiling(AutoencoderVidTokTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderVidTokSlicingTiling(AutoencoderVidTokTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderVidTok."""

def test_enable_disable_tiling(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_autoencoder_wan.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SingleFileTesterMixin,
TrainingTesterMixin,
)
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_layerwise_casting_training(self):
pass


class TestAutoencoderKLWanSlicingTiling(AutoencoderKLWanTesterConfig, NewAutoencoderTesterMixin):
class TestAutoencoderKLWanSlicingTiling(AutoencoderKLWanTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for AutoencoderKLWan."""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
torch_device,
)
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -103,7 +103,7 @@ class TestConsistencyDecoderVAEMemory(ConsistencyDecoderVAETesterConfig, MemoryT
"""Memory optimization tests for ConsistencyDecoderVAE."""


class TestConsistencyDecoderVAESlicingTiling(ConsistencyDecoderVAETesterConfig, NewAutoencoderTesterMixin):
class TestConsistencyDecoderVAESlicingTiling(ConsistencyDecoderVAETesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for ConsistencyDecoderVAE."""


Expand Down
4 changes: 2 additions & 2 deletions tests/models/autoencoders/test_models_vq.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...testing_utils import backend_manual_seed, enable_full_determinism, torch_device
from ..testing_utils import BaseModelTesterConfig, MemoryTesterMixin, ModelTesterMixin, TrainingTesterMixin
from .testing_utils import NewAutoencoderTesterMixin
from .testing_utils import AutoencoderTesterMixin


enable_full_determinism()
Expand Down Expand Up @@ -136,5 +136,5 @@ class TestVQModelMemory(VQModelTesterConfig, MemoryTesterMixin):
"""Memory optimization tests for VQModel."""


class TestVQModelSlicingTiling(VQModelTesterConfig, NewAutoencoderTesterMixin):
class TestVQModelSlicingTiling(VQModelTesterConfig, AutoencoderTesterMixin):
"""Slicing and tiling tests for VQModel."""
Loading
Loading