提供昇腾适配的更多Bridge模型代码
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
docs: Add PR template Co-authored-by: cjy840282<chenjingyi9@huawei.com> # message auto-generated for no-merge-commit merge: !43 merge template into master docs: Add PR template Created-by: cjy840282 Commit-by: cjy840282 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Add PR template. [#31](https://gitcode.com/Ascend/MindSpeed-Bridge/issues/31) ## Does this PR introduce any user-facing change? Make PR submissions more standardized to improve readability. ## How was this patch tested? Manual Review. See merge request: Ascend/MindSpeed-Bridge!43 | 9 天前 | |
feat: refactor MindSpeed-Bridge framework Co-authored-by: guozhihua2<guozhihua2@huawei.com> # message auto-generated for no-merge-commit merge: !38 merge bridge_setup_update into master feat: refactor MindSpeed-Bridge framework Created-by: guozhihua2 Commit-by: guozhihua2 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. Introduces a pip-installable MindSpeed-Bridge runtime, replacing the previous workflow that copied MindSpeed-Bridge files into Megatron-Bridge and modified upstream source code. 2. Adds a lightweight autoload mechanism that activates MindSpeed patches before Megatron-Bridge AutoBridge imports GPU-dependent modules, avoiding premature Transformer Engine imports on Ascend environments. 3. Adds lazy discovery and registration for model providers and model bridges under mindspeed_bridge.models. 4. Adds a unified extension mechanism for run_recipe-style entrypoints. Model-specific *_step.py modules can expose forward_step or STEP_FUNCTIONS without modifying the upstream run_recipe.py. 5. Keeps the Megatron-Bridge directory layout and provides the training launcher at mindspeed_bridge/scripts/training/run_recipe.py. 6. Separates AutoBridge model registration from training-step collection, so each workflow imports only the plugins it requires. 7. Splits runtime responsibilities into focused modules for autoloading, adaptor activation, plugin scanning and registration, entrypoint adaptation, hooks, and runtime state. 8. Adds concise installation/autoload and extension guides, plus three focused Skills for collection, upstream patching, and complete rewrites. ## Does this PR introduce any user-facing change? Yes. MindSpeed-Bridge should now be installed with pip instead of being copied into Megatron-Bridge: bash pip install -e . --no-deps Training should be launched through the installed module: bash torchrun ... --module mindspeed_bridge.scripts.training.run_recipe \ --recipe <recipe_name> \ --step_func <step_name> External RL and weight-conversion workflows can continue using Megatron-Bridge AutoBridge. MindSpeed-Bridge activates the required MindSpeed adaptor and registers available model providers and bridges when an AutoBridge factory is called. ## How was this patch tested? 1. Verified pip editable installation and Python startup autoload behavior. 2. Verified startup does not eagerly import all model and recipe modules. 3. Verified the MindSpeed adaptor is activated before AutoBridge loads GPU-dependent modules. 4. Verified lazy model-provider and model-bridge registration through AutoBridge.from_hf_pretrained() and AutoBridge.from_hf_config(). 5. Verified nested *_step.py discovery and injection into the upstream STEP_FUNCTIONS registry. 6. Verified the MindSpeed launcher delegates to the upstream Megatron-Bridge run_recipe entrypoint. 7. All files changed by this PR passed the repository pre-commit hooks, and the updated branch passed remote repository hooks. See merge request: Ascend/MindSpeed-Bridge!38 | 15 天前 | |
feat: add Docker build support for MindSpeed-Bridge Co-authored-by: yanzhixiao23<yanzhixiao@h-partners.com> # message auto-generated for no-merge-commit merge: !41 merge docker into master feat: add Docker build support for MindSpeed-Bridge Created-by: yanzhixiao23 Commit-by: yanzhixiao23 Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR adds a Docker build directory for MindSpeed-Bridge. It provides a configurable Dockerfile and build script for constructing an Ascend NPU training image based on the CANN 9.1.0-beta.3 base image and PTA v26.1.0-beta.2-pytorch2.9.0. Main changes: - Added docker/Dockerfile for building the MindSpeed-Bridge runtime image. - Added docker/image_build.sh to configure NPU type, OS, base image, PyTorch, torch_npu, and related dependency branches. - Added support for CANN 9.1.0-beta.3 images with Python 3.12. - Added support for a3, 950, 910b, 910, and 310p CANN image tags. - Added support for openeuler24.03 and ubuntu22.04. - Added --base-image-devel for using -devel CANN images. - Set default PTA release to v26.1.0-beta.2-pytorch2.9.0. - Set default torch_npu version to 2.9.0.post5. - Added apt/yum repository configuration scripts. - Added Chinese and English Docker usage documents. ## Does this PR introduce any user-facing change? Yes. This PR adds a new Docker build entry for MindSpeed-Bridge. Users can build the default image with: bash cd docker bash image_build.sh Users can also customize the base image, OS, NPU type, and torch_npu wheel, for example: bash bash image_build.sh -t a3 -o ubuntu22.04 Related documentation: - docker/OVERVIEW.zh.md - docker/OVERVIEW.md ## How was this patch tested? This is a Docker and documentation change. Verification performed: - Checked that the Docker files are added under docker/. - Checked that the default CANN base image version is 9.1.0-beta.3. - Checked that the default PTA release is v26.1.0-beta.2-pytorch2.9.0. - Checked that the default torch_npu version is 2.9.0.post5. - Checked that Python version references are aligned to 3.12. - Checked that CANN image tags support a3, 950, 910b, 910, and 310p. - Checked that both openeuler24.03 and ubuntu22.04 are documented. No Docker build was run in the local environment. See merge request: Ascend/MindSpeed-Bridge!41 | 4 天前 | |
feat: add Docker build support for MindSpeed-Bridge Co-authored-by: yanzhixiao23<yanzhixiao@h-partners.com> # message auto-generated for no-merge-commit merge: !41 merge docker into master feat: add Docker build support for MindSpeed-Bridge Created-by: yanzhixiao23 Commit-by: yanzhixiao23 Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR adds a Docker build directory for MindSpeed-Bridge. It provides a configurable Dockerfile and build script for constructing an Ascend NPU training image based on the CANN 9.1.0-beta.3 base image and PTA v26.1.0-beta.2-pytorch2.9.0. Main changes: - Added docker/Dockerfile for building the MindSpeed-Bridge runtime image. - Added docker/image_build.sh to configure NPU type, OS, base image, PyTorch, torch_npu, and related dependency branches. - Added support for CANN 9.1.0-beta.3 images with Python 3.12. - Added support for a3, 950, 910b, 910, and 310p CANN image tags. - Added support for openeuler24.03 and ubuntu22.04. - Added --base-image-devel for using -devel CANN images. - Set default PTA release to v26.1.0-beta.2-pytorch2.9.0. - Set default torch_npu version to 2.9.0.post5. - Added apt/yum repository configuration scripts. - Added Chinese and English Docker usage documents. ## Does this PR introduce any user-facing change? Yes. This PR adds a new Docker build entry for MindSpeed-Bridge. Users can build the default image with: bash cd docker bash image_build.sh Users can also customize the base image, OS, NPU type, and torch_npu wheel, for example: bash bash image_build.sh -t a3 -o ubuntu22.04 Related documentation: - docker/OVERVIEW.zh.md - docker/OVERVIEW.md ## How was this patch tested? This is a Docker and documentation change. Verification performed: - Checked that the Docker files are added under docker/. - Checked that the default CANN base image version is 9.1.0-beta.3. - Checked that the default PTA release is v26.1.0-beta.2-pytorch2.9.0. - Checked that the default torch_npu version is 2.9.0.post5. - Checked that Python version references are aligned to 3.12. - Checked that CANN image tags support a3, 950, 910b, 910, and 310p. - Checked that both openeuler24.03 and ubuntu22.04 are documented. No Docker build was run in the local environment. See merge request: Ascend/MindSpeed-Bridge!41 | 4 天前 | |
feat: Migrate Qwen VL Triton imports to mindspeed_ops Co-authored-by: yanzhixiao<yanzhixiao@h-partners.com> # message auto-generated for no-merge-commit merge: !42 merge ops into master feat: Migrate Qwen VL Triton imports to mindspeed_ops Created-by: yanzhixiao23 Commit-by: yanzhixiao Merged-by: ascend-robot Description: ## What this PR does / why we need it? - Migrate Qwen VL GDN-related Triton imports from mindspeed.ops.triton to mindspeed_ops. - Add local arch dispatch wrappers for GDN ops that are not exposed through mindspeed_ops.api.triton. - Update flash_gated_delta_rule.py and gated_delta_net.py to use mindspeed_ops.api.triton. - Fix an indentation error in mindspeed_ops.api.triton.chunk_gated_delta_rule. ## Does this PR introduce any user-facing change? Qwen3.5 VL registration can fail when Bridge imports still depend on the old mindspeed.ops.triton paths after MindSpeed-Ops is installed separately. This keeps the Qwen VL import chain aligned with the new mindspeed_ops package and prevents registration from being skipped due to import errors. ## How was this patch tested? - Ran python -m py_compile on the modified Qwen VL files and mindspeed_ops.api.triton.chunk_gated_delta_rule.py. - Confirmed no mindspeed.ops.triton imports remain under mindspeed_bridge/models/qwen_vl. - The Qwen3.5 9B and 35B models have passed the validation checks. See merge request: Ascend/MindSpeed-Bridge!42 | 5 天前 | |
add glm52 Co-authored-by: guozhihua2<guozhihua2@huawei.com> # message auto-generated for no-merge-commit merge: !27 merge add_glm5.2 into master add glm52 Created-by: guozhihua2 Commit-by: guozhihua2 Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR adds GLM52 model support in MindSpeed-Bridge and refactors the GLMBridge implementation to better support GLM-family model variants. Main changes include: 1. Add GLM52 model adaptation in Bridge, including model registration, provider configuration, model build flow, and related GLM52-specific bridge logic. 2. Refactor GLMBridge to separate common GLM bridge logic from model-specific behavior, making it easier to maintain GLM, GLM52, and future GLM-family model adaptations. 3. Add GLM52 indexer reuse logic. GLM52 does not keep a full indexer on every layer. Some layers compute and update indexer results, while shared/skipped layers reuse the cached indexer output from previous full-indexer layers. This PR adds the corresponding layer policy and runtime reuse logic to ensure the Megatron-side behavior is aligned with the GLM52 model design. 4. Add weight conversion filtering logic for GLM52. Since reused indexer layers do not own a complete set of indexer parameters, the conversion flow needs to filter out shared/runtime-only indexer states and only convert valid model parameters. This avoids unnecessary missing-key or unexpected-key issues during HF ↔ Megatron weight conversion. 5. Keep existing GLMBridge behavior compatible while extending the bridge to support GLM52-specific indexer and conversion requirements. ## Does this PR introduce any user-facing change? Yes. Users can now use the GLM52 model through MindSpeed-Bridge. No existing GLM model usage is expected to be affected. The main user-visible change is the newly supported GLM52 model type and its related training/conversion workflow. ## How was this patch tested? Verified by running the GLM52 ST script: tests/st/glm52_744b_tp4pp2ep4_layer4.sh This test covers the GLM52 Bridge adaptation path with TP4, PP2, EP4 and a 4-layer configuration, including model build and runtime execution. See merge request: Ascend/MindSpeed-Bridge!27 | 19 天前 | |
docs: add tests README for MindSpeed-Bridge Co-authored-by: yanzhixiao<yanzhixiao@h-partners.com> # message auto-generated for no-merge-commit merge: !40 merge master-test-md into master docs: add tests README for MindSpeed-Bridge Created-by: yanzhixiao23 Commit-by: yanzhixiao Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR adds tests/README.md for MindSpeed-Bridge to document the current ST/UT test coverage and test contribution rules. Main changes: - Added CI guarded test list for existing ST and UT cases. - Documented ST script, baseline, and metric registration rules. - Documented UT naming and distributed test guidelines. ## Does this PR introduce any user-facing change? No. This is a documentation-only change. Related documentation: - tests/README.md ## How was this patch tested? This documentation change was verified by checking that all links in tests/README.md point to existing test files. No automated tests were run. See merge request: Ascend/MindSpeed-Bridge!40 | 5 天前 | |
feat: refactor MindSpeed-Bridge framework Co-authored-by: guozhihua2<guozhihua2@huawei.com> # message auto-generated for no-merge-commit merge: !38 merge bridge_setup_update into master feat: refactor MindSpeed-Bridge framework Created-by: guozhihua2 Commit-by: guozhihua2 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. Introduces a pip-installable MindSpeed-Bridge runtime, replacing the previous workflow that copied MindSpeed-Bridge files into Megatron-Bridge and modified upstream source code. 2. Adds a lightweight autoload mechanism that activates MindSpeed patches before Megatron-Bridge AutoBridge imports GPU-dependent modules, avoiding premature Transformer Engine imports on Ascend environments. 3. Adds lazy discovery and registration for model providers and model bridges under mindspeed_bridge.models. 4. Adds a unified extension mechanism for run_recipe-style entrypoints. Model-specific *_step.py modules can expose forward_step or STEP_FUNCTIONS without modifying the upstream run_recipe.py. 5. Keeps the Megatron-Bridge directory layout and provides the training launcher at mindspeed_bridge/scripts/training/run_recipe.py. 6. Separates AutoBridge model registration from training-step collection, so each workflow imports only the plugins it requires. 7. Splits runtime responsibilities into focused modules for autoloading, adaptor activation, plugin scanning and registration, entrypoint adaptation, hooks, and runtime state. 8. Adds concise installation/autoload and extension guides, plus three focused Skills for collection, upstream patching, and complete rewrites. ## Does this PR introduce any user-facing change? Yes. MindSpeed-Bridge should now be installed with pip instead of being copied into Megatron-Bridge: bash pip install -e . --no-deps Training should be launched through the installed module: bash torchrun ... --module mindspeed_bridge.scripts.training.run_recipe \ --recipe <recipe_name> \ --step_func <step_name> External RL and weight-conversion workflows can continue using Megatron-Bridge AutoBridge. MindSpeed-Bridge activates the required MindSpeed adaptor and registers available model providers and bridges when an AutoBridge factory is called. ## How was this patch tested? 1. Verified pip editable installation and Python startup autoload behavior. 2. Verified startup does not eagerly import all model and recipe modules. 3. Verified the MindSpeed adaptor is activated before AutoBridge loads GPU-dependent modules. 4. Verified lazy model-provider and model-bridge registration through AutoBridge.from_hf_pretrained() and AutoBridge.from_hf_config(). 5. Verified nested *_step.py discovery and injection into the upstream STEP_FUNCTIONS registry. 6. Verified the MindSpeed launcher delegates to the upstream Megatron-Bridge run_recipe entrypoint. 7. All files changed by this PR passed the repository pre-commit hooks, and the updated branch passed remote repository hooks. See merge request: Ascend/MindSpeed-Bridge!38 | 15 天前 | |
add qwen35vl_35B_sft Co-authored-by: guozhihua2<guozhihua2@huawei.com> | 2 个月前 | |
add qwen35vl_35B_sft Co-authored-by: guozhihua2<guozhihua2@huawei.com> | 2 个月前 | |
feat: Automated Installation Co-authored-by: leizhenzhen23<leizhenzhen4@huawei.com> # message auto-generated for no-merge-commit merge: !8 merge master into master feat: Automated Installation Created-by: leizhenzhen23 Commit-by: leizhenzhen23 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 提供自动化安装工具,支持两种模式: 一键安装模式 :自动下载依赖并完成适配 仅适配模式 :在已有依赖基础上完成适配 ## Does this PR introduce any user-facing change? NA ## How was this patch tested? NA See merge request: Ascend/MindSpeed-Bridge!8 | 2 个月前 | |
feat: refactor MindSpeed-Bridge framework Co-authored-by: guozhihua2<guozhihua2@huawei.com> # message auto-generated for no-merge-commit merge: !38 merge bridge_setup_update into master feat: refactor MindSpeed-Bridge framework Created-by: guozhihua2 Commit-by: guozhihua2 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. Introduces a pip-installable MindSpeed-Bridge runtime, replacing the previous workflow that copied MindSpeed-Bridge files into Megatron-Bridge and modified upstream source code. 2. Adds a lightweight autoload mechanism that activates MindSpeed patches before Megatron-Bridge AutoBridge imports GPU-dependent modules, avoiding premature Transformer Engine imports on Ascend environments. 3. Adds lazy discovery and registration for model providers and model bridges under mindspeed_bridge.models. 4. Adds a unified extension mechanism for run_recipe-style entrypoints. Model-specific *_step.py modules can expose forward_step or STEP_FUNCTIONS without modifying the upstream run_recipe.py. 5. Keeps the Megatron-Bridge directory layout and provides the training launcher at mindspeed_bridge/scripts/training/run_recipe.py. 6. Separates AutoBridge model registration from training-step collection, so each workflow imports only the plugins it requires. 7. Splits runtime responsibilities into focused modules for autoloading, adaptor activation, plugin scanning and registration, entrypoint adaptation, hooks, and runtime state. 8. Adds concise installation/autoload and extension guides, plus three focused Skills for collection, upstream patching, and complete rewrites. ## Does this PR introduce any user-facing change? Yes. MindSpeed-Bridge should now be installed with pip instead of being copied into Megatron-Bridge: bash pip install -e . --no-deps Training should be launched through the installed module: bash torchrun ... --module mindspeed_bridge.scripts.training.run_recipe \ --recipe <recipe_name> \ --step_func <step_name> External RL and weight-conversion workflows can continue using Megatron-Bridge AutoBridge. MindSpeed-Bridge activates the required MindSpeed adaptor and registers available model providers and bridges when an AutoBridge factory is called. ## How was this patch tested? 1. Verified pip editable installation and Python startup autoload behavior. 2. Verified startup does not eagerly import all model and recipe modules. 3. Verified the MindSpeed adaptor is activated before AutoBridge loads GPU-dependent modules. 4. Verified lazy model-provider and model-bridge registration through AutoBridge.from_hf_pretrained() and AutoBridge.from_hf_config(). 5. Verified nested *_step.py discovery and injection into the upstream STEP_FUNCTIONS registry. 6. Verified the MindSpeed launcher delegates to the upstream Megatron-Bridge run_recipe entrypoint. 7. All files changed by this PR passed the repository pre-commit hooks, and the updated branch passed remote repository hooks. See merge request: Ascend/MindSpeed-Bridge!38 | 15 天前 | |
feat: compatibility improvements among third-party dependencies Co-authored-by: yanzhixiao<yanzhixiao@h-partners.com> # message auto-generated for no-merge-commit merge: !31 merge requirement-fix into master feat: compatibility improvements among third-party dependencies Created-by: yanzhixiao23 Commit-by: yanzhixiao Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1.Improves compatibility with third-party dependencies. 2.Removes version constraints on third-party packages, including fla, setuptools, nvidia-modelopt, nvidia-resiliency-ext. 3.The transformers and torchvision version has already been approved and is not included in this update. ## Does this PR introduce any user-facing change? No. This PR only contains compatibility improvements and does not introduce any user-facing changes. ## How was this patch tested? Passed ST validation in the LLM repository. See merge request: Ascend/MindSpeed-Bridge!31 | 22 天前 | |
feat: refactor MindSpeed-Bridge framework Co-authored-by: guozhihua2<guozhihua2@huawei.com> # message auto-generated for no-merge-commit merge: !38 merge bridge_setup_update into master feat: refactor MindSpeed-Bridge framework Created-by: guozhihua2 Commit-by: guozhihua2 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. Introduces a pip-installable MindSpeed-Bridge runtime, replacing the previous workflow that copied MindSpeed-Bridge files into Megatron-Bridge and modified upstream source code. 2. Adds a lightweight autoload mechanism that activates MindSpeed patches before Megatron-Bridge AutoBridge imports GPU-dependent modules, avoiding premature Transformer Engine imports on Ascend environments. 3. Adds lazy discovery and registration for model providers and model bridges under mindspeed_bridge.models. 4. Adds a unified extension mechanism for run_recipe-style entrypoints. Model-specific *_step.py modules can expose forward_step or STEP_FUNCTIONS without modifying the upstream run_recipe.py. 5. Keeps the Megatron-Bridge directory layout and provides the training launcher at mindspeed_bridge/scripts/training/run_recipe.py. 6. Separates AutoBridge model registration from training-step collection, so each workflow imports only the plugins it requires. 7. Splits runtime responsibilities into focused modules for autoloading, adaptor activation, plugin scanning and registration, entrypoint adaptation, hooks, and runtime state. 8. Adds concise installation/autoload and extension guides, plus three focused Skills for collection, upstream patching, and complete rewrites. ## Does this PR introduce any user-facing change? Yes. MindSpeed-Bridge should now be installed with pip instead of being copied into Megatron-Bridge: bash pip install -e . --no-deps Training should be launched through the installed module: bash torchrun ... --module mindspeed_bridge.scripts.training.run_recipe \ --recipe <recipe_name> \ --step_func <step_name> External RL and weight-conversion workflows can continue using Megatron-Bridge AutoBridge. MindSpeed-Bridge activates the required MindSpeed adaptor and registers available model providers and bridges when an AutoBridge factory is called. ## How was this patch tested? 1. Verified pip editable installation and Python startup autoload behavior. 2. Verified startup does not eagerly import all model and recipe modules. 3. Verified the MindSpeed adaptor is activated before AutoBridge loads GPU-dependent modules. 4. Verified lazy model-provider and model-bridge registration through AutoBridge.from_hf_pretrained() and AutoBridge.from_hf_config(). 5. Verified nested *_step.py discovery and injection into the upstream STEP_FUNCTIONS registry. 6. Verified the MindSpeed launcher delegates to the upstream Megatron-Bridge run_recipe entrypoint. 7. All files changed by this PR passed the repository pre-commit hooks, and the updated branch passed remote repository hooks. See merge request: Ascend/MindSpeed-Bridge!38 | 15 天前 |
MindSpeed-Bridge
Megatron-Bridge 是 NeMo Framework 下的 PyTorch 原生库,为主流 LLM/VLM 模型提供预训练、SFT 和 LoRA 能力。在训练方面,基于 Megatron Core 构建高性能可扩展的训练循环,支持张量并行、流水线并行及混合精度训练(FP8、BF16 等);在模型转换方面,作为 Hugging Face 与 Megatron Core 之间的桥接与验证层,支持双向 checkpoint 转换,便于其他项目接入 Megatron Core 的并行能力或将模型导出至各类推理引擎,同时内置验证机制保障跨格式转换的精度与完整性。
MindSpeed-Bridge 在 Megatron-Bridge 基础上,面向昇腾平台额外提供:
- 更多开源模型支持:扩展昇腾平台上的模型覆盖范围
- 精度验证:经过昇腾 NPU 平台的精度对齐与验证
- 亲和性能优化:针对昇腾硬件特性的性能调优
最新消息
- 🔥 2026-05:MindSpeed-Bridge 仓库创建,提供 Qwen3.5-VL 模型的训练与适配支持