Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/accelerate/utils/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def set_module_tensor_to_device(
module.weight = module.weight.cuda(device_index)

# clean pre and post forward hook
if clear_cache and device != "cpu":
if clear_cache and device not in ("cpu", "meta"):
clear_device_cache()

# When handling tied weights, we update tied_params_map to keep track of the tied weights that have already been allocated on the device in
Expand Down
Loading