After you install the scheduling component ack-ai-installer provided by the cloud-native AI suite, you can add a label to a GPU-accelerated node to enable a scheduling policy, such as GPU sharing or topology-aware GPU scheduling. This topic describes the labels for enabling different GPU scheduling policies. This topic also describes how to change the value of a label.
Labels for enabling GPU scheduling policies
ack.node.gpu.schedule
Policy | Label value | Whether other label values are supported | Description |
Exclusive GPU scheduling | default | Yes. The following label values are supported:
|
|
GPU sharing | cgpu | Yes. The following label values are supported:
|
|
core_mem | Yes. The following label values are supported:
|
| |
share | Yes. The following label values are supported:
|
| |
Topology-aware GPU scheduling | topology | Yes. The following label values are supported:
|
|
Dynamic Multi-Instance GPU (MIG) partitioning | mig | No. |
|
ack.node.gpu.placement
Policy | Label value | Whether other label values are supported | Description |
GPU sharing | spread | Yes. You can change the label value to binpack. |
|
binpack | Yes. You can change the label value to spread. |
|
Change label values
Issues that may occur if you use the kubectl label nodes
command or use the label management feature to change label values in the ACK console
The following issues may occur if you run the kubectl label nodes
command to switch the GPU scheduling policy of a GPU-accelerated node from A to B, or use the Labels feature on the Nodes page of the ACK console to change label values:
Applications that use GPU resources may be deployed on the node. The pods of these applications request GPU resources based on Scheduling Policy A. After the scheduling policy is switched from A to B, the preceding pods will not be included in the GPU resource ledger of the node maintained by the scheduler. The GPU resource ledger is inconsistent with the actual GPU resource allocation. Consequently, the preceding applications will compete for GPU resources with other GPU-heavy applications.
Some features are enabled by adding settings to the configuration of the node. Using the
kubectl label nodes
command or using the label management feature in the Container Service for Kubernetes (ACK) console to change label values does not reset the configuration of the node. Consequently, the node may fail to enable the specified scheduling policy.
To avoid the preceding issues, we recommend that you configure GPU scheduling policies for node pools.
Configure GPU scheduling policies for node pools
Assume that you want to enable GPU sharing (with GPU memory isolation only) and GPU sharing (with GPU memory isolation and computing power limits) for a cluster. In this scenario, you can create two node pools in the cluster:
Node Pool A: manages nodes that have GPU memory isolation enabled.
Node Pool B: manages nodes that have GPU memory isolation and computing power limits enabled.
To change the GPU scheduling policy of a GPU-accelerated node from the policy used by Node Pool A to the policy used by Node Pool B, remove the node from Node Pool A and add the node to Node Pool B. For more information, see Remove a node and Add existing ECS instances to an ACK cluster.
Manually change the GPU scheduling policy of a node
You can also manually change the GPU scheduling policy of a node. To do this, you need to perform the following operations:
Set the node to Unschedulable: Disable the node to accept new pods.
Drain the node: Evict all existing pods from the node.
Log on to the node and reset the label settings: The reset operation varies based on the value of the label. For more information, see Reset label settings.
Change the label value: After you complete the reset operation, run the
kubectl label
command to change the label value.Set the node to Schedulable: Enable the node to accept new pods.
Reset label settings
Policy | Label | Operation to reset label settings before changing the label value |
GPU sharing | ack.node.gpu.schedule=cgpu | bash /usr/local/cgpu-installer/uninstall.sh |
ack.node.gpu.schedule=core_mem | bash /usr/local/cgpu-installer/uninstall.sh |
References
For more information about the labels that are used to specify GPU model, how to schedule applications to specific GPU models, and how to avoid scheduling applications to specific GPU models, see Labels used to specify GPU models.