Train a PyTorch model using EAIS
After you attach an EAIS instance to an ECS instance, you can log on to the ECS instance to train a PyTorch model.
Prerequisites
An EAIS instance is attached to an ECS instance. For more information, see Associate with an ECS instance.
Background information
You can train PyTorch models using only Python scripts. If you encounter problems during training, contact EAIS technical support.
Limits
PyTorch models can be trained only when a single EAIS instance is attached to a single ECS instance.
Procedure
Remotely log on to the ECS instance.
Log on to the EAIS console.
In the upper-left corner of the page, select the region where the instance is located.
In the instance list, click the ID of the ECS instance that is associated with the EAIS instance to open the ECS console.
Remotely log on to the ECS instance.
For more information, see Remote connection to an ECS instance.
Install the eais-tool package and view the information about the EAIS instance.
For more information, see eais-tool.
Install a CUDA 11.X.X package.
Run the following command to download and install the CUDA package.
NoteThis topic uses CUDA 11.7.0 as an example. The command varies based on the CUDA version that you install.
wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run sudo sh cuda_11.7.0_515.43.04_linux.run --silent --toolkitRun the following command to set the CUDA-related environment variables.
export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
Install the eais-cuda package.
For more information, see eais-cuda.
Deploy your training program and train the PyTorch model.