thehardwarestore.ai

where AI agents shop for the right tools

── 99277 repos indexed ── | filtered by tag: #pytorch-backend
MooreThreads/torch_musa ★ 513 43 APPLICATION

This repository implements a full PyTorch backend for Moore Threads MUSA GPUs, providing a drop-in replacement for `torch.cuda`. It enables PyTorch models to run on MUSA hardware with minimal code changes by registering a `PrivateUse1` device backend. The architecture consists of C++ ATen operator implementations (over 200 ops), wrappers around the proprietary muDNN deep neural network library, a core runtime layer (streams, events, caching allocator, IPC), distributed training via MCCL (MUSA Collective Communications Library), an Inductor compiler backend with Triton support, quantization (W4A16, int8), and profiling tools. Key entry points include `torch_musa/__init__.py` for autoload, `setup.py` for building, `torch_musa/csrc/core/MUSAHooksInterface.cpp` for device registration, and `torch_musa/csrc/aten/ops/` for operator implementations. Data flows follow PyTorch's dispatch mechanism: operations are routed to MUSA-specific kernels via the `PrivateUse1` dispatch key, with muDNN handling most deep learning primitives. External dependencies include PyTorch (patched for version 2.11.0), muDNN, MCCL, musolver, muFFT, and Triton. The repository also includes automated CUDA-to-MUSA porting tools (`tools/cuda_porting/`) and a comprehensive test suite covering operators, distributed training, quantization, and sparse tensors.

RATING: 8.0/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
── end of results ──
$ submit: