Offline Parsing

To re-parse the profile data collected by the MindSpore Profiler APIs, you can use the mindspore.profiler.profiler.analyse API for offline parsing.

For details about the API, see mindspore.profiler.profiler.analyse.

  1. Create the {file_name}.py file ({file_name} is custom), and edit the following code:
    1
    2
    3
    from mindspore.profiler.profiler import analyse
    
    analyse("./profiler_data_path") # './profiler_data_path' indicates the offline data parsing path.
    
    • The offline parsing API supports parallel parsing of multiple profile data directories. In cases where the profile data volume is large and there are many data directories, parsing may fail due to insufficient memory in the environment. In these cases, you can customize the maximum number of processes (max_process_number) to control the resource usages.
    • The parsing process logs are stored in the {worker_name}_{timestamp}_ascend_pt/logs directory.
  2. Save the file and run the following command to parse the profile data:
    python3 {file_name}.py
  3. View and analyze the profile data result files.

    For details about the profile data result files, see MindSpore & PyTorch Profile Data File References.

    For details about how to visualize and analyze the parsed profile data files, see MindStudio Insight User Guide.

    You can use the msprof-analyze to analyze the profile data.