-
Notifications
You must be signed in to change notification settings - Fork 3
Add intermediate course #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
pzehner
wants to merge
10
commits into
main
Choose a base branch
from
course_intermediate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
797ef4c
Allow to reuse the theme
pzehner e93ce08
Merge branch 'main' into course_intermediate
pzehner 86dbebd
Rename directory
pzehner ae8beef
Add outline
pzehner 0a720f6
Start adding profiling/debugging section
pzehner 6db1ef3
Merge branch 'main' into course_intermediate
pzehner b8d9580
Add slides for tools
pzehner d88874f
Merge branch 'main' into course_intermediate
pzehner 1a019b5
Add handle for presentation/handout build
pzehner 05b5d01
Fix env variable and add part about NVTX connector
pzehner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| $xelatex = 'xelatex -shell-escape %O %S' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| all: main | ||
|
|
||
| %: | ||
| latexmk -pdfxe $< | ||
|
|
||
| clean: | ||
| latexmk -c | ||
|
|
||
| cleanall: | ||
| latexmk -C | ||
| rm -rf _minted-* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,283 @@ | ||
| % !TeX program = xelatex | ||
|
|
||
| \documentclass[ | ||
| aspectratio=169, | ||
| handout, | ||
| ]{beamer} | ||
|
|
||
| \usepackage{minted} | ||
| \usepackage{xcolor} | ||
| \usepackage{tcolorbox} | ||
| \usepackage{graphicx} | ||
| \usepackage{fontspec} | ||
| \usepackage{tabularray} | ||
|
|
||
| % allow to look for themes in another folder | ||
| % https://tex.stackexchange.com/a/284157/301699 | ||
| \makeatletter | ||
| \def\beamer@calltheme#1#2#3{% | ||
| \def\beamer@themelist{#2} | ||
| \@for\beamer@themename:=\beamer@themelist\do | ||
| {\usepackage[{#1}]{\beamer@themelocation/#3\beamer@themename}}} | ||
|
|
||
| \def\usefolder#1{ | ||
| \def\beamer@themelocation{#1} | ||
| } | ||
| \def\beamer@themelocation{} | ||
| \makeatother | ||
|
|
||
| \usefolder{..} | ||
| \usetheme{cexa-kokkos} | ||
|
|
||
| \AtBeginSection{ | ||
| \begin{frame}{Outline} | ||
| \tableofcontents[currentsection, hideothersubsections] | ||
| \end{frame} | ||
| } | ||
|
|
||
| \AtBeginSubsection{ | ||
| \begin{frame}{Outline} | ||
| \tableofcontents[currentsection, currentsubsection] | ||
| \end{frame} | ||
| } | ||
|
|
||
| \setminted{ | ||
| autogobble, | ||
| fontsize=\small, | ||
| bgcolor=lightgray, | ||
| xleftmargin=0.5em, | ||
| xrightmargin=0.5em, | ||
| breaklines, | ||
| } | ||
|
|
||
| \NewTblrTheme{kokkostable}{ | ||
| \SetTblrInner{ | ||
| width=\linewidth, | ||
| rowhead=1, | ||
| rows={ht=\baselineskip}, | ||
| row{odd}={bg=lightgray}, | ||
| row{1}={bg=lightmain}, | ||
| } | ||
| } | ||
|
|
||
| \graphicspath{{../../images/}} | ||
|
|
||
| %Information to be included in the title page: | ||
| \title{Kokkos intermediate course} | ||
| \author{The CExA team} | ||
| \institute{CEA} | ||
| \date{\today} | ||
| \titlegraphic{% | ||
| \includegraphics[height=4em]{kokkos.png}% | ||
| \hspace{1em}% | ||
| \includegraphics[height=4em]{cexa_logo.png} | ||
| } | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{document} | ||
|
|
||
| \begin{frame}[plain] | ||
| \titlepage | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}{This course is open source} | ||
| \begin{center} | ||
| \githublink{\url{https://github.com/CExA-project/cexa-kokkos-tutorials}} | ||
| \end{center} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}{Prerequisites} | ||
| This course is intended for developers who have have followed the basic course of the tutorials | ||
|
|
||
| \vspace{1em} | ||
|
|
||
| \begin{block}{What you still need} | ||
| \begin{itemize} | ||
| \item Basic knowledge of C/C++ | ||
| \item Basic knowledge of parallel programming | ||
| \item Basic knowledge of CMake | ||
| \item Basic knowledge of a Linux environment | ||
| \item Basic knowledge of Kokkos | ||
| \end{itemize} | ||
| \end{block} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}{Duration of the course} | ||
| \begin{itemize} | ||
| \item Course + practical work: full day | ||
| \item Course + corrected exercise: half day | ||
| \item Short version: 3 hours | ||
| \end{itemize} | ||
| \end{frame} | ||
|
|
||
| \begin{frame}{Outline} | ||
| \tableofcontents[hidesubsections] | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \section{Profiling and debugging} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}{Profiling and debugging tools at hand} | ||
| \begin{columns}[T] | ||
| \begin{column}{0.33\linewidth} | ||
| Kokkos | ||
|
|
||
| \begin{itemize} | ||
| \item KokkosP interface | ||
| \item Regions | ||
| \end{itemize} | ||
| \end{column} | ||
| \begin{column}{0.33\linewidth} | ||
| Kokkos tools | ||
|
|
||
| \begin{itemize} | ||
| \item Kernel timer | ||
| \item Kernel logger | ||
| \item Memory usage | ||
| \item Memory events | ||
| \item Space time stack | ||
| \end{itemize} | ||
| \end{column} | ||
| \begin{column}{0.33\linewidth} | ||
| Third-party tools | ||
|
|
||
| \begin{itemize} | ||
| \item VTune | ||
| \item Nsight Systems | ||
| \item Tau | ||
| \item Timemory | ||
| \item Caliper | ||
| \item HPCToolkit | ||
| \end{itemize} | ||
| \end{column} | ||
| \end{columns} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}{KokkosP interface} | ||
| \begin{itemize} | ||
| \item Provided by Kokkos | ||
| \item Hooks for tools | ||
| \item Always available | ||
| \item No overhead if no tools are used | ||
| \end{itemize} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}[fragile]{Regions} | ||
| \begin{columns} | ||
| \begin{column}{0.6\linewidth} | ||
| \begin{minted}{C++} | ||
| Kokkos::Profiling::pushRegion("init"); | ||
|
|
||
| Kokkos::parallel_for( | ||
| "initialize A", | ||
| N, | ||
| KOKKOS_LAMBDA(int i) { | ||
| view_a(i) = i; | ||
| } | ||
| ); | ||
|
|
||
| // other initialization kernels | ||
|
|
||
| Kokkos::Profiling::popRegion(); | ||
| \end{minted} | ||
| \end{column} | ||
| \begin{column}{0.4\linewidth} | ||
| \begin{itemize} | ||
| \item Provided by Kokkos | ||
| \item Set regions of interest in your code | ||
| \item No header needed | ||
| \item Namespace \texttt{Kokkos::Profiling} | ||
| \item \texttt{pushRegion} and \texttt{popRegion} to create a region | ||
| \end{itemize} | ||
| \end{column} | ||
| \end{columns} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}{Kokkos tools} | ||
| \begin{itemize} | ||
| \item \githublink{\url{https://github.com/kokkos/kokkos-tools}} | ||
| \item Has a different version number than Kokkos | ||
| \item Should be built and installed somewhere | ||
| \item Use one tool at a time with the environment variable \texttt{KOKKOS\_TOOLS\_LIB} | ||
| \end{itemize} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}[fragile]{Kernel timer to do a basic profiling} | ||
| \begin{columns} | ||
| \begin{column}{0.6\linewidth} | ||
| \begin{minted}[breakafter=/]{sh} | ||
| export KOKKOS_TOOLS_LIB=path/to/lib/libkp_kernel_timer.so | ||
| ./my_program | ||
| kp_reader ./name_of_report.dat | ||
| \end{minted} | ||
| \end{column} | ||
| \begin{column}{0.4\linewidth} | ||
| \begin{itemize} | ||
| \item Simple tool producing some timing analysis | ||
| \item Export environment variable to use the tool | ||
| \item Run the program as usual | ||
| \item Analyze the generated data with the provided \texttt{kp\_reader} program | ||
| \end{itemize} | ||
| \end{column} | ||
| \end{columns} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \begin{frame}[fragile]{Kernel timer output} | ||
| \begin{minted}[fontsize=\scriptsize]{text} | ||
| (Type) Total Time, Call Count, Avg. Time per Call, %Total Time in Kernels, %Total Program Time | ||
| ------------------------------------------------------------------------- | ||
| Regions: | ||
| ... | ||
| ------------------------------------------------------------------------- | ||
| Kernels: | ||
| ... | ||
| ------------------------------------------------------------------------- | ||
| Summary: | ||
|
|
||
| Total Execution Time (incl. Kokkos + non-Kokkos): 0.00205 seconds | ||
| Total Time in Kokkos kernels: 0.00115 seconds | ||
| -> Time outside Kokkos kernels: 0.00090 seconds | ||
| -> Percentage in Kokkos kernels: 55.98 % | ||
| Total Calls to Kokkos Kernels: 3 | ||
|
|
||
| ------------------------------------------------------------------------- | ||
| \end{minted} | ||
| \end{frame} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \section{Subviews} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \section{Atomics} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \section{Layouts} | ||
|
|
||
| % _____________________________________________________________________________ | ||
|
|
||
| \section{Subviews} | ||
|
|
||
| \end{document} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.