We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
cpu
meta
1 parent 1438331 commit 057edecCopy full SHA for 057edec
src/accelerate/utils/modeling.py
@@ -404,7 +404,7 @@ def set_module_tensor_to_device(
404
module.weight = module.weight.cuda(device_index)
405
406
# clean pre and post forward hook
407
- if clear_cache and device != "cpu":
+ if clear_cache and device not in ("cpu", "meta"):
408
clear_device_cache()
409
410
# 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
0 commit comments