Project
Loading...
Searching...
No Matches
LaunchGeometry.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
17
18#ifndef ITSTRACKINGGPU_LAUNCHGEOMETRY_H_
19#define ITSTRACKINGGPU_LAUNCHGEOMETRY_H_
20
21namespace o2::its::gpu
22{
23
24#if defined(GPUCA_GPUTYPE_VEGA) // gfx906: MI50, Radeon VII
25constexpr int ComputeUnits = 60;
26constexpr int WarpSize = 64;
27#elif defined(GPUCA_GPUTYPE_MI100) // gfx908
28constexpr int ComputeUnits = 120;
29constexpr int WarpSize = 64;
30#elif defined(GPUCA_GPUTYPE_MI210) // gfx90a
31constexpr int ComputeUnits = 104;
32constexpr int WarpSize = 64;
33#elif defined(GPUCA_GPUTYPE_MI300) // gfx942: MI300X (MI300A has 228)
34constexpr int ComputeUnits = 304;
35constexpr int WarpSize = 64;
36#elif defined(GPUCA_GPUTYPE_RDNA) // gfx10xx/11xx consumer parts, wave32
37constexpr int ComputeUnits = 60;
38constexpr int WarpSize = 32;
39#elif defined(GPUCA_GPUTYPE_BLACKWELL) // sm_120: RTX 5080
40constexpr int ComputeUnits = 84;
41constexpr int WarpSize = 32;
42#elif defined(GPUCA_GPUTYPE_HOPPER) // sm_90: H100
43constexpr int ComputeUnits = 132;
44constexpr int WarpSize = 32;
45#elif defined(GPUCA_GPUTYPE_ADA) // sm_89: RTX 4090
46constexpr int ComputeUnits = 128;
47constexpr int WarpSize = 32;
48#elif defined(GPUCA_GPUTYPE_AMPERE) // sm_80/86: A100 has 108, RTX 3090 has 82
49constexpr int ComputeUnits = 108;
50constexpr int WarpSize = 32;
51#elif defined(GPUCA_GPUTYPE_TURING) // sm_75: RTX 2080 Ti
52constexpr int ComputeUnits = 68;
53constexpr int WarpSize = 32;
54#else
55// this is the fallback as we had it before
56constexpr int ComputeUnits = 60;
57constexpr int WarpSize = 64;
58#endif
59
60constexpr int GPUThreads = 256;
62constexpr int MaxBlocksPerComputeUnit = 10;
63
99
101constexpr KernelOccupancy uniformOccupancy(int minBlocks)
102{
103 return {.computeLayerTracklets = minBlocks,
104 .computeLayerCells = minBlocks,
105 .computeLayerCellNeighbours = minBlocks,
106 .processNeighboursCellSeed = minBlocks,
107 .processNeighboursTrackSeed = minBlocks,
108 .fitTrackSeeds = minBlocks,
109 .fitTrackSeedsExtended = minBlocks,
110 .compileLookupTable = minBlocks};
111}
112
113#if defined(GPUCA_GPUTYPE_VEGA) // gfx906: MI50, Radeon VII
114
116constexpr KernelOccupancy MinBlocks{
118 .computeLayerCells = 3,
119 .computeLayerCellNeighbours = 3,
120 .processNeighboursCellSeed = 3,
121 .processNeighboursTrackSeed = 3,
122 .fitTrackSeeds = 4,
123 .fitTrackSeedsExtended = 3, // untested: the follower is compiled out of every default iteration
124 .compileLookupTable = 1,
125};
126
128constexpr KernelOccupancy ResidentBlocks{
129 .computeLayerTracklets = 4, // 56 VGPR
130 .computeLayerCells = 3, // 84 VGPR
131 .computeLayerCellNeighbours = 3, // 84 VGPR
132 .processNeighboursCellSeed = 3, // 84 VGPR
133 .processNeighboursTrackSeed = 3, // 84 VGPR
134 .fitTrackSeeds = 4, // 64 VGPR
135 .fitTrackSeedsExtended = 3, // 84 VGPR
136 .compileLookupTable = 4, // 8 VGPR,
137};
138
139#elif defined(__HIPCC__) || defined(__HIP_PLATFORM_AMD__)
141constexpr KernelOccupancy MinBlocks = uniformOccupancy(3);
143#else
147#endif
148
150constexpr int gridBlocks(int residentBlocksPerComputeUnit)
151{
152 return ComputeUnits * residentBlocksPerComputeUnit;
153}
154
156constexpr int gridThreads(int residentBlocksPerComputeUnit)
157{
158 return gridBlocks(residentBlocksPerComputeUnit) * GPUThreads;
159}
160
161static_assert(MinBlocks.min() >= 1,
162 "an occupancy floor below one resident block is meaningless");
163
164static_assert(MinBlocks.max() <= MaxBlocksPerComputeUnit,
165 "the occupancy floor cannot exceed the blocks a CU can hold");
166
167static_assert(ResidentBlocks.min() >= 1,
168 "every kernel must have at least one resident block per CU");
169
171 "resident blocks per CU cannot exceed what a CU can hold");
172
185
186static_assert(residentCoversFloor(), "a kernel's grid is narrower than the occupancy its __launch_bounds__ floor demands");
187
188static_assert(GPUThreads % WarpSize == 0, "block size must be a whole number of warps/waves");
189
190static_assert(ComputeUnits > 0 && GPUThreads > 0 && DefaultBlocksPerComputeUnit > 0, "degenerate launch geometry");
191
192} // namespace o2::its::gpu
193
194#endif // ITSTRACKINGGPU_LAUNCHGEOMETRY_H_
uint32_t c
Definition RawData.h:2
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
constexpr int MaxBlocksPerComputeUnit
constexpr KernelOccupancy MinBlocks
NVIDIA: unmeasured.
constexpr KernelOccupancy uniformOccupancy(int minBlocks)
Use the same occupancy floor for every kernel when no per-kernel measurements are available.
constexpr bool residentCoversFloor()
The grid must provide at least as many blocks per CU as the corresponding occupancy floor.
constexpr KernelOccupancy ResidentBlocks
constexpr int WarpSize
constexpr int DefaultBlocksPerComputeUnit
constexpr int gridThreads(int residentBlocksPerComputeUnit)
Number of threads covered by a grid whose depth is residentBlocksPerComputeUnit blocks per CU.
constexpr int gridBlocks(int residentBlocksPerComputeUnit)
Number of blocks in a grid whose depth is residentBlocksPerComputeUnit blocks per CU.
constexpr int ComputeUnits
constexpr int GPUThreads
Minimum resident blocks per compute unit to request when no per-kernel measurement exists.
constexpr int max() const
Return the largest occupancy value in the table.
constexpr int min() const
Return the smallest occupancy value in the table.