feat: Add safe_serialization option to the dcp checkpoint conversion script
What does this PR do ?
Currently, the script converts dcp checkpoints to .bin for the HF checkpoint. This PR allows users to also convert checkpoints to .safetensors.
Issues
Closes #491
Usage
- You can potentially add a usage example below
uv run python examples/converters/convert_dcp_to_hf.py \
--config results/grpo/step_170/config.yaml \
--dcp-ckpt-path results/grpo/step_170/policy/weights/ \
--hf-ckpt-path results/grpo/hf \
--safe-serialization true
Before your PR is "Ready for review"
Pre checks:
- [x] Make sure you read and followed Contributor guidelines
- [ ] Did you write any new necessary tests?
- [x] Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
- [x] Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.
@ffrujeri @joyang-nv is this still relevant with Automodel ?
@ffrujeri @joyang-nv is this still relevant with Automodel ?
With the Automodel integrations, the users will be able to save directly a checkpoint in .safetensors format. But if a previous checkpoint was created on the .dcp format and the user wants to convert to safetensors and then start training from there, I think this conversion script could be useful? Did I understand this PR correctly?
@ffrujeri i think so. @joyang-nv what is your feedback. how do we plan to transition folks from earlier DTensor path to Automodel path ?
gentle bump here @joyang-nv
Deeply sorry for so late reply.
Here is my feedbacks. @giordanobsf , deeply sorry from me on so late reply on this PR. Can you rebase your PR and could help to test:
- Convert checkpoint from v1 policy worker?
- Convert checkpoint from v2 policy worker? I knew with v2 HF converter might have issue. It will be great if your PR could work in both paths.
Reviving this thread. @ffrujeri / @terrykong - What's the recommendation in March 2026? I need this capability as well.