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

Qwen3-VL-30B-A3B-Instruct much worse performance after fine-tune compared to 32B and 8B dense

Open mertunsall opened this issue 1 year ago • 5 comments

@Jintao-Huang We found that the 30B-A3B model performs worse after finetuning compared to 32B and 8B dense with almost exactly the same hyperparameters and default settings recommended. Do we have some tests to verify that there are no bugs.

I am using megatron sft

mertunsall avatar Nov 08 '25 18:11 mertunsall

Please provide some bad case screenshots and training scripts.

Jintao-Huang avatar Nov 09 '25 08:11 Jintao-Huang

It's hard to tell apart from the fact that it performs worse on the benchmark. I can share the training scripts below:

# 8 * 80GiB
PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True' \
OMP_NUM_THREADS=14 \
NPROC_PER_NODE=8 \
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
megatron sft \
    --load '***/Qwen3-VL-30B-A3B-Instruct-mcore' \
    --dataset '***/*-sft' \
    --load_from_cache_file true \
    --freeze_llm false \
    --freeze_vit false \
    --freeze_aligner false \
    --split_dataset_ratio 0.01 \
    --moe_permute_fusion true \
    --tensor_model_parallel_size 1 \
    --expert_model_parallel_size 4   \
    --moe_grouped_gemm true \
    --moe_shared_expert_overlap true \
    --moe_aux_loss_coeff 1e-6 \
    --micro_batch_size 1 \
    --global_batch_size 16 \
    --recompute_granularity full \
    --recompute_method uniform \
    --recompute_num_layers 1 \
    --max_epochs 3 \
    --finetune true \
    --lr 2e-5 \
    --lr_warmup_fraction 0.05 \
    --min_lr 1e-6 \
    --save ***/Qwen3-VL-30B-A3B-Instruct-301025-test \
    --eval_interval 100000 \
    --save_interval 500 \
    --max_length 32768 \
    --packing true \
    --num_workers 160 \
    --dataset_num_proc 160 \
    --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.0 \
    --use_hf true

For 32B

PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True' \
NPROC_PER_NODE=8 \
MAX_PIXELS=1003520 \
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
megatron sft \
    --model 'Qwen/Qwen3-VL-32B-Instruct' \
    --load_safetensors true \
    --save_safetensors true \
    --dataset '***/*-sft' \
    --load_from_cache_file true \
    --tensor_model_parallel_size 4 \
    --sequence_parallel true \
    --packing true \
    --freeze_llm false \
    --freeze_vit false \
    --freeze_aligner false \
    --split_dataset_ratio 0.01 \
    --micro_batch_size 1 \
    --global_batch_size 32 \
    --recompute_granularity full \
    --recompute_method uniform \
    --recompute_num_layers 1 \
    --finetune true \
    --lr 2e-5 \
    --lr_warmup_fraction 0.05 \
    --min_lr 1e-6 \
    --max_epochs 1 \
    --save '***/Qwen3-VL-32B-Instruct-301025' \
    --save_interval 200 \
    --eval_interval 200 \
    --vit_gradient_checkpointing true \
    --max_length 32768 \
    --num_workers 100 \
    --no_save_optim true \
    --no_save_rng true \
    --dataset_num_proc 100 \
    --use_hf true 

mertunsall avatar Nov 09 '25 18:11 mertunsall

@Jintao-Huang are there any updates on this? have you identified any problems?

mertunsall avatar Nov 30 '25 01:11 mertunsall

I encountered the same problem

Owen1B avatar Feb 08 '26 22:02 Owen1B

encounter the same problem, after sft, 30b output weird tokens.

yxh-y avatar Feb 27 '26 07:02 yxh-y