# Trainer use multigpu

**URL:** <https://discuss.huggingface.co/t/trainer-use-multigpu/8799>\
**Category:** 🤗Transformers\
**Created:** [July 29, 2021, 9:29am UTC](https://discuss.huggingface.co/t/trainer-use-multigpu/8799 "2021-07-29T09:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrdxwandg](https://avatars.discourse-cdn.com/v4/letter/h/ad7895/32.png) [@hrdxwandg](https://discuss.huggingface.co/u/hrdxwandg)\
**Post date:** [July 29, 2021, 9:29am UTC](https://discuss.huggingface.co/t/trainer-use-multigpu/8799/1 "2021-07-29T09:29:51Z")

</div>

I read many discussion，they tell me if I use trainer API, I can automatically use multi-gpu. But in my case, it is not true

I run the pytorch version example run\_mlm.py with model bert-base-chinese and my own train/valid dataset. But I find the GPU-Util is low, but the cpu is full. How Can I fix the problem, and use GPU-Util is full. when I use Accelerate library, the GPU-Util is almost 100% with the same params.

![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/0/0ad35d867bc6a272c4c33b5be591ffee38c4430c.png)

![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/7/7edb72833d2f1ab781f0370ab33e23aaea584e45.png)
