File tree Expand file tree Collapse file tree
tests/models/testing_utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222import torch
2323from accelerate .utils .modeling import compute_module_sizes
2424
25- from diffusers .utils .testing_utils import _check_safetensors_serialization
2625from diffusers .utils .torch_utils import get_torch_cuda_device_capability
2726
2827from ...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 :
You can’t perform that action at this time.
0 commit comments