Skip to content

Commit 58e396e

Browse files
committed
Add cdna4 stats
1 parent f62d1c6 commit 58e396e

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

docs/amdgpu_kernel_optimization_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ For `ds_read_b128`, the access happens in four phases of 16 threads each:
337337
> to avoid bank conflicts when accessing LDS in a > column-wise fashion, as with MFMA instructions.
338338
> Instead, prefer XOR-based swizzling as described [here](https://rocm.blogs.amd.com/software-tools-optimization/lds-bank-conflict/README.html)
339339
340-
For empirically discovered LDS latency tables and phase-groups on MI300X, RX 9070
340+
For empirically discovered LDS latency tables and phase-groups on MI300X, MI350X, RX 9070
341341
XT, and W7900, see the
342342
[empirical LDS measurements](./empirical-lds/lds_summary.md).
343343

docs/empirical-lds/cdna4info.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CDNA4 MI350X LDS Measurements
2+
3+
Measurements were collected on MI350X (`gfx950`), which has a wavefront size of
4+
64 threads. The LDS bank count was measured to be 64. With 4-byte banks, the
5+
bank mapping repeats every 256 bytes, so an access stride of 256 bytes causes
6+
the maximum possible number of bank conflicts.
7+
8+
The captured bank-count sweep in this note covers `ds_read_b64`. No usable
9+
normalized rocprof bank-conflict counter values were recorded for this capture,
10+
so the table uses benchmark timer values. Latencies are average active-thread
11+
timer values from `clock64()`, reported in cycles, and were collected using the
12+
macro payload with 64 `ds_read` instructions. Phase groups are discovered by
13+
comparing pairwise latencies of threads mapping to the same bank. Threads in the
14+
same access phase experience bank conflicts.
15+
16+
## ds_read_b32 Phase Group
17+
18+
For `ds_read_b32`, the access happens in a single phase: T0-T63.
19+
20+
## ds_read_b64 Latencies
21+
22+
| stride (bytes) | avg thread latency (cycles) |
23+
| -------------- | --------------------------- |
24+
| 8 | 583.353 |
25+
| 16 | 819.207 |
26+
| 32 | 1490.275 |
27+
| 64 | 2758.733 |
28+
| 128 | 5089.500 |
29+
| 256 | 10024.566 |
30+
| 512 | 10014.062 |
31+
32+
For `ds_read_b64`, the access happens in two phases of 32 lanes each: T0-T31,
33+
then T32-T63. The high-latency bucket starts at the 256-byte stride and remains
34+
saturated for the 512-byte stride.
35+
36+
## ds_read_b128 Phase Groups
37+
38+
For `ds_read_b128`, the access happens in four phases of 16 lanes each.
39+
40+
1. T0-T3, T12-T15, T20-T23, T24-T27
41+
2. T32-T35, T44-T47, T52-T55, T56-T59
42+
3. T4-T7, T8-T11, T16-T19, T28-T31
43+
4. T36-T39, T40-T43, T48-T51, T60-T63
44+
45+
## Summary
46+
47+
On MI350X, the recorded `ds_read_b64` sweep supports a 64-bank, 4-byte bank
48+
model: the latency pattern saturates at 256-byte stride, and larger strides stay
49+
in the same high-latency bucket.
50+
51+
| access width | phase count | lanes per phase | most likely bank count |
52+
| ------------ | ----------- | --------------- | ---------------------- |
53+
| 32-bit | 1 | 64 | 64 |
54+
| 64-bit | 2 | 32 | 64 |
55+
| 128-bit | 4 | 16 | 64 |
56+
57+
The profiler classified the recorded sweep using average thread latency. The
58+
CDNA4 phase groups above follow the 64-bank MI350 LDS behavior: a 32-bit read
59+
can cover the whole 64-lane wave in one phase, while 64- and 128-bit reads split
60+
the wave into two and four phases respectively.

0 commit comments

Comments
 (0)