# Using Transformers with DistributedDataParallel — any examples?

**URL:** <https://discuss.huggingface.co/t/using-transformers-with-distributeddataparallel-any-examples/10775>\
**Category:** Intermediate\
**Created:** [October 14, 2021, 2:33pm UTC](https://discuss.huggingface.co/t/using-transformers-with-distributeddataparallel-any-examples/10775 "2021-10-14T14:33:51Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/brando/32/30114_2.png) [@brando](https://discuss.huggingface.co/u/brando)\
**Post date:** [August 17, 2022, 7:12pm UTC](https://discuss.huggingface.co/t/using-transformers-with-distributeddataparallel-any-examples/10775/10 "2022-08-17T19:12:16Z")

</div>

In case that wasn’t clear this will do everything automatically:

```auto
python -m torch.distributed.launch --nproc_per_node 2 ~/src/main_debug.py

```

see details: [How to run an end to end example of distributed data parallel with hugging face's trainer api (ideally on a single node multiple gpus)? - #4 by brando](https://discuss.huggingface.co/t/how-to-run-an-end-to-end-example-of-distributed-data-parallel-with-hugging-faces-trainer-api-ideally-on-a-single-node-multiple-gpus/21750/4)

---

_[View the full topic](https://discuss.huggingface.co/t/using-transformers-with-distributeddataparallel-any-examples/10775)._
