Skip to content
Merged
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
3 changes: 2 additions & 1 deletion src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4828,7 +4828,8 @@ def _find_mismatched_keys(

if device_map is not None:
expanded_device_map = expand_device_map(device_map, original_loaded_keys, start_prefix)
caching_allocator_warmup(model, expanded_device_map, dtype)
if hf_quantizer is None:
caching_allocator_warmup(model_to_load, expanded_device_map, dtype)

if device_map is not None and is_safetensors:
param_device_map = expanded_device_map
Expand Down