Skip to content
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

Can't load BnB models #1513

Open
6 of 8 tasks
Blaizzy opened this issue Apr 10, 2024 · 9 comments
Open
6 of 8 tasks

Can't load BnB models #1513

Blaizzy opened this issue Apr 10, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@Blaizzy
Copy link

Blaizzy commented Apr 10, 2024

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

I want to load a BnB quantized model.

Current behaviour

It throws a ValueError.

Steps to reproduce

Launch the config yaml.

Config yaml

base_model: unsloth/tinyllama-bnb-4bit
model_type: LlamaForCausalLM
tokenizer_type: LlamaTokenizer
is_llama_derived_model: true

load_in_8bit: false
load_in_4bit: true
strict: false

datasets:
  - path: HuggingFaceH4/ultrachat_200k
    split: train_sft
    type: sharegpt
    conversation: chatml

dataset_prepared_path:
val_set_size: 0.05
output_dir: ./qlora-out

adapter: qlora
lora_model_dir:

sequence_len: 1096
sample_packing: true
pad_to_sequence_len: true

lora_r: 32
lora_alpha: 16
lora_dropout: 0.05
lora_target_modules:
lora_target_linear: true
lora_fan_in_fan_out:

wandb_project: axolotl
wandb_entity:
wandb_watch:
wandb_name: tinyllama
wandb_log_model:

gradient_accumulation_steps: 1
micro_batch_size: 1
max_steps: 20
optimizer: paged_adamw_32bit
lr_scheduler: cosine
learning_rate: 0.0002

train_on_inputs: false
group_by_length: false
bf16: false
fp16: true
tf32: false

gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: false

warmup_steps: 10
evals_per_epoch:
saves_per_epoch:
debug:
deepspeed:
weight_decay: 0.0
fsdp:
fsdp_config:
special_tokens:
  eos_token: "<|im_end|>"

tokens:
- "<|im_start|>"

Possible solution

Extend or remove the fixed check of gptq introduced here: #913

Which Operating Systems are you using?

  • Linux
  • macOS
  • Windows

Python Version

3.10

axolotl branch-commit

main

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of axolotl.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@Blaizzy Blaizzy added the bug Something isn't working label Apr 10, 2024
@NanoCode012
Copy link
Collaborator

More details regarding error please. Were you also the one who posted a bnb issue on discord?

@tsunayoshi21
Copy link

Any new update regarding this error? I have a similar issue

@Blaizzy
Copy link
Author

Blaizzy commented Jun 22, 2024

@NanoCode012

Could you let me know what else are you looking for?

@NanoCode012
Copy link
Collaborator

Could someone post logs of the issue? Is it due to the check of quant_config?

@Blaizzy
Copy link
Author

Blaizzy commented Jun 22, 2024

Ayt, got it!

I will post the logs later today

@tsunayoshi21
Copy link

tsunayoshi21 commented Jun 22, 2024

@NanoCode012
Yes, for me the error is that the check of quant_config always raises a error because the quant_method is not gptq, and if i set gptq:false in the yaml, it raises a error that says i can't load a quantized model without gptq.

So if my model is previously BnB quantized i have no clue of how i can finetune with axolotl

@FrederikHandberg
Copy link

@Blaizzy what was your fix?

@Blaizzy
Copy link
Author

Blaizzy commented Jul 8, 2024

@Blaizzy what was your fix?

I used a full precision model and set load_in_4bit: to true

Example:

base_model: meta/llama-7b-hf
load_in_4bit: true

Whilst, I actually wanted to load a prequantized model.

base_model: meta/llama-7b-hf-4bit

@FrederikHandberg
Copy link

Thanks

+1 id like to do the same (would be a nice addition)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants