AI-accelerated ECSs

AI-accelerated ECSs, powered by Ascend processors and software stacks, are dedicated for accelerating AI applications.

AI inference-accelerated ECSs use Ascend 310 processors for AI inference acceleration.

Images Supported by AI-accelerated ECSs

Table 1 Image list

Classification

ECS Type

Supported Image

Enhanced AI inference-accelerated (type I)

AI1s

Ubuntu Server 18.04 64bit

CentOS 7.6 64bit

AI inference-accelerated (type I)

AI1

Ubuntu Server 16.04 64bit

CentOS 7.4 64bit

Enhanced AI Inference-accelerated AI1s (Type I)

Overview

AI1s ECSs use Ascend 310 processors for AI acceleration. Ascend 310 processors feature low power consumption, high computing capabilities, and significantly improved energy efficiency ratio (EER). This facilitates the wide application of AI inference. AI1s ECSs deliver the computing acceleration capabilities of the Ascend 310 processors on the public cloud.

AI-accelerated ECSs are ideal for computer vision, security surveillance, smart campus, smart city, smart transportation, smart retail, Internet-based real-time communication, and video encoding and decoding scenarios.

Specifications

Table 2 AI1s ECS specifications

Flavor

vCPUs

Memory (GiB)

Maximum/Assured Bandwidth

Maximum PPS (10,000)

Ascend 310 Processors

Ascend RAM (GiB)

Virtualization Type

ai1s.large.4

2

8

4/1.3

20

1

8

KVM

ai1s.xlarge.4

4

16

6/2

35

2

16

KVM

ai1s.2xlarge.4

8

32

10/4

50

4

32

KVM

ai1s.4xlarge.4

16

64

15/8

100

8

64

KVM

ai1s.8xlarge.4

32

128

25/15

200

16

128

KVM

Features

AI1s ECSs have the following features:

  • 1:4 ratio of vCPUs to memory
  • CPU: 2nd Generation Intel® Xeon® Scalable 6278 processors (2.6 GHz of base frequency and 3.5 GHz of turbo frequency), or Intel® Xeon® Scalable 6151 processors (3.0 GHz of base frequency and 3.4 GHz of turbo frequency)
  • Atlas 300 chips, four of which in an Atlas300 accelerator
  • 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
  • 5-channel HD video decoder (H.264/H.265) based on built-in hardware video codec engine

Notes

  1. AI1s ECSs support the following OSs:
    • Ubuntu Server 18.04 64bit
    • CentOS 7.6 64bit
  2. AI1s ECSs do not support modification of specifications.
  3. AI1s ECSs support automatic recovery when the hosts accommodating such ECSs become faulty.

Using an AI1s ECS

Perform the steps that follow:

  1. Create an AI1s ECS.

    By default, the AI1s 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 verify the functions of such an ECS, see 3.

  2. Remotely log in to the AI1s ECS.

    If your AI1s ECS runs a Linux OS, use an SSH password to log in to the ECS. For details, see Login Using an SSH Password.

  3. Use the AI1s ECS.

    This use case describes how to use the AI1s 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.

    1. Convert your model.
      1. Log in to the AI1s ECS as user root.
      2. 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/x86_64-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
      3. 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/x86_64-linux_gcc7.3.0/acllib/sample/acl_execute_model/acl_dvpp_resnet50/caffe_model directory on the ECS.

      4. 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.

      5. 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.

    2. Build the code.
      1. 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/x86_64-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/x86_64-linux_gcc7.3.0

        export NPU_HOST_LIB=/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux_gcc7.3.0/acllib/lib64/stub

      2. 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

      3. 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
      4. 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
    3. Run an application.
      1. Set the environment variables.

        This use case assumes that the path is /usr/local/Ascend/ascend-toolkit/latest/x86_64-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/x86_64-linux_gcc7.3.0/acllib/lib64:/usr/local/Ascend/add-ons

      2. 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

      3. 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
      4. After the command is executed successfully, the class ID with the maximum confidence scores is displayed.
        Figure 5 Class ID

AI Inference-accelerated AI1 (Type I)

Overview

AI1 ECSs use Ascend 310 processors for AI acceleration. Ascend 310 processors feature low power consumption, high computing capabilities, and significantly improved energy efficiency ratio (EER), and facilitate the wide application of AI inference. AI1 ECSs deliver the computing acceleration capabilities of the Ascend 310 processors on HUAWEI CLOUD.

AI1 ECSs are ideal for computer vision, speech recognition, and natural language processing to support smart retail, smart campus, robot cloud brain, and safe city scenarios.

Specifications

Table 3 AI1 ECS specifications

Flavor

vCPUs

Memory (GiB)

Maximum/Assured Bandwidth

Maximum PPS (10,000)

Ascend 310 Processors

Ascend RAM (GiB)

Virtualization Type

ai1.large.4

2

8

4/1.3

20

1

8

KVM

ai1.xlarge.4

4

16

6/2

35

2

16

KVM

ai1.2xlarge.4

8

32

10/4

50

4

32

KVM

ai1.4xlarge.4

16

64

15/8

100

8

64

KVM

ai1.8xlarge.4

32

128

25/15

200

16

128

KVM

Features

AI1 ECSs have the following features:

  • 1:4 ratio of vCPUs to memory
  • CPU: 2nd Generation Intel® Xeon® Scalable 6278 processors (2.6 GHz of base frequency and 3.5 GHz of turbo frequency), or Intel® Xeon® Scalable 6151 processors (3.0 GHz of base frequency and 3.4 GHz of turbo frequency)
  • Atlas 300 processor, four of which in an Hi1910 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
  • 16-channel HD video decoder (H.264/H.265) based on built-in hardware video codec engine

Notes

  1. AI1 ECSs support the following OSs:
    • Ubuntu Server 16.04 64bit
    • CentOS 7.4 64bit
  2. AI1 ECSs do not support modification of specifications.
  3. AI1 ECSs support automatic recovery when the hosts accommodating such ECSs become faulty.

Using an AI1 ECS

Do the steps that follow:

  1. Create an AI1 ECS.

    By default, the AI1 ECSs created using a public image are delivered with a Mind Studio installation package, DDK installation package, and automatic installation script. However, you must manually install Mind Studio and DDK. For details, see 3.

  2. Remotely log in to the ECS.

    If your AI1 ECS runs a Linux OS, use an SSH password to log in to the ECS. For details, see Login Using an SSH Password.

  3. Prepare and install the AI1 development environment.

    The AI1 ECS provides the Mind Studio orchestration development platform, allowing you to customize orchestration for AI service flows. This platform centrally manages the application model and data set of inference services, and offers functions such as log analysis, performance analysis, and black box. Using Mind Studio, you can develop and manage Ascend processor-based AI projects and convert other framework training models.

    The DDK installation package contains the NPU-based digital developer suite. You can use DDK to build the compilation environment for projects. The NPU-based DDK varies depending on the DDK installation package version. The latest version of DDK integrates the dependency libraries and header files of components such as TE, DVPP, and process orchestration. You can compile project files using makefile.

    1. Prepare the development environment.

      AI1 ECSs support Ubuntu 16.04 64bit and CentOS 64bit. By default, the AI1 ECSs created using a public image are delivered with a Mind Studio installation package, DDK installation package, and automatic installation script.

      • For details about Ubuntu 16.04 64bit OSs, see Table 4.
      • For details about CentOS 64bit OSs, see Table 5.

      After you create the ECS, run the ll or ls command to check whether the root directory contains the installation package and script file.

      Consider CentOS 64bit as an example. If the command output shown in Figure 6 is displayed, the installation package and script file are included.

      Figure 6 Checking the installation package and script file
      Table 4 Files delivered with an Ubuntu 16.04 64bit OS

      Item

      File Name

      Mind Studio installation package

      mini_mind_studio_Ubuntu.rar

      DDK installation package

      MSpore_DDK-{VERSION}-x86_64.ubuntu16.04-x86_64.ubuntu16.04-aarch64.miniOS.tar.gz

      {VERSION} indicates the DDK version. The DDK version must be the same as the version of the Mind Studio installation package.

      Automatic installation script

      Mindstutio_install.sh

      Table 5 Files delivered with a CentOS 64bit OS

      Item

      File Name

      Mind Studio installation package

      mini_mind_studio_centos.rar

      DDK installation package

      MSpore_DDK-{VERSION}-x86_64 centOS7.4-x86_64.centOS7.4-aarch64.miniOS.tar.gz

      {VERSION} indicates the DDK version. The DDK version must be the same as the version of the Mind Studio installation package.

      Automatic installation script

      Mindstutio_install.sh

      Image source file

      ius.repo

      If verifying that the root directory contains the installation package and script file, install both Mind Studio and DDK. For details, see 3.b.

    2. Install Mind Studio and DDK.

      Run the following command in the root directory:

      bash Mindstudio_install.sh user_name user_passwd

      • user_name and user_passwd are customized. After you run this command, the system automatically installs Mind Studio and DDK.
      • If the system displays a message indicating that the download has timed out, run the userdel username command and then run the preceding command again.

      If no exception occurs after the preceding command is executed, Mind Studio has started.

    3. Visit the following website using a browser and check whether the Mind Studio page can be accessed. If so, Mind Studio has started.

      https://EIP:Port number

      • EIP is the IP address of the server where Mind Studio is installed.
      • Port number is the Mind Studio access port.
      • To access Mind Studio through an intranet, run the following command:

        https://Private IP address:Port number

      For example, if the EIP is 123.xxx.xxx.456 and the default Mind Studio access port is 8888, the access address is https://123.xxx.xxx.456:8888.