Track the target program

Updated at:
Copy as MD

1. PPU activity tracking

asys supports collecting trace information from both HGGC and mainstream GPUs simultaneously. Use the -t option to specify the trace items to capture. If you do not specify any trace items, asys collects hggc,hgtx,acdnn,acblas by default. The following table describes the PPU-related trace items supported by the --trace option.

Trace item

Description

hggc

Execution time and call stack information for HGGC runtime/driver APIs

Execution time and call stack information for mainstream GPU runtime/driver APIs

PPU execution information: kernel, memcpy, and memset operations

Correlation between HGGC APIs and PPU execution

acdnn

cuDNN API: Execution time information

acblas

cuBLAS API: Execution time information

hgvideo

Execution time of HG-Encode APIs

Execution time of HG-ACVID APIs

Execution time of HG-JPEG APIs

PPU execution information: video encoding and decoding

Correlation between video APIs and PPU execution

pccl

Execution time for each stage of PCCL communication

You can control the collection scope of the hggc trace item by using the --hggc-trace-set option to enable specific subsets. Separate multiple subsets with a comma. For example: --hggc-trace-set=kernel-activity,kernel-api.

HGGC trace subset

Description

kernel-activity

Collects information about kernel execution on the PPU.

memory-activity

Collects information about memory operations on the PPU.

kernel-api

Collects execution information for kernel-related APIs on the host.

memory-api

Collects execution information for memory-related APIs on the host.

default-set

The default value. Includes all available trace subsets and other HGGC trace information.

To exclude specific APIs from the hggc trace, set the ASIGHT_HGGC_TRACE_BLACKLIST environment variable to a comma-separated list of API names. For example: export ASIGHT_HGGC_TRACE_BLACKLIST=cudaEventQuery,cuEventQuery.

1.1 Device-side PPU activity

1.1.1 PPU activity

Required asys option: --trace hggc

When you open a collected report in the GUI, PPU activity appears in the hierarchy shown below:

image

For clarity, the same timeline event can appear in multiple rows. For example, the add_kernel event in the preceding figure is shown in its own row and is also aggregated into the Kernels and Stream rows. If a context has multiple streams, an [All Stream] row appears that summarizes all stream activities.

Tip: If a device has only one context, the tool hides the Context node and displays its Stream nodes directly. Similarly, if a context has only one stream, the tool also hides the Stream node.

Each PPU node name starts with a percentage that indicates the node's duration as a percentage of its parent's duration. For a stream node, the rule is as follows:

stream time percentage = 100.0 * stream duration / context duration
stream duration = sum of the durations of all events within the stream
context duration = sum of the durations of all events within the context

Therefore, "50.3% Stream 8" means that the total duration of all events in this stream accounts for 50.3% of the total duration of all events in its parent context.

Tip: The percentage calculation for Kernel HGTX nodes under the Kernels row is an exception. The denominator for this percentage is the Stream node, not its direct parent node.

Tip: When you apply a filter, the tool recalculates the time percentages of PPU nodes based on the filtered range and re-sorts the nodes.

The PPU Device row summarizes all activity on the device. It is split into two layers: the upper layer shows kernel execution, and the lower layer shows memory operations. Different colors distinguish memory operation types, such as host-to-device (HtoD), device-to-host (DtoH), device-to-device (DtoD), pinned, and pageable, as shown in the following figure:

image

1.1.2 PPU graph

Required asys option: --trace hggc

The Timeline View can show graph timelines independently to help you analyze graph execution. If a report contains graph information, graph nodes appear under the stream node in the following hierarchy:

  • Graph Group

    • Graph

      • Graph Exec

For graph timelines, the tool shows the Graph ID and Graph Exec ID, as shown in the following figure:

image

The device row also shows aggregated graph information.

image

1.1.3 PPU video

Required asys option: --trace hgvideo

asys can also collect Video Activity data on the PPU and display the corresponding timelines to help you analyze video processing performance, as shown in the following figure:

image

Video nodes appear under the stream node, showing all Video Activity within that stream. Similar to kernel timelines, the device node also summarizes this activity. When you select a time range, the tooltip shows the time percentage of Video Activity, as shown in the following figure:

image

1.2 Host-side API calls

1.2.1 HGGC API

Required asys option: --trace hggc

Under each thread node, the timeline displays HGGC API calls. You can view the dispatch time of HGGC kernels and the launch time of memory operations:

image

1.2.2 ACDNN

Required asys option: --trace acdnn

After you enable collection, the ACDNN timeline appears under the thread node:

image

1.2.3 ACBLAS

Required asys option: --trace acblas

After you enable collection, the ACBLAS timeline appears under the thread node:

image

1.2.4 Video API

Required asys option: --trace hgvideo

When you enable collection, Video API calls, including Encode, Decode, and HGJPEG APIs, appear as follows:

image

1.3 Navigating between host APIs and device activity

Asight Systems shows the correlation between host APIs and device activity and allows you to navigate between them:

image

In the figure above, when you click a cudaLaunchKernel API call, the tool highlights the corresponding kernel executing on the device. You can use the Go to Host API or Go to Device Activity options in the context menu to navigate between them.

1.4 Switching API and kernel names

To switch the display name for launch APIs, go to Tools > Options > Systems Profile > HGGC API Name Mode and select one of the following options:

  • Show host API name

  • Show launched kernel name

1.5 Dependencies between PPU activities

APIs such as cudaEventRecord and cudaStreamWait can establish execution dependencies between kernels on different streams on the PPU. The Timeline View can visualize these dependencies. To show them, use the context menu for a PPU Activity timeline or a related Event API timeline.

image

For timelines with dependencies created by event-related APIs, the Timeline View uses orange curves to represent the dependencies, as shown in the following figure:

image

The view grays out timelines not involved in the dependency. When you hover over a curve, a tooltip displays details about the dependency. Clicking the curve highlights all timelines in that dependency path. Green curves show dependencies between kernels on the same stream and dependencies on the default stream:

image

Tip: The tool calculates dependencies from the trace data in the report. If multiple threads operate on an HGGC stream concurrently, the displayed dependencies may be inaccurate due to race conditions.

1.6 Analyzing a single kernel

If a kernel's performance does not meet expectations and you want to analyze it in detail, select the kernel in the Timeline View. From the context menu, select Analyze the Selected Kernel with Asight Compute to copy a command. Run this command in the Asight Compute command-line tool to generate a detailed report, which you can then analyze in the Asight Compute GUI tool.

image

image

2. Tracking PPU metrics

asys supports periodically sampling various runtime metrics from devices, such as resource utilization and I/O throughput. The Asight Systems GUI then visualizes these metrics over time:

image

The GUI groups metrics by category, offering both Overlay and Stacked summary views. Use the --ppu-metrics-device option to specify the list of devices to sample from. You can use --ppu-metrics-device all to sample from all devices. For example:

asys profile -t hggc --ppu-metrics-device all python test_linear.py

The preceding command samples all devices using the default metrics set. To specify a particular metrics set, use the --ppu-metrics-set option. For example, --ppu-metrics-set throughput collects the metrics set related to I/O throughput:

asys profile -t hggc --ppu-metrics-device all --ppu-metrics-set throughput python test_linear.py

Use the --ppu-metrics-device help option to list available devices. You can specify multiple devices by separating their IDs with a comma. For example, --ppu-metrics-device 0,1 samples runtime metrics from devices 0 and 1 only:

root@02892cb56ba5:~# asys profile --ppu-metrics-device help
Possible --ppu-metrics-device values are:
    all: Select all supported PPUs
    none: Disable PPU Metrics [Default]
    device ID list: comma separated device ID list(eg.: 0,1)

Available PPU metrics sampling devices are:
    0: PPU, PCI Bus ID: 00000000:10:00.0
    1: PPU, PCI Bus ID: 00000000:11:00.0
    2: PPU, PCI Bus ID: 00000000:CE:00.0
    3: PPU, PCI Bus ID: 00000000:CF:00.0

asys periodically samples device metrics. The default sampling frequency is 1,000 times per second (1 kHz). Use the --ppu-metrics-frequency option to set a different frequency. For example, --ppu-metrics-frequency 10000 sets the sampling frequency to 10 kHz.

asys supports a wide range of device metrics, but the device's sampling capacity limits the number of metrics you can collect simultaneously. asys provides several predefined metrics sets. To view the supported sets, use the --ppu-metrics-set help option:

root@02892cb56ba5:~# asys profile --ppu-metrics-set help
Possible --ppu-metrics-set values are:
 ---------------- ---------------------------------------- --------------------------------------------
  Identifier       Description                              Enabled Metrics
 ---------------- ---------------------------------------- --------------------------------------------
  summary          Collect clock / memory / CU activity /   ce__cycles_elapsed.avg.per_second
                   Bus throughput information.              ce__cycles_active.avg.pct_of_peak_sustained_elapsed
                                                            gd__dispatch_count.avg.pct_of_peak_sustained_elapsed
                                                            ce__warps_active_accumulated.avg.pct_of_peak_sustained_elapsed
                                                            ce__warps_inactive_cu_active_accumulated.avg.pct_of_peak_sustained_elapsed
                                                            ce__warps_inactive_cu_idle_accumulated.avg.pct_of_peak_sustained_elapsed
                                                            cu__cycles_active.avg.pct_of_peak_sustained_elapsed
                                                            cu__ws_issue_active.avg.pct_of_peak_sustained_elapsed
                                                            cu__we_pipe_tensor_cycles_active.avg.pct_of_peak_sustained_elapsed
                                                            dram__exclude_hbm_bytes_read.sum.pct_of_peak_sustained_elapsed
                                                            dram__exclude_hbm_bytes_write.sum.pct_of_peak_sustained_elapsed
...
  throughput       Collect DRAM / PCIe / ICN link           kvd__transaction_hit_rate.pct
                   throughput information.                  ksd__transaction_hit_rate.pct
                                                            l2__transaction_hit_rate.pct
                                                            dram__exclude_hbm_bytes_read.sum.pct_of_peak_sustained_elapsed
                                                            dram__exclude_hbm_bytes_write.sum.pct_of_peak_sustained_elapsed
                                                            pcie__read_bytes.avg.pct_of_peak_sustained_elapsed
                                                            pcie__write_bytes.avg.pct_of_peak_sustained_elapsed
                                                            icnltx__bytes.sum.pct_of_peak_sustained_elapsed
                                                            icnlrx__bytes.sum.pct_of_peak_sustained_elapsed
...

You can also define a custom list of metrics to collect. To view the descriptions for all supported metrics, use the --ppu-metrics-list help option:

root@02892cb56ba5:~# asys profile --ppu-metrics-list help
Possible --ppu-metrics-list values are:

ce__cycles_active.avg
    Display Name:
        ce__cycles_active.avg
    Unit: cycle
    Description:
        # of cycles active on CE across CEs
...
kvd__transaction_hit_rate.pct
    Display Name:
        kvd__transaction_hit_rate.pct
    Unit: %
    Description:
        (%) hit rate of KVD cacheable requests
...

Use the --ppu-metrics-list option to specify a custom list of metrics, separated by commas. asys collects metrics specified with --ppu-metrics-list in addition to those from the set specified by --ppu-metrics-set. For example, --ppu-metrics-list ce__cycles_active.avg,kvd__transaction_hit_rate.pct collects metrics on CE utilization and KVD cache hit rate:

asys profile -t hggc --ppu-metrics-device all --ppu-metrics-set none --ppu-metrics-list ce__cycles_active.avg,kvd__transaction_hit_rate.pct python test_linear.py

When specifying a custom list with --ppu-metrics-list, ensure it does not exceed the device's sampling capacity. Use the --check-ppu-metrics-list option to validate a comma-separated list of metrics:

root@02892cb56ba5:~# asys profile --check-ppu-metrics-list ce__cycles_active.avg,kvd__transaction_hit_rate.pct,pu__we_average_warps_issue_stalled_compute_sfu_raw_per_issue_active.ratio
Check sampling metrics list result: PASS.
Metrics list is suitable for PPU sampling capacity.

Tips: asys might fail to collect device runtime metrics if another application is using the PPU profiling resources. This can happen for the following reasons:

  • Another asys application is already collecting device runtime metrics.

  • Another acu application is collecting trace data.

  • DCGM is collecting profiling metrics. Use dcgmi profile --pause to pause DCGM collection.

  • Use PPU-SMI to check if the PPU performance counter and the HGML GPM service are busy.

    • ppu-smi -q: Checks the status of the PPU performance counter.

    • ppu-smi gpm --get-sample-state: Checks if the HGML GPM service is enabled. When enabled, this service occupies the PPU performance counter.

    • Use ppu-smi gpm -s 0 to pause the HGML GPM service's output and release its lock on the PPU performance counter.

3. HGTX tracking

Asight Systems supports HGTX tracking for annotating timelines. This feature supports custom domains and the push/pop and start/end APIs. The following example shows how to use HGTX:

#include <nvtx3/nvToolsExt.h>

for (int index = 0; index < 1000; ++index) {
    nvtxRangePushA("Loop");
    nvtxRangePushA("DoProcess");
    DoProcess();
    nvtxRangePop();
    ...
    nvtxRangePop();
}

The code sequentially pushes two HGTX ranges: Loop and DoProcess. The innermost DoProcess() function calls several HGGC APIs. Use the following command to collect HGTX data:

asys profile -t hgtx -o test_report sample

The GUI displays the collected data as follows:

image

As the figure shows, the outer NVTX range is displayed in an upper row, and the inner NVTX range is displayed in a lower row. The Loop range contains the DoProcess range, which contains the timeline for the innermost runtime API calls. Asight Systems supports collecting and displaying user-specified colors:

image

4. OS Runtime tracing

OS Runtime tracing (OSRT) helps you investigate why a CPU thread is suspended, such as when it is waiting for a pthread_mutex_lock or sleeping. To collect OSRT data, add osrt to the -t trace option:

  • Use --osrt-threshold to set the collection threshold.

  • Use --osrt-backtrace-threshold to set the backtrace threshold for collecting call stacks.

For example:

asys profile -t osrt --osrt-backtrace-threshold 80000 python /test_script/ops/test_linear.py

The GUI displays the OSRT timeline:

image

5. CPU and thread activity tracking

Asight Systems collects data on how threads are scheduled across CPU cores. Use the --sample or -s option in asys to collect data about your application's execution on system CPUs. This feature also periodically collects CPU execution call stacks and aggregates the information to provide statistics on function execution time.

For example, to collect CPU execution information and specify the call stack sampling period:

asys profile -s process-tree -b dwarf --sample-period 2000000 python test_linear.py
  • -s process-tree: Collects CPU scheduling traces for the application's process tree.

  • -b dwarf: Enables collecting CPU execution call stacks. This is enabled by default and can be omitted.

  • --sample-period 2000000: Specifies the call stack sampling period for each CPU, measured in CPU cycles.

  • --sample-backtrace-depth: Specifies the call stack depth for CPU sampling. The default is 24.

Tips:

  • Enabling CPU execution sampling significantly increases the report size. The smaller the --sample-period, the greater the performance overhead on your application.

  • Due to operating system limitations, the actual sampling rate might be lower than specified by the --sample-period option.

  • When you specify a short sampling period with --sample-period, some sampling points might be dropped due to throughput limitations.

5.1 CPU activity

Requires one of the following options:

  • --sample process-tree: Collects the process tree.

  • --sample system-wide: Collects all processes on the system.

After you enable CPU sampling, you can view the CPU activity:

image

In the figure above, the CPU Group row shows overall CPU activity. Each node below it represents the workload on a specific core. A filled portion of the timeline indicates that the core was busy during that period, while a blank area indicates it was idle. Main process activity appears in dark blue, and child process activity appears in black. On the left, each CPU core node has a colored label that is also used in the thread rows. The timeline's tooltip shows which process and thread are currently executing on the CPU:

image

To jump to the corresponding thread row, right-click and select "Go to Thread Row" from the context menu:

image

Tip: CPU sampling uses a high rate, which increases the report file size. If you do not need CPU sampling data, pass -s none on the asys command line to disable it.

5.2 Thread scheduling

Requires one of the following options:

  • --sample process-tree: Collects the process tree.

  • --sample system-wide: Collects all processes on the system.

The thread timeline with CPU sampling enabled appears as follows:

image

Child nodes under a thread row show various API calls. The thread row itself shows the thread's execution on each CPU core and is divided into five sub-rows:

image

From top to bottom, these are:

  • CPU Utilization: Shows the thread's CPU resource usage.

  • CPU Core: Shows the core where the thread is scheduled. The color corresponds to the label color of the CPU core node.

  • Thread State: Shows one of three states:

    • runningimage

    • not scheduledimage

    • waitingimage

  • Calling OSRTimage

  • Backtrace Sample Point: A point in time where the call stack was sampled. The tooltip provides detailed call stack information.

Hover over an item for more details.

If CPU sampling is disabled but OSRT collection is enabled, Asight Systems estimates the thread state based on OSRT execution. Time spent in an OSRT call is considered idle, while time spent outside an OSRT call is considered busy, as shown in the following figure:

image

In this case, there are two possible thread states:

  • Possibly runningimage

  • Possibly waitingimage

If you only enable backtrace sampling, the thread row displays the sampling points:

image

You can view statistics on function execution time for your application in the Function View at the bottom of the GUI:

image

API call stack tracing

asys supports API call stack tracing for HGGC, OSRT, ACDNN, ACBLAS, CUDNN, CUBLAS, and other APIs. You can specify a runtime threshold to collect call stacks only for APIs that exceed this threshold and control the maximum backtrace depth. After you enable call stack tracing, you can view flame graphs, icicle graphs, and Top Down, Bottom Up, and Flat tables for function calls in the Function View of the GUI.

Collect HGGC call stacks

Use the following command to collect HGGC traces and call stack information:

asys profile -t hggc --hggcbacktrace all:1000 --hggc-backtrace-depth 24 python test_linear.py
  • -t hggc: Enables HGGC tracing.

  • --hggcbacktrace all:1000: Collects call stacks for all HGGC APIs with a runtime exceeding 1,000 nanoseconds (ns).

  • --hggc-backtrace-depth 24: Sets the maximum backtrace depth for the HGGC call stack to 24 frames.

You can hover over an event on the timeline to view its call stack:

image

Collect OSRT call stacks

Use the following command to collect OSRT traces and call stack information:

asys profile -t osrt --osrt-backtrace-threshold 80000 --osrt-backtrace-depth 24 python /test_script/ops/test_linear.py
  • -t osrt: Enables OSRT tracing.

  • --osrt-backtrace-threshold 80000: Collects call stacks for OSRT APIs with a runtime exceeding 80,000 nanoseconds (ns).

  • --osrt-backtrace-depth 24: Sets the maximum backtrace depth for the OSRT call stack to 24 frames.

The call stack is displayed as follows:

image

Collect ACDNN and ACBLAS call stacks

Use the following command to collect ACDNN and ACBLAS traces and call stack information:

asys profile -t acdnn,acblas --acompute-backtrace-threshold 80000 python /test_script/ops/test_linear.py
  • -t acdnn,acblas: Enables ACDNN and ACBLAS tracing.

  • --acompute-backtrace-threshold 80000: Collects call stacks for ACDNN and ACBLAS APIs with a runtime exceeding 80,000 nanoseconds (ns).

The call stack is displayed as follows:

image

7. Memory usage tracking

7.1 PPU memory usage

asys collects data on your application's device memory usage. It captures call stack information for memory allocations and deallocations, and aggregates this data to provide usage statistics. Enable this collection with the --hggc-memory-usage option. For example:

asys profile -t hggc --hggc-memory-usage true python test_linear.py

When memory usage tracking is enabled, Asight Systems displays PPU memory usage on the timeline, helping you analyze memory usage as shown in the following figure:

image

The Device memory usage row shows the PPU memory usage during program execution. Features include:

  • Correlation with HGGC APIs.

  • Support for call stacks.

  • Display of memory allocation and free events in the Events View.

If a PPU memory allocation fails, Asight Systems marks it with a small red dot in the Device memory usage row:

image

In the Device Memory View, you can view the Top Down, Bottom Up, and Flat tables.

Tips:

  • Use the --hggc-backtrace-depth option to control the call stack collection depth. The default depth is 24 frames. For example, --hggc-backtrace-depth 50 sets the maximum backtrace depth to 50 frames.

  • This feature does not collect device memory freed by the HGGC destructor when the process terminates.

7.2 Host memory usage

asys lets you periodically sample your application's CPU-side system memory usage. Use the --host-memory-sampling option to enable sampling and the --host-memory-sampling-frequency option to control the sampling frequency. For example:

asys profile -t hggc --host-memory-sampling true --host-memory-sampling-frequency 500 python test_linear.py

The sampled system memory usage data lets you view how each process's CPU-side memory usage changes over time in the Asight Systems GUI:

image

The view displays two types of memory usage:

  • Resident set size: The amount of physical memory in use.

  • Water mark: The peak physical memory usage during the collection period.

Tip: asys can collect system memory usage of the application's process tree, which includes the root process and its descendants. When system-wide tracing is enabled (-s system-wide), the host memory sampling feature is disabled.

7.3 Pinned memory usage

asys collects data on your application's pinned memory usage. It captures call stack information for pinned memory allocations and deallocations, and aggregates this data to provide usage statistics. When you enable both the --hggc-memory-usage and --host-memory-sampling options, pinned memory collection is enabled by default. For example:

asys profile -t hggc --hggc-memory-usage true --host-memory-sampling true python test_linear.py

The collected pinned memory data lets you view how pinned memory usage for each process changes over time in the Asight Systems GUI. You can also view aggregated usage summarized by API, as shown in the following figure:

image

The figure above shows how pinned memory usage changes over time. The tooltip provides details for each allocation or deallocation event, including its call stack. The Events View also displays pinned memory events. In the Host Pinned Memory View, you can view the Top Down, Bottom Up, and Flat tables.

Tips:

  • Use the --hggc-backtrace-depth option to control the call stack collection depth. The default depth is 24 frames. For example, --hggc-backtrace-depth 50 sets the maximum backtrace depth to 50 frames.

  • This feature does not collect pinned memory freed by the HGGC destructor when the process terminates.

Python tracing

Collect Python call stacks

Sample Python call stacks (Python sampling)

asys samples the call stacks of running Python scripts and displays the collected data—including function names, file names, and line numbers—in the Asight Systems GUI:

image

Use the --python-sampling option to enable periodic sampling of Python call stacks and the --python-sampling-frequency option to control the sampling frequency. For example:

asys profile --python-sampling true --python-sampling-frequency 1000 python launch.py
  • --python-sampling true: Enables periodic sampling of Python call stacks. The default is true.

  • --python-sampling-frequency 1000: Sets the sampling frequency. The valid range is 1 Hz to 1 kHz. The default is 500 samples per second (500 Hz).

  • --python-backtrace-depth: Specifies the call stack depth for Python sampling. The default is 24.

Collect Python call stacks for events (Python backtrace)

When tracing specific events, asys captures the current Python call stack and combines it with the C call stack to display the complete call chain.

image

image

Use --python-backtrace=hggc to enable this feature and --python-backtrace-depth to control the call stack depth. The following trace items are currently supported for Python backtrace:

  • hggc

    For example:

    asys profile --python-backtrace=hggc python launch.py
    
  • device memory / pinned memory

    For example:

    asys profile --hggc-memory-usage=true --host-memory-sampling=true --python-backtrace=hggc python launch.py
    

Note:

  • asys Python call stack collection currently supports Python versions 3.8 to 3.12.

  • Python call stack collection is not supported for applications launched with an aliased Python interpreter (any name other than python or python3).

Trace Python functions (Python functions trace)

asys traces Python function execution without modifying the source code and displays the collected information as HGTX ranges:

image

Use the --python-functions-trace option to specify which functions to trace. The following modes are available:

Value

Description

none

Default. Do not collect data.

all

Collects all functions in the Python application.

module:<module_name>

Collects all functions in the specified module. You can specify a parent module. Separate multiple modules with commas (,). For example: module:torch,threading

<json_file>

Collects data for the functions specified in the JSON file.

Use the --python-functions-threshold option to set a runtime threshold, in nanoseconds (ns), for tracing Python functions. The default is 80,000 ns. You can specify functions in a JSON file in the following three ways:

  • Specify only the module. By default, asys collects all functions in that module. The module can be a parent module. For example, if you specify torch, asys collects all functions under torch.nn.

    [
      {    
        "module": "torch.nn.functional"
      },
      {
        "module": "threading"
      }
    ]
  • Specify a list of function names within a specific module. You must provide the fully qualified module name. You can also define a custom domain. The default domain is 'Python Hgtx'.

    [
      {    
        "module": "torch.nn.functional",
        "domain": "Torch Domain",
        "functions": ["sigmoid","log_softmax"]
      }
    ]
  • Override attributes for specific functions within the functions list. If a function object specifies a module, it overrides the parent module. If it specifies a domain, asys displays the function in multiple domains.

    [
      {    
        "module": "torch.nn.functional",
        "domain": "Parent Domain",
        "functions": ["sigmoid", {"function": "Adadelta.step", "module": "torch.optim.adadelta", "domain": "Child Domain"}]
      }
    ]

You can combine the preceding JSON specification methods. If there are conflicting rules, the last specified rule takes precedence.

For example, to trace all functions within the torch module and set the runtime threshold to 1000 ns:

asys profile --python-functions-trace module:torch --python-functions-threshold 1000 python xx.py

Note:

  • asys Python function trace supports Python 3.8 and later.

  • In multi-threaded scenarios, a delay can occur between the creation of a child thread and when asys begins to trace it.

  • Specifying functions within the __main__ module is not supported.

  • Function tracing may be inaccurate before and after an application forks.

9. PCCL activity tracking

asys collects PCCL activity events for you to view. Enable collection by including pccl in the -t option. For example:

asys profile -t pccl hggc python test_pccl.py

The timeline is shown below:

image

The PCCL timeline is categorized first by channel, and then by pipeline within each channel.

10. Tracking RDMA network metrics

asys periodically collects performance metrics from RDMA network cards, such as bytes sent and received, average packet size, and congestion control information. The Asight Systems GUI visualizes how these metrics change over time:

image

The following metrics are displayed:

  • Network receive rate

  • Network send rate

  • Network receive packet size

  • Network send packet size

  • Network receive CNP rate

  • Network send CNP rate

  • Send wait

When you select a time range, the tooltip displays the average network transfer rate for that period, as shown in the following figure:

image

Use the --nic-metrics option to enable performance metric collection for network interfaces. asys then collects data from all network interfaces and displays the active ones in the GUI. For example:

asys profile --nic-metrics true ./all_reduce_perf
  • --nic-metrics true: Enables performance metric collection for network interfaces.

Use the --nic-device-include option to filter network interfaces by name using a comma-separated list of regular expressions. asys collects metrics for any interface whose name matches one of the expressions. For example:

asys profile --nic-metrics true --nic-device-include "bond" ./all_reduce_perf
  • --nic-device-include "bond": Collects metrics for network interfaces whose names contain "bond".

asys profile --nic-metrics true --nic-device-include "bond,eth" ./all_reduce_perf
  • --nic-device-include "bond,eth": Collects metrics for network interfaces whose names contain either "bond" or "eth".

Use the --nic-metrics-frequency option to set the sampling frequency. The range is 1 Hz to 100 kHz, and the default is 1 kHz.

asys profile --nic-metrics true --nic-metrics-frequency 10000 ./all_reduce_perf

Note: Due to RDMA driver limitations, the driver may cap the actual sampling frequency below the configured value. If the specified frequency exceeds the driver's maximum capability, asys collects data at the highest frequency the driver supports.