ascend-ai-coding/awesome-ascend-skills/mindspeed-mm-pipeline
Claude Code and agent skill by ascend-ai-coding/awesome-ascend-skills
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
MindSpeed-MM skill router and model index for Huawei Ascend NPU. Use when the user is uncertain which MindSpeed-MM skill to use, needs to choose between understanding/generative/omni/audio model categories, or wants an overview of the full training pipeline. Routes to the appropriate leaf skill based on model type.
Install
npx vskill@latest install ascend-ai-coding/awesome-ascend-skills/mindspeed-mm-pipelineSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as ascend-ai-coding/awesome-ascend-skills/mindspeed-mm-pipeline.
MindSpeed-MM End-to-End Multimodal Training Pipeline
This Skill is the routing entry point for all MindSpeed-MM Skills. It determines the model type based on user intent, routes to the corresponding Skill, and provides a complete pipeline overview.
Model Type Router
Routing Criteria:
| Keywords | Model Type | Target | |
|---|---|---|---|
| VLM, vision-language, image-text understanding, OCR, Qwen2VL, InternVL, GLM4V | Understanding (VLM) | mindspeed-mm-vlm | |
| Video generation, image generation, t2v, t2i, i2v, Wan, CogVideoX, FLUX | Generative | mindspeed-mm-generative | |
| Omni, speech + vision + text | Omni | examples/qwen2.5omni/ | |
| Speech recognition, TTS, ASR, Whisper, CosyVoice | Audio | examples/whisper/ or examples/cosyvoice3/ | |
| DPO, GRPO, preference alignment, reinforcement learning | Post-training | See Post-training section |
Complete Workflow Overview
VLM Workflow
Inter-Stage Data Flow:
Generative Model Workflow
Inter-Stage Data Flow:
Key difference between VLM and generative models: Generative models require an additional feature extraction step before training (VAE encodes video/images into latents, TextEncoder encodes text into embeddings). VLM does not have this step.
Full Model Index
Understanding Models (VLM)
| Model | Specs | Entry Script | Status | |
|---|---|---|---|---|
| Qwen2VL | 2B/7B/72B | pretrain_vlm.py | Released | |
| Qwen2.5VL | 3B/7B/32B/72B | pretrain_vlm.py | Released | |
| Qwen3VL | 8B/30B/235B | pretrain_transformers.py | Released | |
| InternVL2.5 | 4B/78B | pretrain_internvl.py | Released | |
| InternVL3 | 8B/78B | pretrain_vlm.py | Released | |
| InternVL3.5 | 30B | pretrain_transformers.py | Released | |
| GLM4.1V | 9B | pretrain_vlm.py | Released | |
| GLM4.5V | -- | pretrain_transformers.py | Prototype | |
| DeepSeekVL2 | -- | pretrain_deepseekvl.py | Released | |
| DeepSeekOCR | -- | finetune_ocr.py (custom) | Prototype | |
| DeepSeekOCR2 | -- | finetune_ocr2.py (custom) | Prototype | |
| JanusPro | -- | -- | -- | |
| Ming | -- | finetune_vl.py (custom) | -- | |
| Bagel | -- | pretrain_omni.py | -- |
Generative Models
| Model | Subtask | Entry Script | Status | |
|---|---|---|---|---|
| Wan2.1 | t2v/i2v/v2v/flf2v | pretrain_sora.py | Released | |
| Wan2.2 | t2v/i2v | pretrain_sora.py | Released | |
| HunyuanVideo | t2v | pretrain_sora.py | Prototype | |
| HunyuanVideo 1.5 | t2v | pretrain_sora.py | Prototype | |
| CogVideoX | t2v | pretrain_sora.py | Released | |
| FLUX | t2i | train_dreambooth_flux.py (diffusers) | Prototype | |
| OpenSoraPlan 1.3 | t2v | pretrain_sora.py | Released | |
| OpenSoraPlan 1.5 | t2v | pretrain_sora.py | Released | |
| StepVideo | t2v | pretrain_sora.py | Prototype | |
| LTX2 | t2v | mindspeed_mm/fsdp/train/trainer.py | -- | |
| Lumina-mGPT | -- | pretrain_lumina.py | Released |
Omni Models
| Model | Entry Script | Status | |
|---|---|---|---|
| Qwen2.5Omni | pretrain_vlm.py | Released | |
| Qwen3Omni | pretrain_transformers.py | Released |
Audio Models
| Model | Entry Script | Status | |
|---|---|---|---|
| Whisper | pretrain_whisper.py | -- | |
| CosyVoice3 | mindspeed_mm/fsdp/tasks/cosyvoice3/train.py | -- | |
| Qwen3TTS | mindspeed_mm/fsdp/train/trainer.py | -- | |
| FunASR | mindspeed_mm/fsdp/tasks/funasr/trainer.py | -- |
Post-training
| Task | Script | Applicable Models | |
|---|---|---|---|
| DPO | posttrain_qwen2vl_dpo.py | Qwen2VL | |
| DPO | posttrain_sora_dpo.py | Wan, Sora-like | |
| GRPO | posttrain_flux_dancegrpo.py | FLUX | |
| GRPO (verl) | verl_plugin/ | Qwen2.5VL |
Entry Script Selection Rules
MindSpeed-MM has three entry script patterns:
- Megatron-based unified entry:
pretrain_vlm.py(VLM),pretrain_sora.py(generative) — most models use these - Megatron-based model-specific entry:
pretrain_internvl.py,pretrain_deepseekvl.py,pretrain_whisper.py,pretrain_lumina.py— dedicated scripts for specific models - FSDP2-based entry:
pretrain_transformers.pyormindspeed_mm/fsdp/train/trainer.pyormindspeed_mm/fsdp/tasks/<model>/train.py— newer models (Qwen3VL, Qwen3Omni, LTX2, CosyVoice3, Qwen3TTS, FunASR)
Always check the actual shell script inexamples/<model_name>/— do not assume from the model name.
New models should use the unified entry. Legacy models still use model-specific entries and are being migrated gradually.
Common Training Args Quick Reference
The following parameters apply to all model types. For full parameter descriptions, see references/common-args.md.
Parallelism Parameters
| Parameter | Description | Typical Values | |
|---|---|---|---|
--tensor-model-parallel-size | Tensor parallelism degree (TP) | 1/2/4/8 | |
--pipeline-model-parallel-size | Pipeline parallelism degree (PP) | 1/2/4/8 | |
--context-parallel-size | Context parallelism degree (CP) | 1/2 | |
--expert-model-parallel-size | Expert parallelism degree (EP, for MoE models) | 1/2/4 |
Batch and Sequence Parameters
| Parameter | Description | |
|---|---|---|
--micro-batch-size | Number of samples per device per step | |
--global-batch-size | Global batch size (= micro DP gradient_accum) | |
--seq-length | Training sequence length |
Memory Optimization Parameters
| Parameter | Description | |
|---|---|---|
--recompute-granularity | Recomputation granularity: full / selective | |
--recompute-method | Recomputation method: uniform / block | |
--use-distributed-optimizer | Use ZeRO-1 distributed optimizer | |
--sequence-parallel | Sequence parallelism (reduces activation memory) |
Training Control Parameters
| Parameter | Description | |
|---|---|---|
--train-iters | Total training steps | |
--lr | Initial learning rate | |
--min-lr | Minimum learning rate | |
--lr-decay-style | Learning rate decay strategy: cosine / linear | |
--weight-decay | Weight decay | |
--bf16 | Use BF16 mixed precision | |
--use-flash-attn | Enable FlashAttention |
Docker Runtime
| Setting | Recommendation | |
|---|---|---|
--ipc=host | Required for DataLoader shared memory | |
--privileged | Required for NPU device access | |
--num-workers | Set to 0 if Docker shm is insufficient | |
MASTER_PORT | Change if port conflict with stale processes |
FSDP2 vs Megatron Backend Selection
MindSpeed-MM supports two distributed training backends:
| Feature | Megatron | FSDP2 | |
|---|---|---|---|
| Maturity | Mature and stable | Newer | |
| Parallelism | Fine-grained TP/PP/CP/EP control | Automatic sharding | |
| Configuration | Command-line arguments | --fsdp2-config-path specifies YAML | |
| Supported Models | All models | Select models (Qwen3.5, CosyVoice3, Kimi-K2.5, etc.) | |
| Advantage | Flexible and tunable | Simple configuration, easy to get started |
Selection Guidelines:
- Use the Megatron backend for most scenarios (better documentation and examples)
- If the model's official examples provide FSDP2 configuration and fine-grained parallelism tuning is not needed, FSDP2 is an option
- FSDP2 uses
--fsdp2-config-pathto specify the configuration file, replacing Megatron's TP/PP/CP parameters
Parameter Consistency Rules
The following parameters must be consistent between weight conversion and training:
| Parameter | Weight Conversion (mm-convert) | Training Script | |
|---|---|---|---|
TP (tensor-model-parallel-size / tp_size) | Set | Must match | |
PP (pipeline-model-parallel-size / pp_layers) | Set | Must match | |
| Model architecture | Determined by HF config | Must match |
Inconsistent parameters will cause weight loading failures or shape mismatch errors.
Pre-flight Checklist
Verify each item before starting deployment:
- [ ] Docker container created with
--privileged --ipc=host(or--shm-size=16g) - [ ] Model-specific dependencies installed (diffusers version, decord for video models)
- [ ] No stale torchrun processes holding MASTER_PORT
- [ ] NPU available:
python -c "import torch_npu; print(torch.npu.is_available())" - [ ] CANN environment activated:
npu-smi info - [ ] MindSpeed-MM installed:
pip show mindspeed-mm - [ ] Megatron module copied:
ls MindSpeed-MM/megatron/ - [ ] Model type determined (VLM / Generative / Omni / Audio)
- [ ] Target model and specs confirmed
- [ ] HF weights fully downloaded
- [ ] TP/PP configuration determined and documented
- [ ] Training data prepared
FAQ
Q: How do I determine which Skill to use?
Choose based on model type: use mindspeed-mm-vlm for VLM models, mindspeed-mm-generative for generative models. When in doubt, refer to the model index table above.
Q: What if different models have conflicting dependency versions?
MindSpeed-MM models have vastly different version requirements for transformers/diffusers/peft. It is strongly recommended to create a separate Docker container for each model. See the dependency conflict section in mindspeed-mm-env-setup.
Q: Where can I find training scripts and configurations for a specific model?
Example scripts and YAML configurations for each model are located in the MindSpeed-MM/examples/<model_name>/ directory.
Q: What is the difference between pretrain_vlm.py and pretrain_qwen2vl.py?
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/training/mindspeed-mm/mindspeed-mm-pipeline/SKILL.md
Popularity
- Repository stars
- 126
- Repository forks
- 51
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ascend-ai-coding/awesome-ascend-skills/mindspeed-mm-pipeline)