Collecting Profile Data of MC2 Operators

This section shows how to use msProf to tune an MC2 operator on the board and generate a communication and compute pipeline.

Prerequisites

  • The MC2 operator has been developed.
  • Environment variables have been configured as instructed in Before You Start.

Procedure

This example uses AscendCL single-operator call as an example. For details about other call scenarios, see Ascend C Operator Development Guide.

  1. Compile and deploy the operator by referring to Compiling and Deploying Operators.
    1. Add the following compilation options to the CMakeLists.txt file in the op_kernel directory of the operator build file to enable the AIC dotting and code line mapping functions of the MC2 operator.
      add_ops_compile_options(ALL OPTIONS -DASCENDC_TIME_STAMP_ON, -g)
    2. Go to the custom operator project directory and compile and deploy the operator.
      ./build_out/custom_opp_<target_os>_<target_architecture>.run
  2. Use msProf to collect the profile data of the MC2 operator.
    msprof op --output=$HOME/projects/output $HOME/projects/MyApp blockdim 1 //  --output is optional. $HOME/projects/MyApp is the application in use. blockdim 1 is an optional parameter of the application.
  3. The following directory structure and profile data files are generated. For details, see msprof op.
  4. Import the trace.json or visualize_data.bin file to MindStudio Insight for visualized display. For details, see Computing Memory Heatmap, Communication and Computing Pipeline Chart, and Roofline Bottleneck Analysis Chart.