Training function utilities#

Call these ray.train APIs from inside your training function to report metrics and checkpoints, read the training context, and get dataset shards. The collective operations live in ray.train.collective.

Classes#

Checkpoint

A reference to data persisted as a directory in local or remote storage.

CheckpointUploadMode

The manner in which we want to upload the checkpoint.

CheckpointConsistencyMode

Read semantics for checkpoint retrieval during an ongoing run.

TrainContext

Abstract interface for training context.

ValidationFn

Protocol for a function that validates a checkpoint.

ValidationTaskConfig

Configuration for a specific validation task, passed to report().

PreemptionInfo

Information about an imminent preemption event.

Functions#

get_all_reported_checkpoints

Get all the reported checkpoints so far.

get_checkpoint

Access the latest reported checkpoint to resume from if one exists.

get_context

Get or create a singleton training context.

get_dataset_shard

Returns the ray.data.DataIterator shard for this worker.

get_preemption_info

Return the imminent preemption info for the current worker, or None.

report

Report metrics and optionally save a checkpoint.

Collective operations#

barrier

Create a barrier across all workers.

broadcast_from_rank_zero

Broadcast small (<1kb) data from the rank 0 worker to all other workers.