Skip to content

Commit 0e74a71

Browse files
authored
Loading optimization (#42239)
* remove loop over modules * no need for set casting
1 parent 47227f4 commit 0e74a71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/modeling_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4709,7 +4709,7 @@ def caching_allocator_warmup(model: PreTrainedModel, expanded_device_map: dict,
47094709
else None
47104710
)
47114711
total_byte_count = defaultdict(lambda: 0)
4712-
tied_param_names = _get_tied_weight_keys(model)
4712+
tied_param_names = model.all_tied_weights_keys.keys()
47134713
for param_name, device in accelerator_device_map.items():
47144714
# Skip if the parameter has already been accounted for (tied weights)
47154715
if param_name in tied_param_names:

0 commit comments

Comments
 (0)