Repository navigation
Releases: modelscope/ms-swift
Release list
v4.5.3
New Models
-
Qwen3.8-Flash-Next, a multimodal MoE model with 125B total parameters (~6B activated per token, including a 51B N-gram embedding table). It combines a hybrid GDN + Qwen Sparse Attention (QSA) backbone, hyper-connections, and a host-offloadable N-gram table, with native 262K context. Megatron training is supported. Best practice: Qwen3.8-Flash-Next-Best-Practice
New Features
- Megatron-SWIFT Muon optimizer supports different learning rates for different parameters.
- OPD distillation (GRPO) now supports separate vision inputs for teacher and student, enabling multimodal distillation. Reference doc: https://swift.readthedocs.io/en/latest/Instruction/Distillation.html
- A
last-checkpointlink is maintained when saving checkpoints, making resume easier. dataloader_persistent_workersnow defaults to True to avoid dataloader cold start on each eval.- Performance: vectorized padding-free log-prob restore and sequence reductions; Megatron loss all-reduce deferred to logging time; vectorized ring attention LSE extraction on NPU.
- Added the
vllm_kunluninference backend for rollout/deploy. - Removed the gradio dependency.
Bug Fixes
- Training:
resume_from_checkpointwith transformers 4.x, DPO/IPO log-prob normalization, reward model margins aligned with pairs,predict_with_generateDDP evaluation, loss scaling with sequence parallelism, vocab loss & external files in multi-processing, template pickling, py3.14 compatibility, etc. - RL: Megatron GRPO vocab-parallel log-prob gradients, vLLM weight sync in colocate mode (LoRA IndexError, sender device alignment), colocated vLLM cleanup ordering on rollout failures, token-in/token-out consistency in agentic multi-step rollouts.
- Megatron: router replay CP partition and expert indices, MTP shared weights forward, reference adapter loading, zero multimodal learning rates, Megatron-FSDP DTensor checkpoint save/load, etc.
- Model fixes: Qwen3.5 (linear attention FP32 weights, multimodal packing kwargs), Qwen-Omni video fps, MiniCPM-o 4.5 video inputs, mplug_owl2_1, etc.
What's Changed
- fix: carry rounded seconds in format_time so it never prints '60s' by @AlejandroCoronadoN in #9919
- Fix single token embedding by @tastelikefeet in #9924
- fix: handle tool messages in last round loss scaling by @Bakuma-sea in #9923
- [Megatron] Fix duplicated GRPO KL gathering by @taking-lying-flat in #9921
- Keep SGLang and LMDeploy streaming response IDs stable by @taking-lying-flat in #9926
- Support qwen3 5 emb by @z0o0ey in #9930
- feat(npu): Add FSDP2 LoRA example for Qwen3.8-27B for Ascend NPU by @zheliuyu in #9920
- doc:Frequently asked questions update by @z0o0ey in #9937
- test(ci): drop legacy structbert tests and dependency pins by @hjh0119 in #9938
- docs(grpo): fix reward model spelling by @BingH225 in #9940
- The ViT gradient checkpoint was incorrectly turned off during multimodal model training. by @z0o0ey in #9945
- Fix save_missing_weights arg by @tastelikefeet in #9956
- fix:(megatron 0.16.1) support PackedSeqParams without total_tokens by @hazelduan in #9960
- fix:Compatibility with Python 3.14 by @z0o0ey in #9961
- Support MOSS-VL by @SSSSuperC in #9944
- [NPU] Adapt vLLM-Ascend 0.23 runtime by @addsubmuldiv in #9959
- sync missing version bump on main by @hjh0119 in #9967
- fix(utils): scope download cache by URL by @YZJF in #9969
- Fix MOSS-VL align test default model id for ModelScope hub by @SSSSuperC in #9974
- fix bug: serialize Qwen tool argument JSON literals by @Zhijun-Xu in #9968
- fix(metrics): count empty NLG predictions in score averages by @Excelius-Wang in #9962
- fix(dataset): honor explicit hub prefixes by @YZJF in #9971
- Fix Qwen3.5 A_log reinitialization by @taking-lying-flat in #9957
- perf(rlhf): vectorize padding-free sequence reductions by @Ruihan11 in #9958
- fix: honor sampled fps in Qwen-Omni video_second_per_grid by @Misaliet in #9955
- Fix external plugin module name collisions by @primorLee in #9953
- Update doc: update uembed models doc. by @SighingSnow in #9951
- align deploy/rollout health endpoint by @hjh0119 in #9950
- Handle missing AgentFlan query for string suffixes by @taking-lying-flat in #9949
- Fix LoRA IndexError when syncing weights to vLLM for Qwen models in GRPO colocate mode by @jinchenyu in #9946
- support LLaVA-OneVision-2-8B by @z0o0ey in #9978
- docs: fix Reward Model links in RLHF guides by @tutao0123 in #9910
- [model] deepseek-v4-pro-0813 by @hjh0119 in #9922
- [bugfix] fix typo and stray characters in base argument docstrings by @BingH225 in #9985
- Fix the compatibility of py3.14 and fix qwen3-vl training bug by @tastelikefeet in #9979
- Add fused operator patch for Qwen3-VL dense models on NPU by @addsubmuldiv in #9987
- fix(train): fail fast on incompatible DLRover flash checkpoint APIs by @Excelius-Wang in #9964
- docs(deploy): fix broken link to examples/infer by @moonturbo in #9989
- fix(template): handle MiniCPM-o 4.5 video inputs for vLLM deployment by @zm249 in #9988
- Link to
last-checkpointwhen saving and fix some code by @tastelikefeet in #9990 - fix: materialize state_dict for SentenceTransformer full-parameter save by @Lossfull in #9986
- Fix colocated vLLM cleanup ordering on rollout failures by @pureoxygen123 in #9952
- Preserve Qwen3.5 linear attention FP32 weights by @liuhao-labs in #9972
- fix: 修复 Megatron GRPO 多模态缓存失配 by @tutao0123 in #9933
- [model] qwen3.8-flash-next by @hjh0119 in #9992
- support Ling-3.0-tiny & Ling-3.0-flash by @z0o0ey in #9993
- Support different lr using muon by @tastelikefeet in #9994
- Fix npu optimizer by @tastelikefeet in #9998
- Fix template pickling by @tastelikefeet in #10000
- Cache downloaded files atomically by @ump45nose in #9999
- fix(fsdp): set ACCELERATE_USE_FSDP so device_map and cpu_ram_efficient_loading take effect by @cben484 in #9980
- fix event loop by @tastelikefeet in #10007
- support Ling-3.0-tiny&flash agent template by @z0o0ey in #10010
- [examples] fix do_eval() call arity in the rft baseline-eval block by @Anai-Guo in #10009
- Fix Megatron-FSDP DTensor checkpoint save/load compatibility by @addsubmuldiv in #9976
- Fix exact token-in/token-out consistency in agentic multi-step rollouts by @P90-RushB in #10012
- feat(opsd): separate vision input for teacher and student by @Tohrusky in #10015
- Fix Megatron-FSDP checkpoints with Megatron-Core-only installs by @addsubmuldiv in #10017
- support WeMM-Embedding by @z0o0ey in #10018
- remove gradio in requirement by @hjh0119 in #10020
- fix(megat...
v4.5.2
Bug Fixes
- Fixed: Corrected the incorrect
sizeconfiguration forQwen3.8-35B-A3B, which was mistakenly copied from the previous Qwen3.5/3.6 series during development. We apologize for the confusion and inconvenience this caused. Thanks to the community for reporting this issue.
v4.5.0
New Models
Qwen3.8
Qwen3.8, the strongest open Qwen generation so far. Same Gated DeltaNet hybrid backbone as Qwen3.5/3.6, native vision/video, hybrid thinking on by default, plus tunable reasoning effort and preserved historical thinking. (#9914)
NVIDIA Nemotron 3.5 Lightning
Nemotron 3.5 Lightning 30B-A3B: hybrid Mamba-2 + MoE + Attention, 30B total / 3B active, 1M context, MTP. (#9894)
Muse Glimmer
Muse-Glimmer-30B, Meta’s 30B dense multimodal model distilled from Muse Spark for local agents. (#9887)
Other changes
- MiMo-V2.5 inference (vLLM / SGLang) (#9880)
- DeepSeek-V4-Flash-0731 adaptation (#9834)
- Thinking-prefix loss scale (#9875)
- OpenAI / Anthropic message processors (#9809)
What's Changed
- fix: preserve explicit PEFT LoRA dtype by @yaodong-shen in #9832
- Fix export merge_lora with quantization not working by @hyongtao-code in #9830
- Support OpenAI and Anthropic message processors by @lumincui in #9809
- [bugfix] Fix Qwen3.5 non-packing causal conv routing by @taking-lying-flat in #9812
- Fix Gemma 3 mixed-batch token type IDs by @GoGiants1 in #9786
- remove qoder-review action by @hjh0119 in #9842
- Fix GKD Liger teacher routing by @taking-lying-flat in #9841
- fix(infer): propagate streaming errors by @RerankerGuo in #9849
- fix(npu): handle BF16 MindSpeed grouped linear activation offload by @addsubmuldiv in #9846
- Fix GRPO offload compatibility with FSDP2 CPU offload by @addsubmuldiv in #9844
- fix(infer): reject prompts without generation space by @RerankerGuo in #9851
- docs(readme): fix v3.0 release note links by @RerankerGuo in #9853
- Support ds v4 flash 0731 by @tastelikefeet in #9834
- Fix missing LoRARequest injection in GRPOVllmEngine.infer_async by @Zuozhuo in #9856
- fix(utils): close daemon event loops on shutdown by @RerankerGuo in #9858
- fix(utils): preserve streamed download bytes by @RerankerGuo in #9857
- fix(qwen3.5): add Torch fallback for Qwen3.5 linear attention SP by @meichangsu1 in #9865
- update 4.4.3 image by @hjh0119 in #9869
- Support empty content openai message format and standalone tool message by @tastelikefeet in #9861
- feat: add loss mask for response-start thinking prefixes by @yph22 in #9875
- [Infer] Fix transformers streaming logprobs by @taking-lying-flat in #9866
- support Xiaomi-MiMo-V2.5 inference( sglang / vllm ) by @z0o0ey in #9880
- fix(template): keep MiMo dependencies optional by @RerankerGuo in #9886
- Support muse-glimmer by @tastelikefeet in #9887
- fix(rlhf): reduce sequence-parallel log-prob memory by @yongyaoduan in #9882
- [model] support nemotron by @hjh0119 in #9894
- Fix MathORM false positives on parse failures by @Ruihan11 in #9889
- Fix dcp_validation bug in megatron distributed saving by @tastelikefeet in #9896
- fix:MiMo audio input by @z0o0ey in #9898
- Fix sp with transformers5.15 by @tastelikefeet in #9899
- Synchronize MuonClip max logits across ranks by @taking-lying-flat in #9901
- fix: add set_epoch() to DataLoaderDispatcher for streaming datasets by @tomzw11 in #9902
- Fix alpha UMI Next loss scale by @taking-lying-flat in #9900
- fix(megatron/grpo): clear MegatronGRPOTrainer._metrics per rollout by @HSYZhang in #9884
- fix megatron common pt save by @hjh0119 in #9908
- fix nemotron grpo by @hjh0119 in #9905
- remove auto_config patch for vllm by @hjh0119 in #9911
- [model] qwen3.8 by @hjh0119 in #9914
- rename qwen3.5 doc by @hjh0119 in #9918
- fix(README): restore broken star history chart by @PingouinFerreux in #9913
New Contributors
- @yaodong-shen made their first contribution in #9832
- @lumincui made their first contribution in #9809
- @GoGiants1 made their first contribution in #9786
- @RerankerGuo made their first contribution in #9849
- @Zuozhuo made their first contribution in #9856
- @yph22 made their first contribution in #9875
- @yongyaoduan made their first contribution in #9882
- @Ruihan11 made their first contribution in #9889
- @tomzw11 made their first contribution in #9902
- @HSYZhang made their first contribution in #9884
- @PingouinFerreux made their first contribution in #9913
Full Changelog: v4.4.3...v4.5.0
Patch release v4.4.3
What's Changed
- Update NPU doc and example by @addsubmuldiv in #9683
- [bugfix] fix batch_sampler set_epoch by @Jintao-Huang in #9685
- fix(template): preserve non-string prefix elements in _replace_system by @he-yufeng in #9612
- [model] support hy3 by @Jintao-Huang in #9684
- feat(megatron): add nccl_comm_warmup to avoid iteration-1 NCCL cudaMalloc OOM (#6387) by @yuchenwang3 in #9602
- feat(packing): add opt-in packing_strategy (binpack | sequential) for order-preserving packing by @yuchenwang3 in #9598
- update packing_strategy by @Jintao-Huang in #9686
- [bugfix] fix hy_v3 template by @Jintao-Huang in #9688
- [bugfix] fix qwen3_5 transformers_version megatron by @Jintao-Huang in #9690
- Avoid overwriting AutoTP-related settings when using DeepSpeed configuration files. by @1787648106 in #9691
- fix: support Qwen3.5 MoE models in linear attention sequence parallel… by @meichangsu1 in #9696
- [feat] support gkd multi turn by @hjh0119 in #9698
- [bugfix] fix qwen3_5 template by @Jintao-Huang in #9703
- [doc] replace use_async_engine with vllm_use_async_engine by @hjh0119 in #9706
- support deepseek_v4 packing /CP by @Jintao-Huang in #9705
- [bugfix] pass hf teacher_tag_key by @hjh0119 in #9711
- [bugfix] fix hf multi turn split by @hjh0119 in #9713
- fix gkd truncation by @hjh0119 in #9716
- fix: Qwen3-TTS project input text embedding by @FelysNeko in #9715
- [bugfix] fix qwen3_tts by @Jintao-Huang in #9721
- [doc] fix qwen35 gkd deploy by @hjh0119 in #9718
- [megatron] Fix MXFP8 sequence-length padding under sequence parallel by @yszhli in #9722
- support optional megatron-bridge backend by @hjh0119 in #9725
- [bugfix] avoid duplicate resize for Qwen3-Omni by @taking-lying-flat in #9729
- [bugfix] include image mode and size in tmp image cache key by @he-yufeng in #9605
- [docs] update docs by @Jintao-Huang in #9734
- [docs] update swift image 4.4.1 by @Jintao-Huang in #9735
- update requirements by @Jintao-Huang in #9737
- [bugfix] vllm seq_cls by @hjh0119 in #9736
- compat megatron-core main branch by @Jintao-Huang in #9743
- Support dsa cp by @Jintao-Huang in #9720
- fix(examples/grpo): build rollout_infos before _close_and_remove in sudoku scheduler (#9745) by @Anai-Guo in #9748
- fix npu qwen3.5 fla patch and use fla GDN by @addsubmuldiv in #9746
- update install_all by @Jintao-Huang in #9759
- compat modelscope_hub by @Jintao-Huang in #9760
- feat(grpo): add RLSD self-distilled advantage reweighting by @qychen2001 in #9758
- fix(qwen3_omni): read router_aux_loss_coef from text_config by @Anai-Guo in #9763
- add lora examples by @Jintao-Huang in #9766
- fix: Qwen3-TTS incorrect loss handling by @FelysNeko in #9752
- fix(rlhf): mask teacher logprobs before KL by @tongchen126 in #9767
- Add SDAR confidence-gated teacher distillation loss to GRPO by @qychen2001 in #9768
- fix(template): guard MiniCPM-V/mPLUG-Owl3 video sampling against 0-fps metadata by @he-yufeng in #9750
- [bugfix] fix packing streaming split by @Jintao-Huang in #9771
- fix megatron rollout buffer by @hjh0119 in #9774
- [model] support OvisOCR2 by @hjh0119 in #9773
- Fix async GRPO _prefetch crash: convert raw rows via to_samples() by @zzong2006 in #9775
- support megatron_fsdp by @Jintao-Huang in #9776
- Unlimited-OCR train R-SWA implementation by @z0o0ey in #9781
- perf: vectorize _select_dataset for cached-dataset loading by @Va1-HallA in #9777
- Support qwen3/3.5 adapter by @tastelikefeet in #9785
- Fix MindSpeed GDN import on Ascend 950 by @addsubmuldiv in #9783
- fix(npu): handle frozen weights in MindSpeed gradient accumulation fusion by @addsubmuldiv in #9790
- Doc refactoring by @z0o0ey in #9796
- fix(ci): refresh wandb in the CUDA test container setup by @he-yufeng in #9789
- Feat: add qwen3_5-Moe GRPO megatron training scripts for Ascend NPU by @ys2025-AI in #9792
- fix(npu): support Qwen3.5 LoRA and MoE sleep/wake in GRPO rollout by @addsubmuldiv in #9800
- fix router replay with cp by @hjh0119 in #9804
- fix qwen-asr import error by @tastelikefeet in #9805
- Fix: torch_dtype argument not passed to inference engine in swift sample by @hyongtao-code in #9808
- fix(npu): fix context parallelism for Qwen3.5 by @addsubmuldiv in #9814
- fix gkd use_vllm false by @hjh0119 in #9818
- update wechat by @tastelikefeet in #9819
- fix(sample): don't crash on torch_dtype in engine_kwargs by @he-yufeng in #9816
- Add kimi-k3 template by @tastelikefeet in #9811
- perf(megatron): remove per-document device syncs in channel loss aggregation by @gakkiri in #9795
- [megatron] Fix FA4 backward recompilation: pass max_seqlen as int in PackedSeqParams by @xuwang0117 in #9798
- [bugfix] report per-device maximum memory by @kaining-never-stop in #9825
- feat(rollout): support min_p sampling in GRPO/DAPO rollout (#9824) by @Anai-Guo in #9826
- fix(npu): optimize MoE weight synchronization for NPU colocate training with vLLM-Ascend. by @addsubmuldiv in #9828
- docs: fix broken Reward Model example link in README by @latent-9 in #9831
- [Bugfix (rlhf)] skip model reload during colocate vLLM init on FSDP2 by @ys2025-AI in #9793
- bump transformers and peft by @hjh0119 in #9837
New Contributors
- @1787648106 made their first contribution in #9691
- @FelysNeko made their first contribution in #9715
- @yszhli made their first contribution in #9722
- @Anai-Guo made their first contribution in #9748
- @qychen2001 made their first contribution in #9758
- @zzong2006 made their first contribution in #9775
- @Va1-HallA made their first contribution in #9777
- @xuwang0117 made their first contribution in #9798
- @kaining-never-stop made their first contribution in #9825
- @latent-9 made their first contribution in #9831
Full Changelog: v4.4.2...v4.4.3
Patch release v4.4.2
Full Changelog: v4.4.1...v4.4.2
Patch release v4.4.1
Full Changelog: v4.4.0...v4.4.1
v4.4.0
中文版
新特性
- RL
a. GRPO 支持 OPD RL 训练。参考文档:https://swift.readthedocs.io/zh-cn/latest/Instruction/Distillation.html
b. GRPO/GKD 支持 Multi-teacher 训练。参考文档:https://swift.readthedocs.io/zh-cn/latest/Instruction/Distillation.html
c. 新增多模态 vLLM 对齐测试。参考 issue:#9668
d. GRPO/GKD Trainer 完成重构。 - Megatron-SWIFT
a. 新增 model_type 支持:GLM-5.2(glm_moe_dsa 新增indexer_type= 'shared' 支持)、minicpmv4_6。
b. NPU Megatron-Core 版本升级至 0.16。(感谢 @addsubmuldiv 的贡献)
c.moe_router_load_balancing_type支持同时指定多个类型。
d. 修复 DeepSeek-V4 FP8 相关问题。 - 训练
a. 新增 DLLM 训练支持(DiffusionGemma)。训练脚本参考:https://github.com/modelscope/ms-swift/blob/main/examples/models/gemma4/diffusion_gemma.sh
b. 新增 Qwen3-TTS 训练支持。训练脚本参考:https://github.com/modelscope/ms-swift/tree/main/examples/models/qwen3_tts
c. Embedding 模型新增 MRL 支持,引入mrl_dims参数。
d. Loss Scale 支持 ConcatLossScale,可将多种 loss scale 策略叠加使用,例如:last_round+ignore_empty_think+hermes。
e. Qwen3.5、minicpmv4.6 支持 padding_free/packing。
新模型
- 纯文本模型
a. ZhipuAI/GLM-5.2 - 多模态模型
a. moonshotai/Kimi-K2.7-Code
b. MiniMaxAI/MiniMax-M3
c. PaddlePaddle/Unlimited-OCR
d. google/diffusiongemma-26B-A4B-it
English Version
New Features
- RL
a. GRPO now supports OPD RL training. Reference doc: https://swift.readthedocs.io/zh-cn/latest/Instruction/Distillation.html
b. GRPO/GKD now supports Multi-teacher training. Reference doc: https://swift.readthedocs.io/zh-cn/latest/Instruction/Distillation.html
c. Added multimodal vLLM alignment tests. Reference issue: #9668
d. GRPO/GKD Trainer has been refactored. - Megatron-SWIFT
a. Added new model_type support: GLM-5.2 (glm_moe_dsa addsindexer_type= 'shared' support) and minicpmv4_6.
b. NPU Megatron-Core upgraded to version 0.16. (Thanks to @addsubmuldiv for the contribution.)
c.moe_router_load_balancing_typenow supports specifying multiple types simultaneously.
d. Fixed DeepSeek-V4 FP8 related issues. - Training
a. Added DLLM training support (DiffusionGemma). Training script reference: https://github.com/modelscope/ms-swift/blob/main/examples/models/gemma4/diffusion_gemma.sh
b. Added Qwen3-TTS training support. Training script reference: https://github.com/modelscope/ms-swift/tree/main/examples/models/qwen3_tts
c. Added MRL support for Embedding models, introducing themrl_dimsparameter.
d. Loss Scale now supports ConcatLossScale, enabling multiple loss scale strategies to be stacked, e.g.:last_round+ignore_empty_think+hermes.
e. Qwen3.5 and minicpmv4.6 now support padding_free/packing.
New Models
- Text-Only Models
a. ZhipuAI/GLM-5.2 - Multimodal Models
a. moonshotai/Kimi-K2.7-Code
b. MiniMaxAI/MiniMax-M3
c. PaddlePaddle/Unlimited-OCR
d. google/diffusiongemma-26B-A4B-it
What's Changed
- [doc] update ray doc by @hjh0119 in #9527
- support embedding MRL by @Jintao-Huang in #9528
- [1/N] Refactor SP by @Jintao-Huang in #9509
- [bugfix] fix megatron server mode by @hjh0119 in #9531
- Add NPU-compatible select_device() and new test cases for data preprocessing by @Ginray in #9512
- update gemma4 agent_template by @Jintao-Huang in #9532
- [megatron] update mcore requirements by @Jintao-Huang in #9536
- support concat_loss_scale by @Jintao-Huang in #9537
- Update doc mindspeed by @addsubmuldiv in #9542
- Update dataset by @Jintao-Huang in #9543
- fix swanlab get_run by @hjh0119 in #9547
- [model] support kimi_k27 by @Jintao-Huang in #9552
- [bugfix] pin MeanMetric all_reduce tensor to float32 to avoid cross-rank dtype mismatch by @HaozheZhang6 in #9551
- update npu scripts for qwen3 omni and 3.5 moe by @hazelduan in #9540
- [model] support diffusion_gemma4 by @Jintao-Huang in #9548
- revert select_device by @Jintao-Huang in #9559
- enable_thinking is set to False for hybrid thinking models. by @Jintao-Huang in #9557
- [template] Add disable ignore empty think by @Jintao-Huang in #9558
- [megatron] megatron remove num_samples by @Jintao-Huang in #9522
- [model] support minimax_m3 by @Jintao-Huang in #9553
- [bugfix] fix minimax_m3 by @Jintao-Huang in #9568
- Add Qwen3.5 NPU A3 16die script by @hazelduan in #9569
- [transformers] support qwen3_5 padding_free/packing by @Jintao-Huang in #9571
- fix gemma4-12b weight sync by @hjh0119 in #9572
- [doc] router replay by @hjh0119 in #9579
- [megatron] update cross_entropy_fusion_impl default value 'te' -> 'native' (#9578) by @Jintao-Huang in #9578
- Add logger initialization to main CLI by @rivergod in #9577
- [model] support GLM 5.2 by @Jintao-Huang in #9581
- [utils] update utils lazy_init by @Jintao-Huang in #9584
- [docs] update deepseek_v4 docs by @Jintao-Huang in #9585
- [docs] update docs by @Jintao-Huang in #9586
- [doc] sort grpo doc index by @hjh0119 in #9587
- [docs] update swift 4.3.1 image by @Jintao-Huang in #9574
- Fix DDP fp32 grad reduce arg mapping by @addsubmuldiv in #9590
- feat(megatron): expose muon_coefficient_type for the Muon optimizer by @yuchenwang3 in #9591
- [ci] introduce uv to accelerate pip install by @KadenZhang3321 in #9297
- fix(muon): muon_use_nesterov silently dropped (arg/config name mismatch) by @yuchenwang3 in #9599
- [bugfix] fix ddp_config by @Jintao-Huang in #9592
- [bugfix] fix gemma4 system by @Jintao-Huang in #9604
- Fix NPU Qwen3.5 grpo bugs by @addsubmuldiv in #9589
- [compat] compat moe_router_load_balancing_type mcore>=0.16 by @Jintao-Huang in #9603
- [1/N] refactor grpo/gkd by @hjh0119 in #9580
- [misc] rollout support sample-level chat template kwargs by @hjh0119 in #9623
- fix elastic code in transformers>=4.57.6 by @meichangsu1 in #9614
- [docs] update qwen3_5 docs by @Jintao-Huang in #9625
- Fix NPU MindSpeed 0.16 compatibility issues by @addsubmuldiv in #9624
- support dsa fused by @Jintao-Huang in #9616
- [BugFix] Fix IPC issue of async mode on AMD platform (ROCm) by @Treemann in #9627
- docs: fix GRPO pseudocode answer by @YingchaoX in #9630
- [feat] grpo multi-turn support openenv by @hjh0119 in #9628
- [docs] update contributing docs by @Jintao-Huang in #9634
- [docs] update deepseek_v4 vllm docs by @Jintao-Huang in #9597
- fix CI by @Jintao-Huang in #9636
- [bugfix] fix sp qwen3_5 by @Jintao-Huang in #9643
- update doc by @addsubmuldiv in #9650
- [model] support Unlimited_OCR by @z0o0ey in #9645
- [bugfix] fix Megatron Ray issue on AMD platform (ROCm) & update AMD support docs by @Treemann in #9653
- support minicpmv4_6 packing by @Jintao-Huang in #9654
- fix(dataset): skip empty rejected_messages instead of crashing by @he-yufeng in #9642
- [docs] update swift image by @Jintao-Huang in #9662
- [feat] support opd rl by @hjh0119 in #9641
- [model] support qwen3_tts by @Jintao-Huang in #9638
- Add support for Unlimited-OCR model with R-SWA by @z0o0ey in #9665
- align swift mm processor with vllm by @hjh0119 in #9669
- [bugfix] add missing offload_teacher_model param by @hjh0119 in #9674
- [bugfix] fix hf...
Patch release v4.3.2
Full Changelog: v4.3.1...v4.3.2
Patch release v4.3.1
Full Changelog: v4.3.0...v4.3.1
v4.3.0
中文版
新特性
- Megatron-SWIFT
a. 新增 model_type 支持:deepseek_v4, gemma4, gemma4_unified, bailing_hybrid, bailing_moe, qwen3_asr。DeepSeek-V4 微调实践:https://swift.readthedocs.io/zh-cn/latest/BestPractices/deepseek-v4.html 。Gemma4 训练脚本:https://github.com/modelscope/ms-swift/blob/main/examples/models/gemma4
b. 新增language_model_only参数,支持只加载、训练和保存多模态模型的语言模型部分。
c. 更多任务类型支持上下文并行(长文本训练):embedding、generative_reranker、seq_cls 和 reward_model 任务。
d. Qwen3-Next 支持 Mcore-GDN 方式运行(默认),支持序列 packing、FP8 及 CP能力。
e. Mcore-Bridge 新增极简 Forward 示例:创建模型、执行 forward并计算损失,方便接入其他项目:https://github.com/modelscope/mcore-bridge?tab=readme-ov-file#minimal-forward-example
f. test_convert_precision 功能增强:新增对 Attention Backend(fused / flash)、上下文并行(CP)及 padding_free 的支持。
g. generative_reranker 任务训练 lm_head 部分显存占用优化,只提取 positive / negative token 位置的 logits 而不是完整的 logits。
h. 训练设置--merge_lora true时,会将 lora 增量权重和 merged 权重都进行存储。
i. 新增megatron_extra_kwargs参数,支持将额外参数直接透传至 Megatron,提升配置灵活性。
j. 支持通过--attention_backend flash_2 / flash_3 / flash_4手动指定 Attention 后端。
k. 新增 Megatron FP4 训练参数:fp4_format、fp4_recipe和fp4_param_gather。
l. 新增 FP8 与 LoRA 结合使用的训练示例脚本:https://github.com/modelscope/ms-swift/blob/main/examples/megatron/fp8/lora.sh
m. embedding 与 generative_reranker 任务支持非 padding_free 方式训练。
n.batch_p2p_comm参数支持。如遇流水线并行(PP)训练卡住的情况,可将其设置为 False。
o.mlp_padding_free参数兼容上下文并行。 - RL
a. 新增基于 Megatron + Ray 的 GRPO 和 GKD 训练支持,适用于超大规模分布式强化学习场景,参考文档 https://swift.readthedocs.io/zh-cn/latest/Instruction/Ray.html
b. Megatron GRPO 支持多轮对话场景下的训练。
c. Megatron GRPO 新增 REAL 算法支持。(感谢@li2zhi 贡献)
d. GRPO 新增 FIPO 算法支持。(感谢 @li2zhi 贡献)
e. GKD 的 teacher_server 重构为基于swift deploy的部署方式。
f. 新增基于 FrozenLake 环境的多轮训练完整示例,参考文档 https://swift.readthedocs.io/zh-cn/latest/Instruction/GRPO/DeveloperGuide/gym_env.html#frozenlake
g. rollout / deploy 支持 vllm 0.16+ 的 dense model 数据并行。
h. gym 模块重构,参考文档 https://swift.readthedocs.io/zh-cn/latest/Instruction/GRPO/DeveloperGuide/gym_env.html - 训练
a. 新增 preserve_thinking 参数:可在推理与训练时控制是否保留历史思考内容。
b. 新增 chat_template_kwargs:训练/推理支持数据样本粒度配置 max_pixels、enable_thinking 等参数,部署侧支持通过 OpenAI 格式传入 enable_thinking / preserve_thinking。
c. 支持在昇腾 NPU 上使用 Zigzag Ring 序列并行策略。(感谢 @addsubmuldiv 的贡献)
d. 音频数据支持从视频文件读取。(感谢 @Tohrusky 的贡献)
e. 兼容python 3.13。
新模型
- 纯文本模型
a. deepseek-ai/DeepSeek-V4-Flash 系列
b. OpenBMB/MiniCPM5-1B 系列
c. inclusionAI/Ling-2.6-1T, inclusionAI/Ring-2.6-1T 系列 - 多模态模型
a. OpenBMB/MiniCPM-V-4.6(感谢 @tsjyma 的贡献)
b. PaddlePaddle/PaddleOCR-VL-1.6
c. google/gemma-4-12B-it 系列
d. moonshotai/Kimi-K2.5, moonshotai/Kimi-K2.6 支持多模态
English Version
New Features
- Megatron-SWIFT
a. New model_type support: deepseek_v4, gemma4, gemma4_unified, bailing_hybrid, bailing_moe, qwen3_asr. DeepSeek-V4 fine-tuning best practices: https://swift.readthedocs.io/en/latest/BestPractices/deepseek-v4.html. Gemma4 training scripts: https://github.com/modelscope/ms-swift/blob/main/examples/models/gemma4
b. Addedlanguage_model_onlyparameter to support loading, training, and saving only the language model component of multimodal models.
c. Context Parallelism (CP) extended to more task types (long-sequence training): embedding, generative_reranker, seq_cls, and reward_model.
d. Qwen3-Next now defaults to Mcore-GDN, enabling sequence packing, FP8 training, and Context Parallelism.
e. Mcore-Bridge adds a minimal Forward example covering model creation, forward execution, and loss computation, making it straightforward to integrate into other projects: https://github.com/modelscope/mcore-bridge?tab=readme-ov-file#minimal-forward-example
f.test_convert_precisionenhancements: added support for Attention Backend (fused/flash), Context Parallelism (CP), andpadding_freemode.
g. Memory optimization forlm_headingenerative_rerankertraining: only the logits at positive / negative token positions are extracted instead of materializing the full logits matrix, significantly reducing peak memory usage in large-vocabulary scenarios.
h. When--merge_lora trueis set, both the LoRA delta weights and the merged weights are now saved simultaneously.
i. Addedmegatron_extra_kwargsparameter to allow arbitrary extra arguments to be passed directly to Megatron, improving configuration flexibility.
j. Support for manually specifying the Attention backend via--attention_backend flash_2 / flash_3 / flash_4.
k. Added Megatron FP4 training parameters:fp4_format,fp4_recipe, andfp4_param_gather.
l. Added a training example script for combined FP8 + LoRA usage: https://github.com/modelscope/ms-swift/blob/main/examples/megatron/fp8/lora.sh
m.embeddingandgenerative_rerankertasks now support training withoutpadding_freemode.
n. Addedbatch_p2p_commparameter. If pipeline parallelism (PP) training hangs, setting this toFalsecan resolve the communication blocking issue.
o.mlp_padding_freeis now compatible with Context Parallelism (CP). - RL
a. Added GRPO and GKD training support based on Megatron + Ray, targeting large-scale distributed reinforcement learning scenarios. Refer to: https://swift.readthedocs.io/en/latest/Instruction/Ray.html
b. Megatron GRPO now supports multi-turn dialogue training.
c. Megatron GRPO adds support for the REAL algorithm. (Thanks to @li2zhi for the contribution.)
d. GRPO adds support for the FIPO algorithm. (Thanks to @li2zhi for the contribution.)
e. GKDteacher_serverhas been refactored to useswift deployas the serving backend.
f. Added a complete multi-turn training example based on the FrozenLake environment. Refer to: https://swift.readthedocs.io/en/latest/Instruction/GRPO/DeveloperGuide/gym_env.html#frozenlake
g.rollout/deploynow supports data parallelism for dense models with vLLM 0.16+.
h.gymmodule refactored for a cleaner interface and improved extensibility. Refer to: https://swift.readthedocs.io/en/latest/Instruction/GRPO/DeveloperGuide/gym_env.html - Training
a. Addedpreserve_thinkingparameter to control whether historical chain-of-thought content is retained during inference and training.
b. Addedchat_template_kwargssupport: training and inference now support sample-level configuration of parameters such asmax_pixelsandenable_thinking; on the serving side,enable_thinking/preserve_thinkingcan be passed via the OpenAI-compatible API format.
c. Added support for the Zigzag Ring sequence parallelism strategy on Ascend NPU. (Thanks to @addsubmuldiv for the contribution.)
d. Audio data can now be read directly from video files. (Thanks to @Tohrusky for the contribution.)
e. Python 3.13 compatibility.
New Models
- Language Models
a. deepseek-ai/DeepSeek-V4-Flash series
b. OpenBMB/MiniCPM5-1B series
c. inclusionAI/Ling-2.6-1T, inclusionAI/Ring-2.6-1T series - Multimodal Models
a. OpenBMB/MiniCPM-V-4.6 (Thanks to @tsjyma for the contribution.)
b. PaddlePaddle/PaddleOCR-VL-1.6
c. google/gemma-4-12B-it series
d. moonshotai/Kimi-K2.5, moonshotai/Kimi-K2.6 with multimodal support
What's Changed
- [bugfix] fix datasets cache hash by @Jintao-Huang in #9284
- [readme] fix readme by @Jintao-Huang in #9285
- [template] support chat_template_kwargs by @Jintao-Huang in #9272
- compat python3.13 by @Jintao-Huang in #9288
- [bugfix]: fix qwen2.5 omni image list mode fps by @Tohrusky in #9290
- update lint compat py313 by @Jintao-Huang in #9289
- [model] Support deepseek v4 template by @Jintao-Huang in #9208
- [docs] update support docs by @Jintao-Huang in #9291
- [docs] fix docs install swift by @Jintao-Huang in #9292
- [model] Add support for MiniCPM-V-4.6 model by @tsjyma in #9286
- [docs] update swift image 4.2.0 by @Jintao-Huang in #9300
- Fix missing root_image_dir attribute in deepseekocr template by @hjh0119 in #9305
- [bugfix] fix deepspeed lr_scheduler by @Jintao-Huang in #9304
- fix vllm dp & reset_encoder_cache & fix vllm init with zero3 by @hjh0119 in #9295
- Megatron REAL Support by @li2zhi in #9270
- [docs] update docs & fix gemma4 megatron by @Jintao-Huang in #9308
- megatron grpo data_shuffle by @hjh0119 in #9310
- [template] Support preserve thinking by @Jintao-Huang in #9309
- [Bugfix] Fix NPU FSDP2 parameter device placement for full_tensor access by @ys2025-AI in #9314
- NPU ring attention adapt by @addsubmuldiv in #9298
- refactor_mm_token_type by @Jintao-Huang in #9316
- [model] support minicpmv4_6 by @Jintao-Huang in #9326
- [bugfix] fix qwen3 vl template by @Jintao-Huang in #9327
- [fix] support video as audio input by @Tohrusky in #9311
- [bugfix] f...