ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

Qwen3_VL_A3B_30B Lora合并问题

Open cockroach864 opened this issue 11 months ago • 4 comments

合并代码: CUDA_VISIBLE_DEVICES=0,1
swift export
--mcore_adapters ./output/megatron_output/Qwen3-VL-30B-A3B-Instructs/sft_gr/v0-20251214-000945
--torch_dtype bfloat16
--merge_lora true
--output_dir ./output/megatron_output/Qwen3-VL-30B-A3B-Instructs/sft_gr_hf \

训练代码: PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True'
OMP_NUM_THREADS=10
NPROC_PER_NODE=8
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
IMAGE_MAX_TOKEN_NUM=16384
IMAGE_MIN_TOKEN_NUM=4
megatron sft
--load ./output/Qwen3-VL-30B-A3B-Instruct-mcore
--dataset ./output/Grounding/moe_sft_data.json
--loss_scale ignore_empty_think
--train_type lora
--lora_rank 8
--lora_alpha 32
--target_modules all-linear
--load_from_cache_file true
--split_dataset_ratio 0.01
--moe_permute_fusion true
--moe_grouped_gemm true
--expert_model_parallel_size 4
--moe_shared_expert_overlap true
--moe_aux_loss_coeff 1e-3
--micro_batch_size 4
--global_batch_size 32
--recompute_granularity full
--recompute_method uniform
--recompute_num_layers 1
--max_epochs 1
--finetune true
--cross_entropy_loss_fusion true
--lr 1e-5
--lr_warmup_fraction 0.05
--min_lr 1e-6
--save ./output/megatron_output/Qwen3-VL-30B-A3B-Instructs/sft
--eval_interval 1000
--save_interval 1000
--max_length 4096
--packing true
--num_workers 8
--dataset_num_proc 8
--no_save_optim true
--no_save_rng true
--sequence_parallel true
--moe_expert_capacity_factor 2
--optimizer_cpu_offload true
--use_precision_aware_optimizer true
--optimizer_offload_fraction 0.2
--attention_backend flash \

报错: Traceback (most recent call last): File "/root/paddlejob/workspace/env_run/output/ms-swift/swift/cli/export.py", line 5, in export_main() File "/root/paddlejob/workspace/env_run/output/ms-swift/swift/llm/export/export.py", line 53, in export_main return SwiftExport(args).main() File "/root/paddlejob/workspace/env_run/output/ms-swift/swift/llm/base.py", line 49, in main result = self.run() File "/root/paddlejob/workspace/env_run/output/ms-swift/swift/llm/export/export.py", line 27, in run merge_lora(args) File "/root/paddlejob/workspace/env_run/output/ms-swift/swift/llm/export/merge_lora.py", line 53, in merge_lora additional_saved_files=model.model_meta.additional_saved_files) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1962, in getattr raise AttributeError( AttributeError: 'Qwen3VLMoeModel' object has no attribute 'model_meta'

请问这个报错应该怎么修复?

cockroach864 avatar Dec 14 '25 06:12 cockroach864

try use release/3.11 or main branch

Jintao-Huang avatar Dec 14 '25 07:12 Jintao-Huang

https://swift.readthedocs.io/zh-cn/latest/Megatron-SWIFT/LoRA-Training.html#mcorehf

Jintao-Huang avatar Dec 14 '25 07:12 Jintao-Huang

https://swift.readthedocs.io/zh-cn/latest/Megatron-SWIFT/LoRA-Training.html#mcorehf

That's helpful, thanks!

cockroach864 avatar Dec 14 '25 07:12 cockroach864

This issue has been inactive for over 3 months and will be automatically closed in 7 days. If this issue is still relevant, please reply to this message.

github-actions[bot] avatar Mar 15 '26 00:03 github-actions[bot]