deepspeedai / deepspeedai/DeepSpeed

[BUG] Why in the checkpoints of later stage of training, the global_step number is inconsistent with checkpoint step number?

Open
#7,405 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug training
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Describe the bug
I'm training a LLM on a 8-gpu node, using ZeRO3. In the checkpoints of later stage of training, for example after 300 steps when total steps equal to 500, the number of global_step folder inside the checkpoint folder is inconsistent with checkpoint step number. If I continue my training with this checkpoint, later the checkpoints of the new training will amplify this mismatch. The new checkpoints could be "checkpoint-1200" with "global_step1192". And I'm not sure if this mismatch will cause a spike of training loss.

To Reproduce
Steps to reproduce the behavior:

  1. Go to later stage checkpoint, e.g. "checkpoint-800"
  2. See error, there's a folder: e.g. "global_step799", the step doesn't match.

Expected behavior
In the early stage, this should be "checkpoint-200" with "global_step200".

ds_report output
The screenshot of my file system will be shown beow:

Screenshots

Image

System info (please complete the following information):

  • OS: [Red Hat Enterprise Linux 9.5]
  • GPU count and types [1 machine with x8 A100s]
  • Python version 3.11
  • ZeRO3

Launcher context
Are you launching your experiment with the deepspeed launcher, MPI, or something else?
compute_environment: LOCAL_MACHINE
debug: false
deepspeed_config:
deepspeed_multinode_launcher: standard
offload_optimizer_device: none
offload_param_device: none
zero3_init_flag: true
zero3_save_16bit_model: true
zero_stage: 3
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: true
bf16:
enabled: true
distributed_type: DEEPSPEED
downcast_bf16: 'no'
machine_rank: 0
main_training_function: main
mixed_precision: bf16
num_machines: 1
num_processes: 8
rdzv_backend: static
same_network: true
tpu_env: []
tpu_use_cluster: false
tpu_use_sudo: false
use_cpu: false

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

Reproduce the report with the stated 8-GPU ZeRO3 configuration and compare checkpoint directory names with their global_step folders, including checkpoint-800/global_step799 and resumed-training examples. Trace the checkpoint save and resume entry points responsible for these names; done means later-stage and resumed checkpoints use consistent step values without altering training behavior.

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
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.