EAIS package overview

更新时间:
复制 MD 格式

After you attach an EAIS instance to an ECS instance, you must install the EAIS packages on the ECS instance to run GPU tasks. This topic describes how to install and use these packages.

Package list

When you use EAIS, you may need to install one or more of the following packages:

eais-tool

Package description

Package information

Description

Installation requirements

Required

Purpose

Use eais-tool to manage your EAIS instances.

Current version

4.2.5

Installation method

The eais-tool package is available in .deb and .rpm formats. Install the package that corresponds to the operating system of your ECS instance.

  • The ECS instance runs Ubuntu

    1. Run the following commands to install the eais-tool .deb package.

      export VERSION=4.2.5
      wget https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-tool_${VERSION}_amd64.deb
      sudo dpkg -i eais-tool_${VERSION}_amd64.deb
      source /etc/profile
    2. Run the following command to check the installation result.

      dpkg -l | grep eais-tool

      If the output contains information about the eais-tool package, the installation was successful.

  • The ECS instance runs CentOS or Alibaba Cloud Linux

    1. Run the following commands to install the eais-tool .rpm package.

      export VERSION=4.2.5
      wget https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-tool-${VERSION}-1.x86_64.rpm
      sudo rpm -ivh eais-tool-${VERSION}-1.x86_64.rpm --nodeps
      source /etc/profile
    2. Run the following command to check the installation result.

      rpm -qa | grep eais-tool

      If the output contains information about the eais-tool package, the installation was successful.

Usage

After you install the eais-tool package, run the eais_smi command to view EAIS information. The output displays information such as the EAIS instance type and EAIS GPU utilization. The following is a sample output.

eais-cuda

Package description

Package information

Description

Installation requirements

Required

Purpose

eais-cuda automatically runs GPU tasks from your ECS instance on the attached EAIS instance.

Current version

4.2.5

Dependencies

CUDA 11

Installation method

The eais-cuda package is available in .deb and .rpm formats. Install the package that corresponds to the operating system of your ECS instance.

  • The ECS instance runs Ubuntu

    1. Run the following commands to install the eais-cuda .deb package.

      export VERSION=4.2.5
      wget https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-cuda_${VERSION}_amd64.deb
      sudo dpkg -i eais-cuda_${VERSION}_amd64.deb
    2. Run the following command to check the installation result.

      dpkg -l | grep eais-cuda

      If the output contains information about the eais-cuda package, the installation was successful.

  • The ECS instance runs CentOS or Alibaba Cloud Linux

    1. Run the following commands to install the eais-cuda .rpm package.

      export VERSION=4.2.5
      wget https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-cuda-${VERSION}-1.x86_64.rpm
      sudo rpm -ivh eais-cuda-${VERSION}-1.x86_64.rpm --nodeps
    2. Run the following command to check the installation result.

      rpm -qa | grep eais-cuda

      If the output contains information about the eais-cuda package, the installation was successful.

Usage

After eais-cuda is installed, it works automatically. No further action is required.

eais-torch

Package description

Package information

Description

Installation requirements

Install the eais-torch package to use PyTorch JIT models for inference.

Purpose

eais-torch automatically processes PyTorch models from your ECS instance on the attached EAIS instance and uses Shenlong AIACC for inference acceleration.

Current version

4.2.5

Dependency versions

  • PyTorch: 1.9.0 or 1.13.1

  • libtorch: 1.9.0 or 1.13.1

Python version

3.6 to 3.11

Installation method

When you install the eais-torch package, you must specify the version number of its dependency, which is either the libtorch package or the PyTorch package. The installation procedure is different for Python and C++ programs.

Python programs

To install the eais-torch .whl package, first make sure that Python 3 and pip3 are installed in your environment. Then, follow these steps:

  1. Run the following commands to set the version numbers for the EAIS and PyTorch packages.

    The version numbers that you set are automatically used in the subsequent steps.

    Important
    • EAIS_PACKAGE_VERSION: The version number of the EAIS package. Only 4.2.5 is supported.

    • pytorch_VERSION: The version number of the PyTorch package. This topic uses PyTorch 1.13.1 as an example.

    export EAIS_PACKAGE_VERSION=4.2.5
    export pytorch_VERSION=1.13.1
  2. Download and install the eais-torch .whl package.

    sudo pip3 install eais-torch${pytorch_VERSION}==${EAIS_PACKAGE_VERSION} \
      -f https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/index.html
  3. Run the following command to check the installation result.

    pip3 list | grep eais

    If the output contains information about the eais-torch package, the installation was successful.

C++ programs

  1. Run the following commands to set the version numbers for the EAIS and libtorch packages.

    The version numbers that you set are automatically used in the subsequent steps.

    Important
    • EAIS_PACKAGE_VERSION: The version number of the EAIS package. Only 4.2.5 is supported.

    • libtorch_VERSION: The version number of the libtorch package. This topic uses libtorch 1.13.1 as an example.

    export EAIS_PACKAGE_VERSION=4.2.5
    export libtorch_VERSION=1.13.1
  2. Obtain the package download URL.

    EAIS provides packages that depend on libtorch and are compiled with either Pre-cxx11 ABI or cxx11 ABI. The following table lists the download URLs for the eais-torch packages that include libtorch.

    ECS instance operating system

    Compilation method

    Package type

    EAIS package download URL

    Ubuntu

    Pre-cxx11 ABI

    deb

    https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}_${EAIS_PACKAGE_VERSION}_amd64.deb

    cxx11 ABI

    deb

    https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}-cxx11-abi_${EAIS_PACKAGE_VERSION}_amd64.deb

    CentOS or Alibaba Cloud Linux

    Pre-cxx11 ABI

    rpm

    https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}-${EAIS_PACKAGE_VERSION}-1.x86_64.rpm

    cxx11 ABI

    RPM

    https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}-cxx11-abi-${EAIS_PACKAGE_VERSION}-1.x86_64.rpm

  3. Download and install the EAIS package.

    • The ECS instance runs Ubuntu

      The following steps use the eais-torch .deb package that depends on libtorch and is compiled with cxx11 ABI as an example:

      1. Run the following commands to download and install the eais-torch .deb package.

        wget https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}-cxx11-abi_${EAIS_PACKAGE_VERSION}_amd64.deb
        dpkg -i eais-torch${libtorch_VERSION}-cxx11-abi_${EAIS_PACKAGE_VERSION}_amd64.deb
        source /etc/profile
      2. Run the following command to check the installation result.

        dpkg -l | grep eais-torch

        If the output contains information about the eais-torch package, the installation was successful.

    • The ECS instance runs CentOS or Alibaba Cloud Linux

      The following steps use the eais-torch .rpm package that depends on libtorch and is compiled with cxx11 ABI as an example:

      1. Run the following commands to download and install the EAIS torch .rpm package.

        wget https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}-cxx11-abi-${EAIS_PACKAGE_VERSION}-1.x86_64.rpm
        sudo rpm -ivh eais-torch${libtorch_VERSION}-cxx11-abi-${EAIS_PACKAGE_VERSION}-1.x86_64.rpm --nodeps
        source /etc/profile
      2. Run the following command to check the installation result.

        rpm -qa | grep eais-torch

        If the output contains information about the eais-torch package, the installation was successful.

Usage

Python programs

To enable eais-torch, add the following line to your Python inference script.

import eais.torch_eais

C++ programs

Assume that your C++ program for PyTorch model inference is named my_program and you run it using the following commands:

export LD_LIBRARY_PATH=/your/lib/path:$LD_LIBRARY_PATH
./my_program my_model.pt

To use EAIS to infer your PyTorch model, run your C++ program using one of the following command options. eais-torch is automatically enabled at runtime.

  • Command 1:

    export LD_LIBRARY_PATH=/your/lib/path:$LD_LIBRARY_PATH
    LD_PRELOAD=libtorcheais.so ./my_program my_model.pt
  • Command 2:

    export LD_LIBRARY_PATH=/your/lib/path:$LD_LIBRARY_PATH
    export LD_PRELOAD=libtorcheais.so
    ./my_program my_model.pt

eais-miniconda

Package description

Package information

Description

Installation requirements

Install the eais-miniconda package if you want to quickly try out the EAIS inference procedure.

Purpose

Provides sample code for EAIS inference, the model files and data files required by the sample inference program, and an environment for inferring PyTorch models using Python scripts.

Current version

4.2.5

Installation method

Important

This package is supported only on Ubuntu.

Run the following commands to download and decompress the eais-miniconda package.

wget https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-miniconda.zip
sudo apt-get update && sudo apt-get install -y unzip
unzip -q eais-miniconda.zip
Note

The downloaded eais-miniconda package has PyTorch 1.13.1 pre-installed.

Usage

  1. Run the following command to navigate to the root directory of the eais-miniconda package.

    Note

    This topic uses the eais-miniconda/ directory as an example. Replace it with your actual installation directory.

    cd eais-miniconda/
  2. Run the following command to activate the EAIS miniconda environment.

    source bin/activate
  3. Infer the PyTorch model.

    For more information, see Step 6: Infer and accelerate the PyTorch model.

  4. When you no longer need the EAIS miniconda environment, run the following command to exit the environment.

    source bin/deactivate