DocsResume & Restart
SchedulingScheduling StrategiesResume & Restart

Overview

Polyaxon allows to resume, restart, and restart with copy mode previous operation runs with or without modification of the original manifest.

Overrides and full replacements

Pass -f to change the run you resume, restart, or copy. Each file is an override applied to the stored run's Polyaxonfile: it can change params, native run fields, shortcuts such as resources (Polyaxon 2.18.0 and later), and runPatch. Files merge in order, each with its own patchStrategy (post_merge by default), and Polyaxon compiles the run again. Fields the files do not set keep their stored values.

# override.yaml
params:
  lr: 0.01
resources:
  cpu: "2"

With --recompile, the file is a full replacement: it must be a complete Polyaxonfile, and the stored Polyaxonfile is not used. The run keeps its name, description, and tags unless you pass new ones.

The CLI, client, and UI can pass overrides with the resume and restart calls.

Resuming operations

Polyaxon provides the possibility to resume an already stopped operation (experiment, job, or a service).

polyaxon ops resume

The way Polyaxon resumes operations is by automatically loading all artifacts generated by the previous run and by using similar configuration that was used for scheduling the original operation.

To resume with updated parameters or environment, pass an override, or a full replacement with --recompile:

polyaxon ops resume -f override.yaml
polyaxon ops resume -f polyaxonfile.yaml --recompile

If you use an operation for training a machine learning or deep learning model, your code must have the logic to handle check-pointing and resuming the training.

Restarting operations

Sometimes resuming is not an option, or you may want to preserve the original operation's run record in an immutable fashion. In that case restarting an operation is a better option, Polyaxon by default will restart the operation with the same configuration:

polyaxon ops restart

To restart with updated parameters or environment, pass an override, or a full replacement with --recompile:

polyaxon ops restart -f override.yaml
polyaxon ops restart -f polyaxonfile.yaml --recompile

Restarting operations with copy mode

In order to restart an operation and automatically load the artifacts generated by the original run, users can enable the copy mode:

polyaxon ops restart --copy

The copy mode works with overrides and full replacements too, and can be enabled by the CLI, client, and UI:

polyaxon ops restart --copy -f override.yaml
polyaxon ops restart --copy -f polyaxonfile.yaml --recompile