Skip to content

Add a config to load/save model from/to DCP snapshot#1

Open
heslami wants to merge 2 commits into
heslami/deepseek_rlfrom
heslami/dcp_config
Open

Add a config to load/save model from/to DCP snapshot#1
heslami wants to merge 2 commits into
heslami/deepseek_rlfrom
heslami/dcp_config

Conversation

@heslami

@heslami heslami commented Aug 15, 2025

Copy link
Copy Markdown
Owner

For development purposes, it's often slow to always read safetensor files. Especially for large models such as deepseek v3, we often perform transformations on safetensors (e.g., dequantization and weight mapping) that take a non-trivial amount of time in each run.

So far, folks have been using hacky logic to avoid reading safetensors, relying on specific folder naming structures just so they can save the DCP files in the first run and then use the same written snapshot in subsequent runs.

This PR adds a new config to the policy so that we can optionally pass in the path to DCP. The logic is as follows:

  • If the DCP path is given but DCP files aren't present, we download from HF, but after loading the weights we also dump the DCP files.
  • If the DCP path is given and the DCP files are present, we short-circuit the run (i.e., we assume that this is a subsequent run from one that loaded from HF and dumped DCP) and directly load the model from DCP.

@heslami heslami changed the title Add a config to load/save model from/to DCP checkpoint Add a config to load/save model from/to DCP snapshot Aug 15, 2025
@heslami heslami force-pushed the heslami/deepseek_rl branch 4 times, most recently from 0fa42a2 to bd47ee4 Compare August 18, 2025 18:00
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.

1 participant