File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
tests/quantization/torchao Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -476,6 +476,18 @@ def test_wrong_config(self):
476476 with self .assertRaises (ValueError ):
477477 self .get_dummy_components (TorchAoConfig ("int42" ))
478478
479+ def test_sequential_cpu_offload (self ):
480+ r"""
481+ A test that checks if inference runs as expected when sequential cpu offloading is enabled.
482+ """
483+ quantization_config = TorchAoConfig ("int8wo" )
484+ components = self .get_dummy_components (quantization_config )
485+ pipe = FluxPipeline (** components )
486+ pipe .enable_sequential_cpu_offload ()
487+
488+ inputs = self .get_dummy_inputs (torch_device )
489+ _ = pipe (** inputs )
490+
479491
480492# Slices for these tests have been obtained on our aws-g6e-xlarge-plus runners
481493@require_torch
You can’t perform that action at this time.
0 commit comments