MindSpeed-Bridge:基于 Megatron-Bridge 的昇腾 NPU 大模型训练适配框架

提供昇腾适配的更多Bridge模型代码

Branch5Tags1

MindSpeed Bridge

Megatron-Bridge is a PyTorch-native library within the NeMo Framework that provides pretraining, supervised fine-tuning (SFT), and low-rank adaptation (LoRA) capabilities for mainstream LLMs and VLMs. For training, it builds a high-performance, scalable training loop on Megatron Core, supporting tensor parallelism, pipeline parallelism, context parallelism, expert parallelism, sequence parallelism, and mixed-precision training (FP8, BF16, etc.). For model conversion, it serves as a bridging and verification layer between Hugging Face and Megatron Core, enabling bidirectional checkpoint conversion so that other projects can leverage Megatron Core's parallelism capabilities or export models to various inference engines, while a built-in verification mechanism ensures the accuracy and completeness of cross-format conversion.

MindSpeed Bridge is a training adaptation framework of Megatron-Bridge on the Ascend platform. It integrates with Megatron-Bridge in a non-intrusive way and additionally provides the following features for Huawei Ascend NPUs:

  • More open-source model support: Expands model coverage on the Ascend platform, with pre-configured training adaptations and out-of-the-box training scripts for models such as GLM-5/GLM-5.2, Kimi-K3, and Qwen3.5-VL.
  • Accuracy verification: Provides a consistency comparison tool for Hugging Face and Megatron weight conversion, and ensures accuracy alignment and verification on the Ascend NPU platform through system test baseline comparison.
  • Affinity performance optimization: Performance tuning targeted at Ascend hardware features, such as NPU-affinity implementations of fused optimizers, sparse attention such as DSA, and linear attention such as KDA and GDN.

For a detailed framework introduction, see MindSpeed Bridge Introduction.

Latest News


  • 🔥 2026-08: Training and adaptation support available for GLM-5 and GLM-5.2 models
  • 🔥 2026-05: MindSpeed Bridge repository created, with training and adaptation support for Qwen3.5-VL models

Directory Structure


The MindSpeed Bridge project code is organized following modular design principles.

MindSpeed-Bridge/
 ├── .gitcode                  # GitCode platform configuration (PR templates, etc.)
 ├── ci                        # CI gates
 ├── docker                    # Docker training image build
 ├── docs                      # Project documentation directory
 │   ├── zh                    # Chinese documentation
 │   └── en                    # English documentation
 ├── mindspeed_bridge          # Core code directory
 │   ├── examples              # Example training scripts and tools
 │   ├── features              # Feature modules (optimizers/data processing/distributed checkpoint resumption)
 │   ├── models                # Model adaptation (bridge/provider/modeling)
 │   ├── recipes               # Training recipe configuration
 │   ├── runtime               # Runtime (automatic registration/entry adaptation)
 │   ├── scripts               # Training entry scripts
 │   ├── skill                 # Development skills and workflow documentation
 │   └── utils                 # Utility functions
 ├── pre-commit                # pre-commit hook configuration
 ├── tests                     # Test case directory (ST/UT)
 ├── tools                     # Tool scripts (install_auto.sh, etc.)
 ├── pyproject.toml            # Build configuration
 ├── requirements.txt          # Python dependency file
 ├── setup.py                  # Installation configuration file
 ├── README_en.md              # English project documentation
 └── README.md                 # Chinese project documentation

Documentation Guide


The MindSpeed Bridge documentation directory contains the following core content:

Release Notes


See the Release Notes for the latest and historical releases of MindSpeed Bridge, including the software compatibility tables for each version, version compatibility descriptions, and update notes for the current version.

Installation


Quick Start


Guides developers to quickly launch instruction fine-tuning tasks for large language models/multimodal models. For specific operations, refer to:

MindSpeed Bridge comes with the following pre-configured training example scripts (located in mindspeed_bridge/examples/):

Model Task Example Script
Qwen3.5-VL-9B SFT qwen35_vl_9b_sft_4k_A3.sh
Kimi-K3 SFT kimi_k3_sft_4k_A3.sh
Qwen3.5-VL-35B-A3B SFT qwen35_vl_35b_sft_4k_A3.sh
Qwen3.5-VL-122B-A10B SFT qwen35_vl_122b_sft.sh
Qwen3.5-VL-397B-A17B SFT qwen35_vl_397b_sft.sh

Supported Models


MindSpeed Bridge has completed training adaptation (the Bridge/Provider/modeling trio) and fine-tuning recipes for multiple models, covering Dense/MoE/VLM architectures. For the list of supported models, see the Supported Models.

Training Solutions and Features


MindSpeed Bridge provides distributed instruction supervised fine-tuning (SFT) training solutions, supporting multi-dimensional parallel strategies such as TP/PP/CP/EP/SP, sequence packing, recomputation, MTP multi-token prediction, CUDA Graph, and other training optimization techniques. It also comes with pre-configured performance optimization features for Ascend hardware:

  • Fused optimizer: FastAdamW (fused AdamW), fast multi-tensor gradient scaling
  • Data processing: shuffle control for VLM preloaded datasets
  • Distributed checkpoint resumption: compatibility support for NVRX asynchronous checkpoints
  • Ascend GDN: forward and backward implementations of Gated Delta Net using AscendC custom operators

Weight Conversion and Accuracy Verification


MindSpeed Bridge supports bidirectional weight conversion between Hugging Face and Megatron formats (based on AutoBridge of Megatron-Bridge), and provides the Hugging Face and Megatron Model Comparison Tool to verify the forward output consistency of converted models. It supports text-only LLMs and vision-language models, as well as the storage and loading of Kimi-K3 MXFP4 (E2M1) quantized weights.

Testing


MindSpeed Bridge provides a dual testing system consisting of unit tests (UT) and end-to-end system tests (ST, including baseline comparison) to safeguard core training, model adaptation, and common test tool capabilities. For details, see the Test Case Contribution Guide.

Version Maintenance Policy


MindSpeed Bridge versions go through the following five maintenance phases:

Status Time Description
Planned 1-3 months Planned features
Development 3 months Features under development
Maintenance 6-12 months Merge all resolved issues and release new versions; different maintenance strategies apply to different MindSpeed Bridge versions, with maintenance periods of 6 months and 12 months for regular versions and long-term support versions respectively
No maintenance 0-3 months Merge all resolved issues; no dedicated maintainers and no releases
End of Life (EOL) N/A The branch no longer accepts any changes

Maintenance strategy for released MindSpeed Bridge versions:

MindSpeed Bridge Version Corresponding Tag Maintenance Strategy Current Status Release Date Next Status EOL Date
26.2.0_v0.5.0 v26.2.0_v0.5.0 Regular version Maintenance 2026/9/30 Expected no maintenance from 2027/3/30
0.3.1 v0.3.1 Regular version Maintenance 2026/6/30 Expected no maintenance from 2026/12/30

Roadmap


The roadmap will be refreshed in the MindSpeed Bridge RoadMap. Welcome to check out the latest planning updates of MindSpeed Bridge.

FAQs


For common issues encountered during basic use of the repository, refer to the MindSpeed Bridge FAQs. For questions not covered in the FAQ, you can search the issues list of the repository for similar issues, or submit a new issue.

Security Statement


MindSpeed Bridge is intended solely for research and development purposes. When using it, please comply with applicable laws and regulations as well as the License requirements of the models and datasets used. For information on system hardening, data security, runtime security, communication security, and vulnerability reporting, see the MindSpeed Bridge Security Notice.

Disclaimer


To MindSpeed Bridge Users

  1. The models provided by MindSpeed Bridge are for your non-commercial use only.
  2. The third-party open-source software that MindSpeed Bridge depends on, such as Megatron-LM and Megatron-Bridge, is provided and maintained by third-party communities. Fixes for issues caused by third-party open-source software depend on the contributions and feedback of the relevant communities. You should understand that the MindSpeed Bridge repository does not guarantee fixes for issues in the third-party open-source software itself, nor does it guarantee that it will test and correct all vulnerabilities and errors in third-party open-source software.
  3. For each model, MindSpeed Bridge merely suggests datasets that may be used for training; Huawei does not provide any datasets. If you use these datasets for training, please pay special attention to complying with the License of the corresponding datasets. Huawei shall not bear any responsibility for any infringement disputes arising from your use of the datasets.
  4. If you discover any issues while using MindSpeed Bridge (including but not limited to functional and compliance issues), please submit an issue on GitCode, and we will review and resolve it in a timely manner.

To Dataset Owners

If you do not want your dataset to be mentioned by the models in MindSpeed Bridge, or if you want to update the description of your dataset in the models of MindSpeed Bridge, please submit an issue on GitCode, and we will delete or update the description of your dataset according to your request. We sincerely appreciate your understanding of and contribution to MindSpeed Bridge.

License Statement


For the license to use MindSpeed Bridge, see LICENSE.

Contributions


If you wish to report issues to MindSpeed Bridge and contribute code, see the Contribution Guide.

Acknowledgments


Thanks to every PR from the community. Contributions to MindSpeed Bridge are welcome.

Introduction

提供昇腾适配的更多Bridge模型代码

Customize your domain