huggingface / huggingface/accelerate

Loading weights straight to GPU only works for inference

Open
#2,028 8 comments 0 reactions 0 assignees View on GitHub
enhancement feature request
Dominant language
Python
Stars
9.9k
Forks
1.5k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

### System Info

```Shell
accelerate v0.22.0
```

### Information

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

### Tasks

- [X] 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

Going through the doc, accelerate currently does not seem to support loading weights straight to the GPU if the model is to be used for training. If this is correct, are there any plans to support this in the future?

### Expected behavior

It would be nice to be able to load weights straight to GPU when training, and to be able to do this either in the single or multi-gpu case.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.