syne_tune.remote.remote_launcher module
- class syne_tune.remote.remote_launcher.RemoteLauncher(tuner, role=None, instance_type='ml.c5.4xlarge', dependencies=None, store_logs_localbackend=False, log_level=None, s3_path=None, no_tuner_logging=False, publish_tuning_metrics=True, **estimator_kwargs)[source]
Bases:
object
This class allows to launch a tuning job remotely. The remote tuning job may use either the local backend (in which case the remote instance will be used to evaluate trials) or the Sagemaker backend in which case the remote instance will spawn one Sagemaker job per trial.
- Parameters:
tuner (
Tuner
) – Tuner that should be run remotely on ainstance_type
instance. Note thatStoppingCriterion
should be used for theTuner
rather than a lambda function to ensure serialization.role (
Optional
[str
]) – SageMaker role to be used to launch the remote tuning instance.instance_type (
str
) – Instance where the tuning is going to happen. Defaults to “ml.c5.4xlarge”dependencies (
Optional
[List
[str
]]) – List of folders that should be included as dependencies for the backend script to runestimator_kwargs – Extra arguments for creating the SageMaker estimator for the tuning code.
store_logs_localbackend (
bool
) – Whether to sync logs and checkpoints to S3 when using the local backend. When using SageMaker backend, logs are persisted by SageMaker. UsingTrue
can lead to failure with large checkpoints. Defauls toFalse
log_level (
Optional
[int
]) – Logging level. Default islogging.INFO
, whilelogging.DEBUG
gives more messagess3_path (
Optional
[str
]) – S3 base path used for checkpointing, outputs of tuning will be stored under{s3_path}/{tuner_name}
. The logs of the local backend are only stored ifstore_logs_localbackend
is True. Defaults tos3_experiment_path()
no_tuner_logging (
bool
) – IfTrue
, the logging level forsyne_tune.tuner
is set tologging.ERROR
. Defaults toFalse
publish_tuning_metrics (
bool
) – IfTrue
, a number of tuning metrics (seeRemoteTuningMetricsCallback
) are reported and displayed in the SageMaker training job console. This is modifyingtuner
, in the sense that a callback is appended totuner.callbacks
. Defaults toTrue
.
- run(wait=True)[source]
- Parameters:
wait (
bool
) – Whether the call should wait until the job completes (default:True
). If False the call returns once the tuning job is scheduled on SageMaker.
- prepare_upload()[source]
Prepares the files that needs to be uploaded by SageMaker so that the tuning job can happen. This includes, 1) the entrypoint script of the backend and 2) the tuner that needs to run remotely.