Ray AIR Session#

See also

See this Ray Train user guide and this Ray Tune user guide for usage examples of ray.air.session in the respective libraries.

Report Metrics and Save Checkpoints#

session.report(metrics, *[, checkpoint])

Report metrics and optionally save a checkpoint.

Retrieve Checkpoints and Datasets#

session.get_checkpoint()

Access the session's last checkpoint to resume from if applicable.

session.get_dataset_shard([dataset_name])

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

AIR Session Metadata#

session.get_experiment_name()

Experiment name for the corresponding trial.

session.get_trial_name()

Trial name for the corresponding trial.

session.get_trial_id()

Trial id for the corresponding trial.

session.get_trial_resources()

Trial resources for the corresponding trial.

session.get_trial_dir()

Log directory corresponding to the trial directory for a Tune session.

session.get_world_size()

Get the current world size (i.e.

session.get_world_rank()

Get the world rank of this worker.

session.get_local_world_size()

Get the local rank of this worker (rank of the worker on its node).

session.get_local_rank()

Get the local rank of this worker (rank of the worker on its node).

session.get_node_rank()

Get the local rank of this worker (rank of the worker on its node).