EAIS package overview
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: Required.
eais-cuda: Required.
eais-torch: Optional. Install this package only if you want to use PyTorch JIT models for inference.
eais-miniconda: Optional. Install this package to quickly test the EAIS inference procedure. For example, you can use EAIS to infer a PyTorch model with a Python script. For more information, see Use EAIS to infer PyTorch models (Python).
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.
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.
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 |
|
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:
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.
ImportantEAIS_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.1Download 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.htmlRun the following command to check the installation result.
pip3 list | grep eaisIf the output contains information about the eais-torch package, the installation was successful.
C++ programs
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.
ImportantEAIS_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.1Obtain 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.debcxx11 ABI
deb
https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}-cxx11-abi_${EAIS_PACKAGE_VERSION}_amd64.debCentOS 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.rpmcxx11 ABI
RPM
https://eais-rel-pub.oss-cn-beijing.aliyuncs.com/packages/eais-torch${libtorch_VERSION}-cxx11-abi-${EAIS_PACKAGE_VERSION}-1.x86_64.rpmDownload and install the EAIS package.
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.ptCommand 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
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
The downloaded eais-miniconda package has PyTorch 1.13.1 pre-installed.
Usage
Run the following command to navigate to the root directory of the eais-miniconda package.
NoteThis topic uses the
eais-miniconda/directory as an example. Replace it with your actual installation directory.cd eais-miniconda/Run the following command to activate the EAIS miniconda environment.
source bin/activateInfer the PyTorch model.
For more information, see Step 6: Infer and accelerate the PyTorch model.
When you no longer need the EAIS miniconda environment, run the following command to exit the environment.
source bin/deactivate