Skip to content

Commit 7b8f906

Browse files
committed
edit pass: how-to-manage-kubernetes-instance-types
1 parent e8112ff commit 7b8f906

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

articles/machine-learning/how-to-manage-kubernetes-instance-types.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.custom: build-spring-2022, cliv2, sdkv2, event-tier1-build-2022
1414

1515
# Create and manage instance types for efficient utilization of compute resources
1616

17-
Instance types are an Azure Machine Learning concept that allows targeting certain types of compute nodes for training and inference workloads. For an Azure virtual machine (VM), an example of an instance type is `STANDARD_D2_V3`.
17+
Instance types are an Azure Machine Learning concept that allows targeting certain types of compute nodes for training and inference workloads. For an Azure virtual machine, an example of an instance type is `STANDARD_D2_V3`.
1818

1919
In Kubernetes clusters, instance types are represented in a custom resource definition (CRD) that's installed with the Azure Machine Learning extension. Two elements in the Azure Machine Learning extension represent the instance types:
2020

@@ -24,7 +24,7 @@ In Kubernetes clusters, instance types are represented in a custom resource defi
2424
If you [specify a nodeSelector field when deploying the Azure Machine Learning extension](./how-to-deploy-kubernetes-extension.md#review-azure-machine-learning-extension-configuration-settings), the `nodeSelector` field will be applied to all instance types. This means that:
2525

2626
- For each instance type that you create, the specified `nodeSelector` field should be a subset of the extension-specified `nodeSelector` field.
27-
- If you use an instance type with `nodeSelector`, the workload will run on any node that matches both the extension-specified `nodeSelector` field and the instance type-specified `nodeSelector` field.
27+
- If you use an instance type with `nodeSelector`, the workload will run on any node that matches both the extension-specified `nodeSelector` field and the instance-type-specified `nodeSelector` field.
2828
- If you use an instance type without a `nodeSelector` field, the workload will run on any node that matches the extension-specified `nodeSelector` field.
2929

3030
## Create a default instance type
@@ -44,12 +44,12 @@ resources:
4444
4545
If you don't apply a `nodeSelector` field, the pod can be scheduled on any node. The workload's pods are assigned default resources with 0.1 CPU cores, 2 GB of memory, and 0 GPUs for the request. The resources that the workload's pods use are limited to 2 CPU cores and 8 GB of memory.
4646

47-
The default instance type purposefully uses few resources. To ensure that all machine learning workloads run with appropriate resources (for example, GPU resource), we highly recommend that you create custom instance types.
47+
The default instance type purposefully uses few resources. To ensure that all machine learning workloads run with appropriate resources (for example, GPU resource), we highly recommend that you [create custom instance types](#create-a-custom-instance-type).
4848

4949
Keep in mind the following points about the default instance type:
5050

5151
- `defaultinstancetype` doesn't appear as an `InstanceType` custom resource in the cluster when you're running the command ```kubectl get instancetype```, but it does appear in all clients (UI, Azure CLI, SDK).
52-
- `defaultinstancetype` can be overridden with a [custom instance type](#create-a-custom-instance-type) definition that has the same name.
52+
- `defaultinstancetype` can be overridden with the definition of a custom instance type that has the same name.
5353

5454
## Create a custom instance type
5555

@@ -94,7 +94,7 @@ Creation of custom instance types must meet the following parameters and definit
9494
| `Memory request` | Required | String values, which can't be zero or empty. <br>You can specify the memory as a full number + suffix; for example, `1024Mi` for 1,024 mebibytes (MiB).|
9595
| `CPU limit` | Required | String values, which can't be zero or empty. <br>You can specify the CPU in millicores; for example, `100m`. You can also specify it as full numbers. For example, `"1"` is equivalent to `1000m`.|
9696
| `Memory limit` | Required | String values, which can't be zero or empty. <br>You can specify the memory as a full number + suffix; for example, `1024Mi` for 1024 MiB.|
97-
| `GPU` | Optional | Integer values, which can only be specified in the `limits` section. <br>For more information, see the [Kubernetes documentation](https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/#using-device-plugins). |
97+
| `GPU` | Optional | Integer values, which can be specified only in the `limits` section. <br>For more information, see the [Kubernetes documentation](https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/#using-device-plugins). |
9898
| `nodeSelector` | Optional | Map of string keys and values. |
9999

100100
It's also possible to create multiple instance types at once:
@@ -142,7 +142,7 @@ If you submit a training or inference workload without an instance type, it uses
142142

143143
### [Azure CLI](#tab/select-instancetype-to-trainingjob-with-cli)
144144

145-
To select an instance type for a training job by using the Azure CLI (V2), specify its name as part of the
145+
To select an instance type for a training job by using the Azure CLI (v2), specify its name as part of the
146146
`resources` properties section in the job YAML. For example:
147147

148148
```yaml
@@ -151,12 +151,12 @@ environment:
151151
image: library/python:latest
152152
compute: azureml:<Kubernetes-compute_target_name>
153153
resources:
154-
instance_type: <instance_type_name>
154+
instance_type: <instance type name>
155155
```
156156

157157
### [Python SDK](#tab/select-instancetype-to-trainingjob-with-sdk)
158158

159-
To select an instance type for a training job by using the SDK (V2), specify its name for the `instance_type` property in the `command` class. For example:
159+
To select an instance type for a training job by using the SDK (v2), specify its name for the `instance_type` property in the `command` class. For example:
160160

161161
```python
162162
from azure.ai.ml import command
@@ -166,19 +166,19 @@ command_job = command(
166166
command="python -c "print('Hello world!')"",
167167
environment="AzureML-lightgbm-3.2-ubuntu18.04-py37-cpu@latest",
168168
compute="<Kubernetes-compute_target_name>",
169-
instance_type="<instance_type_name>"
169+
instance_type="<instance type name>"
170170
)
171171
```
172172

173173
---
174174

175-
In the preceding example, replace `<Kubernetes-compute_target_name>` with the name of your Kubernetes compute target. Replace `<instance_type_name>` with the name of the instance type that you want to select. If you don't specify an `instance_type` property, the system uses `defaultinstancetype` to submit the job.
175+
In the preceding example, replace `<Kubernetes-compute_target_name>` with the name of your Kubernetes compute target. Replace `<instance type name>` with the name of the instance type that you want to select. If you don't specify an `instance_type` property, the system uses `defaultinstancetype` to submit the job.
176176

177177
## Select an instance type to deploy a model
178178

179179
### [Azure CLI](#tab/select-instancetype-to-modeldeployment-with-cli)
180180

181-
To select an instance type for a model deployment by using the Azure CLI (V2), specify its name for the `instance_type` property in the deployment YAML. For example:
181+
To select an instance type for a model deployment by using the Azure CLI (v2), specify its name for the `instance_type` property in the deployment YAML. For example:
182182

183183
```yaml
184184
name: blue
@@ -197,7 +197,7 @@ environment:
197197

198198
### [Python SDK](#tab/select-instancetype-to-modeldeployment-with-sdk)
199199

200-
To select an instance type for a model deployment by using the SDK (V2), specify its name for the `instance_type` property in the `KubernetesOnlineDeployment` class. For example:
200+
To select an instance type for a model deployment by using the SDK (v2), specify its name for the `instance_type` property in the `KubernetesOnlineDeployment` class. For example:
201201

202202
```python
203203
from azure.ai.ml import KubernetesOnlineDeployment,Model,Environment,CodeConfiguration
@@ -224,7 +224,7 @@ blue_deployment = KubernetesOnlineDeployment(
224224

225225
---
226226

227-
In the preceding example, replace `<instance_type_name>` with the name of the instance type that you want to select. If you don't specify an `instance_type` property, the system uses `defaultinstancetype` to deploy the model.
227+
In the preceding example, replace `<instance type name>` with the name of the instance type that you want to select. If you don't specify an `instance_type` property, the system uses `defaultinstancetype` to deploy the model.
228228

229229
> [!IMPORTANT]
230230
> For MLflow model deployment, the resource request requires at least 2 CPU cores and 4 GB of memory. Otherwise, the deployment will fail.

0 commit comments

Comments
 (0)