# How to All Utilize all GPU's when device="balanced\_low\_0" in GPU setting

**URL:** <https://discuss.huggingface.co/t/how-to-all-utilize-all-gpus-when-device-balanced-low-0-in-gpu-setting/79201>\
**Category:** 🤗Transformers\
**Created:** [March 28, 2024, 8:33pm UTC](https://discuss.huggingface.co/t/how-to-all-utilize-all-gpus-when-device-balanced-low-0-in-gpu-setting/79201 "2024-03-28T20:33:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon97538739](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@anon97538739](https://discuss.huggingface.co/u/anon97538739)\
**Post date:** [March 28, 2024, 8:33pm UTC](https://discuss.huggingface.co/t/how-to-all-utilize-all-gpus-when-device-balanced-low-0-in-gpu-setting/79201/1 "2024-03-28T20:33:26Z")

</div>

While loading the model in “balanced\_low\_0” GPU setting the model is loaded into all GPU’s apart from 0: GPU. Where the 0: GPU is left to do the text inference. (i.e. text inference as in performing all the calculation to generate response inside the LLM)

So, as per the give device parameter my model is loaded onto 1,2,3 GPU’s and 0: GPU is left for inference.

| ID | GPU | MEM |  
| 0 | 0% | 3% |  
| 1 | 0% | 83% |  
| 2 | 0% | 82% |  
| 3 | 0% | 76% |

Question: How can i also utilize the remaining 1,2,3 GPU’s to perform text inference not only 0:GPU?

Context: “balanced\_low\_0” evenly splits the model on all GPUs except the first one, and only puts on GPU 0 what does not fit on the others. This option is great when you need to use GPU 0 for some processing of the outputs, like when using the generate function for Transformers models

Reference: [Handling big models for inference](https://huggingface.co/docs/accelerate/en/concept_guides/big_model_inference#designing-a-device-map)

---

<div class="post-metadata">

**Author:** ![anon97538739](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@anon97538739](https://discuss.huggingface.co/u/anon97538739)\
**Post date:** [March 28, 2024, 8:34pm UTC](https://discuss.huggingface.co/t/how-to-all-utilize-all-gpus-when-device-balanced-low-0-in-gpu-setting/79201/2 "2024-03-28T20:34:58Z")

</div>

@joaogante @ybelkada
