Kunpeng AI Inference-accelerated ECSs
Kunpeng AI-accelerated ECSs are designed to provide acceleration services for AI services. These ECSs are provided with the Ascend AI Processors and Ascend AI Software Stack.
Kunpeng AI inference-accelerated ECSs use Ascend 310 processors for AI inference acceleration.
Kunpeng Enhanced AI Inference-accelerated kAI1s (Type I)
Overview
Kunpeng AI inference-accelerated kAI1s ECSs use Huawei Ascend 310 processors for AI acceleration. Ascend 310 processors feature low power consumption, high computing capabilities, and significantly improved energy efficiency ratio (EER), facilitating the wide application of AI inference. kAI1s ECSs release the computing acceleration capabilities of the Ascend 310 processors on the public cloud. This helps you quickly and simply use the Ascend 310 processors.
kAI1s ECSs are based on Atlas 300 accelerators. For details, see the Ascend developer community.
kAI1s ECSs are used for general technologies, such as computer vision, speech recognition, and natural language processing to support smart retail, smart campus, robot cloud brain, and safe city scenarios.
Specifications
| Flavor | vCPUs | Memory (GiB) | Maximum/Assured Bandwidth | Maximum PPS (10,000) | NIC Multi-Queue | Maximum NICs | Ascend 310 Processors | Virtualization Type |
|---|---|---|---|---|---|---|---|---|
| kai1s.xlarge.1 | 4 | 4 | 3/0.8 | 20 | 2 | 2 | 1 | KVM |
| kai1s.2xlarge.1 | 8 | 8 | 4/1.5 | 40 | 2 | 3 | 2 | KVM |
| kai1s.4xlarge.1 | 16 | 16 | 6/3 | 80 | 4 | 4 | 4 | KVM |
| kai1s.3xlarge.2 | 12 | 24 | 8/4 | 100 | 4 | 4 | 4 | KVM |
| kai1s.4xlarge.2 | 16 | 32 | 10/6 | 140 | 4 | 5 | 6 | KVM |
| kai1s.6xlarge.2 | 24 | 48 | 12/8 | 200 | 8 | 6 | 8 | KVM |
| kai1s.9xlarge.2 | 36 | 72 | 12/8 | 200 | 8 | 6 | 12 | KVM |
| kai1s.12xlarge.2 | 48 | 96 | 12/8 | 200 | 16 | 6 | 12 | KVM |
Features
kAI1s ECSs have the following features:
- 1:1 or 1:2 ratio of vCPUs to memory
- CPU: Huawei Kunpeng 920 (2.6 GHz)
- Ascend 310 processors, four of which in an Atlas 300 accelerator
- 8 TeraFLOPS of half-precision computing (FP16) on one processor
- 16 TeraOPS of integer-precision computing on a single processor (INT8)
- 8 GiB of GPU memory with a memory bandwidth of 50 GiB/s on one processor
- Built-in hardware video codec engine, supporting H.264/H.265
Notes
- kAI1s ECSs support the following OSs:
- Ubuntu Server 16.04 64-bit
- CentOS 7.6 64-bit
- kAI1s ECSs do not support modification of specifications.
- kAI1s ECSs support automatic recovery when the hosts accommodating such ECSs become faulty.
Using a kAI1s ECS
Perform the steps that follow:
- Create a kAI1s ECS.
By default, the kAI1s ECSs created using a public image are delivered with pre-installed driver, firmware, and development suite as well as preset environment variables.
For details about how to purchase such an ECS, see Purchasing an ECS. For details about how to verify the functions of such an ECS, see 3.
- Remotely log in to the kAI1s ECS.
If your kAI1s ECS runs a Linux OS, use an SSH password to log in to the ECS. For details, see Login Using an SSH Password.
- Use the kAI1s ECS.
This use case describes how to use the kAI1s ECS to classify images based on the Caffe ResNet-50 network (single input and single batch).
Convert the model file of the Caffe ResNet-50 network into an offline model (*.om file). In this use case, load the .om file, decode, resize, and infer two .jpg images, process the obtained inference results, and output the class index with the top confidence value of each image.
During model conversion, you must set CSC parameters to convert YUV420SP images into RGB images to meet the input requirements of the model.
- Convert your model.
- Log in to the kAI1s ECS as user root.
- Set environment variables if your ECS was created using a private image. By default, public images contain preset environment variables. This use case takes environment variables driver_home and install_path as an example. Replace the values of them with the actual installation paths.
export driver_home=/usr/local/Ascend export install_path=${driver_home}/ascend-toolkit/latest/arm64-linux_gcc7.3.0 export DDK_PATH=${install_path} export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:${install_path}/fwkacllib/ccec_compiler/bin:$PATH export PYTHONPATH=${install_path}/atc/python/site-packages/te:${install_path}/atc/python/site-packages/topi:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune/:${install_path}/atc/python/site-packages/schedule_search.egg:${install_path}/opp/op_impl/built-in/ai_core/tbe/:${install_path}/fwkacllib/python/site-packages/topi:${install_path}/fwkacllib/python/site-packages/hccl:${install_path}/fwkacllib/python/site-packages/auto_tune.egg:${install_path}/fwkacllib/python/site-packages/schedule_search.egg:${install_path}/fwkacllib/python/site-packages/te:${install_path}/tfplugin/python/site-packages/npu_bridge:$PYTHONPATH export LD_LIBRARY_PATH=/usr/local/lib/:/usr/lib/:${install_path}/acllib/lib64:${install_path}/atc/lib64:${install_path}/fwkacllib/lib64:${driver_home}/driver/lib64:${driver_home}/add-ons:${install_path}/toolkit/lib64:$LD_LIBRARY_PATH export ASCEND_OPP_PATH=${install_path}/opp export NPU_HOST_LIB=${install_path}/acllib/lib64/stub export SOC_VERSION=Ascend310 - Prepare data.
This use case assumes that the path is /usr/local/Ascend/ascend-toolkit/latest/arm64-linux_gcc7.3.0. Replace it with the actual path of ACLlib.
Obtain the weight file (.caffemodel) of the ResNet-50 network and upload the file to the /usr/local/Ascend/ascend-toolkit/latest/arm64-linux_gcc7.3.0/acllib/sample/acl_execute_model/acl_dvpp_resnet50/caffe_model directory on the ECS.
- Convert the ResNet-50 network into an offline model (an .om file) that adapts to Ascend AI processors. During model conversion, you must set CSC parameters to convert YUV420SP images to RGB images.
Go to the acl_dvpp_resnet50 directory and run the following command:
atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50_aipp --soc_version=Ascend310 --insert_op_conf=caffe_model/aipp.cfg
Figure 1 Converting the model
--output: specifies the directory for storing the generated resnet50_aipp.om file, that is, the acl_dvpp_resnet50/model directory.
- Build the operator description information (.json file) of the Cast and ArgMaxD operators into an offline model (.om file) that adapts to the Ascend AI processors separately to verify the operator operation. Go to the acl_dvpp_resnet50 directory and run the following command:
atc --singleop=out/op_models/op_list.json --soc_version=Ascend310 --output=out/op_models
Figure 2 Compiling the model
--output: specifies the directory for storing the generated .om file, that is, the out/op_models directory.
- Convert your model.
- Build the code.
- Set the environment variables.
The build script src/CMakeLists.txt builds code based on the header file path and library file path set by environment variables.
This use case assumes that the path is /usr/local/Ascend/ascend-toolkit/latest/arm64-linux_gcc7.3.0. Replace it with the actual path of ACLlib.
Run the following commands to import environment variables. By default, public images contain preset environment variables. If your ECS was created using a private image, you must set the environment variables.
export DDK_PATH=/usr/local/Ascend/ascend-toolkit/latest/arm64-linux_gcc7.3.0 export NPU_HOST_LIB=/usr/local/Ascend/ascend-toolkit/latest/arm64-linux_gcc7.3.0/acllib/lib64/stub
- Go to the acl_dvpp_resnet50 directory and create a directory for storing the build outputs. In this use case, the build/intermediates/host directory is created.
mkdir -p build/intermediates/host
- Go to the build/intermediates/host directory and run the cmake command.
Replace ../../../src with the actual directory of CMakeLists.txt.
cd build/intermediates/host
cmake ../../../src -DCMAKE_CXX_COMPILER=g++ -DCMAKE_SKIP_RPATH=TRUE
Figure 3 Execution of the cmake command
- Run the make command to generate an executable file main in the acl_dvpp_resnet50/out directory.
make
Figure 4 Generating the executable file main
- Set the environment variables.
- Run an application.
- Set the environment variables.
This use case assumes that the path is /usr/local/Ascend/ascend-toolkit/latest/arm64-linux_gcc7.3.0/acllib/lib64:/usr/local/Ascend/add-ons. Replace it with the actual path of ACLlib. By default, public images contain preset environment variables. If your ECS was created using a private image, you must set the environment variables.
export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/arm64-linux_gcc7.3.0/acllib/lib64:/usr/local/Ascend/add-ons
- Go to the directory where the executable file main is located, for example acl_dvpp_resnet50/out, and grant the execute permission on the main file in the directory.
chmod +x main
- Go to the directory where the executable file main is located, for sample, /home/HwHiAiUser/acl_dvpp_resnet50/out, and run the executable file.
./main
After the command is executed successfully, the class ID with the maximum confidence scores is displayed.Figure 5 Class ID
- Set the environment variables.
Last Article: Kunpeng Ultra-high I/O ECSs
Next Article: Discontinued ECS Specifications
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.