gobhardw/swdev 479013 (#1014)
* test pr for ROCm sdk tests
* SWDEV-479013 doc updates
[ROCm/rocprofiler-sdk commit: 5bec9f66b6]
This commit is contained in:
@@ -4,7 +4,7 @@ For the buffered approach, supported buffer record categories are enumerated in
|
||||
|
||||
## Overview
|
||||
|
||||
In buffered approach, callbacks are receieved for batches of records from an internal (background) thread.
|
||||
In buffered approach, callbacks are received for batches of records from an internal (background) thread.
|
||||
Supported buffered tracing services are enumerated in `rocprofiler_buffer_tracing_kind_t`. Configuring
|
||||
a buffer tracing service requires the creation of a buffer. When the buffer is "flushed", either implicitly
|
||||
or explicitly, a callback to the tool will be invoked which provides an array of one or more buffer records.
|
||||
|
||||
@@ -273,14 +273,14 @@ Sample Output:
|
||||
2: rocprofiler_dim3_t dimBlocks = {z=1, y=32, x=32}
|
||||
3: void** args = 0x7ffe6d8dd3c0
|
||||
4: unsigned long sharedMemBytes = 0
|
||||
5: ihipStream_t* stream = 0x17b40c0
|
||||
5: hipStream_t* stream = 0x17b40c0
|
||||
|
||||
[HIP_RUNTIME_API] hipMemcpyAsync
|
||||
0: void* dst = 0x7f06c7bbb010
|
||||
1: void const* src = 0x7f0698800000
|
||||
2: unsigned long sizeBytes = 393625600
|
||||
3: hipMemcpyKind kind = DeviceToHost
|
||||
4: ihipStream_t* stream = 0x25dfcf0
|
||||
4: hipStream_t* stream = 0x25dfcf0
|
||||
```
|
||||
|
||||
## Code Object Tracing
|
||||
@@ -334,4 +334,4 @@ any/all buffers which might contain references to that code object or kernel sym
|
||||
deleting the associated data.
|
||||
|
||||
For a sample of code object tracing, please see the `samples/code_object_tracing` example in the
|
||||
[rocprofiler-sdk GitHub repository](https://github.com/ROCm/rocproifler-sdk).
|
||||
[rocprofiler-sdk GitHub repository](https://github.com/ROCm/rocprofiler-sdk).
|
||||
|
||||
@@ -128,7 +128,7 @@ rocprofiler_counter_id_t is a handle to a counter. The information about the cou
|
||||
for(auto& counter : gpu_counters)
|
||||
{
|
||||
// Contains name and other attributes about the counter.
|
||||
// See API documenation for more info on the contents of this struct.
|
||||
// See API documentation for more info on the contents of this struct.
|
||||
rocprofiler_counter_info_v0_t version;
|
||||
ROCPROFILER_CALL(
|
||||
rocprofiler_query_counter_info(
|
||||
@@ -150,6 +150,7 @@ After you have identified a set of counters you wish to collect, a profile can b
|
||||
The created profile can in turn be used for both dispatch and agent counter collection services.
|
||||
|
||||
##### Special Notes On Profile Behavior
|
||||
|
||||
- Profile created is *only valid* for the agent it was created for.
|
||||
- Profiles are immutable. If a new counter set is desired to be collected, construct a new profile.
|
||||
- A single profile can be used multiple times on the same agent.
|
||||
@@ -234,18 +235,18 @@ counter_name: # Counter name
|
||||
gfx90a: # Architecture name
|
||||
block: # Block information (SQ/etc)
|
||||
event: # Event ID (used by AQLProfile to identify counter register)
|
||||
expression: # Formula for the counter (if derrived counter)
|
||||
expression: # Formula for the counter (if derived counter)
|
||||
description: # Per-arch description (optional)
|
||||
gfx1010:
|
||||
...
|
||||
description: # Description of the counter
|
||||
```
|
||||
|
||||
Architectures can be separately defined with their own definitions (i.e. gfx90a and gfx1010 in the above example). If two or more architectures share the same block/event/expression definition, they can be "/" delimited on a single line (i.e. "gfx90a/gfx1010:"). Hardware metrics have the elements block, event, and description defined. Derrived metrics have the element expression defined (and cannot have block or event defined).
|
||||
Architectures can be separately defined with their own definitions (i.e. gfx90a and gfx1010 in the above example). If two or more architectures share the same block/event/expression definition, they can be "/" delimited on a single line (i.e. "gfx90a/gfx1010:"). Hardware metrics have the elements block, event, and description defined. Derived metrics have the element expression defined (and cannot have block or event defined).
|
||||
|
||||
## Derived Metrics
|
||||
|
||||
Derrived metrics allow for computations (via expressions) to be performed on collected hardware metrics with the result returned as it it were a real hardware counter.
|
||||
Derived metrics allow for computations (via expressions) to be performed on collected hardware metrics with the result returned as it it were a real hardware counter.
|
||||
|
||||
```yaml
|
||||
GPU_UTIL:
|
||||
@@ -255,7 +256,7 @@ GPU_UTIL:
|
||||
description: Percentage of the time that GUI is active
|
||||
```
|
||||
|
||||
GPU_UTIL is an example of a derrived metric which takes the values of two GRBM hardware counters (GRBM_GUI_ACTIVE and GRBM_COUNT) and uses a mathematic expression to calculate the utilization rate of the GPU. Expressions support the standard set of math operators (/,*,-,+) along with a set of special functions (reduce and accumulate).
|
||||
GPU_UTIL is an example of a derived metric which takes the values of two GRBM hardware counters (GRBM_GUI_ACTIVE and GRBM_COUNT) and uses a mathematic expression to calculate the utilization rate of the GPU. Expressions support the standard set of math operators (/,*,-,+) along with a set of special functions (reduce and accumulate).
|
||||
|
||||
### Reduce Function
|
||||
|
||||
@@ -266,16 +267,20 @@ expression: 100*reduce(GL2C_HIT,sum)/(reduce(GL2C_HIT,sum)+reduce(GL2C_MISS,sum)
|
||||
Reduce() reduces counter values across all dimensions (shader engine, SIMD, etc) to produce a single output value. This is useful when you want to collect and compare values across the entire device. There are a number of reduction operations that can be perfomed: sum, average (avr), minimum value (selects minimum value across all dimensions, min), and max (selects the maximum value across all dimensions). For example reduce(GL2C_HIT,sum) sums all GL2C_HIT hardware register values together to return a single output value.
|
||||
|
||||
### Accumulate Function
|
||||
|
||||
```yaml
|
||||
expression: accumulate(<basic_level_counter>, <resolution>)
|
||||
```
|
||||
|
||||
#### Description
|
||||
|
||||
- The accumulate metric is used to sum the values of a basic level counter over a specified number of cycles. By setting the resolution parameter, you can control the frequency of the summing operation:
|
||||
- HIGH_RES: Sums up the basic counter every clock cycle. Captures the value every single cycle for higher accuracy, suitable for fine-grained analysis.
|
||||
- LOW_RES: Sums up the basic counter every four clock cycles. Reduces the data points and provides less detailed summing, useful for reducing data volume.
|
||||
- NONE: Does nothing and is equivalent to collecting basic_level_counter. Outputs the value of the basic counter without any summing operation.
|
||||
- HIGH_RES: Sums up the basic counter every clock cycle. Captures the value every single cycle for higher accuracy, suitable for fine-grained analysis.
|
||||
- LOW_RES: Sums up the basic counter every four clock cycles. Reduces the data points and provides less detailed summing, useful for reducing data volume.
|
||||
- NONE: Does nothing and is equivalent to collecting basic_level_counter. Outputs the value of the basic counter without any summing operation.
|
||||
|
||||
#### Usage
|
||||
|
||||
```yaml
|
||||
MeanOccupancyPerCU:
|
||||
architectures:
|
||||
@@ -283,5 +288,7 @@ MeanOccupancyPerCU:
|
||||
expression: accumulate(SQ_LEVEL_WAVES,HIGH_RES)/reduce(GRBM_GUI_ACTIVE,max)/CU_NUM
|
||||
description: Mean occupancy per compute unit.
|
||||
```
|
||||
<metric name="MeanOccupancyPerCU" expr=accumulate(SQ_LEVEL_WAVES,HIGH_RES)/reduce(GRBM_GUI_ACTIVE,max)/CU_NUM descr="Mean occupancy per compute unit."></metric>
|
||||
|
||||
<metric name="MeanOccupancyPerCU" expr=accumulate(SQ_LEVEL_WAVES,HIGH_RES)/reduce(GRBM_GUI_ACTIVE,max)/CU_NUM descr="Mean occupancy per compute unit."></metric>
|
||||
|
||||
- MeanOccupancyPerCU: This metric calculates the mean occupancy per compute unit. It uses the accumulate function with HIGH_RES to sum the SQ_LEVEL_WAVES counter at every clock cycle. This sum is then divided by GRBM_GUI_ACTIVE and the number of compute units (CU_NUM) to derive the mean occupancy.
|
||||
|
||||
@@ -65,7 +65,7 @@ get_dispatch_table()
|
||||
} // namespace impl
|
||||
```
|
||||
|
||||
### Implementaiton of public C API function
|
||||
### Implementation of public C API function
|
||||
|
||||
```cpp
|
||||
extern "C"
|
||||
|
||||
@@ -5,10 +5,10 @@ PC Sampling is a profiling method that uses statistical approximation of the ker
|
||||
**Note**: The PC sampling feature is still under development and may not be completely stable.
|
||||
|
||||
**Risk Acknowledgment**:
|
||||
|
||||
- By activating this feature through `ROCPROFILER_PC_SAMPLING_BETA_ENABLED` environment variable, you acknowledge and accept the following potential risks:
|
||||
|
||||
- **Hardware Freeze**: This beta feature could cause your hardware to freeze unexpectedly.
|
||||
- **Need for Cold Restart**: In the event of a hardware freeze, you may need to perform a cold restart (turning the hardware off and on) to restore normal operations.
|
||||
|
||||
|
||||
By activating this feature through `ROCPROFILER_PC_SAMPLING_BETA_ENABLED` environment variable, you acknowledge and accept the following potential risks:
|
||||
|
||||
- **Hardware Freeze**: This beta feature could cause your hardware to freeze unexpectedly.
|
||||
- **Need for Cold Restart**: In the event of a hardware freeze, you may need to perform a cold restart (turning the hardware off and on) to restore normal operations.
|
||||
|
||||
Please use this beta feature cautiously. It may affect your system's stability and performance. Proceed at your own risk.
|
||||
|
||||
@@ -9,6 +9,7 @@ The ROCm runtimes are designed to directly communicate with a helper library nam
|
||||
## Tool library design
|
||||
|
||||
When ROCprofiler-SDK detects `rocprofiler_configure` in a tool's symbol table, ROCprofiler-SDK invokes `rocprofiler-configure` with parameters such as ROCprofiler-SDK version that invokes the function, number of tools already invoked, and a unique identifier for the tool. The tool returns a pointer to a `rocprofiler_tool_configure_result_t` struct, which, if non-null, provides ROCprofiler-SDK with:
|
||||
|
||||
- Function to be called for tool initialization, which is also the opportunity for context creation.
|
||||
- Function to be called when ROCprofiler-SDK is finalized.
|
||||
- A pointer to data to be provided to the tool when ROCprofiler-SDK calls the initialization and finalization functions.
|
||||
|
||||
Reference in New Issue
Block a user