MooreThreads/torch_musa

torch_musa is an open source repository based on PyTorch, which can make full use of the super computing power of MooreThreads graphics cards.

What it solves

It enables PyTorch users to run their machine learning workloads on Moore Threads graphics cards. It removes the need to rewrite code for different hardware by providing a backend that mimics the PyTorch API, allowing developers to switch from CUDA or CPU to MUSA with minimal changes.

How it works

torch_musa acts as an extension to PyTorch. By changing the device string from cuda or cpu to musa, users can leverage Moore Threads hardware. It integrates with the MUSA-SDK, including tools like muDNN and MCCL (for distributed training), and provides a C/C++ extension API for writing custom high-performance layers with minimal boilerplate.

Who it’s for

AI developers and researchers who use PyTorch and want to migrate their models to Moore Threads GPUs.

Highlights

  • API Consistency: Uses the same format as PyTorch, making migration smooth for those accustomed to the standard library.
  • Hardware Acceleration: Provides access to Moore Threads GPU power through the musa backend.
  • C/C++ Extensions: Includes an efficient API for writing custom layers without needing extensive wrapper code.
  • Distributed Support: Supports distributed training and inference using the mccl backend.
  • Optimization Tools: Offers advanced features like Dynamic Double Casting and Unified Memory Management.

Related

  • Project
  • Project
  • Project
  • Project
  • Project