acu CLI
Asight Compute provides the Asight Compute CLI (acu) to profile target applications and generate report files without a GUI tool. You can copy these files to other platforms for subsequent parsing and visualization by a GUI tool.
Key features of acu:
Collects performance data for applications running on a PPU and aggregates it into various metrics, such as:
Theoretical peak-related metrics
Compute workload
Memory workload
Warp scheduler statistics
Warp state and instruction stall reason statistics
Instruction statistics
ICN link-related metrics
Lets you specify metric collections at three levels of granularity: set, section, and metric.
Automatically replays the application to gather all performance data when the required metrics exceed the PPU's device capabilities.
Application Replay mode
Kernel Replay mode
Range Replay mode
Application Range Replay mode
Lets you specify the collection range for performance data and offers multiple kernel filtering options.
Specify the PPU device to profile
Specify the Context ID and Stream ID to profile
Specify the kernel name to profile
Specify the profiling range using
cudaProfilerStart/Stop()andhggcProfilerStart/Stop()Specify the number of kernels to profile
Specify the number of kernels to skip
Offers PC Sampling mode.
1. Collect performance data
1.1 Supported metrics
You can specify the scope of performance data collection by using a metric set, which can be defined at three levels of granularity:
metric: Measures a specific aspect of PPU performance. It represents the finest granularity for specifying a collection scope in acu.
section: A group of logically related metrics. acu provides built-in sections, and you can create custom sections by creating or modifying a section file.
set: A collection of one or more sections. It represents the coarsest granularity for specifying a collection scope in acu.
1.1.1 Query metric sets
Use the --list-sets command-line option to view details about the metrics sets that acu supports. The output is described in the following table:
root@d29fb2dd227a:/# acu --list-sets
------------ ----------------------------------------------------------------------------- --------- -------------------
identifier sections enabled estimated metrics
------------ ----------------------------------------------------------------------------- --------- -------------------
default Occupancy,MemoryWorkloadAnalysis,SpeedOfLight,SpeedOfLight_TensorRooflineC- yes 314
hart,ComputeWorkloadAnalysis,SpeedOfLight_RooflineChart,LaunchStats
detailed MemoryWorkloadAnalysis_Tables,SchedulerStats,Occupancy,SourceCounters,Memo- no 520
ryWorkloadAnalysis,SpeedOfLight,WarpStateStats,SpeedOfLight_TensorRoofline-
Chart,InstructionStats,ComputeWorkloadAnalysis,SpeedOfLight_RooflineChart,-
LaunchStats
full Icnlink_Tables,MemoryWorkloadAnalysis_Tables,InternalDebug,SchedulerStats,- no 821
Occupancy,Icnlink_Topology,SourceCounters,MemoryWorkloadAnalysis,Professio-
nal,SpeedOfLight,WarpStateStats,SpeedOfLight_TensorRooflineChart,MemoryWor-
kloadAnalysis_Chart,InstructionStats,ComputeWorkloadAnalysis,SpeedOfLight_-
RooflineChart,LaunchStats,Icnlink
systems Systems no 0 Identifier: The name of the metrics set. Pass this name to the
--setoption to select which set to collect.Sections: The sections in the set. Check this list to determine if the set meets your requirements.
Enabled: Indicates whether the set is enabled. By default, the
defaultset is enabled.Estimated metrics: The total number of metrics in the set. Use this count to assess the relative overhead of data collection.
Note: Set details may vary between versions. The actual query results prevail.
1.1.2 Query metric section
Use the --list-sections command-line option to list the supported sections, their display names in the GUI, and the preset path for each section file. By default, this command lists the sections in the default set. The following table describes the output:
root@d29fb2dd227a:/# acu --list-sections
---------------------------------- ------------------------------------------------- --------- --------------------------------------------------
Identifier Display Name Enabled FileName
---------------------------------- ------------------------------------------------- --------- --------------------------------------------------
InstructionStats instruction statistics no /usr/sections/InstructionStatistics.section
MemoryWorkloadAnalysis memory workload analysis yes /usr/sections/MemoryWorkloadAnalysis.section
MemoryWorkloadAnalysis_Chart memory workload analysis chart no /usr/sections/MemoryWorkloadAnalysis_Chart.sect-
ion
MemoryWorkloadAnalysis_Tables memory workload analysis tables no /usr/sections/MemoryWorkloadAnalysis_Tables.sec-
tion
SchedulerStats scheduler statistics no /usr/sections/SchedulerStatistics.section
SpeedOfLight_RooflineChart PPU Speed of Light roofline chart yes /usr/sections/SpeedOfLight_RooflineChart.section
SpeedOfLight_TensorRooflineChart PPU Speed of Light roofline chart (Tensor Core) yes /usr/sections/SpeedOfLight_TensorRooflineChart.-
section
ComputeWorkloadAnalysis PPU compute workload analysis yes /usr/sections/ComputeWorkloadAnalysis.section
Icnlink ICNLink no /usr/sections/Icnlink.section
InternalDebug debug PPU all metrics no /usr/sections/InternalDebug.section
SpeedOfLight PPU Speed of Light throughput yes /usr/sections/SpeedOfLight.section
WarpStateStats warp state statistics no /usr/sections/WarpStateStatistics.sectionIdentifier: The identifier for the metrics section. You can pass this identifier to the
--sectionoption to specify the collection scope.Display name: The display name for this section in Asight Compute.
Enabled: Indicates whether this section is enabled.
File name: The path to the corresponding section file.
Note: Section details may differ between versions; always refer to the query results for the most accurate information.
You can also use the --set option to view section information for a specific set. A value of yes in the Enabled column indicates that the section is available:
root@eb8b441561f7:~# acu --set=full --list-sections
---------------------------------- ------------------------------------------------- --------- --------------------------------------------------
Identifier Display Name Enabled FileName
---------------------------------- ------------------------------------------------- --------- --------------------------------------------------
InstructionStats instruction statistics yes /usr/sections/InstructionStatistics.section
MemoryWorkloadAnalysis_Chart memory workload analysis chart yes /usr/sections/MemoryWorkloadAnalysis_Chart.sect-
ion
MemoryWorkloadAnalysis_Tables memory workload analysis tables yes /usr/sections/MemoryWorkloadAnalysis_Tables.sec-
tion
ComputeWorkloadAnalysis PPU compute workload analysis yes /usr/sections/ComputeWorkloadAnalysis.section
Icnlink ICNLink no /usr/sections/Icnlink.section
InternalDebug all PPU metrics debugging yes /usr/sections/InternalDebug.section
MemoryWorkloadAnalysis memory workload analysis yes /usr/sections/MemoryWorkloadAnalysis.section
SchedulerStats scheduler statistics yes /usr/sections/SchedulerStatistics.section
SpeedOfLight PPU speed of light throughput yes /usr/sections/SpeedOfLight.section
SpeedOfLight_RooflineChart PPU speed of light Roofline chart yes /usr/sections/SpeedOfLight_RooflineChart.section
SpeedOfLight_TensorRooflineChart PPU speed of light Roofline chart (Tensor Core) yes /usr/sections/SpeedOfLight_TensorRooflineChart.-
section
WarpStateStats warp state statistics yes /usr/sections/WarpStateStatistics.sectionNote: The sections in a set can vary between versions; always refer to the query results for the most accurate information.
Specify a section file search path
When you specify a search path, acu uses all .section files in that path as sections. You can specify the path in two ways:
--section-folder: Specifies the search path for section files. acu searches this path for files with the .section extension, but does not search subfolders.--section-folder-recursive: Specifies the search path for section files. acu recursively searches this path for files with the .section extension.
For example, to view the /usr/custom section:
acu --list-sections --section-folder=/usr/custom/1.1.3 Query metrics
Use the --list-metrics command-line option to query supported metrics. By default, it queries the default set. You can use the --section or --set option to query a specific section or set.
Querying metrics in a section
Use --section to query the metrics in a specific section.
root@d29fb2dd227a:/# acu --section SpeedOfLight --list-metrics
breakdown:cu__throughput.avg.pct_of_peak_sustained_elapsed
breakdown:ppu__compute_memory_throughput.avg.pct_of_peak_sustained_elapsed
ce__cycles_active.max
ce__cycles_elapsed.avg.per_second
ce__cycles_elapsed.max
cu__cycles_active.avg
cu__throughput.avg.pct_of_peak_sustained_elapsed
dram__cycles_elapsed.avg.per_second
l1__throughput.avg.pct_of_peak_sustained_active
l2__throughput.avg.pct_of_peak_sustained_elapsed
llc__throughput.avg.pct_of_peak_sustained_elapsed
ppu__compute_memory_throughput.avg.pct_of_peak_sustained_elapsed
ppu__dram_throughput.avg.pct_of_peak_sustained_elapsed
ppu__time_duration.sumList metrics in a set
Use--set to query the metrics for a specific set.
root@d29fb2dd227a:/# acu --set=default --list-metrics
breakdown:cu__throughput.avg.pct_of_peak_sustained_elapsed
breakdown:ppu__compute_memory_throughput.avg.pct_of_peak_sustained_elapsed
ce__cycles_active.max
ce__cycles_elapsed.avg.per_second
ce__cycles_elapsed.max
cu__cycles_active.avg
cu__inst_executed.avg.pct_of_peak_sustained_active
cu__inst_executed.avg.per_cycle_active
cu__inst_executed.avg.per_cycle_elapsed
cu__inst_executed_pipe_falu_fp16.avg.pct_of_peak_sustained_active
cu__inst_executed_pipe_falu_fp32.avg.pct_of_peak_sustained_active
cu__inst_executed_pipe_lsu.avg.pct_of_peak_sustained_active
cu__inst_executed_pipe_sfu.avg.pct_of_peak_sustained_active
cu__inst_executed_pipe_simt_control.avg.pct_of_peak_sustained_active
cu__inst_executed_pipe_sls.avg.pct_of_peak_sustained_active
cu__inst_executed_pipe_tensor_fp16.avg.pct_of_peak_sustained_active
cu__inst_executed_pipe_tensor_tf32.avg.pct_of_peak_sustained_active
cu__instruction_throughput.avg.pct_of_peak_sustained_active
cu__memory_throughput.avg.pct_of_peak_sustained_elapsed
cu__throughput.avg.pct_of_peak_sustained_elapsed
dram__bytes.sum.peak_sustained
dram__bytes.sum.per_second
dram__cycles_elapsed.avg.per_second
ksd__transaction_hit_rate.pct
kvd__transaction_hit_rate.pct
l1__throughput.avg.pct_of_peak_sustained_active
l2__throughput.avg.pct_of_peak_sustained_elapsed
l2__transaction_hit_rate.pct
llc__average_lcu_input_transaction_success_rate.pct
llc__average_lcu_output_transaction_compression_achieved_rate.ratio
llc__throughput.avg.pct_of_peak_sustained_elapsed
llc__transaction_hit_rate.pct
ppu__compute_memory_access_throughput.avg.pct_of_peak_sustained_elapsed
ppu__compute_memory_request_throughput.avg.pct_of_peak_sustained_elapsed
ppu__compute_memory_throughput.avg.pct_of_peak_sustained_elapsed
ppu__dram_throughput.avg.pct_of_peak_sustained_elapsed
ppu__time_duration.sum
pu__cycles_elapsed.avg.per_second1.1.4 Querying metrics
Run acu --query-metrics to view metric descriptions. For example:
root@0549cf16bb85:~# acu --query-metrics
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Metric Name Type Unit Metric Description
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ce__cycles_active.avg Counter cycle # of cycles active on CE across CEs
ce__cycles_active.max Counter cycle # of cycles active on CE across CEs
...
dram__bytes_read.sum Counter byte # of bytes read from DRAM
dram__bytes_read.sum.pct_of_peak_sustained_elapsed Counter % # of bytes read from DRAM
dram__bytes_read.sum.per_second Counter byte/second # of bytes read from DRAM
...
l2__transaction_hit_rate Ratio unitless (0.x) hit rate of L2 cacheable requests
l2__transaction_hit_rate.pct Ratio % (0-100) hit rate of L2 cacheable requests
...
Metric name: The metric's name.
Type: The type of the metric, which can be one of the following:
Counter: A raw counter from the PPU.
Ratio: The result of dividing one counter by another.
Throughput: A value derived from a set of counters where each counter is expressed as a percentage of the PPU peak. The throughput is the maximum of these percentages.
Unit: The metric's unit of measure.
Metric description: An explanation of what the metric represents.
Tip: To view a performance metric and its description in the Asight Compute GUI, hover over its name or open the Metric Details page.

1.2 Specify a metric set
To specify the set of metrics to collect, select a granularity: set, section, or metric.
The combined effects of the three granularity levels are as follows:
If none of the
--set, --section, and --metricsoptions are specified, the effective metric set is the default set.If the
--sectionor--metricsoption is specified, the--setoption is ignored.--sectionand--metricsoptions can be used together. The effective metric set is their union.
Tip: Higher granularity results in a larger number of metrics being collected. If this number exceeds the PPU capability limit, the application may require multiple replays to collect all metric data, resulting in a longer acu profiling time.
1.2.1 Collection set
Use the --set option to specify the metric set to enable. The basic rules are as follows:
You can enable only one set at a time.
If you do not specify
--set,--section, or--metrics, the default set is enabled.
To enable the detailed set, run this command:
acu -o test_report -f --set="detailed" ./cuda_test 10The default set is enabled by default but excludes some metrics, such as memory throughput. To collect all metrics, enable the full set with the following command:
acu -o test_report -f --set="full" ./cuda_test 101.2.2 Specify collection section
Use the --section option to specify which metric sections to enable. The basic rules are as follows:
Each
--sectionoption specifies a matching rule for a section.This option supports two matching modes:
Exact match: Specify a section identifier. A section is enabled only if its identifier is an exact match. Use the
--list-sectionsoption to view available section identifiers.Regex match: Specify a regular expression using the syntax
regex:<expression>. This enables all sections whose identifier matches the regular expression <expression>.
If you specify multiple
--sectionoptions, only the last one applies.
For example, use the regular expression regex:.*WorkloadAnalysis to enable all sections ending with WorkloadAnalysis, such as ComputeWorkloadAnalysis and MemoryWorkloadAnalysis.
acu --section="regex:.*WorkloadAnalysis" python test_linear.pyFor example, if you specify the two exact match rules, SpeedOfLight and SchedulerStats, in order, the system collects only sectionSchedulerStats:
acu --section SpeedOfLight --section SchedulerStats python test_linear.pyTip: To prevent the Linux shell from interpreting special characters in a regular expression, wrap the parameter in double quotes (""). For example: --section="regex:.*Analysis.*"
1.2.3 Specify metrics
Use the --metrics option to specify which metrics to enable. The basic rules are as follows:
Separate metric names with a comma (,). Use the
--list-metricsoption to view supported metric names.If you specify multiple
--metricsoptions, only the last one takes effect.If you also specify the
--sectionoption, the system collects both the metrics in that section and those specified by--metrics.The
--metricsoption supports two types of name matching rules:Exact match, which covers three cases:
Specify the full metric name.
Specify the full name of a metric group. The syntax is group:<group name>, and the system collects all metrics in this metric group.
Specify the full name of a breakdown. The syntax is breakdown:<metric name>, and the system collects and calculates all sub-metrics produced by this breakdown.
Regex match: Use the syntax regex:<expression> to collect all metrics whose names match the regular expression <expression>.
Tips:
Use the
--list-metricscommand-line option to query metric groups and breakdowns.The Linux shell might interpret the regular expression. To prevent this, wrap the parameter in double quotes ("") when you specify a metric by using a regular expression. For example:
--metrics="regex:dram.*".
For example, to collect the ce__cycles_active.max and dram__bytes.sum.per_second metrics, run this command:
acu --metrics=ce__cycles_active.max,dram__bytes.sum.per_second python test_linear.pyFor example, to collect all metrics in groupmemory__chart, run the following command:
acu --metrics="group:memory__chart" python test_linear.pyFor example, to collect and compute the values of all sub-metrics of cu__throughput.avg.pct_of_peak_sustained_elapsed and ppu__compute_memory_throughput.avg.pct_of_peak_sustained_elapsed without computing the parent metrics, run the following command:
acu --metrics=breakdown:cu__throughput.avg.pct_of_peak_sustained_elapsed,breakdown:ppu__compute_memory_throughput.avg.pct_of_peak_sustained_elapsed python test_linear.pyFor example, the following command uses a regular expression to collect all metrics containing cycles_elapsed, such as ce__cycles_elapsed.avg.per_second and ce__cycles_elapsed.max:
acu --metrics="regex:cycles_elapsed.*" python test_linear.pyFor example, the following command uses a regular expression to collect metrics starting with dram, such as dram__bytes.sum.peak_sustained and dram__bytes.sum.per_second. It ignores other metrics, such as ppu__dram_throughput.avg.pct_of_peak_sustained_elapsed:
acu --metrics="regex:^DRAM.*$" python test_linear.py1.3 Specify replay mode
When the number of performance counters required by all metrics exceeds the PPU's hardware limit for simultaneous collection, acu must replay the kernel multiple times. Each replay, called a pass, uses a different counter configuration to collect all the metric data.

acu supports multiple replay modes. By default, it uses the kernel replay mode to collect data. You can use the --replay-mode option to select a different mode:
Replay mode | Description | Profiling object | Execution count | Save/restore memory | Overhead | Limitations |
kernel | Each kernel is replayed sequentially within a single application run. | kernel | 1 | Yes |
| Applications that require concurrent kernel execution. |
application | The application runs multiple times. Each run sequentially collects performance metrics for each kernel. | kernel | Multiple | No | Overhead from multiple application launches. |
|
range | Each range, containing kernel launches and HGGC API calls, is replayed sequentially within a single application run. | range | 1 | Yes |
|
|
app-range | The application runs multiple times. Each run sequentially collects performance metrics for each range, including its kernel launches and HGGC API calls. | range | Multiple | No | Overhead from multiple application launches. | Applications with non-deterministic behavior. |
Choose the replay mode that best suits your application, as each mode affects it in different ways, such as altering kernel execution order or introducing performance overhead.
Example: Use kernel replay mode to collect performance data.
acu --replay-mode kernel python test_linear.py1.3.1 Kernel replay mode
In kernel replay mode, each kernel runs multiple times per application run to collect all metric data. Before the first kernel execution, the mode backs up the PPU device memory. Before each subsequent kernel replay, it restores the device memory to the state captured during the first pass.

Key features of Kernel Replay mode include:
Replay completes in a single application execution.
Performance data is collected at kernel granularity.
Application kernels are forced to execute serially.
Backing up and restoring memory before kernel execution increases the total application execution time.
Memory backup consumes device memory.
Kernel Replay forces kernel serialization during profiling, which makes it unsuitable for some programs. The following sections detail its use cases and limitations.
Use cases
Single-process, single-thread: A single thread launches all kernels sequentially.

Single-process, multi-thread: Kernels launched from different threads operate independently.

Multi-process: Kernels launched from different processes operate independently.

Unsupported scenarios
Using Kernel Replay on dependent kernels can cause the application to hang.
Single-process, single-thread applications with dependent kernels.

Example: pccl-tests (1 process, 1 thread, 2 ranks).
acu --set full -f -o all_reduce_2_ranks_2M ./build/all_reduce_perf -g 1 -t 2 -n 1 -w 0 -b 2M -e 2M -c 0Single-process, multi-thread applications with dependent kernels across threads.

Example: pccl-tests (1 process, 2 threads, 1 rank per thread).
acu --set full -f -o all_reduce_2_ranks_2M ./build/all_reduce_perf -g 1 -t 2 -n 1 -w 0 -b 2M -e 2M -c 0Multi-process applications with dependent kernels across processes.

Example: pccl-tests (2 processes, 1 thread per process, and 1 rank per thread).
ncu --set full --replay-mode kernel --target-processes all -o all_reduce_perf_kernel_p2_t1_g1 mpirun -np 2 --allow-run-as-root ./build/all_reduce_perf -g 1 -t 1 -n 1 -w 0 -b 2M -e 2M -c 0Graph scenarios (kernels launched by an HGGC graph).
The current version only supports profiling a graph as a whole. By default, acu ignores kernels within the graph, so the report does not include their performance data.

1.3.2 Application replay mode
Application Replay mode collects metric data by running the application multiple times. Because this mode repeatedly relaunches the application, it does not require a memory backup or restore for each kernel. However, the application must behave consistently across runs, such as the name, number, and execution order of its kernels.

Key features of Application Replay mode include:
The application is run multiple times to ensure all metric data is collected.
Performance data is collected at kernel granularity.
Application kernels must execute serially.
If the application has time-consuming host-side operations, such as initialization, multiple replays increase the overall execution time.
Use cases
Application Replay is subject to the same conditions as Kernel Replay because both force kernel serialization during profiling. For more information, see Kernel Replay's applicable scenarios and limitations.
Because Application Replay scatters a kernel's metric data across multiple runs, matching the data for a specific kernel becomes a challenge. To solve this, acu provides the --app-replay-mode and --app-replay-match command-line options.
Kernel match pattern
acu provides the --app-replay-mode option to control whether to strictly check for behavioral consistency across multiple runs during kernel matching in Application Replay. Two modes are available:
App-replay-mode options | Description |
strict | Default. All kernels in each application run must match those from the first run. If a mismatch occurs in any pass, profiling aborts. |
relaxed | Allows kernels to differ across application runs. Outputs metric data only for matching kernels. |
Tip: If an application fails to generate a report in strict mode, this indicates non-deterministic execution behavior. You can try relaxed mode, but be aware that the report might lack performance data for some kernels.
Kernel matching policy
acu uses the --app-replay-match option to specify the kernel matching strategy for Application Replay. This strategy defines what makes kernels identical. acu supports the following three matching strategies:
Value | Matching strategy description |
name | Kernels are matched as follows:
|
grid | Default. Kernels are matched as follows:
|
all | Kernels are matched as follows:
|
Example: Use application replay mode to collect performance data in relaxed mode, using the grid matching strategy:
acu --replay-mode application --app-replay-mode relaxed --app-replay-match grid python test_linear.py1.3.3 Range replay mode
In range replay mode, the system collects all metric data by repeatedly executing a range containing kernel launches and HGGC API calls during a single application run. These metrics apply to the entire range, not a specific kernel. This mode captures the kernel launches and HGGC API calls within the range and saves and restores host and device memory.

Key features of the Range Replay mode include:
Replay completes within a single application execution.
It collects performance data at range granularity, not kernel granularity.
Kernels within a range can execute in parallel without forced serialization.
Range replay involves memory backup and restore operations, increasing application execution time.
A range supports only a subset of HGGC APIs.
Range replay replays only PPU Device behavior, not host application behavior.
Applications define ranges using
hg(gc)ProfilerStartandhg(gc)ProfilerStopand must ensureacucan synchronize all contexts at the start of each range.Each range can profile only one PPU Device.
Range
To use range replay, you must specify a range for performance analysis within your application. A range is defined by start and end markers and includes all HGGC API calls and kernels launched from any CPU thread between these markers. The application must add appropriate synchronization between threads to ensure it captures the expected set of API calls. You can set the range in one of the following two ways:
Profiler Start/Stop API
Use hg(gc)ProfilerStart and hg(gc)ProfilerStop to set the start and end markers, respectively, which is the default method for defining a range in Asight Compute.
hggcProfilerStart();
/* Add profiling code here (e.g., HGGC API calls, kernels). */
hggcProfilerStop();HGX range
Use an HGTX include expression to define a Range. The Range capture starts with the first HGGC API call and ends with the last API call that matches the expression. If you specify multiple expressions, each matched expression defines a new Range. This allows you to capture and analyze multiple Ranges in a single application run. To enable expression matching, instrument the application with the HGTX API.
hgtxRangeId_t r1 = hgtxRangeStartA("Range 1");
/* Profiles code using the HGGC API and kernels */
hgtxRangeEnd(r1);Scenarios
While Range Replay can also run in the three applicable scenarios for Kernel Replay, it is primarily used to profile multiple parallel kernels (specifically cases 1 and 2 from Kernel Replay's non-applicable scenarios).
Single process, single thread (where dependent kernels are in the same range).

Example: pccl-tests (1 process, 1 thread, 2 ranks).
acu --set full --replay-mode range -o all_reduce_perf_range_p1_t1_g2 ./build/all_reduce_perf -g 2 -n 1 -w 0 -b 2M -e 2M -c 0Single process, multi-thread (where dependent kernels are in the same range).

Example: pccl-tests (1 process, 2 threads, 1 rank).
acu --set full --replay-mode range -f -o all_reduce_2_ranks_2M ./build/all_reduce_perf -g 1 -t 2 -n 1 -w 0 -b 2M -e 2M -c 0
Unsupported scenarios
The range for Range Replay is process-level, so if interdependent kernels run on different threads, the range must include all of them to prevent the application from hanging.
Range Replay forces range serialization, which can cause a process to hang if one of its ranges depends on a kernel or a range from another process.
Single-process, multi-thread (interdependent kernels are in different ranges).

Multi-process (a range in one process depends on a kernel in another process).

Example: pccl-tests (2 processes, 1 thread per process, 1 rank per thread, with a range on only one rank).
acu --set full --replay-mode range --target-processes all -o all_reduce_perf_range_p2_t1_g1 mpirun -np 2 --allow-run-as-root ./build/all_reduce_perf -g 1 -t 1 -n 1 -w 0 -b 2M -e 2M -c 0 -j 0Multi-process (a range in one process depends on a range in another process).

Example: pccl-tests (2 processes, 1 thread per process, 1 rank per thread, with a range on both ranks).
acu --set full --replay-mode range --target-processes all -o all_reduce_perf_range_p2_t1_g1 mpirun -np 2 --allow-run-as-root ./build/all_reduce_perf -g 1 -t 1 -n 1 -w 0 -b 2M -e 2M -c 0
1.3.4 Application range replay
In Application Range Replay mode, all requested metrics are grouped into one or more passes. Similar to Range Replay, metrics are associated with the selected range rather than with individual kernels. The tool does not need to serialize workloads (e.g., kernels and graphs), which enables performance analysis of workloads that require concurrent execution.
Unlike Range Replay, you do not need to explicitly capture each range before executing it multiple times. Instead, the system reruns the entire application multiple times, and each run constitutes a pass that collects metrics for each range. This approach eliminates the need to track and capture application state for each range (such as saving and restoring memory), because the application itself correctly executes the range. The definition of a range is the same as in Range Replay, and you must ensure the workload within the range is deterministic.

Scenarios
Unlike Range Replay, Application Range Replay handles multi-process scenarios, provided that a single process defines the range.

Example: pccl-tests (2 processes, 1 thread per process, 1 rank per thread, with a range defined on only one rank).
acu --section Icnlink --replay-mode app-range --target-processes all mpirun -np 2 --allow-run-as-root ./build/all_gather_perf -g 1 -t 1 -n 1 -w 0 -b 512M -e 512M -c 0 -q 1 -s 1 -j 0Unsupported scenarios
An application with multiple processes will hang if there are dependencies between their defined ranges.
If the execution order of ranges is inconsistent across replays, the performance data cannot be aligned by range, which prevents report generation.
Multiprocessing with two ranges, where the range of one process depends on the other.

Multiprocessing with two independent ranges without a guaranteed execution order.

Multithreading with two independent ranges without a guaranteed execution order.

1.3.5 Graph profiling
Graph Profiling analyzes an HGGC graph as a single workload entity, not as a collection of individual kernel nodes.

Enable this feature with the --graph-profiling graph option.
This mode's main use cases include:
The graph contains kernel nodes that require concurrent execution.
Graphs with multiple kernel nodes require more accurate performance analysis.
Consider the following when enabling graph profiling:
This feature requires the
--replay-mode kerneloption and is disabled by default.Certain performance metrics, such as instruction statistics, are unavailable.
2. Control the profiling process
2.1 Specify profiling devices
Use --devices to specify which PPU devices to profile.
Specify devices by their zero-based index, which is assigned when the PPU device powers on.
Separate multiple PPU device indices with a comma (
,).By default, profiling is enabled on all PPU devices if you omit this option.
Example: To profile PPU devices 1 and 2:
acu --devices 1,2 python test_linear.py
Note: In Range Replay mode, the --devices option supports only one PPU device.
2.2 Specify the profiling time range
The --profile-from-start option controls when profiling begins. This option applies to Application Replay and Kernel Replay modes. The supported values are described below:
Value | Description |
on or yes (Default) | Starts profiling at application launch. |
off or no | Starts profiling when a start API is called and stops when a stop API is called. See the list below for supported APIs. |
acu supports the following profiler start/stop API pairs:
cudaProfilerStart/Stop
hggcProfilerStart/Stop
cuProfilerStart/Stop
hgProfilerStart/Stop
Example: To start profiling at the profiler start API and end at the profiler stop API, run the following command:
acu --profile-from-start off python test_linear.pyAs shown in the figure, if you define profiling ranges with cu(da)ProfilerStart() and cu(da)ProfilerStop(), acu profiles the first range (three kernels) and the second range (one kernel).

disable-profiler-start-stop
Use the --disable-profiler-start-stop option to ignore the profiler start/stop APIs.
If you specify the
--disable-profiler-start-stopoption, acu ignores the--profile-from-startoption and starts profiling at application launch.
2.3 Filter kernels
acu provides several methods for filtering which kernels to profile.
These kernel-level filtering methods apply only in Application Replay and Kernel Replay modes.
2.3.1 Specify the kernel name base
Use the --kernel-name-base option to specify the kernel name format for the --kernel-name and --kernel-id options. Supported values are function, mangled, and demangled. The default value is function.
function: The function name without parameters or templates (e.g.,foo).demangled: The demangled function name, including parameters and templates (e.g.,foo(float*,int,int)).mangled: The mangled function name generated by the compiler (e.g.,_S4_S4_9TileShapeS4_S4_iSC).
Example: To use the function name as the filtering base and profile all kernels whose function name contains foo, run the following command:
acu --kernel-name-base function --kernel-name regex:foo -o cuda_test ./cuda_test 12.3.2 Specify the kernel name
Use the --kernel-name option to specify an expression for matching kernel names. The name format used for matching depends on the --kernel-name-base option. For more information, see the description of --kernel-name-base. The following formats are supported:
Exact match: Profiles kernels with names that exactly match the specified string.
Regular expression: Use the syntax
regex:<expression>to profile all kernels with names matching the regular expression.
Because the Linux shell may process regular expression syntax, we recommend wrapping the argument in double quotes when specifying a kernel name with a regular expression (e.g., --kernel-name="regex:^.*foo$").
Example: Match all kernels named Bar.
acu --kernel-name Bar ./cuda_test 1
Example: Match all kernels containing the string "Bar", such as Bar and FooBar.
acu --kernel-name "regex:Bar" ./cuda_test 1
Example: Match all kernels containing the string "foo" or "bar", such as foo, foobar, and _bar2.
acu --kernel-name "regex:foo|bar" ./cuda_test 12.3.3 Specify the kernel ID
Use the --kernel-id option to specify a kernel ID expression. acu profiles a kernel's performance data only if its ID matches the expression. The syntax for the kernel ID expression is context-id:stream-id:[name-operator:]kernel-name:invocation-nr. Fields are separated by a colon (:). Leaving a field empty disables filtering for that field. The five fields are described below:
context-id: Specifies the kernel's context ID.stream-id: Specifies the kernel's stream ID.name-operator: An optional descriptor that modifies thekernel-namefield. If omitted, the colon (:) is not required.Currently, the only supported value is
regex, which indicates thatkernel-nameis a regular expression.
kernel-name: An expression for the kernel name. The name format used for matching depends on the value of--kernel-name-base. For more information, see the description of--kernel-name-base.If
name-operatorisregex: Profiles all kernels with names that match the regular expression.If
name-operatoris empty: Profiles kernels with names that exactly match the specified string.
invocation-nr: Specifies the invocation number of this kernel.Multiple invocations can be specified using a regular expression.
The invocation count is incremented only when all preceding criteria (e.g.,
context-id,stream-id,kernel-name) match.
Because the Linux shell may process regular expression syntax, we recommend wrapping the argument in double quotes when specifying a kernel ID with a regular expression (e.g., --kernel-id="::regex:^.*foo$").
Example: Match the second invocation of the kernel named Foo, without specifying a context or stream ID.
acu --kernel-id ::Foo:2 ./cuda_test
Example: Match the third invocation and all invocations ending in 5 for all kernels.
acu --kernel-id "::::.*5|3" ./cuda_testExample: Match all kernels that end with "foo".
acu --kernel-id "::regex:^.*foo$" ./cuda_testExample: Match all kernels that do not start with "foo".
acu --kernel-id "::regex:^(?!foo)" ./cuda_testExample: Match the fifth invocation of all kernels on context 1, stream 3.
acu --kernel-id 1:3::5 ./cuda_test2.3.4 Specify kernel count
Use the --launch-count option to set the maximum number of kernels to profile. This counts only kernels that match the --kernel-name and --kernel-id filters.
This option is also supported in Range Replay mode, where it counts ranges.
Example: Profile only two kernels. acu does not profile subsequent kernels.
acu --launch-count 2 ./cuda_test
2.3.5 Specify the number of kernels to skip
Use the --launch-skip option to set the number of matching kernels to ignore before profiling begins. This counts only kernels that match the filter criteria of the --kernel-name and --kernel-id options.
This option is also supported in Range Replay mode, where it counts ranges.Example: Skip the first kernel, then profile all subsequent kernels.
acu --launch-skip 1 ./cuda_test
Example: Skip the first kernel, then profile the next two kernels. acu does not profile any remaining kernels.
acu --launch-skip 1 --launch-count 2 ./cuda_test
2.3.6 Skip kernels before matching
Use the --launch-skip-before-match option to set the number of kernels to ignore before profiling begins. All kernels are counted, regardless of whether they match any filter criteria.
Example: Unconditionally skip two kernels, then profile all kernels whose name contains Foo.
acu --launch-skip-before-match 2 --kernel-name regex:Foo ./cuda_test
Example: Skip the first two kernels regardless of their name (black). Then, among the kernels that match the filter (name contains Foo), skip the next two (red), and then profile the next two (green). acu does not profile any remaining kernels.
acu --launch-skip-before-match 2 --launch-skip 2 --launch-count 2 --kernel-name regex:Foo ./cuda_test
2.3.7 Specify whether to terminate the application
Use the --kill option to determine whether to terminate the application after the launch-count is reached. The default is yes.
Example: Profile two kernels and then terminate the application.
acu --launch-count 2 --kill yes ./cuda_test
Example: Profile two kernels and allow the application to run to completion. acu does not profile subsequent kernels.
acu --launch-count 2 --kill no ./cuda_test
2.4 Specify the report name
By default, acu generates output files in the .acurep format for analysis in the GUI. Use the -o option to specify the report name. Do not include the file extension; acu automatically adds the .acurep extension. If -o is not specified, acu prints output to the console by default using --page=details.
2.5 Set console output format
In addition to storing results in a report file, acu can print results to the console using different page formats. These pages correspond to the pages in the UI report. If you do not specify an output file, acu prints the details page by default. To select a different page, or to print to the console while also saving results to a file, use the --page=<Page> command. Currently, acu supports the details and raw pages. If you set an output file with -o but do not specify the --page option, acu does not print any results to the console. Besides page format, acu also supports CSV output. Use the --csv option to print the console output in CSV format.
2.6 Import a report file
Use the --import option to import an existing report and print its contents to the console. You can combine this with the --page <page> option.
2.7 HGTX filtering
--hgtx-include <configuration> --hgtx-exclude <configuration>
Use these command-line options to profile only the kernels that meet specified configuration conditions, allowing you to select kernels within a specific range.
To use HGTX filtering, you must specify the --hgtx option. You can also specify the --hgtx-include and --hgtx-exclude options one or more times.
There are two types of HGTX range configurations: HgtxRangeStart/End and HgtxRangePush/Pop. The configuration syntax for each is described below.
Start-End Ranges
Quantifier
Description
Example
,
Delimiter between range names.
Range A,Range B
Range B,Range A,Range C
@
Specifies the domain name. If not specified, the default domain is assumed.
Domain A@Range A
Domain B@Range B,Range Z
acu --hgtx --hgtx-include "Domain A@Range A" hgtx_filtering_testacu profiles kernels within the
Domain A@Range Arange.acu --hgtx --hgtx-include "Range A,Range B" hgtx_filtering_testacu profiles kernels that are simultaneously within both
Range AandRange B.acu --hgtx --hgtx-include "Range A" --hgtx-include "Range B" hgtx_filtering_testacu profiles kernels that are within
Range AorRange B.acu --hgtx --hgtx-exclude "Range A" hgtx_filtering_testacu profiles all kernels except those within
Range A.acu --hgtx --hgtx-include "Range B"--hgtx-exclude "Range A" hgtx_filtering_testacu profiles kernels that are within
Range Bbut not withinRange A.Push-Pop Ranges
Quantifier
Description
Example
/
Delimiter between range names.
Range A/Range B
Range A/*/Range B
Range A/
[
The range is at the bottom of the stack.
[Range A
[Range A/+/Range Z
]
The range is at the top of the stack.
Range Z]
Range C/*/Range Z]
+
Exactly one range is between the two other ranges.
Range B/+/Range D
*
Zero or more ranges are between the two other ranges.
Range B/*/Range Z
@
Specifies the domain name. If not specified, the default domain is assumed.
Domain A@Range A
Domain B@Range A/*/Range Z]
acu --hgtx --hgtx-include "Domain A@Range A/" hgtx_filtering_testacu profiles kernels within the
Domain A@Range Arange.acu --hgtx --hgtx-include "[Range A" hgtx_filtering_testacu profiles kernels that are within
Range AwhenRange Ais at the bottom of the stack.acu --hgtx --hgtx-include "Range A/*/Range B" hgtx_filtering_testacu profiles kernels that are within both
Range AandRange B, with zero or more ranges in between.acu --hgtx --hgtx-exclude "Range A/*/Range B" hgtx_filtering_testacu profiles all kernels except for those within both
Range AandRange B, with zero or more ranges betweenRange AandRange B.acu --hgtx --hgtx-include "Range A/" --hgtx-exclude "Range B]" hgtx_filtering_testacu profiles kernels that are within
Range Abut not in a range withRange Bat the top of the stack.Other Configurations
--hgtx-include DomainA@RangeA,DomainB@RangeB// Invalid configurationA single HGTX configuration string can only specify one domain, even if it includes multiple ranges.
--hgtx-include "Range A\[i\]"Quantifiers in a name (
@,,,[,],/,*,+) can be escaped with a backslash (\).Range A\[i\]refers to a range literally namedRange A[i].--hgtx-include "Range A"// Start/End configuration--hgtx-include "Range A/"// Push/Pop configuration--hgtx-include "Range A]"// Push/Pop configurationIf a name contains a backslash (
\), use four backslashes (\\\\). Do not use\\\\before a quantifier.To include or exclude a single Push/Pop configuration, use
/at the end. Do not use[or].--hgtx-include "Range A/*/RangeB"The order in a Push/Pop configuration is important. In the example,
Range Ais belowRange Bin the stack.
2.8 Run multiple instances of acu
You can run multiple instances of acu. You can start multiple acu processes in the same terminal session or Docker container for profiling, with each instance generating a separate report. This method can be used with the mpirun command. Since each acu instance can only profile on a single PPU device, you must ensure that the target application of each acu instance has exclusive access to one PPU device. If acu detects that another application is using the target device during profiling, acu displays a log message similar to the following:
The application running on the device[0], may affect the metrics results of profiling.
Running application list: xxxxxxxxxx If this message appears, the current acu profiling session will continue, but the performance data may be incorrect and could include data from kernels running in other applications.
There are two ways to use the mpirun command for acu profiling:
Place
mpirunafteracuto launch it as the target application. The command format is as follows:acu -o your_report mpirun -np 8 <your_target_application>This method launches only one instance of
acu, butmpirunmay fork multiple application processes. acu profiles data from kernels in all forked processes and merges it into a single report file.Place
mpirunbeforeacuto launchacuas the application. The command format is as follows:mpirun -np 8 acu -o mpi_repot_%p <your_target_application>This method launches eight instances of
acu. Each instance starts one<your_target_application>process for profiling, generating eight separate reports.
This command combination is applicable only in Kernel Replay and Range Replay modes, and the target application must not contain any pccl APIs.
A key parameter for acu in the preceding command is:
-o: This example uses the wildcard %p, which is replaced by the process ID (PID) of <your_target_application>. This ensures that each acu instance outputs a uniquely named report, preventing files from being overwritten. For more wildcards, see the description of the -o and --export options in the acu --help output.
2.9 Cache control
Value | Description |
none | Default. Does not flush any PPU caches during profiling. When replaying a single kernel to collect metrics, this mode can improve performance and better reproduce application behavior and metric results. However, some metric results will depend on previous PPU workloads and may vary between replay passes, potentially causing fluctuations in metric values. |
all | Flushes all PPU caches before each kernel replay during profiling. With a "cold" cache state, metric values may differ from the application's normal execution environment, but this ensures stable, reproducible results across replay passes and multiple profiling runs. |
In Kernel Replay mode, it may be necessary to replay a kernel multiple times to collect all requested metrics. Although Asight Compute checkpoints can save and restore PPU device memory accessed by the kernel, they cannot save and restore data in the L1, L2, and LLC caches. The caches may be populated with data from a kernel's most recent access. Similarly, hardware performance counter values from the first replay pass may depend on which kernels executed before the profiled kernel launch. These factors can cause subsequent replay passes to perform better or worse than the first.
To improve the stability and accuracy of hardware performance counter metrics, Asight Compute provides the --cache-control all option, which flushes all PPU caches before each kernel replay. This ensures the kernel accesses a clean cache in each replay, behaving as if it were executed in complete isolation.
However, this mode has side effects that can be detrimental to performance analysis, especially when profiling a single kernel within a large application and collecting data for cache-focused metrics. In such cases, consider using --cache-control none to prevent the tool from flushing any hardware caches.
Similarly, in Application Replay mode, memory accessed by the kernel does not need to be saved and restored via checkpoints, so each kernel launch executes only once during the application's lifecycle. Therefore, you can also use --cache-control none in this mode. However, if an application requires a clean cache state before a specific kernel launch, you can achieve it by setting the cache control.
When --cache-control all is set, the cache flushing operation itself is not measured by the hardware performance counters. As shown in the figure below, a memory D2H operation is not reflected in the LLC-to-DRAM write bytes data in the memory chart.

To measure the actual data volume written from LLC to DRAM, you can modify the application code to expand the profiling range. Add cudaProfilerStart before the kernel launch and cudaProfilerStop after the memory D2H call. This ensures the profiling range includes the actual memory D2H behavior. You can then use --replay-mode range to collect the relevant metrics with Range Replay mode.
2.10 Clock control
This feature controls the behavior of the PPU clock during performance analysis.
The current PPU CU and memory clock frequencies directly affect the values of many metrics. Consider the following scenarios:
If other kernels execute before the kernel being analyzed, the PPU may already be at a higher clock frequency, which affects the kernel's execution time and other metrics.
If the kernel is the first one launched in the application, the PPU clock frequency is usually lower.
Because
acuperforms kernel replay, metric values can be affected by the pass in which acu collects them, as later passes can lead to higher clock frequencies.
To mitigate this variability, acu attempts to lock the PPU clock frequency to its base value with --clock-control base. This reduces the impact of the kernel's position in the application and the profiling pass on the metric values.
However, in some scenarios, you may not want to lock the clock frequency to its base value, for example, if you have already locked it using an external tool (like ppu-msi). To address this, use the --clock-control none option to prevent acu from locking any clock frequencies.
Value | Description |
base | During performance analysis, acu locks the CU and memory clocks to their respective base frequencies. The current base clock for the CU is 900 MHz. |
none | Default. During performance analysis, |
reset | Resets the CU and memory clocks for all devices (or for selected devices specified with |
Thermal throttling can cause the PPU clock frequency to change.
acucannot control this behavior.The
clock-controlfunctionality requires sudo permissions. Without them, acu interrupts the performance analysis and issues a permissions warning.When
--clock-control baseis used,acuresets the PPU clocks when the application finishes. It does not revert to the clock speeds that existed before the performance analysis began (e.g., clocks set viappu-smi).
3. PC sampling
PC Sampling periodically samples the warp scheduler's state. At a fixed interval, each sampler selects an active warp and outputs the current instruction's PC address and the scheduler's state. PC Sampling is enabled by default in acu. You can view the sampling data by opening the report in the GUI.
3.1 GUI display
The Details Page and the Source Page display PC Sampling data.
3.1.1 Details Page
In the Source Counters section of the Details Page, the Wrap Stall Sampling table lists the top five stall reasons, ranked by count. The table provides the following details for each reason:
source code location
stall reason count
stall reason percentage

For details on stall reasons, see the warp stall reason documentation.
3.1.2 Source Page
The Source Page presents stall reason data in a bar chart. Both the Source View and PASM View display the values and total count for all stall reasons for each line of code or instruction.

3.2 Specify sampling interval
You can specify the sampling interval. If the collected data is not detailed enough for your analysis, decrease the sampling interval using the --sampling-interval option.
The minimum sampling period is 128 cycles (2^7), and the maximum is 65,536 cycles (2^16). acu ignores values specified outside this range.
The
--sampling-intervaloption accepts a value in the range of 0 to 9. acu calculates the actual sampling period as 2^(7 + value) cycles.If set to
auto(the default), acu automatically selects the highest possible sampling frequency based on the current environment to ensure sufficient data collection while preventing buffer overflow.
Example: Set the sampling period to 256 cycles for PC Sampling:
acu --sampling-interval 1 -o cuda_test ./cuda_testExample: Automatically select the highest sampling frequency for PC Sampling:
acu --sampling-interval auto -o cuda_test ./cuda_test4. Instruction statistics
The instruction statistics feature collects execution data for functions like kernel functions and device functions. This feature is enabled by default. To disable instruction statistics, set the following environment variable before starting acu: export ASIGHT_FEATURE_INSTRUCTION_COUNT=0. With the exception of graphs (i.e., in --graph-profiling graph scenarios), instruction statistics supports profiling kernels or ranges in all replay modes.
Workload type | Instruction level source |
Kernel | ✅ |
Range | ✅ |
Graph | ❌ |
acu adds a separate pass to collect instruction execution data and parse the assembly instructions of a function. This process gathers the number of warp and thread executions for each instruction. The GUI tool displays this data in various formats.
4.1 Source page
On the Source Page of a report with instruction statistics, you can see the Instructions Executed and Thread Instructions Executed columns in both the Source View and PASM View.
Instructions Executed The number of times an instruction is executed by a warp, regardless of the number of participating threads.
Thread Instructions Executed The total number of times an instruction is executed across all threads.

Additionally, instruction statistics enables the GUI to display assembly instruction data and its source code correlation for device functions called by a kernel function. See the Source Page for more details.

4.2 Details page
In the Instruction Statistics Section on the Details Page, a bar chart displays the instruction execution distribution. For details, see the Executed Instruction Mix Bar Chart.

The Source Counters Section on the Details Page now displays statistics for Most Instruction Executed and Most Thread Instruction Executed. For details, see the Source Counters Section.













