Skip to content

Commit d799b9a

Browse files
committed
fix group offloading with disk tests
1 parent 947bc23 commit d799b9a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/models/testing_utils/memory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import torch
2323
from accelerate.utils.modeling import compute_module_sizes
2424

25-
from diffusers.utils.testing_utils import _check_safetensors_serialization
2625
from diffusers.utils.torch_utils import get_torch_cuda_device_capability
2726

2827
from ...testing_utils import (
28+
_check_safetensors_serialization,
2929
assert_tensors_close,
3030
backend_empty_cache,
3131
backend_max_memory_allocated,
@@ -361,6 +361,9 @@ def _run_forward(model, inputs_dict):
361361
offload_to_disk_path=tmpdir,
362362
offload_type=offload_type,
363363
num_blocks_per_group=num_blocks_per_group,
364+
block_modules=model._group_offload_block_modules
365+
if hasattr(model, "_group_offload_block_modules")
366+
else None,
364367
)
365368
if not is_correct:
366369
if extra_files:

0 commit comments

Comments
 (0)