Overview
WeightSyncer coordinates saving sampler checkpoints and syncing them to a deployment, including automatic base/delta chain state tracking, session-scoped snapshot naming, and post-sync warmup.
Constructor
| Field | Type | Default | Description |
|---|---|---|---|
policy_client | FiretitanTrainingClient | — | Training client for save operations |
deploy_mgr | DeploymentManager | None | None | Deployment manager for weight sync (None = no weight sync) |
deployment_id | str | None | None | Target deployment for weight sync |
base_model | str | "" | Model name for weight sync API calls |
hotload_timeout | int | 600 | Timeout in seconds for hotload_and_wait |
first_checkpoint_type | str | "base" | Type for the first checkpoint ("base" or "delta") |
dcp_timeout | int | 2700 | Timeout for DCP save operations |
compression_format | str | "arc_v2" | Delta compression format |
warmup_after_hotload | bool | True | Send a warmup request after each successful weight sync |
warmup_max_retries | int | 10 | Max retries for post-weight-sync warmup |
Methods
save_and_hotload(name, checkpoint_type=None)
Save sampler weights and sync to deployment. Automatically handles base (first) vs delta (subsequent) checkpoint types.
Returns the snapshot_name (str | None) on success or raises on failure:
save_only(name, checkpoint_type=None)
Save sampler weights without syncing to deployment:
snapshot_name or None.
hotload(snapshot_name)
Sync a previously saved snapshot to the deployment:
True on success, False on failure.
save_dcp(name)
Save a DCP checkpoint only (for resume). No sampler checkpoint, no weight sync. Returns bool (True on success):
training_client.save_state(...).result() on the raw SDK client instead.
check_deployment_state()
Query the deployment’s current weight sync state:
wait_for_hotload_ready(timeout_s=300, poll_interval_s=5)
Block until the deployment’s weight sync manager is initialized.
Usage patterns
On-policy weight sync (every step)
For on-policy training (e.g. GRPO), sync weights after every optimizer step:Interval weight sync (off-policy)
For off-policy training, sync weights every N steps:Split save and sync
Separate save from weight sync when you need intermediate steps (e.g. warmup):DCP checkpoints for resume
Save DCP checkpoints at intervals alongside weight sync saves:Related guides
- DeploymentManager — deployment lifecycle and hotload API
- Saving and Loading — checkpoint concepts
- Training and Sampling — end-to-end workflow