Analysis Operation

PyTorch GPU2Ascend provides the script analysis function to help users analyze the operators and APIs supported by a PyTorch training script before migration, and outputs expert suggestions on API accuracy and performance tuning in the training script.

Procedure

  1. Use either of the following methods to start an analysis task:
    • Click on the toolbar.
    • Choose Ascend > Migration Tools > PyTorch GPU2Ascend from the main menu.
    • Right-click the training project and choose PyTorch GPU2Ascend from the shortcut menu.
  2. Configure parameters as required.
    By default, the Analysis page is displayed, as shown in Figure 1. You can set parameters as required.
    Figure 1 Analysis parameter configuration
    Table 1 PyTorch GPU2Ascend parameters

    Parameter

    Description

    PyTorch Version

    (Required) PyTorch version of the script to be analyzed. Currently, PyTorch 1.11.0, 2.1.0, and 2.2.0 are supported.

    The default version is 1.11.0.

    Input Path

    (Required) Directory of the script file to be analyzed. Click the folder icon to select one.

    Output Path

    (Required) Output path of the analysis result file. Click the folder icon to select one.

  3. Click Analyse to execute the analysis task.

    After the migration, check the result file in the Output Path directory.

    ├── xxx_analysis     // Output directory of the analysis result.
    │   ├── cuda_op_list.csv           // List of CUDA operators.
    │   ├── unknown_api.csv            // List of APIs whose support statuses are not clear.
    │   ├── unsupported_api.csv        // List of unsupported APIs.
    │   ├── api_precision_advice.csv    // Expert suggestions on API accuracy tuning.
    │   ├── api_performance_advice.csv  // Expert suggestions on API performance tuning.
    │   ├── pytorch_analysis.txt       // Analysis process log.

    For APIs that are not supported by the current framework, you can seek help from the Ascend open source community.

    You can refer to the expert suggestions on performance tuning. You can also use Performance Analysis for tuning.