Intel® Advisor Help

Check How Assumed Dependencies Affect Modeling

The Dependencies analysis adds a high overhead to your application and is optional for the Offload Modeling workflow, but information about loop-carried dependencies might be very important for the Intel® Advisor to decide if a loop can be profitable to run on a graphics processing unit (GPU).

If a loop has dependencies, it cannot be run in parallel and in most cases cannot be offloaded to the GPU. Intel Advisor can get the information about loop-carried dependencies from the following resources:

Verify Assumed Dependencies

If you do not know what dependency types there are in your application, run the Offload Modeling without the Dependencies analysis first to check if potential dependencies affect modeling results. Use the following strategy to decide if you need to run the Dependencies analysis to check for loop-carried dependencies when running the Offload Modeling:

  1. Run the Offload Modeling without the Dependencies analysis.

    • From GUI: Select Medium accuracy level and enable the Assume Dependencies option for the Performance Modeling in the Analysis Workflow tab. Run the perspective.

    • From CLI: Run the following analyses, for example, using the advisor command line interface:

      advisor --collect=survey --project-dir=<project-dir> --stackwalk-mode=online --static-instruction-mix -- <target-application> [<target-options>]

      advisor --collect=tripcounts --project-dir=<project-dir> --flop --enable-cache-simulation --target-device=<target> --stacks --data-transfer=light -- <target-application> [<target-options>]

      advisor --collect=projection --project-dir=<project-dir> --config=<config>

  2. Open the generated report and go to the Accelerated Regions tab.

  3. Expand the Measured column group and examine the Dependency Type column.

    • You do not need to run the Dependencies analysis for loops with the following dependency types:

      • Parallel: Programming Model dependency type means that the loop is uses Data Parallel C++, OpenCL™ or OpenMP* target programming model.

      • Parallel: Explicit dependency type means that the loop is threaded and vectorized on CPU (for example, with OpenMP parallel for or Intel® oneAPI Threading Building Blocks parallel for).

      • Parallel: Proven dependency type means that an Intel Compiler found no dependencies at the compile time.

    • You might need to run the Dependencies analysis for loops that have Dependency: Assumed dependency type. It means that the Intel Advisor does not have information about loop-carried dependencies for these loops and do not consider them as offload candidates.

  4. If you see many Dependency: Assumed types, rerun the performance modeling with assumed dependencies ignored, as follows:

    • From GUI: Select only the Performance Modeling step in the Analysis Workflow tab and make sure the Assume Dependencies option is disabled. Run the perspective.

    • From CLI: Run the Performance Modeling with one of the following options

      • Use --no-assume-dependencies to ignore assumed dependencies for all loops/functions:

        advisor --collect=projection --project-dir=<project-dir> --config=<config> --no-assume-dependencies

      • Use --set-parallel=[<loop-ID1>|<file-name1>:<line1>,<loop-ID2>|<file-name2>:<line2>,...] to ignore assumed dependencies for specific loops/functions only. Use this option if you know that some loops/functions have dependencies and you do not want to model them as parallel.

        advisor --collect=projection --project-dir=<project-dir> --config=<config> --set-parallel=[<IDs/source-locations>]

  5. Review the results generated to check if the potential dependencies might block offloading to GPU.

    Loops that previously had Dependency: Assumed dependency type are now marked as Parallel: Assumed. Intel Advisor models their performance on the target GPU and checks potential offload profitability and speedup.

  6. Compare the program metrics calculated with and without assumed dependencies, such as speedup, number of offloads, and estimated accelerated time.

    • If the difference is small, for example, 1.5x speedup with assumed dependencies and 1.6x speedup without assumed dependencies, you can skip the Dependencies analysis and rely on the current estimations. In this case, most loops with potential dependencies are not profitable to be offloaded and do not add much speedup to the application on the target GPU.

    • If the difference is big, for example, 2x speedup with assumed dependencies and 40x speedup without assumed dependencies, you should run the Dependencies analysis. In this case, the information about loop-carried dependencies is critical for correct performance estimation.

Run the Dependencies Analysis

To check for real dependencies in your code, run the Dependencies analysis and rerun the Performance Modeling to get more accurate estimations of your application performance on GPU:

Open the result in the Intel Advisor, view the interactive HTML report, or print it to the command line. Continue to investigate the results and identify code regions to offload.

See Also