pub struct CheckpointManager { /* private fields */ }Expand description
Manages asynchronous checkpointing during training
Implementations§
Source§impl CheckpointManager
impl CheckpointManager
Sourcepub fn new(model_path: PathBuf) -> Result<CheckpointManager, Error>
pub fn new(model_path: PathBuf) -> Result<CheckpointManager, Error>
Create new checkpoint manager (no git operations)
Sourcepub fn with_repo_client(
model_path: PathBuf,
repo_client: RepositoryClient,
) -> Result<CheckpointManager, Error>
pub fn with_repo_client( model_path: PathBuf, repo_client: RepositoryClient, ) -> Result<CheckpointManager, Error>
Create checkpoint manager with a repository client for git operations
Sourcepub fn for_adapter(
model_path: PathBuf,
branch_name: String,
repo_client: Option<RepositoryClient>,
) -> Result<CheckpointManager, Error>
pub fn for_adapter( model_path: PathBuf, branch_name: String, repo_client: Option<RepositoryClient>, ) -> Result<CheckpointManager, Error>
Create checkpoint manager for an adapter branch
Sourcepub fn with_config(
model_path: PathBuf,
config: CheckpointConfig,
branch_name: Option<String>,
repo_client: Option<RepositoryClient>,
) -> Result<CheckpointManager, Error>
pub fn with_config( model_path: PathBuf, config: CheckpointConfig, branch_name: Option<String>, repo_client: Option<RepositoryClient>, ) -> Result<CheckpointManager, Error>
Create with custom configuration
Sourcepub fn with_target_adapter(self, adapter_name: String) -> CheckpointManager
pub fn with_target_adapter(self, adapter_name: String) -> CheckpointManager
Set target adapter to update on each checkpoint
When set, each checkpoint will also copy weights to
adapters/{target_adapter}.safetensors for live inference.
Sourcepub fn target_adapter(&self) -> Option<&str>
pub fn target_adapter(&self) -> Option<&str>
Get the target adapter name if set
Sourcepub async fn checkpoint(&self, request: CheckpointRequest) -> Result<(), Error>
pub async fn checkpoint(&self, request: CheckpointRequest) -> Result<(), Error>
Request asynchronous checkpoint
Sourcepub fn create_request(
step: usize,
weights: WeightSnapshot,
metrics: Option<TrainingMetrics>,
) -> CheckpointRequest
pub fn create_request( step: usize, weights: WeightSnapshot, metrics: Option<TrainingMetrics>, ) -> CheckpointRequest
Create checkpoint request for current training state
Sourcepub async fn write_checkpoint(
&self,
weights: WeightSnapshot,
step: usize,
metadata: Option<TrainingMetrics>,
) -> Result<PathBuf, Error>
pub async fn write_checkpoint( &self, weights: WeightSnapshot, step: usize, metadata: Option<TrainingMetrics>, ) -> Result<PathBuf, Error>
Write checkpoint to filesystem without Git commit Note: Uses single checkpoint.safetensors file - git handles versioning
Sourcepub async fn commit_checkpoint(
&self,
checkpoint_path: &Path,
message: Option<String>,
branch: Option<String>,
) -> Result<String, Error>
pub async fn commit_checkpoint( &self, checkpoint_path: &Path, message: Option<String>, branch: Option<String>, ) -> Result<String, Error>
Commit existing checkpoint to Git (separate from write)
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Check if there are pending checkpoints in the queue
Sourcepub async fn get_checkpoint(&self) -> Result<Option<CheckpointInfo>, Error>
pub async fn get_checkpoint(&self) -> Result<Option<CheckpointInfo>, Error>
Get current checkpoint info (single file, git handles history)
Sourcepub async fn load_checkpoint(&self) -> Result<PathBuf, Error>
pub async fn load_checkpoint(&self) -> Result<PathBuf, Error>
Load current checkpoint weights path
Trait Implementations§
Source§impl Drop for CheckpointManager
impl Drop for CheckpointManager
Auto Trait Implementations§
impl Freeze for CheckpointManager
impl !RefUnwindSafe for CheckpointManager
impl Send for CheckpointManager
impl Sync for CheckpointManager
impl Unpin for CheckpointManager
impl UnsafeUnpin for CheckpointManager
impl !UnwindSafe for CheckpointManager
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request