Overview

Ascend NPU is an up-and-comer in the AI computing field, but most training and online inference scripts are based on GPUs. Due to the architecture differences between NPUs and GPUs, GPU-based training and online inference scripts cannot be directly used on NPUs. PyTorch GPU2Ascend provides an automated method for migrating GPU-based scripts into NPU-based scripts, reducing the learning cost and workload of manual script migration, thereby improving the migration efficiency.

  • PyTorch GPU2Ascend can migrate the models listed in Table 1 (including but not limited to). After the migration is successful, some models can directly run on MindSpore while some others need small adaptation.
  • If the original code invokes third-party libraries or components, adaptation problems may occur during the migration. Therefore, before migrating the original code, install the third-party libraries or components that have been adapted to Ascend.
  • Currently, PyTorch GPU2Ascend can migrate PyTorch 1.5.0 and 1.8.1 training scripts.
  • The original scripts must be executed in the GPU environment and based on Python 3.7 or later.
  • The execution logic after script migration must be the same as that before migration.
  • When the similar API replacement function is enabled, the ascend_function directory is generated in the output directory to store the similar APIs used to replace those that are not supported by the current framework. The migrated scripts are executed depending on this directory.