-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.tex
More file actions
347 lines (270 loc) · 10.3 KB
/
Copy pathinstall.tex
File metadata and controls
347 lines (270 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
\documentclass[
kokkoshighlight,
% print,
]{./cheat_sheet_kokkos}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{adjustbox}
% document properties
\title{Installation cheat sheet for Kokkos}
\author{CExA}
\date{\today}
\begin{document}
\maketitle
\begin{multicols}{2}
\section{Requirements}
\subsection{Compiler}
\begin{tblr}[theme=kokkostable]{Xll}
Compiler & Minimum version & Notes \\
ARM Clang & 20.1 & \\
Clang & 15.0.0 & For CUDA \\
Clang & 14.0.0 & For CPU \\
GCC & 10.4.0 & \\
Intel LLVM & 2024.2.1 & For SYCL \\
Intel LLVM & 2022.0.0 & For CPU \\
MSVC & 19.30 & \\
NVCC & 12.2 & \\
NVHPC & 22.3 & \\
ROCM & 6.2.0 & \\
\end{tblr}
\subsection{Build system}
\begin{tblr}[theme=kokkostable]{llX}
Build system & Min. vers. & Notes \\
CMake & 3.25.2 & For Intel LLVM full support and CUDA CMake language support \\
CMake & 3.22 & \\
\end{tblr}
\section{How to integrate Kokkos}
\subsection{As an external dependency}
\subsubsection{Configure, build and install Kokkos}
\begin{minted}{sh}
git clone -b x.y.z "https://github.com/kokkos/kokkos.git"
cd kokkos
cmake -B build \
-DCMAKE_CXX_COMPILER="<your C++ compiler>" \
-DCMAKE_INSTALL_PREFIX="path/to/kokkos/install" \
"<Kokkos compile options>"
cmake --build build
cmake --install build
\end{minted}
\subsubsection{Install Kokkos with Spack}
\begin{minted}{sh}
spack install kokkos@x.y.z "<Kokkos variants>"
\end{minted}
See \url{https://packages.spack.io} or \mintinline{text}{spack info kokkos} to list variants.
\subsubsection{Setup, and configure your code}
\begin{minted}{cmake}
find_package(Kokkos x.y.z REQUIRED)
target_link_libraries(
my-app
Kokkos::kokkos
)
\end{minted}
\begin{minted}{sh}
cd "path/to/your/code"
cmake -B build \
-DCMAKE_CXX_COMPILER="<your C++ compiler>" \
-DKokkos_ROOT="path/to/kokkos/install"
\end{minted}
\subsection{As an internal dependency}
\subsubsection{Setup with a Git submodule}
\begin{minted}{sh}
git submodule add -b x.y.z "https://github.com/kokkos/kokkos.git" tpls/kokkos
\end{minted}
\begin{minted}{cmake}
add_subdirectory(path/to/kokkos)
target_link_libraries(
my-app
Kokkos::kokkos
)
\end{minted}
\subsubsection{Setup with FetchContent}
\begin{minted}[breakafter=/]{cmake}
include(FetchContent)
FetchContent_Declare(
kokkos
URL https://github.com/kokkos/kokkos/releases/download/x.y.z/kokkos-x.y.z.tar.gz
URL_HASH SHA256=<hash for x.y.z archive>
)
FetchContent_MakeAvailable(kokkos)
target_link_libraries(
my-app
Kokkos::kokkos
)
\end{minted}
\subsubsection{Configure your code}
\begin{minted}{sh}
cmake -B build \
-DCMAKE_CXX_COMPILER="<your C++ compiler>" \
"<Kokkos compile options>"
\end{minted}
You may combine the external/internal dependency approaches.
\section{Kokkos compile options}
\subsection{Host backends}
\begin{tblr}[theme=kokkostable]{Xl}
Option & Backend \\
\mintinline{text}{-DKokkos_ENABLE_SERIAL=ON} & Serial \\
\mintinline{text}{-DKokkos_ENABLE_OPENMP=ON} & OpenMP \\
\mintinline{text}{-DKokkos_ENABLE_THREADS=ON} & Threads \\
\end{tblr}
The serial backend is enabled by default if no other host backend is enabled.
\subsection{Device backends}
\begin{tblr}[theme=kokkostable]{Xll}
Option & Backend & Device \\
\mintinline{text}{-DKokkos_ENABLE_CUDA=ON} & CUDA & NVIDIA \\
\mintinline{text}{-DKokkos_ENABLE_HIP=ON} & HIP & AMD \\
\mintinline{text}{-DKokkos_ENABLE_SYCL=ON} & SYCL & Intel \\
\end{tblr}
You can only select the serial backend, plus another host backend and one device backend at a time.
See architecture-specific options.
\subsection{Specific options}
\begin{tblr}[theme=kokkostable]{lX}
Option & Description \\
\mintinline{text}{-DKokkos_ENABLE_DEBUG=ON} & Activate extra debug features, may increase compile times \\
\mintinline{text}{-DKokkos_ENABLE_DEBUG_BOUNDS_CHECK=ON} & Use bounds checking, will increase runtime \\
\mintinline{text}{-DKokkos_ENABLE_EXAMPLES=ON} & Build examples \\
\mintinline{text}{-DKokkos_ENABLE_TUNING=ON} & Create bindings for tuning tools \\
\end{tblr}
\subsection{Architecture-specific options}
\subsubsection{Host architectures}
Host options are used for controlling optimization and are optional.
\begin{tblr}[theme=kokkostable]{Xl}
Option & Architecture \\
\mintinline{text}{-DKokkos_ARCH_NATIVE=ON} & Local host \\
\end{tblr}
\subsubsection{Device architectures}
Device options are mandatory. They can be deduced from the device if present at CMake configuration time.
\paragraph{AMD GPU architectures (HIP)}
{
% temporary disable justify align
\RenewDocumentCommand\TblrAlignBoth{}{\RaggedRight}
% squeeze cells to fit in the page
\NewDocumentCommand{\squeezecellbox}{m}{%
% obliged to guess the cell width
\adjustbox{scale={0.9}{1}, minipage={3.4cm}}{#1}%
}
\NewDocumentCommand{\squeezecell}{m}{%
\adjustbox{scale={0.85}{1}}{#1}%
}
\begin{tblr}[theme=kokkostable]{colspec={llX}, cell{2-Z}{2}={cmd=\squeezecell}, cell{2-Z}{3}={cmd=\squeezecellbox}}
Option & Arch. & Associated cards \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX950=ON} & GFX950 & MI350X, MI355X \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX942_APU=ON} & GFX942 \squeezecell{APU} & MI300A \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX942=ON} & GFX942 & MI300X \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX90A=ON} & GFX90A & MI210, MI250, MI250X \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX908=ON} & GFX908 & MI100 \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX906=ON} & GFX906 & MI50, MI60 \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX1201=ON} & GFX1201 & Radeon AI PRO R9700, RX 9070 XT \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX1152=ON} & GFX1152 & Radeon 860M \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX1151=ON} & GFX1151 & Strix Halo \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX1103=ON} & GFX1103 & Ryzen 8000G, Radeon 740M, 760M, 780M, 880M, 980M \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX1101=ON} & GFX1101 & Radeon RX 7800 XT, RX 7700 XT, RX 7700 \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX1100=ON} & GFX1100 & 7900xt \\
\mintinline{text}{-DKokkos_ARCH_AMD_GFX1030=ON} & GFX1030 & V620, W6800 \\
\end{tblr}
}
\paragraph{Intel GPU architectures (SYCL)}
{
% temporary disable justify align
\RenewDocumentCommand\TblrAlignBoth{}{\RaggedRight}
\begin{tblr}[theme=kokkostable]{llX}
Option & Arch. & Associated cards \\
\mintinline{text}{-DKokkos_ARCH_INTEL_GEN=ON} & \SetCell[c=2]{l} (Generic JIT) \\
\mintinline{text}{-DKokkos_ARCH_INTEL_PVC=ON} & Xe-HPC & GPU Max 1550 (Ponte Vecchio) \\
\mintinline{text}{-DKokkos_ARCH_INTEL_XEHP=ON} & Xe-HP & \\
\mintinline{text}{-DKokkos_ARCH_INTEL_DG2=ON} & DG2 & Flex, Arc \\
\mintinline{text}{-DKokkos_ARCH_INTEL_DG1=ON} & DG1 & Iris Xe MAX \\
\mintinline{text}{-DKokkos_ARCH_INTEL_GEN12LP=ON} & Gen12LP & UHD Graphics 770 \\
\mintinline{text}{-DKokkos_ARCH_INTEL_GEN11=ON} & Gen11 & UHD Graphics \\
\end{tblr}
}
\paragraph{NVIDIA GPU architectures (CUDA)}
{
% temporary disable justify align
\RenewDocumentCommand\TblrAlignBoth{}{\RaggedRight}
\begin{tblr}[theme=kokkostable]{lllX}
Option & Arch. & CC & Assoc.\ cards \\
\mintinline{text}{-DKokkos_ARCH_BLACKWELL120=ON} & Blackwell & 12.0 & RTX 5080 \\
\mintinline{text}{-DKokkos_ARCH_BLACKWELL103=ON} & Blackwell & 10.0 & B300 \\
\mintinline{text}{-DKokkos_ARCH_BLACKWELL100=ON} & Blackwell & 10.0 & B200, B100 \\
\mintinline{text}{-DKokkos_ARCH_HOPPER90=ON} & Hopper & 9.0 & H200, H100 \\
\mintinline{text}{-DKokkos_ARCH_ADA89=ON} & Ada & 8.9 & L4, L40 \\
\mintinline{text}{-DKokkos_ARCH_AMPERE87=ON} & Ampere & 8.7 & Jetson Orin \\
\end{tblr}
}
% table broken between two pages
\begin{tblr}[theme=kokkostable]{lllX}
Option & Arch. & CC & Associated cards \\
\mintinline{text}{-DKokkos_ARCH_AMPERE86=ON} & Ampere & 8.6 & A40, A10, A16, A2 \\
\mintinline{text}{-DKokkos_ARCH_AMPERE80=ON} & Ampere & 8.0 & A100, A30 \\
\mintinline{text}{-DKokkos_ARCH_TURING75=ON} & Turing & 7.5 & T4 \\
\mintinline{text}{-DKokkos_ARCH_VOLTA70=ON} & Volta & 7.0 & V100 \\
\mintinline{text}{-DKokkos_ARCH_PASCAL61=ON} & Pascal & 6.1 & P6, P40, P4 \\
\mintinline{text}{-DKokkos_ARCH_PASCAL60=ON} & Pascal & 6.0 & P100 \\
\mintinline{text}{-DKokkos_ARCH_MAXWELL53=ON} & Maxwell & 5.3 & \\
\mintinline{text}{-DKokkos_ARCH_MAXWELL52=ON} & Maxwell & 5.2 & M6, M60, M4, M40 \\
\mintinline{text}{-DKokkos_ARCH_MAXWELL50=ON} & Maxwell & 5.0 & M10 \\
\end{tblr}
\subsection{Examples for the most common architectures}
\subsubsection{Current CPU with OpenMP}
\begin{minted}{sh}
cmake \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DKokkos_ENABLE_OPENMP=ON \
-DKokkos_ARCH_NATIVE=ON
\end{minted}
\subsubsection{AMD MI300A APU with HIP}
\begin{minted}{sh}
export HSA_XNACK=1
cmake \
-B build \
-DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_BUILD_TYPE=Release \
-DKokkos_ENABLE_HIP=ON \
-DKokkos_ARCH_AMD_GFX942_APU=ON
\end{minted}
The environment variable is required to access host allocations from the device.
\subsubsection{AMD MI250 GPU with HIP}
\begin{minted}{sh}
cmake \
-B build \
-DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_BUILD_TYPE=Release \
-DKokkos_ENABLE_HIP=ON \
-DKokkos_ARCH_AMD_GFX90A=ON
\end{minted}
\subsubsection{Intel GPU Max 1550 (Ponte Vecchio) with SYCL}
\begin{minted}{sh}
cmake \
-B build \
-DCMAKE_CXX_COMPILER=icpx \
-DCMAKE_BUILD_TYPE=Release \
-DKokkos_ENABLE_SYCL=ON \
-DKokkos_ARCH_INTEL_PVC=ON \
-DCMAKE_CXX_FLAGS="-fp-model=precise"
\end{minted}
The last option is required for math operators precision.
\subsubsection{NVIDIA H100 GPU with CUDA}
\begin{minted}{sh}
cmake \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DKokkos_ENABLE_CUDA=ON \
-DKokkos_ARCH_HOPPER90=ON
\end{minted}
\subsubsection{NVIDIA A100 GPU with CUDA}
\begin{minted}{sh}
cmake \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DKokkos_ENABLE_CUDA=ON \
-DKokkos_ARCH_AMPERE80=ON
\end{minted}
\end{multicols}
% add a watermark here
%\watermark
% add a notes section here
%\notessection
% add a notes section followed by a watermark here
%\notessection{\watermark}
\end{document}