Unverified Commit 3ccea2b2 authored by Stella Biderman's avatar Stella Biderman Committed by GitHub
Browse files

Merge pull request #918 from Muennighoff/patch-2

pass through low_cpu_mem_usage
parents 906ef948 d98cb3d5
......@@ -19,7 +19,6 @@ _DeviceMapping = NewType("DeviceMapping", Mapping[str, Union[int, str, torch.dev
def _get_accelerate_args(
low_cpu_mem_usage: Optional[bool] = True,
device_map_option: Optional[str] = "auto",
max_memory_per_gpu: Optional[Union[int, str]] = None,
max_cpu_memory: Optional[Union[int, str]] = None,
......@@ -39,7 +38,6 @@ def _get_accelerate_args(
args = {}
if max_memory:
args["max_memory"] = max_memory
args["low_cpu_mem_usage"] = low_cpu_mem_usage
args["device_map"] = device_map_option
args["offload_folder"] = offload_folder
return args
......@@ -222,7 +220,6 @@ class HuggingFaceAutoLM(BaseLM):
model_kwargs = {}
if use_accelerate:
model_kwargs = _get_accelerate_args(
low_cpu_mem_usage,
device_map_option,
max_memory_per_gpu,
max_cpu_memory,
......@@ -242,6 +239,7 @@ class HuggingFaceAutoLM(BaseLM):
bnb_4bit_quant_type=bnb_4bit_quant_type,
bnb_4bit_compute_dtype=bnb_4bit_compute_dtype,
bnb_4bit_use_double_quant=bnb_4bit_use_double_quant,
low_cpu_mem_usage=low_cpu_mem_usage,
**model_kwargs,
)
# note: peft_path can be different than pretrained model path
......
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