-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
offload_dir error @ PeftModel.from_pretrained() when loading LoRA FLAN-T5 XL in default 13GB RAM Colab #136
Comments
does it happened to you even though you had enough ram on your system? (swap area excluded) |
See also #225. I am running into the same issue with Alpaca-LoRA 7B. The error appears during loading at 13.3GB (with 15GB of total GPU memory allocated in my instance). The issue does not occur on a 'Premium' Colab GPU instance, which allocates 40GB of GPU memory.
I got it 'working' (my system RAM usage was increasing) by adding |
I have 24gb on my MacBook air m2 |
Same issue on my side, Trying to run in my local env. 32GB RAM + 3080, it says Tried with @rasmi "modification" but no luck: My code: def load_alpaca(load_8bit=False, base_model="decapoda-research/llama-7b-hf", lora_weights="tloen/alpaca-lora-7b", prompt_template=""):
tokenizer = LlamaTokenizer.from_pretrained(base_model)
print(device)
model = LlamaForCausalLM.from_pretrained(
base_model,
load_in_8bit=load_8bit,
torch_dtype=torch.float16,
device_map="auto",
offload_folder="."
)
model = PeftModel.from_pretrained(
model,
lora_weights,
torch_dtype=torch.float16,
offload_dir=""
) |
@sergiocasero can you try the solution provided in #248 ? |
Yes!!! Thanks @younesbelkada |
Just a heads up ! #257 will be merged, you will need to use |
Notebook for reproduction: https://colab.research.google.com/drive/1eWep-uJUEBVIM3FMxS08LaX5gzRZxQOv?usp=sharing
It doesn't reproduce with a VM with more RAM, so accelerate is likely offloading. (system has 8.6 / 12.7 GB before it hits that line)
if there's another way to get a LoRAed FLAN-T5 XL to load within the default Colab VM, it would be appreciated! (although baking the LORA-weights would technically work too)
The text was updated successfully, but these errors were encountered: