AB
AiBoss
project

MusaCoder - Moore Threads' open-source dedicated code model

MusaCoder is an open-source code model developed by Moore Threads for generating high-performance CUDA/MUSA kernels from PyTorch operators.

What is MusaCoder?

MusaCoder is an open-source, dedicated large-scale code model for generating GPU-based low-level operators, developed by Moore's Threads. It supports the automatic generation of high-performance CUDA/MUSA kernels from PyTorch operators. The entire training process is completed on the Kua'e Intelligent Computing Cluster based on the MTT S5000. In KernelBench benchmarks, MusaCoder-27B-RL outperformed mainstream models such as Claude Opus 4.7 and DeepSeek-V4 Pro with scores of 93.2% Overall Pass@8 and 88.60% Avg.@8, achieving industry-leading performance.

MusaCoder's main functions

  • Operators are automatically generatedSupports automatic generation of high-performance CUDA/MUSA GPU kernel code from PyTorch operator descriptions.
  • Core operator coverageIt covers core deep learning operators such as matrix multiplication, convolution, reduction, and element-level operations.
  • Multi-specification modelIt offers three parameter scales: 7B, 14B, and 27B, flexibly adapting to computing power needs from the edge to the data center.
  • Execution verification closed loopBuilt-in compilation and runtime verification mechanism automatically detects the functional correctness and execution efficiency of the generated code.
  • Full-chain open sourceIt provides open-source model weights, training code, datasets, and validation tools, supporting the community in reproducing and retraining on domestically produced GPUs.

MusaCoder's technical principles

  • Infrastructure and Post-trainingBased on the Qwen2.5 series 7B/14B/32B large language model architecture, it injects GPU parallel programming and operator optimization knowledge through full-supervised fine-tuning, and then further aligns with performance goals through reinforcement learning, forming a dedicated code generation capability for underlying hardware.
  • Execution feedback reinforcement learningIntroducing a generation-compilation-execution closed-loop verification mechanism in the RL stage, using actual GPU running results as reward signals, continuously optimizing the model outputs runnable and efficient kernel code, significantly reducing the probability of hallucination code.
  • Full-chain verification of domestically produced GPUsThe entire post-training process is completed on the Kua'e Intelligent Computing Cluster based on Moore Threads MTT S5000, realizing a closed-loop end-to-end of domestic full-function GPUs from model training to operator inference, ensuring deep adaptation of the generated code to domestic hardware.

How to use MusaCoder

  • Environmental preparationDeploy Moore Threads MTT S5000 GPU and MUSA SDK, and install PyTorch and MusaTorch adapter frameworks.
  • Get the modelDownload the MusaCoder-7B/14B/27B open-source model weights from HuggingFace.
  • Input operator descriptionProvides a PyTorch operator API to be implemented or a high-level mathematical description as a hint for model input.
  • Generate KernelRun model inference and automatically generate the corresponding CUDA or MUSA underlying kernel implementation code.
  • Verification ExecutionThe generated kernel is compiled and executed using the built-in toolchain. The numerical correctness and running efficiency are compared, and iterative optimization is performed.

MusaCoder's core advantages

  • Domestic end-to-end closed loopThe first dedicated large-scale code model to complete the entire closed loop of training, validation, and inference on a domestically produced full-function GPU.
  • KernelBench LeadingThe MusaCoder-27B-RL achieved an Overall Pass@8 score of 93.2% in KernelBench testing, surpassing the Claude Opus 4.7 and DeepSeek-V4 Pro.
  • Enforceability GuaranteeThe closed-loop verification process of "generation-compilation-execution" ensures that the output code is compileable, runnable, and produces correct results.
  • Lowering the barrier to entry for domestically produced GPUsThe open-source full-stack solution allows developers to adapt to Moore's Threads GPUs without having to write the underlying kernel themselves.
  • Flexible deployment of multiple specificationsThe 7B / 14B / 27B three-level model meets different needs from real-time interaction to large-scale batch generation.

MusaCoder's project address

  • HuggingFace model libraryhttps://huggingface.co/MooreThreads/MusaCoder-27B
  • arXiv technical paper: https://arxiv.org/pdf/2606.04847

Comparison of similar products with MusaCoder

Dimension MusaCoder DeepSeek-Coder-V2
position Dedicated code model for GPU operator generation General code understanding, generation and reasoning model
Architectural foundation Post-training based on Qwen2.5 series Self-developed MoE architecture (total parameters 236B)
Training hardware Domestic MTT S5000 GPU Full-Chain Closed Loop NVIDIA GPU cluster
Verification mechanism Generate-compile-execute hardware closed-loop verification Static analysis and unit testing are the main methods.
Evaluation performance KernelBench Pass@8 93.2% (Industry Leading) Leading in general code evaluation (HumanEval, etc.)
Open source scope Model weights + training code + dataset Model weights open source

Application Scenarios of MusaCoder

  • Domestic AI Framework AdaptationAutomatically generate high-performance operator libraries adapted for Moore's Threads GPUs for frameworks such as PyTorch and TensorFlow.
  • HPC performance optimizationGenerate customized parallel computing kernels for scenarios such as scientific computing, meteorological simulation, and fluid dynamics.
  • Accelerating edge AI inference: Utilize lightweight 7B models to quickly generate optimized operators on edge devices, reducing inference latency.
  • AI compiler assistanceIt provides intelligent references for operator decomposition strategies and underlying code generation for deep learning compilers.
  • Domestic GPU Ecosystem EducationAs an open-source teaching case, it helps developers learn low-level parallel programming based on domestically produced GPUs.