qwen3_vl_moe
本任务涉及围为 qwen3_vl_moe
HyperParallel Trainer 已经具备基础的 FSDP、TP 和通用训练能力,但不同模型在权重加载、模型配置、输入数据和保存恢复流程上仍需要模型专用接入。
Qwen3-VL-MoE 同时包含文本 Decoder 和视觉 Encoder。要让它真正进入 Trainer 的可用模型范围,需要补齐训练模板、模型并行接入、checkpoint 保存恢复、集成测试和使用文档,并用单卡结果验证多卡训练的精度一致性。
需要在现有 hyper_parallel/models/ 和 Trainer 发现机制下完成 qwen3_vl_moe 的训练入口,确保:
hyper_parallel/models/
model.name: qwen3_vl_moe
需要提供:
examples/qwen3_vl_30b_a3b_instruct/train.yaml
模板至少包含:
建议的 checkpoint 配置:
train: max_steps: 100 checkpoint: output_dir: outputs/qwen3_vl_moe save_steps: 50 load_path: null
视觉侧的 vision_parallel 可以作为 qwen3_vl_moe 模型专用配置保留,用于验证视觉塔并行路径,但它不是本任务的主要验收对象。
vision_parallel
需要验证:
save_steps
load_path
需要补充覆盖以下内容的测试:
当前代码对应的测试入口可以放在:
tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vision_parity.py tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vl_trainer.py
docs/guide/qwen3_vl_moe.md
docs/index.md
主验收以 HyperParallel 单卡训练结果为基线:
验收标准:
abs(mean_loss_2card - mean_loss_1card) <= 5e-3
如果环境允许,额外与 Hugging Face + LlamaFactory 的单卡结果进行参考对比。外部框架结果只作为补充,不替代 HyperParallel 单卡基线。
export HYPER_PARALLEL_PLATFORM=torch export ASCEND_VISIBLE_DEVICES=0,1 export TORCH_DEVICE_BACKEND_AUTOLOAD=0 python -m hyper_parallel.trainer.launch \ --config examples/qwen3_vl_30b_a3b_instruct/train.yaml
export HYPER_PARALLEL_PLATFORM=torch python -m pytest -q \ tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vision_parity.py
export HYPER_PARALLEL_PLATFORM=torch export ASCEND_VISIBLE_DEVICES=0,1 export TORCH_DEVICE_BACKEND_AUTOLOAD=0 python -m pytest -q \ tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vl_trainer.py -s
以下为当前服务器上已实际完成的 NPU 验证记录。
npu-smi
step_50
step_100
checkpoint-50
9.5e-7
2.5e-7
补充说明:单卡与 2 卡首步 loss 完全一致,均为 11.931214332580566;视觉塔回归测试 tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vision_parity.py 已通过。
11.931214332580566
tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vision_parity.py
外部参考补充:使用 LlamaFactory v1 + Hugging Face tiny-random/qwen3-vl-moe 在单 NPU npu:0 上完成 100 step 多模态 demo SFT,mean_loss=11.919068269729614,last_loss=11.922738075256348。验证时使用了本机临时工作目录生成的配置、数据副本和兼容层,最终在临时输出目录中生成了 checkpoint-50 和 checkpoint-100。 该结果只作为外部训练链路 smoke。
tiny-random/qwen3-vl-moe
npu:0
mean_loss=11.919068269729614
last_loss=11.922738075256348
checkpoint-100
HyperParallel Trainer 接入
qwen3_vl_moe背景
HyperParallel Trainer 已经具备基础的 FSDP、TP 和通用训练能力,但不同模型在权重加载、模型配置、输入数据和保存恢复流程上仍需要模型专用接入。
Qwen3-VL-MoE 同时包含文本 Decoder 和视觉 Encoder。要让它真正进入 Trainer 的可用模型范围,需要补齐训练模板、模型并行接入、checkpoint 保存恢复、集成测试和使用文档,并用单卡结果验证多卡训练的精度一致性。
任务目标
qwen3_vl_moe的 Trainer 训练接入;功能需求
1. 模型训练接入
需要在现有
hyper_parallel/models/和 Trainer 发现机制下完成qwen3_vl_moe的训练入口,确保:model.name: qwen3_vl_moe可以被 Trainer 正确识别;2. 训练配置模板
需要提供:
模板至少包含:
model.name: qwen3_vl_moe;建议的 checkpoint 配置:
train: max_steps: 100 checkpoint: output_dir: outputs/qwen3_vl_moe save_steps: 50 load_path: null视觉侧的
vision_parallel可以作为qwen3_vl_moe模型专用配置保留,用于验证视觉塔并行路径,但它不是本任务的主要验收对象。3. 保存和恢复
需要验证:
save_steps保存 checkpoint;load_path可以从已有 checkpoint 继续训练;4. 集成测试
需要补充覆盖以下内容的测试:
qwen3_vl_moe1 卡训练 smoke;qwen3_vl_moe2 卡 FSDP / TP 训练 smoke;当前代码对应的测试入口可以放在:
5. 使用文档
需要提供:
docs/guide/qwen3_vl_moe.md;docs/index.md中的文档入口;6. 精度对齐
主验收以 HyperParallel 单卡训练结果为基线:
验收标准:
如果环境允许,额外与 Hugging Face + LlamaFactory 的单卡结果进行参考对比。外部框架结果只作为补充,不替代 HyperParallel 单卡基线。
验收命令
1. 训练模板
export HYPER_PARALLEL_PLATFORM=torch export ASCEND_VISIBLE_DEVICES=0,1 export TORCH_DEVICE_BACKEND_AUTOLOAD=0 python -m hyper_parallel.trainer.launch \ --config examples/qwen3_vl_30b_a3b_instruct/train.yaml2. 视觉塔回归测试
export HYPER_PARALLEL_PLATFORM=torch python -m pytest -q \ tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vision_parity.py3. Qwen3-VL-MoE 集成测试
export HYPER_PARALLEL_PLATFORM=torch export ASCEND_VISIBLE_DEVICES=0,1 export TORCH_DEVICE_BACKEND_AUTOLOAD=0 python -m pytest -q \ tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vl_trainer.py -s当前验证记录
1. 环境信息
npu-smi26.0.rc1,健康状态 OK2. 训练和精度结果
3. 保存恢复结果
step_50和step_100目录均已生成,包含模型、优化器、scheduler、RNG 和 dataloader 状态load_path恢复checkpoint-50可正常恢复9.5e-72.5e-74. 性能和可靠性结果
补充说明:单卡与 2 卡首步 loss 完全一致,均为
11.931214332580566;视觉塔回归测试tests/torch/qwen3_vl_moe/test_qwen3_vl_moe_vision_parity.py已通过。外部参考补充:使用 LlamaFactory v1 + Hugging Face
tiny-random/qwen3-vl-moe在单 NPUnpu:0上完成 100 step 多模态 demo SFT,mean_loss=11.919068269729614,last_loss=11.922738075256348。验证时使用了本机临时工作目录生成的配置、数据副本和兼容层,最终在临时输出目录中生成了checkpoint-50和checkpoint-100。该结果只作为外部训练链路 smoke。