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

torch_musa enables PyTorch users to run their deep learning models on Moore Threads graphics cards. It acts as a bridge, allowing developers to leverage the hardware acceleration of these GPUs without needing to rewrite their existing PyTorch code.

How it works

The package extends PyTorch by adding a new backend called 'musa'. Users can replace standard 'cuda' or 'cpu' device calls with 'musa' to target Moore Threads hardware. It maintains API consistency with PyTorch, meaning most scripts function with minimal changes. For more complex needs, it provides tools for porting CUDA code, building custom extensions, and managing memory optimizations like Dynamic Double Casting.

Who it’s for

This tool is for developers and researchers who use PyTorch and want to deploy or train models on Moore Threads hardware. It is particularly useful for those who have existing PyTorch projects and want a smooth migration path to the MUSA platform.

Highlights

  • Seamless integration: Switch from 'cuda' to 'musa' backend with minimal code changes.
  • Native support: Provides specialized tools for debugging, porting, and building custom C/C++ layers.
  • Ecosystem compatibility: Supports popular libraries like Transformers, Accelerate, and various PyTorch-related repositories.
  • Flexible deployment: Available via pre-built Python wheels or source builds, with official Docker images for quick setup.
  • Advanced optimization: Includes features like Unified Memory Management and Dynamic Double Casting for performance tuning.

Related

  • Project
  • Project
  • Project
  • Project
  • Project