Skip to content

feat: support megatron wandb #4074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2025

Conversation

firefighter-eric
Copy link
Contributor

@firefighter-eric firefighter-eric commented May 4, 2025

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Add support megatron wandb in ms-swift
Add arguments like megatron llm
https://github.com/NVIDIA/Megatron-LM/blob/89d758b28f57d71fe74a6e1b85d2f93a4302121a/megatron/training/arguments.py#L1514

Write the detail information belongs to this PR.

Experiment results

NPROC_PER_NODE=1 \
CUDA_VISIBLE_DEVICES=0 \
megatron sft \
    --load data/models/Qwen/Qwen3-0.6B-mcore \
    --dataset data/swift/Qwen3-SFT-Mixin/qwen3_32b_distill_1k.jsonl \
    --tensor_model_parallel_size 1 \
    --micro_batch_size 1 \
    --global_batch_size 16 \
    --recompute_granularity selective \
    --train_iters 31 \
    --eval_iters 5 \
    --finetune true \
    --cross_entropy_loss_fusion true \
    --lr 1e-5 \
    --lr_warmup_iters 10 \
    --min_lr 1e-6 \
    --save runs/test/qwen3-0.6b-megatron \
    --save_interval 100 \
    --max_length 2048 \
    --system 'You are a helpful assistant.' \
    --num_workers 4 \
    --no_save_optim true \
    --no_save_rng true \
    --dataset_num_proc 4 \
    --bf16 true \
    --log_interval 1 \
    --use_flash_attn true \
    --wandb_project llm101 \
    --wandb_exp_name qwen3-0.6b-megatron
image

Resolves #4071

@Jintao-Huang Jintao-Huang merged commit 11ed8b9 into modelscope:main May 4, 2025
2 checks passed
tastelikefeet added a commit to tastelikefeet/swift that referenced this pull request May 6, 2025
* main:
  fix enable_cache (modelscope#4091)
  Support ulysses for llm/mllm,dpo/sft (modelscope#4085)
  update docs (modelscope#4078)
  feat: support megatron wandb (modelscope#4074)
  feat: add run name support (modelscope#4072)
  fix padding_side left (modelscope#4069)
  bump version
  support MiMo-7B (modelscope#4067)
  fix packing eval streaming (modelscope#4066)
  Support empty think loss scale (modelscope#4065)
  support qwen3-moe awq (modelscope#4059)
  Fix grpo eval when gas > 1 (modelscope#4057)
  fix rollout(modelscope#4055)
  updates GRPOTrainer compatible with trl 0.17 (modelscope#3969)
  support Qwen2.5-Omni-3B (modelscope#4052)
  update wechat (modelscope#4047)

# Conflicts:
#	swift/llm/train/tuner.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support wandb logging in Swift Megatron SFT
2 participants