"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "076e66e479428af1608c9c478e2bf3bf5765adff"
Unverified Commit 5efd074a authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Indicate better minimal version of PyTorch in big model inference (#20385)

parent dfc3deaf
...@@ -1926,6 +1926,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix ...@@ -1926,6 +1926,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
if low_cpu_mem_usage: if low_cpu_mem_usage:
# low_cpu_mem_usage requires PyTorch >= 1.9 to have the meta device. # low_cpu_mem_usage requires PyTorch >= 1.9 to have the meta device.
require_version_core("torch>=1.9") 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")
if is_deepspeed_zero3_enabled(): if is_deepspeed_zero3_enabled():
raise ValueError( raise ValueError(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment