Prerequisites
Before using the PyTorch GPU2Ascend tool, make the following preparations:
Environment Setup
- Prepare a training server powered by Atlas training productss and install the corresponding driver and firmware.
- Install the Ascend-CANN-Toolkit. For details, see "Installing the Development Environment" in the CANN Software Installation Guide.
- Install MindStudio. For details, see "Installing MindStudio (Linux)" in the MindStudio Installation Guide.
- Install PyTorch 1.5.0. For details, see the "Installing PyTorch" in CANN Software Installation Guide.
- Before using PyTorch GPU2Ascend for script migration, run the following command to install the dependency:
pip3 install pandas # The pandas version must be 1.2.4 or later. pip3 install libcst
Environment Variable Configuration
- Log in as the running user, run the vi ~/.bashrc command in any directory to open the .bashrc file, and append the following content to the file (the default installation path of a non-root user is used as an example):
# Ascend-CANN-Toolkit environment variable. Change it to the actual path. source ~/Ascend/ascend-toolkit/set_env.sh # PyTorch environment variable. Change it to the actual path. export LD_LIBRARY_PATH=~/.local/lib/python3.7/site-packages/torch/lib:$LD_LIBRARY_PATH
- Run the :wq! command to save the file and exit.
- Run the source ~/.bashrc command for the modification to take effect immediately.
Parent topic: Migration Tool (PyTorch GPU2Ascend)