# Trainer attribute, n\_gpu

**URL:** <https://discuss.huggingface.co/t/trainer-attribute-n-gpu/75103>\
**Category:** 🤗Transformers\
**Created:** [February 28, 2024, 5:55am UTC](https://discuss.huggingface.co/t/trainer-attribute-n-gpu/75103 "2024-02-28T05:55:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![qiying](https://avatars.discourse-cdn.com/v4/letter/q/8e8cbc/32.png) [@qiying](https://discuss.huggingface.co/u/qiying)\
**Post date:** [February 28, 2024, 5:55am UTC](https://discuss.huggingface.co/t/trainer-attribute-n-gpu/75103/1 "2024-02-28T05:55:01Z")

</div>

In a ddp training with multiple gpus, what should the value of `n_gpu` be?

In my setting, the `n_gpu` is always 1 no matter how many gpus are used. I am worried about whether this indicates a bug.

framework: pytorch, GPU type: nvidia-a100
