modelscope / modelscope/ms-swift

断点续训参数设置问题

Open
#7,994 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

Checklist / 检查清单
  • I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。
Question Description / 问题描述

请问megatron pt的断点续训,第一次训练和断点续训的参数分别应该如何设置?

第一次训练能够正常训练,参数如下:

PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True' \
NNODES=2 \
NODE_RANK=0 \
MASTER_ADDR=xxxx \
MASTER_PORT=29500 \
NPROC_PER_NODE=8 \
megatron pt \
    --model /data/disk1/Qwen/Qwen3-30B-A3B-Base \
    --no_save_optim true \
    --no_save_rng true \
    --dataset /data/disk1/dataset3.jsonl \
    --load_from_cache_file true \
    --tensor_model_parallel_size 1 \
    --expert_model_parallel_size 8 \
    --pipeline_model_parallel_size 1 \
    --moe_expert_capacity_factor 2 \
    --micro_batch_size 1 \
    --global_batch_size 128 \
    --recompute_granularity full \
    --recompute_num_layers 2 \
    --recompute_method uniform \
    --use_distributed_optimizer true \
    --use_flash_attn true \
    --cross_entropy_loss_fusion true \
    --lr 2e-5 \
    --finetune true \
    --lr_warmup_fraction 0.05 \
    --min_lr 2e-6 \
    --max_epochs 1 \
    --save /data/disk1/Qwen3-30B-A3B-Base-save \
    --save_interval 10 \
    --max_length 32768 \
    --num_workers 16 \
    --dataset_num_proc 2 \
    --model_author swift \
    --model_name swift-robot \
    --packing true \
    --overlap_grad_reduce true \
    --overlap_param_gather true \
    --moe_grouped_gemm true \
    --moe_permute_fusion true \
    --moe_shared_expert_overlap true \
    --log_throughput true

断点续训失败,参数如下:

PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True' \
NNODES=2 \
NODE_RANK=1 \
MASTER_ADDR=xxxx \
MASTER_PORT=29500 \
NPROC_PER_NODE=8 \
megatron pt \
    --load /data/disk1/Qwen3-30B-A3B-Base-save/v0-20260205-202217/checkpoint-10  \ #这里做了更改
    --no_save_optim true \
    --no_save_rng true \
    --dataset /data/disk1/dataset3.jsonl \
    --load_from_cache_file true \
    --tensor_model_parallel_size 1 \
    --expert_model_parallel_size 8 \
    --pipeline_model_parallel_size 1 \
    --moe_expert_capacity_factor 2 \
    --micro_batch_size 1 \
    --global_batch_size 128 \
    --recompute_granularity full \
    --recompute_num_layers 2 \
    --recompute_method uniform \
    --use_distributed_optimizer true \
    --use_flash_attn true \
    --cross_entropy_loss_fusion true \
    --lr 2e-5 \
    --finetune false \                        #这里做了更改
    --lr_warmup_fraction 0.05 \
    --min_lr 2e-6 \
    --max_epochs 1 \
    --save /data/disk1/Qwen3-30B-A3B-Base-save \
    --save_interval 10 \
    --max_length 32768 \
    --num_workers 16 \
    --dataset_num_proc 2 \
    --model_author swift \
    --model_name swift-robot \
    --packing true \
    --overlap_grad_reduce true \
    --overlap_param_gather true \
    --moe_grouped_gemm true \
    --moe_permute_fusion true \
    --moe_shared_expert_overlap true \
    --log_throughput true

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the megatron pt entry point and compare the working command with the resume command, especially --load and --finetune. The issue does not include the failure output, so first reproduce the resume attempt using checkpoint-10; done means training resumes successfully from that checkpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.