Skip to content

Commit 0f04055

Browse files
Matt WilliamsMatt Williams
authored andcommitted
Review comments
1 parent 6827640 commit 0f04055

File tree

5 files changed

+118
-9
lines changed

5 files changed

+118
-9
lines changed

docs/reference/glossary.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
.. meta::
2+
:description: Defined concepts commonly used in AQLprofile
3+
:keywords: AQLprofile, ROCm
4+
5+
AQLprofile glossary
6+
===================
7+
8+
Learn the definitions of concepts commonly used in AQLprofile.
9+
10+
Agents
11+
------
12+
13+
Agents represent computational devices (CPUs, GPUs) in the Heterogeneous
14+
System Architecture (HSA) runtime. In AQLprofile, agents are discovered
15+
via HSA APIs and encapsulated in the ``AgentInfo`` structure. Each agent
16+
contains metadata including device type, name, compute unit count, and
17+
memory pools.
18+
19+
Agents are enumerated using HSA API ``hsa_iterate_agents``, and their
20+
properties are queried via another HSA API, ``hsa_agent_get_info``.
21+
Agents are used to target specific GPUs for profiling, and to allocate
22+
resources such as command buffers and memory pools.
23+
24+
Counters and events
25+
-------------------
26+
27+
Performance counters are special circuits on the hardware that count
28+
specific GPU events (for example, cycles, instructions, cache hits). Events
29+
specify which counters to collect, identified by block name, block
30+
index, and counter ID.
31+
32+
- Events are described using ``hsa_ven_amd_aqlprofile_event_t``
33+
structures.
34+
- Events are grouped into profiles and collected during profiling
35+
sessions.
36+
37+
.. code:: cpp
38+
39+
const hsa_ven_amd_aqlprofile_event_t events_arr1[] = {
40+
{HSA_VEN_AMD_AQLPROFILE_BLOCK_NAME_SQ, 0, 2 /*CYCLES*/},
41+
{HSA_VEN_AMD_AQLPROFILE_BLOCK_NAME_SQ, 0, 3 /*BUSY_CYCLES*/},
42+
// ...
43+
};
44+
45+
Counter blocks
46+
--------------
47+
48+
Counter blocks correspond to hardware units on the GPU (for example, SQ, TCC,
49+
TCP). Each block exposes a set of counters/events.
50+
51+
- Block names (for example, ``HSA_VEN_AMD_AQLPROFILE_BLOCK_NAME_SQ``) map to
52+
specific hardware blocks.
53+
- Events specify both the block and the counter within that block.
54+
55+
Command buffers
56+
---------------
57+
58+
Command buffers are memory regions that store AQL packets and PM4
59+
commands, which control GPU profiling operations. They're allocated per
60+
agent, and must meet alignment and size requirements dictated by the
61+
hardware.
62+
63+
Command packets
64+
---------------
65+
66+
Command packets are AQL or PM4 packets that encode profiling commands
67+
for the GPU. They're constructed and written into command buffers.
68+
69+
They're built using AQLprofile APIs or helper functions and submitted to
70+
the GPU via HSA queues.
71+
72+
.. code:: cpp
73+
74+
bool Queue::Submit(hsa_ext_amd_aql_pm4_packet_t* packet) {
75+
// Write packet to queue and signal doorbell
76+
}
77+
78+
Output buffer
79+
-------------
80+
81+
Output buffers are memory regions that store outputs such as counter
82+
values and thread trace tokens. They're allocated using HSA memory pools
83+
associated with the agent.
84+
85+
Profile object
86+
--------------
87+
88+
The profile object encapsulates all information required to perform a
89+
profiling session. It's represented by the
90+
``hsa_ven_amd_aqlprofile_profile_t`` struct, which includes the agent,
91+
event type, list of events, command buffer, and additional parameters.
92+
93+
Profile objects are constructed by specifying the agent, event type
94+
(PMC, SQTT), events to collect, and associated buffers. They're passed
95+
to AQLprofile APIs to start, stop, and read profiling data.
96+
97+
.. code:: cpp
98+
99+
hsa_ven_amd_aqlprofile_profile_t *profile =
100+
new hsa_ven_amd_aqlprofile_profile_t{
101+
agent_info->dev_id,
102+
HSA_VEN_AMD_AQLPROFILE_EVENT_TYPE_PMC,
103+
events,
104+
num_events,
105+
NULL,
106+
0,
107+
0,
108+
0};
109+

docs/reference/supported-architectures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ across multiple architectures.
1010

1111
.. note::
1212

13-
The GFX versions (GFX9, GFX10, GFX11, GFX12) refer to the architecture families of the hardware for that version.
13+
The GFX versions (GFX9XX, GFX10XX, GFX11XX, GFX12XX) refer to the architecture families of the hardware for that version. See `System requirements (Linux) <https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html>`__ for more info.
1414

1515
Here's a summary of the counter blocks supported for each architecture:
1616

projects/aqlprofile/docs/reference/glossary.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.. meta::
2-
:description: Defined terms commonly used in AQLprofile
2+
:description: Defined concepts commonly used in AQLprofile
33
:keywords: AQLprofile, ROCm
44

5-
AQLprofile terms
6-
================
5+
AQLprofile glossary
6+
===================
77

8-
Learn the definitions of terms commonly used in AQLprofile.
8+
Learn the definitions of concepts commonly used in AQLprofile.
99

1010
Agents
1111
------

projects/aqlprofile/docs/sphinx/_toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ subtrees:
2121

2222
- caption: Reference
2323
entries:
24-
- file: reference/terms.rst
25-
title: Terms
24+
- file: reference/glossary.rst
25+
title: Glossary
2626
- file: reference/supported-architectures.rst
2727
title: Supported architectures and counter blocks
2828
- file: reference/api-list.rst

projects/aqlprofile/docs/sphinx/_toc.yml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ subtrees:
2121

2222
- caption: Reference
2323
entries:
24-
- file: reference/terms.rst
25-
title: Terms
24+
- file: reference/glossary.rst
25+
title: Glossary
2626
- file: reference/supported-architectures.rst
2727
title: Supported architectures and counter blocks
2828
- file: reference/api-list.rst

0 commit comments

Comments
 (0)