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

qwen3.5-35B训练长文本数据训练速度异常的慢

Open fj1024 opened this issue 9 months ago • 4 comments

Checklist / 检查清单

  • [x] I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。

Question Description / 问题描述

运行脚本如下: megatron sft
--model /mnt/public/checkpoints/Qwen3.5-35B-A3B
--save_safetensors true
--merge_lora true
--dataset "${DATASETS[@]}"
--load_from_cache_file true
--add_non_thinking_prefix true
--split_dataset_ratio 0
--tuner_type lora
--lora_rank "${rank}"
--lora_alpha $((rank * 2))
--target_modules all-linear
--tensor_model_parallel_size 2
--pipeline_model_parallel_size 1
--expert_tensor_parallel_size 1
--expert_model_parallel_size 8
--context_parallel_size 1
--sequence_parallel true
--moe_permute_fusion true
--moe_grouped_gemm true
--moe_shared_expert_overlap true
--moe_aux_loss_coeff 1e-3
--moe_z_loss_coeff 5e-4
--micro_batch_size 4
--global_batch_size 8
--recompute_granularity full
--recompute_method uniform
--recompute_num_layers 1
--num_train_epochs 2
--group_by_length true
--finetune true
--freeze_llm false
--freeze_vit true
--freeze_aligner true
--cross_entropy_loss_fusion true
--lr "${lr}"
--lr_warmup_fraction 0.05
--min_lr 1e-6
--output_dir "${OUTPUT_DIR}"
--max_length 16768
--dataloader_num_workers 8
--no_save_optim true
--no_save_rng true
--dataset_num_proc 8
--attention_backend flash
--use_precision_aware_optimizer true
--main_grads_dtype bf16
--overlap_grad_reduce true
--overlap_param_gather true
--padding_free false \

fj1024 avatar Mar 02 '26 06:03 fj1024

参考这个issue: https://github.com/modelscope/ms-swift/issues/8145

Jintao-Huang avatar Mar 02 '26 07:03 Jintao-Huang

参考这个issue: #8145

我也是训练纯文本数据,参考这个issue,注释了NB相关参数,训练速度没有任何改善。

NicholasKX avatar Mar 02 '26 07:03 NicholasKX

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 Jun 01 '26 00:06 github-actions[bot]

第一个step会比较慢。后面是正常的速度

Jintao-Huang avatar Jun 01 '26 03:06 Jintao-Huang