Prerequisites

  • Before migrating PyTorch training scripts, install the following dependencies:
    If you run the following commands as a non-root user, add --user to the end of each installation command, for example, pip3 install pandas --user.
    pip3 install pandas         # The pandas version must be 1.2.4 or later.
    pip3 install libcst
    pip3 install jedi           # This dependency is used for cross-file parsing. It is optional. You are advised to install it.
  • Set the environment variable.
    1. 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 $HOME/Ascend/ascend-toolkit/set_env.sh
    2. Run the :wq! command to save the file and exit.
    3. Run the source ~/.bashrc command for the modification to take effect immediately.