你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
JobResourceConfiguration Class
Job resource configuration class, inherited and extended functionalities from ResourceConfiguration.
Constructor
JobResourceConfiguration(*, locations: List[str] | None = None, instance_count: int | None = None, instance_type: str | List | None = None, properties: Properties | Dict | None = None, docker_args: str | List[str] | None = None, shm_size: str | None = None, max_instance_count: int | None = None, **kwargs: Any)
Keyword-Only Parameters
Name | Description |
---|---|
locations
|
A list of locations where the job can run. Default value: None
|
instance_count
|
The number of instances or nodes used by the compute target. Default value: None
|
instance_type
|
The type of VM to be used, as supported by the compute target. Default value: None
|
properties
|
A dictionary of properties for the job. Default value: None
|
docker_args
|
Extra arguments to pass to the Docker run command. This would override any parameters that have already been set by the system, or in this section. This parameter is only supported for Azure ML compute types. Default value: None
|
shm_size
|
The size of the docker container's shared memory block. This should be in the format of (number)(unit) where the number has to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). Default value: None
|
max_instance_count
|
The maximum number of instances or nodes used by the compute target. Default value: None
|
kwargs
|
A dictionary of additional configuration parameters. |
Examples
Configuring a CommandJob with a JobResourceConfiguration.
from azure.ai.ml import MpiDistribution
from azure.ai.ml.entities import JobResourceConfiguration
trial = CommandJob(
environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33",
command="echo hello world",
distribution=MpiDistribution(),
environment_variables={"ENV1": "VAR1"},
resources=JobResourceConfiguration(instance_count=2, instance_type="STANDARD_BLA"),
code="./",
)
Methods
get | |
has_key | |
items | |
keys | |
update | |
values |
get
get(key: Any, default: Any | None = None) -> Any
Parameters
Name | Description |
---|---|
key
Required
|
|
default
|
Default value: None
|
has_key
has_key(k: Any) -> bool
Parameters
Name | Description |
---|---|
k
Required
|
|
items
items() -> list
keys
keys() -> list
update
update(*args: Any, **kwargs: Any) -> None
values
values() -> list
Attributes
properties
The properties of the job.
Returns
Type | Description |
---|---|
<xref:azure.ai.ml.entities._job.job_resource_configuration.Properties>
|