Single-Operator Profiling Result Viewing

Viewing Profiling Results

Set Target to Simulator__TMModel and run the UT cases of TBE operators. After profiling is successfully executed, the profile data generated during simulation is displayed on the console in the lower part of the IDE. If the UT cases have been executed, you can right-click the operator project name and choose View Profiling Result from the shortcut menu to view the profiling result. Figure 1 shows the profiling result.
Figure 1 Viewing the profiling result
The Parallel Analysis view displays the parallelism degree of each instruction in the run of a single-operator. The horizontal axis indicates the time (in clock ticks), and the vertical axis indicates the instruction units. Move the mouse to the time range, the time consumed by a single instruction and related instructions is displayed.

The duration between Start and End indicates the time range for displaying data. End indicates the number of cycles. A larger value indicates a longer running time. You can scroll the mouse to change the time range for displaying data in the chart.

Setting Code Redirection

For operators developed in TIK mode, if you want to use the function of redirecting from the Parallel Analysis view to the TBE and CCE code, enable the Debug function before running the UT cases.

To enable the Debug function, add the parameter tbe_debug_level to BuildCCE in the operator code. Then set the added parameter to 2. The CCE code will be generated after compilation, and the debug information will be saved in the generated operator target file.

The parameters for enabling the Debug function for the TIK operators are as follows:

        config = {
                 "tbe_debug_level": 2
                 }

         self.tik_instance.BuildCCE(
             kernel_name = self.kernel_name,
             inputs=(self.var_gm, self.indices_gm, self.updates_gm),
             enable_l2 = Fales,
             config=config)

Figure 2 shows the Parallel Analysis view generated after the Debug function of the TIK operators is enabled and the UT cases are run. Right-click a time block. Goto TIK Code and Goto CCE Code are displayed. You can click either one to redirect to the corresponding code.

Figure 2 Parallel Analysis
  • The upper right corner of the Parallel Analysis view contains a switch for hiding the internal operations of TIK Code, which is disabled by default. After this switch is enabled, if a single TIK Code block fails to be redirected, the code block is hidden in the Parallel Analysis view.
  • The Goto TIK Code function does not support redirection to the corresponding code line. You need to manually search for the corresponding TIK code.