-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: We need an offload_dir
to dispatch this model according to this device_map
> ```python
#86
Comments
Thanks for your attention! Currently LoRA model doesn't support ram-optimized load (which offloads parameters to disks during loading). You can try to add --use_ram_optimized_load False to disable it and check if it works. Thanks 😄 |
I checked the implementation of service/app.py. You may change this line to model_args = ModelArguments(model_name_or_path=model_name_or_path, use_ram_optimized_load=False, lora_model_path=lora_path) to see if the problem is resolved. Thanks! |
这样修改之后出错了 |
This is a bit strange. The model argument should accept this field in our latest main branch. Could you please provide the commit id of your code base so we may check that for you? Thanks~ |
|
Hi, was the issue resolved? Thanks! |
This issue has been marked as stale because it has not had recent activity. If you think this still needs to be addressed please feel free to reopen this issue. Thanks |
For anyone in the future passing over this, it should be "offload_folder" instead of "offload_dir"
|
ValueError: At least one of the model submodule will be offloaded to disk, please pass along an |
It worked! |
thank you! I follow your step, it moves on, but raise new issue.
(lmflow) u20@u20:~/LMFlow/service$ python app.py
Loading checkpoint shards: 100%|██████████████████| 2/2 [00:21<00:00, 10.81s/it]
Traceback (most recent call last):
File "/home/u20/LMFlow/service/app.py", line 36, in
model = AutoModel.get_model(model_args, tune_strategy='none', ds_config=ds_config)
File "/home/u20/LMFlow/src/lmflow/models/auto_model.py", line 14, in get_model
return HFDecoderModel(model_args, *args, **kwargs)
File "/home/u20/LMFlow/src/lmflow/models/hf_decoder_model.py", line 192, in init
self.backend_model = PeftModel.from_pretrained(
File "/home/u20/miniconda3/envs/lmflow/lib/python3.9/site-packages/peft/peft_model.py", line 177, in from_pretrained
model = dispatch_model(model, device_map=device_map)
File "/home/u20/miniconda3/envs/lmflow/lib/python3.9/site-packages/accelerate/big_modeling.py", line 342, in dispatch_model
raise ValueError(
ValueError: We need an
offload_dir
to dispatch this model according to thisdevice_map
, the following submodules need to be offloaded: base_model.model.model.layers.22, base_model.model.model.layers.23, base_model.model.model.layers.24, base_model.model.model.layers.25, base_model.model.model.layers.26, base_model.model.model.layers.27, base_model.model.model.layers.28, base_model.model.model.layers.29, base_model.model.model.layers.30, base_model.model.model.layers.31, base_model.model.model.norm, base_model.model.lm_head.after google, the answer may be this : oobabooga/text-generation-webui#383
is it because my llama7b is original model is too large and without quantize and compressed?
do you have a solution for this? thank you
Originally posted by @alexhmyang in #67 (comment)
The text was updated successfully, but these errors were encountered: