Feature Description
The HDK-based virtual instance feature partitions the NPUs configured on a physical machine or virtual machine into multiple vNPUs (virtual NPUs) through resource virtualization, and mounts them into containers for use. The virtualization management enables the allocation and reclamation of resources in various specifications, accommodating repeated resource request and release operations from multiple users.
The Ascend HDK-based virtual instance function allows multiple users to share a single server on demand, lowering the entry barrier and cost of accessing NPU computing power. By enabling resource isolation through containers, this approach ensures a stable and secure runtime environment. The unified resource allocation and reclamation process also facilitates multi-tenant management.
Ascend NPU hardware resources mainly include AICore (used for AI model computation), AICPU, memory, etc. The main principle of the HDK-based virtual instance function is to partition the hardware resources into vNPUs according to user‑specified resource requirements, with each vNPU corresponding to a set of AICores, AICPUs, and memory resources. For example, when a user needs only 4 AICores of computing power, the system creates a vNPU, through which it obtains 4 AICores from the NPU and provides them to the container. The HDK-based virtual instance solution is shown in Figure 1.
Figure 1 Virtual instance solution based on HDK
Table 1 Product support notes
- Static virtualization and dynamic virtualization are implemented based on HDK. The NPU is partitioned into vNPUs through HDK interfaces and then mounted to containers for use.
- If you are using dynamic virtualization, directly refer to the "Dynamic vNPU Scheduling (Inference)" section. You do not need to use the
npu-smicommand to create vNPUs in advance. - If you are using static virtualization, you need to first refer to "Creating vNPU", and then perform the operation of mounting them to a container.
- For detailed descriptions of
npu-smicommands, see the "Ascend Virtual Instance (AVI) Commands" section in the Atlas A3 Center Inference and Training Hardware 26.0.RC1 npu-smi Command Reference.
After a physical NPU is virtualized into vNPUs, it is no longer supported to mount the physical NPU to a container, nor is it supported to pass through the physical NPU to a virtual machine.
A vNPU can only be used by one task container. It is not supported for multiple task containers to use the same vNPU.
The operating modes of the two chips on the Atlas 300I Duo inference card must be consistent. That is, both chips must use the virtualization instance function, or the entire card must use this function. Plan according to your service requirements.
The virtual instance template is used to partition resources across all NPUs on an entire server. Mixing cards of different specifications is not supported. For example, the Atlas 300V Pro video analysis card supports 24 GB and 48 GB memory specifications, virtualization does not support mixing these two memory specifications on the same server. Similarly, mixing Atlas training series products with 30 AICores and those with 32 AICores is not supported.
For Atlas training series servers, the virtual instance function is supported only when the NPU operates in AMP mode, not in SMP mode. The steps for querying and setting the NPU working mode are as follows (ensure the server operating system is powered off).
- Log in to the iBMC command line.
- Run the
ipmcget -d npuworkmodecommand to query the NPU working mode. If it is AMP mode, no switching is required. - Run the
ipmcset -d npuworkmode -v 0command to set the NPU working mode to AMP mode.
For detailed instructions on querying and setting the NPU working mode, see the "Command Line Introduction > Server Commands > Querying and Setting the NPU Working Mode (npuworkmode)" in the Atlas 800 Training Server iBMC User Guide (model 9000).