WorkerConfiguration Class

WorkerConfiguration is the class that holds all the necessary information for the workers to run.

Initialize the WorkerConfiguration

:type azureml.core.runconfig.HistoryConfiguration :param use_gpu: Prameter used to signal whether the default base image should have the packages for

gpu added. This parameter is ignored if environment is set.

yaml file. :type conda_dependencies_file: str

Inheritance
azureml._base_sdk_common.abstract_run_config_element._AbstractRunConfigElement
WorkerConfiguration

Constructor

WorkerConfiguration(node_count, compute_target=None, environment=None, shm_size='2g', history=None, use_gpu=False, pip_packages=None, conda_packages=None, conda_dependencies_file=None, pip_requirements_file=None)

Parameters

Name Description
node_count
Required
int

Number of worker nodes to be initialized, one worker will run per machine in the compute target.

compute_target

The compute target where the workers will run. This can either be an object or the the compute target's name.

Default value: None
environment

The environment definition for the workers. It includes PythonSection, DockerSection, and environment variables. Any environment option not directly exposed through other parameters to the WorkerConfiguration construction can be set using this parameter. If this parameter is specified, it will be used as a base upon which packages specified in pip_packages and conda_packages will be added.

Default value: None
shm_size
str

The docker shm_size configuration for the worker.

Default value: 2g
history

History configuration for the worker's run, this controls which logs folders will be monitored

Default value: None
use_gpu

Parameter used to signal whether the default base image should have the packages for gpu added. This parameter is ignored if environment is set.

Default value: False
conda_packages

A list of strings representing conda packages to be added to the Python environment for the workers.

Default value: None
pip_packages

A list of strings representing pip packages to be added to the Python environment for the workers

Default value: None
pip_requirements_file
str

The relative path to the workers' pip requirements text file. This can be provided in combination with the pip_packages parameter.

Default value: None
conda_dependencies_file
str

The relative path to the workers' conda dependencies yaml file.

Default value: None
node_count
Required
int

Number of worker nodes to be initialized, one worker will run per machine in the compute target.

compute_target
Required
<xref:azureml.core.compute_target.ComputeTarget> or str

The compute target where the workers will run. This can either be an object or the the compute target's name.

environment
Required

The environment definition for the workers. It includes PythonSection, DockerSection, and environment variables. Any environment option not directly exposed through other parameters to the WorkerConfiguration construction can be set using this parameter. If this parameter is specified, it will be used as a base upon which packages specified in pip_packages and conda_packages will be added.

shm_size
Required
str

The docker shm_size configuration for the worker.

history
Required

History configuration for the worker's run, this controls which logs folders will be monitored

conda_packages
Required

A list of strings representing conda packages to be added to the Python environment for the workers.

pip_packages
Required

A list of strings representing pip packages to be added to the Python environment for the workers

pip_requirements_file
Required
str

The relative path to the workers' pip requirements text file. This can be provided in combination with the pip_packages parameter.

conda_dependencies_file
Required

The relative path to the workers' conda dependencies

Attributes

target

Get the compute target where the worker run is scheduled for execution.

Available cloud compute targets can be found using the function compute_targets

Returns

Type Description
str

The target name