Intel® Advisor User Guide

ID 766448
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents
Give Feedback

Run GPU Roofline Insights Perspective from Command Line

To plot a Roofline chart, the Intel® Advisor runs two steps:

  1. Collect OpenCL™ kernels timings and memory data using the Survey analysis with GPU profiling.
  2. Measure the hardware limitations and collect floating-point and integer operations data using the Characterization analysis with GPU profiling.

    Intel® Advisor calculates compute operations (FLOP and INTOP) as a weighted sum of the following groups of instructions: BASIC COMPUTE, FMA, BIT, DIV, POW, MATH.

    Intel Advisor automatically determines data type in the collected operations using the dst register.

For convenience, Intel Advisor has the shortcut --collect=roofline command line action, which you can use to run both Survey and Characterization analyses with a single command. This shortcut command is recommended to run the GPU Roofline Insights perspective.

TIP:
See Intel Advisor cheat sheet for quick reference on command line interface.

Prerequisites

  1. Configure your system to analyze GPU kernels.
  2. Set Intel Advisor environment variables with an automated script to enable the advisor command line interface (CLI).

Run the GPU Roofline Insights Perspective

There are two methods to run the GPU Roofline analysis. Use one of the following:

  • Run the shortcut --collect=roofline command line action to execute the Survey and Characterization analyses for GPU kernels with a single command. This method is recommended to run the CPU / Memory Roofline Insights perspective, but it does not support MPI applications.
  • Run the Survey and Characterization analyses for GPU kernels with the --collect=survey and --collect=tripcounts command actions separately one by one. This method is recommended if you want to analyze an MPI application.

Optionally, you can also run the Performance Modeling analysis as part of the GPU Roofline Insights perspective. If you select this analysis, it models your application performance on a baseline GPU device as a target to compare it with the actual application performance. This data is used to suggest more recommendations for performance optimization.

Note: In the commands below, make sure to replace the myApplication with your application executable path and name before executing a command. If your application requires additional command line options, add them after the executable name.

Method 1. Run the Shortcut Command

  1. Collect data for a GPU Roofline chart with a shortcut.
    advisor --collect=roofline --profile-gpu --project-dir=./advi_results -- ./myApplication

    This command collects data both for GPU kernels and CPU loops/functions in your application. For kernels running on GPU, it generates a Memory-Level Roofline.

  2. Run Performance Modeling for the GPU that the application runs on.
    advisor --collect=projection --profile-gpu --model-baseline-gpu --project-dir=./advi_results
    IMPORTANT:
    Make sure to use the --model-baseline-gpu option for Performance Modeling to work correctly.

    This command models your application potential performance on a baseline GPU as a target to determine additional optimization recommendations.

Method 2. Run the Analyses Separately

Use this method if you want to analyze an MPI application.

  1. Run the Survey analysis.
    advisor --collect=survey --profile-gpu --project-dir=./advi_results -- ./myApplication
  2. Run the Characterization analysis to collect trip counts and FLOP data:
    advisor --collect=tripcounts --flop --profile-gpu --project-dir=./advi_results -- ./myApplication

    These commands collect data both for GPU kernels and CPU loops/functions in your application. For kernels running on GPU, it generates a Memory-Level Roofline.

  3. Run Performance Modeling for the GPU that the application runs on.
    advisor --collect=projection --profile-gpu --model-baseline-gpu --project-dir=./advi_results
    IMPORTANT:
    Make sure to use the --model-baseline-gpu option for Performance Modeling to work correctly.

    This command models your application potential performance on a baseline GPU as a target to determine additional optimization recommendations.

You can view the results in the Intel Advisor graphical user interface (GUI) or in CLI, or generate an interactive HTML report. See View the Results below for details.

Analysis Details

The CPU / Memory Roofline Insights workflow includes only the Roofline analysis, which sequentially runs the Survey and Characterization (trip counts and FLOP) analyses.

The analysis has a set of additional options that modify its behavior and collect additional performance data.

Consider the following options:

Roofline Options

To run the Roofline analysis, use the following command line action: --collect=roofline.

NOTE:
You can also use these options with --collect=survey and --collect=tripcounts if you want to run the analyses separately.

Recommended action options:

Options

Description

--profile-gpu

Analyze GPU kernels. This option is required for each command.

--target-gpu

Select a target GPU adapter to collect profiling data. The adapter configuration should be in the following format <domain>:<bus>:<device-number>.<function-number>. Only decimal numbers are accepted. Use this option if you have more than one GPU adapter on your system. The default is the latest GPU architecture version found on your system.

TIP:
To see a list of GPU adapters available on your system, run advisor --help target-gpu and see the option description.

--gpu-sampling-interval=<double>

Set an interval (in milliseconds) between GPU samples. By default, it is set to 1.

--enable-data-transfer-analysis

Model data transfer between host memory and device memory. Use this option if you want to run the Performance Modeling analysis.

--track-memory-objects

Attribute memory objects to the analyzed loops t