examples icon indicating copy to clipboard operation
examples copied to clipboard

Adding torch accelerator to ddp-tutorial-series example

Open dggaytan opened this issue 3 months ago • 2 comments

Adding accelerator to ddp tutorials examples

  • Support for multiple accelerators:
  • Updated ddp_setup functions in multigpu.py, multigpu_torchrun.py, and multinode.py to use torch.accelerator for device management. The initialization of process groups now dynamically selects the backend based on the device type, with a fallback to CPU if no accelerator is available.

Improvements to example execution:

  • Added run_example.sh to simplify running tutorial examples with configurable GPU counts and node settings.
  • Updated run_distributed_examples.sh to include a new function for running all DDP tutorial series examples.

Dependency updates:

  • Increased the minimum PyTorch version requirement in requirements.txt to 2.7 to ensure compatibility with the new torch.accelerator API.

CC: @msaroufim @malfet @dvrogozh

dggaytan avatar Sep 10 '25 20:09 dggaytan

Deploy Preview for pytorch-examples-preview ready!

Name Link
Latest commit cf74c6f23ca1b205ec75415048eaafbcb8ca58c5
Latest deploy log https://app.netlify.com/projects/pytorch-examples-preview/deploys/68c1dfab176c190008556e29
Deploy Preview https://deploy-preview-1393--pytorch-examples-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Sep 10 '25 20:09 netlify[bot]

@gujinghui @EikanWang

dggaytan avatar Sep 12 '25 17:09 dggaytan