Fix minimum version for device_map (#20489)

This commit is contained in:
Sylvain Gugger 2022-11-30 11:10:55 -05:00 committed by GitHub
parent 08b4621899
commit 396a6a2ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1962,8 +1962,8 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
# low_cpu_mem_usage requires PyTorch >= 1.9 to have the meta device.
require_version_core("torch>=1.9")
if device_map is not None:
# The max memory utils require PyTorch >= 1.11 to have torch.cuda.mem_get_info.
require_version_core("torch>=1.11")
# The max memory utils require PyTorch >= 1.10 to have torch.cuda.mem_get_info.
require_version_core("torch>=1.10")
if is_deepspeed_zero3_enabled():
raise ValueError(