Skip to content

[Spike]Validate Qwen3-4B checkpoint save/restore flow (test_qwen3_4B_ckpt) #27

Description

@CalvinXKY

Summary

Spike to validate whether the checkpoint save/restore flow in tests/test_qwen3_4B_ckpt.py works on vime + vLLM colocate (Qwen3-4B), in support of #11 (Checkpoint save/restore).

This issue records test procedure and observations from a manual run — not a bug filing.

Relation to #11

#11 tracks checkpoint save/restore for the Qwen3-4B baseline. The upstream CI test already defines a two-job workflow:

Phase Purpose Key train.py args
Save Short colocated run + periodic checkpoint --save, --save-interval 2, no --load
Load New Ray job resumes from a fixed step --load <dir>, --ckpt-step 1

CI today runs this with the SGLang rollout stack. This spike runs the same logic with vLLM colocate.

Optimizer / checkpoint args (same as test_qwen3_4B_ckpt.py)

Besides standard Adam / GRPO settings, the spike uses the same optimizer-related flags as the upstream test:

  • --optimizer-cpu-offload — keep optimizer state on CPU to save GPU memory
  • --overlap-cpu-optimizer-d2h-h2d — overlap CPU↔GPU copies for the optimizer
  • --use-precision-aware-optimizer — Megatron precision-aware optimizer (PAO); affects how optimizer state is stored in torch_dist checkpoints

Optional (CI variant): --async-save on the save phase only.

Topology & vLLM

  • 8 GPUs, colocate: --colocate, --actor-num-gpus-per-node 8
  • Rollout (Ray resource, not in VLLM_ARGS): --rollout-num-gpus 8 (must match actor GPU count so colocate PG sizing is correct)
  • vLLM: --rollout-backend vllm, --rollout-num-gpus-per-engine 2, --vllm-gpu-memory-utilization 0.7
  • Weight sync: vLLM colocate IPC (same branch requirement as other Qwen3-4B vLLM colocate smokes, e.g. test/with_ipc)

Spike runner script

RL workspace (outside vime repo): run_scripts/qwen3-4B-vllm-ckpt-verify.sh
Orchestration env vars (script only): CKPT_PHASE=save|load|all, ASYNC_SAVE=0|1, CONCURRENT_RAY=0|1.

Prerequisites

  • 8× GPU node (we used 8× A100 80GB)
  • Qwen3-4B HF checkpoint + Qwen3-4B_torch_dist
  • dapo-math-17k prompt data
  • vime on a branch with vLLM colocate IPC weight sync

Test steps

1. Paths

cd <RL-workspace>
git -C vime checkout <branch-with-vllm-colocate-ipc>

export HF_CKPT=/path/to/Qwen3-4B
export REF_LOAD=/path/to/Qwen3-4B_torch_dist
export SAVE_DIR=/path/to/Qwen3-4B_vllm_ckpt
export PROMPT_DATA=/path/to/dapo-math-17k/dapo-math-17k.jsonl

2. Full spike (save → load)

Aligns with test_qwen3_4B_ckpt.py (including the three optimizer flags above):

CONCURRENT_RAY=0 CKPT_PHASE=all \
  bash run_scripts/qwen3-4B-vllm-ckpt-verify.sh

Save phase (first Ray job):

  • --num-rollout 3, --save-interval 2, --save ${SAVE_DIR}
  • --colocate, --actor-num-gpus-per-node 8, --rollout-num-gpus 8
  • Optimizer flags listed in the table above

Load phase (second Ray job, after Ray/GPU cleanup):

  • --load ${SAVE_DIR}, --ckpt-step 1
  • Same training / vLLM / optimizer flags as save phase

3. Optional variants

# Save only
CKPT_PHASE=save CONCURRENT_RAY=0 bash run_scripts/qwen3-4B-vllm-ckpt-verify.sh

# Load only (after save succeeded)
CKPT_PHASE=load CKPT_STEP=1 CONCURRENT_RAY=0 bash run_scripts/qwen3-4B-vllm-ckpt-verify.sh

# Async save (CI: python tests/test_qwen3_4B_ckpt.py --async-save)
ASYNC_SAVE=1 CKPT_PHASE=all CONCURRENT_RAY=0 bash run_scripts/qwen3-4B-vllm-ckpt-verify.sh

4. Log / artifact checks

Save phase

  • successfully saved checkpoint from iteration … to ${SAVE_DIR}
  • ${SAVE_DIR}/iter_0000001/, iter_0000002/, latest_checkpointed_iteration.txt
  • Ray: Job succeeded

Load phase

  • loading distributed checkpoint from ${SAVE_DIR} at iteration <CKPT_STEP>
  • Training / rollout continues
  • Ray: Job succeeded

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions