accelerate icon indicating copy to clipboard operation
accelerate copied to clipboard

Accelerate + DeepSpeed

Open ByungKwanLee opened this issue 1 year ago • 3 comments

System Info

all is the latest

Information

  • [ ] The official example scripts
  • [X] My own modified scripts

Tasks

  • [ ] One of the scripts in the examples/ folder of Accelerate or an officially supported no_trainer script in the examples folder of the transformers repo (such as run_no_trainer_glue.py)
  • [ ] My own task or dataset (give details below)

Reproduction

I made deepspeed config by accelerate config

I have treid to train the 4-bit quantized model (bitsandbytes) by using deepspeed zero2 or 3 (I tried a lot for each stage 2 3)

However, there is always happening: "ValueError: .to is not supported for 4-bit or 8-bit models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct dtype"

Accelerate's deepspeed config and bitsandbytes are not compatible???

How to solve??

Expected behavior

I want to train the 4-bit quantized model (bitsandbytes) by using deepspeed zero 2 or 3

ByungKwanLee avatar Jun 03 '24 14:06 ByungKwanLee

Can you give us a full reproducer? I believe that should be confirmed to work (verifying 100% soon/shortly) and it may be something up with the code, but first it'd be good to have a full reproducer

muellerzr avatar Jun 03 '24 15:06 muellerzr

You can check with the docs here: https://huggingface.co/docs/peft/accelerate/deepspeed#compatibility-with-bitsandbytes-quantization--lora

muellerzr avatar Jun 03 '24 15:06 muellerzr

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Jul 03 '24 15:07 github-actions[bot]