P

migrate-pytorch-to-accelerator0-26-1

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

Short description

This codemod converts existing PyTorch code that follows the standard naming conventions to use HuggingFace Accelerate 0.26.1.

Detailed description

This codemod converts existing PyTorch code that follows the standard naming conventions to use HuggingFace Accelerate 0.26.1 so that ML code can easily run in a distributed manner. The changes include the additional import statements and some changes when device is concerned.

https://huggingface.co/docs/accelerate/v0.26.1/en/basic_tutorials/migration

Examples

Before

python

After

python

Ready to contribute?

Build your own codemod and share it with the community.