Skip to content

Commit a0160e1

Browse files
committed
add pipeline tests
1 parent db2fd3b commit a0160e1

32 files changed

+104
-0
lines changed

tests/models/test_modeling_common.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,13 @@ def test_group_offloading(self):
14401440
torch.manual_seed(0)
14411441

14421442
def run_forward(model):
1443+
self.assertTrue(
1444+
all(
1445+
module._diffusers_hook.get_hook("group_offloading") is not None
1446+
for module in model.modules()
1447+
if hasattr(module, "_diffusers_hook")
1448+
)
1449+
)
14431450
model.eval()
14441451
with torch.no_grad():
14451452
return model(**inputs_dict)[0]

tests/pipelines/allegro/test_allegro.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class AllegroPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
5858
)
5959
test_xformers_attention = False
6060
test_layerwise_casting = True
61+
test_group_offloading = True
6162

6263
def get_dummy_components(self):
6364
torch.manual_seed(0)

tests/pipelines/amused/test_amused.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class AmusedPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
3939
params = TEXT_TO_IMAGE_PARAMS | {"encoder_hidden_states", "negative_encoder_hidden_states"}
4040
batch_params = TEXT_TO_IMAGE_BATCH_PARAMS
4141
test_layerwise_casting = True
42+
test_group_offloading = True
4243

4344
def get_dummy_components(self):
4445
torch.manual_seed(0)

tests/pipelines/animatediff/test_animatediff.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class AnimateDiffPipelineFastTests(
6161
]
6262
)
6363
test_layerwise_casting = True
64+
test_group_offloading = True
6465

6566
def get_dummy_components(self):
6667
cross_attention_dim = 8

tests/pipelines/aura_flow/test_pipeline_aura_flow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class AuraFlowPipelineFastTests(unittest.TestCase, PipelineTesterMixin):
3131
)
3232
batch_params = frozenset(["prompt", "negative_prompt"])
3333
test_layerwise_casting = True
34+
test_group_offloading = True
3435

3536
def get_dummy_components(self):
3637
torch.manual_seed(0)

tests/pipelines/cogvideo/test_cogvideox.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class CogVideoXPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
5959
)
6060
test_xformers_attention = False
6161
test_layerwise_casting = True
62+
test_group_offloading = True
6263

6364
def get_dummy_components(self):
6465
torch.manual_seed(0)

tests/pipelines/cogvideo/test_cogvideox_fun_control.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class CogVideoXFunControlPipelineFastTests(PipelineTesterMixin, unittest.TestCas
5656
)
5757
test_xformers_attention = False
5858
test_layerwise_casting = True
59+
test_group_offloading = True
5960

6061
def get_dummy_components(self):
6162
torch.manual_seed(0)

tests/pipelines/cogview3/test_cogview3plus.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class CogView3PlusPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
5757
)
5858
test_xformers_attention = False
5959
test_layerwise_casting = True
60+
test_group_offloading = True
6061

6162
def get_dummy_components(self):
6263
torch.manual_seed(0)

tests/pipelines/consisid/test_consisid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class ConsisIDPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
5959
)
6060
test_xformers_attention = False
6161
test_layerwise_casting = True
62+
test_group_offloading = True
6263

6364
def get_dummy_components(self):
6465
torch.manual_seed(0)

tests/pipelines/controlnet/test_controlnet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class ControlNetPipelineFastTests(
127127
image_params = IMAGE_TO_IMAGE_IMAGE_PARAMS
128128
image_latents_params = TEXT_TO_IMAGE_IMAGE_PARAMS
129129
test_layerwise_casting = True
130+
test_group_offloading = True
130131

131132
def get_dummy_components(self, time_cond_proj_dim=None):
132133
torch.manual_seed(0)

0 commit comments

Comments
 (0)