| chore: add VS Code devcontainer configuration Co-authored-by: wxy1105<wangxinyu136@huawei.com> # message auto-generated for no-merge-commit merge: !4892 merge devcontainer_0730 into master chore: add VS Code devcontainer configuration Created-by: wxy1105 Commit-by: wxy1105 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Adds a complete VS Code Dev Container for MindSpeed-LLM, including: CANN, PyTorch, TorchNPU, Triton-Ascend, MindSpeed, Megatron-LM, and FSDPTurbo. NPU driver/device passthrough. Sequential pip mirror fallback and bounded Megatron-LM clone retries. External repositories arranged alongside MindSpeed-LLM under /workspace. Automatic dependency installation and Megatron symlink refresh. This provides a reproducible NPU development and testing environment. ## Does this PR introduce any user-facing change? Yes. Users can now open the repository with VS Code Dev Containers and work in a preconfigured NPU environment. Usage instructions, configuration, version customization, and troubleshooting are documented in: .devcontainer/README.md The existing repository is mounted at /workspace/MindSpeed-LLM; external dependencies are placed under /workspace. Dependency conflicts reported by pip check are warnings and do not block container initialization. ## How was this patch tested? The JSON configuration, Dockerfile syntax/diffs, paths, and dependency-source logic were statically validated. Dev Container builds were also used to verify image construction, dependency installation, post-create initialization, and identified network/dependency failure handling. Verify manually with: npu-smi info python3 -c "import torch, torch_npu; print(torch.__version__, torch.npu.is_available())" python3 -c "import mindspeed, megatron" readlink /workspace/MindSpeed-LLM/megatron python3 -m pip check See merge request: Ascend/MindSpeed-LLM!4892 | 28 天前 |
| docs: change pr template Co-authored-by: LinShua<707894133@qq.com> # message auto-generated for no-merge-commit merge: !4299 merge master_pr_template3 into master docs: change pr template Created-by: LinShua Commit-by: LinShua Merged-by: ascend-robot Description: ## What this PR does / why we need it? change pr template ## Does this PR introduce any user-facing change? NA ## How was this patch tested? NA See merge request: Ascend/MindSpeed-LLM!4299 | 5 个月前 |
| docs: add git submodule management for 3rdparty dependencies Co-authored-by: iansheng<shengjiayi@huawei.com> # message auto-generated for no-merge-commit merge: !4875 merge master into master docs: add git submodule management for 3rdparty dependencies Created-by: iansheng Commit-by: iansheng Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR adds an optional Git Submodule-based installation method to the MindSpeed LLM install guide, enabling unified version management of third-party dependencies (MindSpeed, FSDPTurbo, Megatron-LM). Background: Previously, users had to manually git clone and git checkout each dependency repository (steps 5-7 in "方式二:源码安装"), which made version tracking difficult and error-prone. This PR introduces 方式三:Git Submodule统一管理(可选) as an alternative approach. Detailed changes: Add .gitmodules and register three submodules under 3rdparty/: 3rdparty/MindSpeed — tracks remote master branch (latest) 3rdparty/FSDPTurbo — tracks remote main branch (latest) 3rdparty/Megatron-LM — pinned to tag core_v0.12.1 (commit a845aa7e1) ## Does this PR introduce any user-facing change? Yes, this PR introduces a new optional installation method documented in docs/zh/pytorch/training/install_guide.md. Users can now choose between: 方式二:源码安装 (existing, unchanged) — manual clone + checkout 方式三:Git Submodule统一管理(可选) (new) — git submodule update --init --recursive for one-command dependency setup No changes to existing installation flows. The new method is fully backward-compatible. Users who adopt the submodule approach should be aware that: MindSpeed and FSDPTurbo track remote latest by default; use git submodule update --init --remote to pull the latest commits. Megatron-LM is pinned to core_v0.12.1 and will not auto-update. The symlink-based install requires a Unix-like environment (Linux/macOS). On Windows, use pip3 install -e . within each submodule directory instead. ## How was this patch tested? N/A See merge request: Ascend/MindSpeed-LLM!4875 | 27 天前 |
| feat(pytorch): Upgrading Default Dependencies Co-authored-by: zhyebin01<zhangyebin@h-partners.com> # message auto-generated for no-merge-commit merge: !4996 merge master into master feat(pytorch): Upgrading Default Dependencies Created-by: zhyebin01 Commit-by: zhyebin01 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Upgrade Python (3.10→3.12) and PyTorch (2.7.1→2.10.0) to keep the stack current, improve performance, and apply security patches. Adjusted dependency constraints accordingly. ## Does this PR introduce any user-facing change? Yes. Users must now use **Python 3.12** and **PyTorch 2.10.0** (or compatible versions) for the development/runtime environment. Installation commands may need to be updated accordingly (e.g., conda create -n new_env python=3.12). No change to the training/inference API or command‑line arguments. ## How was this patch tested? pipeline test pass See merge request: Ascend/MindSpeed-LLM!4996 | 2 天前 |
| refactor(pytorch): delete ckpt-v1 Co-authored-by: qyzqyz<quyueze@h-partners.com> # message auto-generated for no-merge-commit merge: !4831 merge master into master refactor(pytorch): delete ckpt-v1 Created-by: qyzqyz Commit-by: qyzqyz Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR removes the legacy Weight Conversion V1 implementation and completes the migration to Weight Conversion V2. The main changes include: * Remove the deprecated Weight Conversion V1 codebase. * Migrate the remaining scripts that still depended on V1 to Weight Conversion V2. * Update related README and documentation to reflect the new conversion workflow. * Clean up obsolete files and references associated with the V1 implementation. This change simplifies code maintenance and ensures that all weight conversion workflows are unified under the actively maintained V2 framework. --- ## Does this PR introduce any user-facing change? Yes. Weight Conversion V1 is no longer supported. Users should use Weight Conversion V2 for all checkpoint conversion workflows. The related README and documentation have been updated accordingly to guide users to the new conversion process. --- ## How was this patch tested? The following verification was performed: * Verified that all remaining weight conversion scripts have been successfully migrated to Weight Conversion V2. * Verified that the updated conversion workflow functions correctly after removing the V1 implementation. * Verified that related documentation and examples are consistent with the current implementation. * Regression tests and pipeline ST passed successfully. See merge request: Ascend/MindSpeed-LLM!4831 | 28 天前 |
| feat: Update Docker Images for MindSpeed-LLM 26.1.0 Co-authored-by: wxy1105<wangxinyu136@huawei.com> # message auto-generated for no-merge-commit merge: !4946 merge docker_rp2 into master feat: Update Docker Images for MindSpeed-LLM 26.1.0 Created-by: wxy1105 Commit-by: wxy1105 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Updates the Docker stack and documentation for MindSpeed-LLM 26.1.0, including CANN 9.1.0, Python 3.12, torch-npu 2.7.1.post8, Ascend 950 support, package source optimization, and historical image tags. ## Does this PR introduce any user-facing change? Yes. Docker builds now use the latest stack by default, support 910b, a3, and 950, and include updated documentation in docker/OVERVIEW.md, docker/OVERVIEW.zh.md, and docker/supported_tags.md. ## How was this patch tested? The image verification script was executed to confirm that the image could be built successfully. See merge request: Ascend/MindSpeed-LLM!4946 | 3 天前 |
| docs(pytorch): updated install_guide for Image Installation Co-authored-by: LQ1206<liuqian164@h-partners.com> # message auto-generated for no-merge-commit merge: !5002 merge master into master docs(pytorch): updated install_guide for Image Installation Created-by: LQ1206 Commit-by: LQ1206 Merged-by: ascend-robot Description: ## What this PR does / why we need it? docs(pytorch): updated install_guide for Image Installation ## Does this PR introduce any user-facing change? docs(pytorch): updated install_guide for Image Installation ## How was this patch tested? No test See merge request: Ascend/MindSpeed-LLM!5002 | 15 小时前 |
| feat(mcore): update GLM-5.2 A3 scripts Co-authored-by: LinShua<707894133@qq.com> # message auto-generated for no-merge-commit merge: !5000 merge glm52_sh_fix into master feat(mcore): update GLM-5.2 A3 scripts Created-by: LinShua Commit-by: LinShua Merged-by: ascend-robot Description: Fixes #1817 ## What this PR does / why we need it? 1. Align the GLM-5.2 744B A3 generation example by removing the default fused lightning indexer, sparse flash attention, and MLA absorb flags that are outside this script's intended configuration. 2. Simplify the GLM-5.2 744B A3 pretraining example and POC script by removing unused argument definitions and no longer passing the extra ROPE, memory, and profiling groups by default where applicable. 3. Add a GLM-5.2 210B 4K A3 pretraining POC script with reusable distributed, model, MLA, MoE, DSA, recomputation, and pipeline argument groups. This PR changes shell entrypoints only and does not modify training runtime code or public APIs. ## Does this PR introduce any user-facing change? Yes. Users gain a GLM-5.2 210B 4K A3 pretraining POC entrypoint under tests/poc/glm52/, while the existing 744B A3 example and POC commands no longer enable or pass the removed optional argument groups by default. ## How was this patch tested? 1. Ran changed-file pre-commit hooks on all four modified or added shell scripts. trailing-whitespace, end-of-file-fixer, check-added-large-files, check-merge-conflict, detect-private-key, codespell, and typos passed; file-type-specific YAML, JSON, Python, and C/C++ hooks were skipped. The repository-local gitleaks-offline-scan hook could not run because the configured ./gitleaks executable is absent. 2. Ran D:\Git\Git\bin\bash.exe -n on all four scripts; it passed. 3. Ran git diff --check origin/master...HEAD; it passed. 4. Verified git rev-list --count origin/master..HEAD returns 1 after squashing. 5. The GitCode push reported remote Git Hooks Checking [PASSED]. 6. No model training, accuracy, performance, or end-to-end functional test was run. See merge request: Ascend/MindSpeed-LLM!5000 | 2 天前 |
| fix: fix loss_coeff not taking effect and missing scaling in DSv4 indexer gradient scaling Co-authored-by: zhezhezhe<lihaozhe9@huawei.com> # message auto-generated for no-merge-commit merge: !4993 merge fix_gnorm into master fix: fix loss_coeff not taking effect and missing scaling in DSv4 indexer gradient scaling Created-by: lihaozhe777 Commit-by: zhezhezhe Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. **npu_sparse_flash_mla_with_indexer_loss.py**: - Removes indexer_scale from ctx and computes it dynamically in backward instead, avoiding cross-step state pollution. - Adds the missing loss_coeff factor to the gradient scaling formula: indexer_scale = grad_scale * loss_coeff / num_seqs 2. **dsa_indexer.py**: - Extracts the indexer_loss_scale variable to unify the loss scale configuration logic. - When use_fused_lightning_indexer_loss is enabled, also sets the loss scale on SparseFlashMlaWithIndexerLossFunction. ## Does this PR introduce any user-facing change? No. This PR only fixes the internal gradient computation logic and does not affect the user interface or usage. ## How was this patch tested? - Needs to be verified on a DSv4 model training task to confirm that the gnorm values converge normally. See merge request: Ascend/MindSpeed-LLM!4993 | 16 小时前 |
| feat: Added gitleaks for sensitive information detection Co-authored-by: wujinyuan1<wujinyuan1@huawei.com> # message auto-generated for no-merge-commit merge: !4843 merge master into master feat: Added gitleaks for sensitive information detection Created-by: wujinyuan1 Commit-by: wujinyuan1 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. 引入gitleaks二进制离线扫描工具 2. 新增pre-commit/.gitleaks.toml配置,继承官方全部检测规则 3. 配置pre-commit钩子,提交前自动扫描密钥硬编码风险。 ## Does this PR introduce any user-facing change? 无. ## How was this patch tested? PR流水线pre-commit检测新增敏感信息检测. See merge request: Ascend/MindSpeed-LLM!4843 | 1 个月前 |
| feat(mcore): update GLM-5.2 A3 scripts Co-authored-by: LinShua<707894133@qq.com> # message auto-generated for no-merge-commit merge: !5000 merge glm52_sh_fix into master feat(mcore): update GLM-5.2 A3 scripts Created-by: LinShua Commit-by: LinShua Merged-by: ascend-robot Description: Fixes #1817 ## What this PR does / why we need it? 1. Align the GLM-5.2 744B A3 generation example by removing the default fused lightning indexer, sparse flash attention, and MLA absorb flags that are outside this script's intended configuration. 2. Simplify the GLM-5.2 744B A3 pretraining example and POC script by removing unused argument definitions and no longer passing the extra ROPE, memory, and profiling groups by default where applicable. 3. Add a GLM-5.2 210B 4K A3 pretraining POC script with reusable distributed, model, MLA, MoE, DSA, recomputation, and pipeline argument groups. This PR changes shell entrypoints only and does not modify training runtime code or public APIs. ## Does this PR introduce any user-facing change? Yes. Users gain a GLM-5.2 210B 4K A3 pretraining POC entrypoint under tests/poc/glm52/, while the existing 744B A3 example and POC commands no longer enable or pass the removed optional argument groups by default. ## How was this patch tested? 1. Ran changed-file pre-commit hooks on all four modified or added shell scripts. trailing-whitespace, end-of-file-fixer, check-added-large-files, check-merge-conflict, detect-private-key, codespell, and typos passed; file-type-specific YAML, JSON, Python, and C/C++ hooks were skipped. The repository-local gitleaks-offline-scan hook could not run because the configured ./gitleaks executable is absent. 2. Ran D:\Git\Git\bin\bash.exe -n on all four scripts; it passed. 3. Ran git diff --check origin/master...HEAD; it passed. 4. Verified git rev-list --count origin/master..HEAD returns 1 after squashing. 5. The GitCode push reported remote Git Hooks Checking [PASSED]. 6. No model training, accuracy, performance, or end-to-end functional test was run. See merge request: Ascend/MindSpeed-LLM!5000 | 2 天前 |
| [feat]Modify and improve the configuration of the pre-commit open-source code detection tool Co-authored-by: wujinyuan1<wujinyuan1@huawei.com> # message auto-generated for no-merge-commit merge: !4448 merge master into master [feat]Modify and improve the configuration of the pre-commit open-source code detection tool Created-by: wujinyuan1 Commit-by: wujinyuan1 Merged-by: ascend-robot Description: ## What this PR does / why we need it? pre-commit 工具规则配置修改:试运行阶段发现python bandit工具检测过严,超出昇腾编程规范。 此次修改重点修改bandit规则。 ## Does this PR introduce any user-facing change? 门禁codecheck检测规则精简,提升代码合入效率 ## How was this patch tested? 代码扫描工具配置,不涉及代码仓功能 See merge request: Ascend/MindSpeed-LLM!4448 | 3 个月前 |
| docs(fsdp2): fix documentation format issues and improve readability Co-authored-by: wangjiangben<wangjiangben@huawei.com> # message auto-generated for no-merge-commit merge: !4476 merge docs/fix-fsdp2-docs-format into master docs(fsdp2): fix documentation format issues and improve readability Created-by: wangjiangben Commit-by: wangjiangben Merged-by: ascend-robot Description: ## Summary Fix format errors in FSDP2 documentation and optimize document structure to improve readability and compliance with Markdown standards. **Format Fixes:** - Fix table format issues in quantization.md (missing header separators, column alignment errors) - Fix HTML entity syntax error in arguments.md ("ulysses" missing semicolon) - Remove extra blank lines in code blocks - Standardize indentation in example scripts **Structure Optimization:** - Unify list markers to standard Markdown - syntax - Optimize DTensor section hierarchy for better structure clarity - Convert reference links to proper Markdown link format - Split long paragraphs in quantization descriptions for better readability - Fix MD032 lint error (add blank line before list) **Files Changed:** - arguments.md: Fix HTML entity syntax - fsdp2_basic_features.md: Optimize structure hierarchy and list format - quantization.md: Fix table format, optimize description text See merge request: Ascend/MindSpeed-LLM!4476 | 3 个月前 |
| docs: add git submodule management for 3rdparty dependencies Co-authored-by: iansheng<shengjiayi@huawei.com> # message auto-generated for no-merge-commit merge: !4875 merge master into master docs: add git submodule management for 3rdparty dependencies Created-by: iansheng Commit-by: iansheng Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR adds an optional Git Submodule-based installation method to the MindSpeed LLM install guide, enabling unified version management of third-party dependencies (MindSpeed, FSDPTurbo, Megatron-LM). Background: Previously, users had to manually git clone and git checkout each dependency repository (steps 5-7 in "方式二:源码安装"), which made version tracking difficult and error-prone. This PR introduces 方式三:Git Submodule统一管理(可选) as an alternative approach. Detailed changes: Add .gitmodules and register three submodules under 3rdparty/: 3rdparty/MindSpeed — tracks remote master branch (latest) 3rdparty/FSDPTurbo — tracks remote main branch (latest) 3rdparty/Megatron-LM — pinned to tag core_v0.12.1 (commit a845aa7e1) ## Does this PR introduce any user-facing change? Yes, this PR introduces a new optional installation method documented in docs/zh/pytorch/training/install_guide.md. Users can now choose between: 方式二:源码安装 (existing, unchanged) — manual clone + checkout 方式三:Git Submodule统一管理(可选) (new) — git submodule update --init --recursive for one-command dependency setup No changes to existing installation flows. The new method is fully backward-compatible. Users who adopt the submodule approach should be aware that: MindSpeed and FSDPTurbo track remote latest by default; use git submodule update --init --remote to pull the latest commits. Megatron-LM is pinned to core_v0.12.1 and will not auto-update. The symlink-based install requires a Unix-like environment (Linux/macOS). On Windows, use pip3 install -e . within each submodule directory instead. ## How was this patch tested? N/A See merge request: Ascend/MindSpeed-LLM!4875 | 27 天前 |
| feat(pytroch): Merge upgrade 018 base code Co-authored-by: cjy840282<chenjingyi9@huawei.com> # message auto-generated for no-merge-commit merge: !4999 merge prepare_018 into master feat(pytroch): Merge upgrade 018 base code Created-by: cjy840282 Commit-by: cjy840282 Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR serves as the foundational update for 018 adaptation. It adds the mindspeed_llm directory under ests and removes DPOFeature, MambaModel, HighAvailabilityFeature, ai_framework_feature, and layerwise_disaggregated_training_feature to facilitate the subsequent integration of code related to the 018 upgrade. ## Does this PR introduce any user-facing change? Users will not perceive any adaptation modifications. ## How was this patch tested? This PR only merges the basic code and does not go through testing; it will be verified during subsequent adaptation. See merge request: Ascend/MindSpeed-LLM!4999 | 2 天前 |
| docs: update README and CONTRIBUTING.md Co-authored-by: xuwenyue<xuwenyue1@huawei.com> # message auto-generated for no-merge-commit merge: !4440 merge master into master docs: update README and CONTRIBUTING.md Created-by: xuwenyue Commit-by: xuwenyue Merged-by: ascend-robot Description: ## What this PR does / why we need it? update README, CONTRIBUTING.md, FAQ.md, features/README.md, performance_tuning.md ## Does this PR introduce any user-facing change? NA ## How was this patch tested? NA See merge request: Ascend/MindSpeed-LLM!4440 | 3 个月前 |
| update LICENSE. add license Signed-off-by: fengliangjun <fengliangjun@huawei.com> | 2 年前 |
| feat(debug): support msProbe and model I/O tracing for FSDP2 and Megatron Co-authored-by: wj<wangjin230@huawei.com> # message auto-generated for no-merge-commit merge: !4878 merge fsdp2-msprobe into master feat(debug): support msProbe and model I/O tracing for FSDP2 and Megatron Created-by: gcw_RxnYoBVv Commit-by: wj Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR adds optional precision-data collection support for both FSDP2 and Megatron training backends. ## Does this PR introduce any user-facing change? Yes. The feature is disabled by default and does not affect existing training jobs unless explicitly enabled. For FSDP2, users can configure the features in the training YAML: yaml training: msprobe: true msprobe_config_path: /absolute/path/to/msprobe_config.json model_io_trace: true model_io_trace_config_path: /absolute/path/to/model_io_trace_config.json For Megatron, the corresponding arguments are: bash --msprobe \ --msprobe-config-path /absolute/path/to/msprobe_config.json \ --model-io-trace \ --model-io-trace-config-path /absolute/path/to/model_io_trace_config.json Related documentation: - docs/zh/pytorch/tools/msprobe.md - docs/zh/pytorch/tools/model_io_trace.md - docs/zh/pytorch/features/fsdp2/arguments.md ## How was this patch tested? After enabling the function, can the relevant files be generated after the training script is completed See merge request: Ascend/MindSpeed-LLM!4878 | 3 天前 |
| fix: migrate llama2 convert scripts to v2 Co-authored-by: wanggangguo<wanggangguo@huawei.com> # message auto-generated for no-merge-commit merge: !4700 merge debug5 into master fix: migrate llama2 convert scripts to v2 Created-by: isfrapples Commit-by: wanggangguo Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. Migrate gemma2, llama2, plm, qwen3 lora checkpoint scripts to v2. 2. Add phi3.5-moe support in convert_ckpt_v2.py and model_cfg.json. 3. Add missing add_qkv_bias config for phi3.5-moe in model_cfg.json. ## Does this PR introduce any user-facing change? 1. No, only internal example scripts are updated to use the new converter. 2. All existing interfaces and behaviors remain unchanged. ## How was this patch tested? 1. All migrated scripts share the same CLI pattern as existing v2 tests. 2. phi3.5-moe changes are validated by existing CI configurations. fixes#1580 See merge request: Ascend/MindSpeed-LLM!4700 | 1 个月前 |
| docs(pytorch): rename install_guide and updated the latest link Co-authored-by: LQ1206<liuqian164@h-partners.com> # message auto-generated for no-merge-commit merge: !4910 merge master into master docs(pytorch): rename install_guide and updated the latest link Created-by: LQ1206 Commit-by: LQ1206 Merged-by: ascend-robot Description: ## What this PR does / why we need it? rename install_guide and updated the latest link ## Does this PR introduce any user-facing change? rename install_guide and updated the latest link ## How was this patch tested? No test See merge request: Ascend/MindSpeed-LLM!4910 | 26 天前 |
| docs(pytorch): updated incorrect link Co-authored-by: LQ1206<liuqian164@h-partners.com> # message auto-generated for no-merge-commit merge: !4927 merge master into master docs(pytorch): updated incorrect link Created-by: LQ1206 Commit-by: LQ1206 Merged-by: ascend-robot Description: ## What this PR does / why we need it? updated incorrect link ## Does this PR introduce any user-facing change? updated incorrect link ## How was this patch tested? No test See merge request: Ascend/MindSpeed-LLM!4927 | 20 天前 |
| !2500 update notice Merge pull request !2500 from sunjunjie/master | 1 年前 |
| feat: support GLM-5.2 ShareIndex with custom VPP layouts Co-authored-by: LinShua<707894133@qq.com> # message auto-generated for no-merge-commit merge: !4961 merge master_share_index_vpp into master feat: support GLM-5.2 ShareIndex with custom VPP layouts Created-by: LinShua Commit-by: LinShua Merged-by: ascend-robot Description: Fixes #1782 ## What this PR does / why we need it? 1. Adds PP/VPP-aware global decoder-layer mapping for GLM-5.2 ShareIndex so each Share layer resolves the intended Compute source inside the same process-local PP/VPP chunk, and rejects groups split across chunk boundaries. 2. Reuses MindSpeed PipelineModelParallelLayoutFeature and PipelineParallelLayerLayout as the runtime layout parser, validator, layer-count provider, and layer-offset provider. --num-layer-list remains the legacy non-VPP uneven-PP mode, while --pipeline-model-parallel-layout independently describes custom PP/VPP placement; the two modes are now rejected when configured together. 3. Uses the MindSpeed layout offset when MindSpeed-LLM selects global-layer-dependent TransformerBlock behavior, including Dense/MoE, attention-pattern, and noop-layer decisions. 4. Persists pipeline_model_parallel_layout in checkpoint arguments, detects distribution-mode conflicts after checkpoint restoration, and extends HF-to-MCore and MCore-to-HF conversion with the same VPP-major/PP-major global-layer mapping, including uneven layouts and layout-defined uneven PP without VPP. 5. Keeps legacy num_layer_list, uniform VPP, and DualPipeV paths unchanged when no custom layout is configured, and updates the GLM-5.2 POC command to use the layout as the sole custom PP/VPP distribution argument. ## Does this PR introduce any user-facing change? Yes. --num-layer-list and --pipeline-model-parallel-layout are mutually exclusive alternatives. For PP=4/VPP=5 custom placement, use --pipeline-model-parallel-layout 'Ett|(tttt|)*18ttttL' without --num-layer-list. The legacy --num-layer-list "18,20,20,20" mode remains available for uneven PP without custom VPP layout. Quote the layout in conversion shell commands because it contains the shell pipe character |. ## How was this patch tested? 1. Ran the repository-configured pre-commit hooks on all 10 PR files. Trailing-whitespace, end-of-file, added-large-file, merge-conflict, private-key, Ruff check/format, Codespell, Pylint, Bandit, and Typos checks passed. The repository-local Gitleaks hook could not run because the required ./gitleaks executable is absent; the same changed-file scope was rerun with only that hook skipped and all other hooks passed. 2. Ran Python byte-code compilation for all 9 changed Python files successfully. 3. Ran lightweight Python assertions for conversion argument mutual exclusion, PP=4/VPP=5 layout mapping, layout-defined uneven PP without VPP, independent num_layer_list behavior, MLA layout offsets, and rejection of num_layer_list with VPP. 4. A functional pytest suite was not executed locally because the available bundled Python runtime does not provide pytest, torch, or transformers. 5. Force-updated the squashed branch; GitCode remote Git Hooks Checking passed. See merge request: Ascend/MindSpeed-LLM!4961 | 2 天前 |
| refactor(megatron):update coverage script Co-authored-by: guihaowen666<guihaowen@huawei.com> # message auto-generated for no-merge-commit merge: !4295 merge br_master_coverage_fix_0313 into master refactor(megatron):update coverage script Created-by: guihaowen666 Commit-by: guihaowen666 Merged-by: ascend-robot Description: # 覆盖率分析脚本更新 ---- ## What this PR does / why we need it? 更新仓库run_coverage.sh脚本,修复覆盖率分析扫描文件不全的问题 ## Does this PR introduce any user-facing change? 不影响仓库基本功能,旨在优化仓库覆盖率分析功能 ## How was this patch tested? 已在蓝区机器上自测通过 See merge request: Ascend/MindSpeed-LLM!4295 | 5 个月前 |
| refactor(megatron):update coverage script Co-authored-by: guihaowen666<guihaowen@huawei.com> # message auto-generated for no-merge-commit merge: !4295 merge br_master_coverage_fix_0313 into master refactor(megatron):update coverage script Created-by: guihaowen666 Commit-by: guihaowen666 Merged-by: ascend-robot Description: # 覆盖率分析脚本更新 ---- ## What this PR does / why we need it? 更新仓库run_coverage.sh脚本,修复覆盖率分析扫描文件不全的问题 ## Does this PR introduce any user-facing change? 不影响仓库基本功能,旨在优化仓库覆盖率分析功能 ## How was this patch tested? 已在蓝区机器上自测通过 See merge request: Ascend/MindSpeed-LLM!4295 | 5 个月前 |
| refactor: remove deepseek4 redundant Triton paths and align CSA/MHC CLI Co-authored-by: dingzicha1997<dingzilin@huawei.com> # message auto-generated for no-merge-commit merge: !4871 merge remove-triton-mhc into master refactor: remove deepseek4 redundant Triton paths and align CSA/MHC CLI Created-by: dingzicha1997 Commit-by: dingzicha1997 Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR simplifies the DeepSeek-V4 CSA and MHC implementations after the Ascend fused paths became stable. Main changes: - Remove redundant Triton MHC, Sinkhorn, RMSNorm, and SFA implementations. - Retain the Triton pre_only kernel required by the MHC head stage. - Keep eager implementations as fallback paths. - Rename G2-related components to DeepSeek-V4 CSA/HCA terminology. - Relocate MHC operators into the common ops directories. - Consolidate CSA eager attention implementations. - Align DeepSeek-V4 CLI arguments with Megatron and MindSpeed conventions. - Remove incompatible legacy RoPE options from all DeepSeek-V4 scripts. ## Does this PR introduce any user-facing change? Yes. DeepSeek-V4 CLI configurations need to be updated as follows: | Type | Previous option | New option / behavior | |---|---|---| | Renamed | --use-ascend-mhc | --use-fused-mhc | | Renamed | --g2-window-size 128 | --sliding-window-size 128 | | Removed | --rope-head-dim 64 | --qk-pos-emb-head-dim 64 | | Removed | --norm-eps 1e-6 | --norm-epsilon 1e-6 | | Renamed | --position-embedding-type g2 | --position-embedding-type deepseek4 | | Replaced | --use-g2-indexer-loss | --indexer-loss-coeff 1.0; use 0 for inference | | Removed | --use-triton-sfa | --use-sparse-flash-attn | | Removed | --use-g2-attention | No replacement required | | Removed | --use-triton-sinkhorn | Use fused MHC or the eager fallback | | Removed | --use-triton-rmsnorm-without-weight | Use fused MHC or the eager fallback | | Removed | --mhc-recompute | No replacement required | | Removed from V4 scripts | --use-fused-rotary-pos-emb | Incompatible with the DeepSeek-V4 RoPE path | | Removed from V4 scripts | --use-rotary-position-embeddings | Overrides the DeepSeek-V4 position embedding type | | Retained | --use-triton-mhc | Only controls the MHC-head pre_only kernel | | Behavior changed | --use-fused-lightning-indexer and --use-fused-lightning-indexer-loss | Must be enabled or disabled together; the framework automatically enables both if only one is provided | Recommended DeepSeek-V4 position embedding configuration: shell --position-embedding-type deepseek4 --qk-pos-emb-head-dim 64 Do not combine it with: shell --use-fused-rotary-pos-emb --use-rotary-position-embeddings ## How was this patch tested? - Checked all DeepSeek-V4 training, fine-tuning, inference, POC, and ST scripts. - Verified that removed CLI options have no remaining DeepSeek-V4 references. - Ran bash -n against all affected DeepSeek-V4 shell scripts. - Ran Python compilation and applicable code-quality checks for the modified Python modules. - Ran git diff --check. - Applicable local pre-commit hooks passed. The local Gitleaks hook could not run because the ./gitleaks binary was unavailable. - GitCode remote Git Hooks passed successfully. - Verified that importing the repository without Triton remains protected by the existing try/except logic. See merge request: Ascend/MindSpeed-LLM!4871 | 1 个月前 |
| feature(pytorch): FSDP2 support hardware-adaptive execution Co-authored-by: zhyebin01<zhangyebin@h-partners.com> # message auto-generated for no-merge-commit merge: !4343 merge fsdp2_gpu into master feature(pytorch): FSDP2 support hardware-adaptive execution Created-by: zhyebin01 Commit-by: zhyebin01 Merged-by: ascend-robot Description: ## What this PR does / why we need it? FSDP2 support hardware-adaptive execution ## Does this PR introduce any user-facing change? No ## How was this patch tested? pipeline test passed See merge request: Ascend/MindSpeed-LLM!4343 | 5 个月前 |
| refactor(megatron):update coverage script Co-authored-by: guihaowen666<guihaowen@huawei.com> # message auto-generated for no-merge-commit merge: !4295 merge br_master_coverage_fix_0313 into master refactor(megatron):update coverage script Created-by: guihaowen666 Commit-by: guihaowen666 Merged-by: ascend-robot Description: # 覆盖率分析脚本更新 ---- ## What this PR does / why we need it? 更新仓库run_coverage.sh脚本,修复覆盖率分析扫描文件不全的问题 ## Does this PR introduce any user-facing change? 不影响仓库基本功能,旨在优化仓库覆盖率分析功能 ## How was this patch tested? 已在蓝区机器上自测通过 See merge request: Ascend/MindSpeed-LLM!4295 | 5 个月前 |
| feat(pytorch): add DeepSeek4 fine-tuning template Co-authored-by: HanhuiChen<chenhanhui1@h-partners.com> # message auto-generated for no-merge-commit merge: !4436 merge dsv4 into master feat(pytorch): add DeepSeek4 fine-tuning template Created-by: HANHU1CHEN Commit-by: HanhuiChen Merged-by: ascend-robot Description: ## What this PR does / why we need it? Adds a fine-tuning template for the DeepSeek4 model series to support its specific prompt format, including thinking mode, tool calling (DSML format), and reasoning effort control. ## Does this PR introduce any user-facing change? Yes — users can now select --prompt-type deepseek4 to fine-tune DeepSeek4 models. Two new behaviors are also exposed: - --enable-thinking controls thinking vs chat mode - --reasoning-effort {max,high} inserts a max-effort instruction prefix; only valid when thinking is enabled - --drop-thinking controls whether reasoning content is kept in each turn ## How was this patch tested? Tested with byte-level alignment against the official encoding_dsv4 script. See merge request: Ascend/MindSpeed-LLM!4436 | 3 个月前 |
| [pytorch][feature]Add RL data processing Co-authored-by: fh_188<fenghui32@huawei.com> # message auto-generated for no-merge-commit merge: !3646 merge fenzhi into master [pytorch][feature]Add RL data processing Created-by: weixin_44917616 Commit-by: fh_188 Merged-by: ascend-robot Description: add preprocess prmompt 修改模板路径 See merge request: Ascend/MindSpeed-LLM!3646 | 9 个月前 |
| refactor: remove deepseek4 redundant Triton paths and align CSA/MHC CLI Co-authored-by: dingzicha1997<dingzilin@huawei.com> # message auto-generated for no-merge-commit merge: !4871 merge remove-triton-mhc into master refactor: remove deepseek4 redundant Triton paths and align CSA/MHC CLI Created-by: dingzicha1997 Commit-by: dingzicha1997 Merged-by: ascend-robot Description: ## What this PR does / why we need it? This PR simplifies the DeepSeek-V4 CSA and MHC implementations after the Ascend fused paths became stable. Main changes: - Remove redundant Triton MHC, Sinkhorn, RMSNorm, and SFA implementations. - Retain the Triton pre_only kernel required by the MHC head stage. - Keep eager implementations as fallback paths. - Rename G2-related components to DeepSeek-V4 CSA/HCA terminology. - Relocate MHC operators into the common ops directories. - Consolidate CSA eager attention implementations. - Align DeepSeek-V4 CLI arguments with Megatron and MindSpeed conventions. - Remove incompatible legacy RoPE options from all DeepSeek-V4 scripts. ## Does this PR introduce any user-facing change? Yes. DeepSeek-V4 CLI configurations need to be updated as follows: | Type | Previous option | New option / behavior | |---|---|---| | Renamed | --use-ascend-mhc | --use-fused-mhc | | Renamed | --g2-window-size 128 | --sliding-window-size 128 | | Removed | --rope-head-dim 64 | --qk-pos-emb-head-dim 64 | | Removed | --norm-eps 1e-6 | --norm-epsilon 1e-6 | | Renamed | --position-embedding-type g2 | --position-embedding-type deepseek4 | | Replaced | --use-g2-indexer-loss | --indexer-loss-coeff 1.0; use 0 for inference | | Removed | --use-triton-sfa | --use-sparse-flash-attn | | Removed | --use-g2-attention | No replacement required | | Removed | --use-triton-sinkhorn | Use fused MHC or the eager fallback | | Removed | --use-triton-rmsnorm-without-weight | Use fused MHC or the eager fallback | | Removed | --mhc-recompute | No replacement required | | Removed from V4 scripts | --use-fused-rotary-pos-emb | Incompatible with the DeepSeek-V4 RoPE path | | Removed from V4 scripts | --use-rotary-position-embeddings | Overrides the DeepSeek-V4 position embedding type | | Retained | --use-triton-mhc | Only controls the MHC-head pre_only kernel | | Behavior changed | --use-fused-lightning-indexer and --use-fused-lightning-indexer-loss | Must be enabled or disabled together; the framework automatically enables both if only one is provided | Recommended DeepSeek-V4 position embedding configuration: shell --position-embedding-type deepseek4 --qk-pos-emb-head-dim 64 Do not combine it with: shell --use-fused-rotary-pos-emb --use-rotary-position-embeddings ## How was this patch tested? - Checked all DeepSeek-V4 training, fine-tuning, inference, POC, and ST scripts. - Verified that removed CLI options have no remaining DeepSeek-V4 references. - Ran bash -n against all affected DeepSeek-V4 shell scripts. - Ran Python compilation and applicable code-quality checks for the modified Python modules. - Ran git diff --check. - Applicable local pre-commit hooks passed. The local Gitleaks hook could not run because the ./gitleaks binary was unavailable. - GitCode remote Git Hooks passed successfully. - Verified that importing the repository without Triton remains protected by the existing try/except logic. See merge request: Ascend/MindSpeed-LLM!4871 | 1 个月前 |
| refactor(megatron):update coverage script Co-authored-by: guihaowen666<guihaowen@huawei.com> # message auto-generated for no-merge-commit merge: !4295 merge br_master_coverage_fix_0313 into master refactor(megatron):update coverage script Created-by: guihaowen666 Commit-by: guihaowen666 Merged-by: ascend-robot Description: # 覆盖率分析脚本更新 ---- ## What this PR does / why we need it? 更新仓库run_coverage.sh脚本,修复覆盖率分析扫描文件不全的问题 ## Does this PR introduce any user-facing change? 不影响仓库基本功能,旨在优化仓库覆盖率分析功能 ## How was this patch tested? 已在蓝区机器上自测通过 See merge request: Ascend/MindSpeed-LLM!4295 | 5 个月前 |
| refactor(megatron):update coverage script Co-authored-by: guihaowen666<guihaowen@huawei.com> # message auto-generated for no-merge-commit merge: !4295 merge br_master_coverage_fix_0313 into master refactor(megatron):update coverage script Created-by: guihaowen666 Commit-by: guihaowen666 Merged-by: ascend-robot Description: # 覆盖率分析脚本更新 ---- ## What this PR does / why we need it? 更新仓库run_coverage.sh脚本,修复覆盖率分析扫描文件不全的问题 ## Does this PR introduce any user-facing change? 不影响仓库基本功能,旨在优化仓库覆盖率分析功能 ## How was this patch tested? 已在蓝区机器上自测通过 See merge request: Ascend/MindSpeed-LLM!4295 | 5 个月前 |
| feat: third-party dependency reduction Co-authored-by: cjy840282<chenjingyi9@huawei.com> # message auto-generated for no-merge-commit merge: !4887 merge requirements into master feat: third-party dependency reduction Created-by: cjy840282 Commit-by: cjy840282 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Non-essential Dependency Cleanup. ## Does this PR introduce any user-facing change? Remove irrelevant dependencies to reduce the difficulty for customers to get started with installation. ## How was this patch tested? CI and Nightly-CI-Component-pipeline_MindSpeed-LLM_master. See merge request: Ascend/MindSpeed-LLM!4887 | 19 天前 |
| add rl ci Co-authored-by: fh_188<fenghui32@huawei.com> # message auto-generated for no-merge-commit merge: !3951 merge master_rl_ci into master [pytorch][feature]Adapt RL for vllm0110 and add CI Created-by: weixin_44917616 Commit-by: fh_188 Merged-by: ascend-robot Description: [pytorch][feature]Adapt RL for vllm0110 and add CI See merge request: Ascend/MindSpeed-LLM!3951 | 8 个月前 |
| [pytorch][build]update setup.py version and python support range master Co-authored-by: tichang<tichang@huawei.com> # message auto-generated for no-merge-commit merge: !4076 merge chore/update_setup.py_version_and_pyversion_info into master [pytorch][build]update setup.py version and python support range master Created-by: tichang Commit-by: tichang Merged-by: ascend-robot Description: chore(setup): update setup.py version and python support range 在master分支修改了setup.py中的版本信息和python支持版本 See merge request: Ascend/MindSpeed-LLM!4076 | 7 个月前 |
| feat: add dsv4 fsdp sh && performance optimization Co-authored-by: sunjunjie1587<sunjunjie8@huawei.com> # message auto-generated for no-merge-commit merge: !4859 merge master into master feat: add dsv4 fsdp sh && performance optimization Created-by: sunjunjie1587 Commit-by: sunjunjie1587 Merged-by: ascend-robot Description: ## What this PR does / why we need it? ### Background As large language model parameters continue to grow, new model architectures like DeepSeek V4 impose higher demands on distributed training. MindSpeed-LLM, as a distributed training suite for LLMs based on the Ascend NPU ecosystem, needs to continuously adapt to new models and optimize training performance. Currently, the repository does not provide a complete training script with performance optimizations for DeepSeek V4 using the FSDP (Fully Sharded Data Parallel) backend, which limits users' ability to efficiently train DeepSeek V4 on Ascend NPUs. ### Detailed Changes This PR introduces the following changes: - **Add DeepSeek V4 FSDP training script** – provides a ready‑to‑use startup script (dsv4 fsdp sh) for FSDP‑based distributed training of DeepSeek V4, reducing the effort required to adapt the model to the FSDP backend. - **Performance optimization** – performs targeted tuning for the DeepSeek V4 model architecture on the FSDP backend, including but not limited to: 1. Integrating the MHC fused operator. 2. Integrating Torch's fused AdamW optimizer. 3. Removing redundant transpose operations. 4. Integrating the SwiGLU_Limit fused operator. - **Training workflow validation** – ensures that the new script covers the basic pre‑training path, confirming correctness and stability. ## Does this PR introduce any user-facing change? Yes. This PR provides a new entry‑point script for DeepSeek V4 FSDP training. Users can directly use this script to launch distributed pre‑training tasks for DeepSeek V4 without manually writing complex distributed configurations. ## How was this patch tested? ### Functional Correctness Verification - Run the newly added dsv4 fsdp sh script on an Ascend NPU cluster to verify that DeepSeek V4 can start FSDP distributed training successfully. - Monitor training loss to ensure it converges as expected, confirming the correctness of the training logic. ### Performance Verification - Compare training throughput (tokens/s) and memory usage before and after the optimization. - Validate that the performance improvements meet the expected targets. See merge request: Ascend/MindSpeed-LLM!4859 | 28 天前 |