Checkpoint - Add non-VPP to VPP model checkpoint converter - #35
Checkpoint - Add non-VPP to VPP model checkpoint converter#35LI MOU (limou102) wants to merge 23 commits into
Conversation
@microsoft-github-policy-service agree company="AMD" |
|
As discussed offline, let's make the code more general, and support uneven VPP case. |
|
uneven pipeline mode is supported now. |
|
Please add a test case that runs in the CI/CD pipeline to test this PR. The test flow can be:
The test case should be in |
|
resolve conversations above |
|
Marking as stale. No activity in 60 days. |
pp_to_vpp
description
This tool can convert a language model checkpoint without virtual pipeline parallelism into one with virtual pipeline parallelism by increasing the virtual pipeline stage size.
Other model parallel parameters (tensor-parallel-size, pipeline-parallel-size, expert-parallel-size ...) remain unchanged.
(2025-05-30) It now supports uneven pipeline mode, as well as cases where the number of layers in a pipeline stage is not divisible by the virtual pipeline degree.
see arguments:
The above two parameters must either both be provided(or both be omitted), indicating that uneven pipeline mode is enabled
and specifying the virtual pipeline layer distribution for the first and last pipeline stages(this distribution may be even, but it still needs to be explicitly provided).
This feature was introduced based on the following Pull Request.
#27
The model after converted needs to be loaded using a Megatron-LM framework that has this Pull Request applied.
Currently, tests have been conducted on the DeepSeek(v2, v3) and Mixtral models.
Note that currently, all of the following configurations must be satisfied to be supported.
tensor_parallel_size=1
ckpt_format=torch
so the checkpoint for each iteration folder should look like this:
how to use
you can modify run_convert_pp_to_vpp.sh and launch it as an example
examples
Some training logs from the tests are available in the logs directory for review.
NOTE
It's also possible to continue training by loading only the model weights without loading the optimizer state (add --no-load-optim argument when launch Megatron-LM, which will reset the optimizer), though performance may recover after training for a few more iterations.