Merge branch 'main' of https://git.elosia.mooo.com/Daniel/master-thesis
Some checks are pending
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, 1.10) (push) Waiting to run
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, 1.6) (push) Waiting to run
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, pre) (push) Waiting to run
Some checks are pending
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, 1.10) (push) Waiting to run
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, 1.6) (push) Waiting to run
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, pre) (push) Waiting to run
This commit is contained in:
@ -1 +1,196 @@
|
||||
[{"Julia":"1.11.5","BenchmarkTools":{"major":1,"minor":6,"patch":0,"prerelease":[],"build":[]}},[["BenchmarkGroup",{"data":{"GPUT":["BenchmarkGroup",{"data":{},"tags":["GPUTranspiler"]}],"GPUI":["BenchmarkGroup",{"data":{"nikuradse_1":["Trial",{"allocs":768767740,"gctimes":[1.4209871071e10,8.529233725e9,8.165943693e9,8.180014668e9,8.231263428e9,1.1110946388e10,1.3136749872e10,1.0515143897e10,1.2978886885e10,1.0709110363e10,1.2408937103e10,1.4486745203e10,1.3229416582e10,1.8353010658e10,1.32173253e10,1.1621004633e10,1.1136122325e10,9.614762707e9,1.4564265563e10,9.399404156e9,1.063983064e10,1.2513746965e10,9.039906393e9,1.2382209752e10,1.3127092115e10,1.2713843793e10,1.1111974511e10,1.5837882785e10,1.5005237417e10,1.2439743996e10,9.607861366e9,1.0680724758e10,1.4012997282e10,1.258804731e10,1.020862355e10,9.630750655e9,1.5428270551e10,1.746317266e10,1.3141055589e10,1.5009128259e10,8.453648604e9,1.6874341516e10,1.1411307067e10,1.2542892313e10,1.1232296452e10,1.3458245148e10,1.0818032806e10,9.239119183e9,1.7897566617e10,1.565065385e10],"memory":54082712568,"params":["Parameters",{"gctrial":true,"time_tolerance":0.05,"evals_set":false,"samples":50,"evals":1,"gcsample":false,"seconds":43200.0,"overhead":0.0,"memory_tolerance":0.01}],"times":[4.72169572882e11,5.0409909815e11,5.07815085942e11,5.10453558146e11,5.10478958938e11,4.97262381193e11,5.0260603513e11,4.99542972531e11,4.87993778737e11,4.89021704445e11,5.03746768492e11,4.89869107858e11,4.73146154356e11,4.8171801387e11,5.08579879922e11,4.949573335e11,4.72187897068e11,4.99229768599e11,4.60419913288e11,4.69019613895e11,4.50583091837e11,4.72792727311e11,4.72333754492e11,4.65152305777e11,4.82234976786e11,4.72238483765e11,4.73826923338e11,4.76267120461e11,4.87120033427e11,5.04120244741e11,4.69559064737e11,4.72201757593e11,4.69914031792e11,4.93629873162e11,4.71968584791e11,5.01452793581e11,4.80458931455e11,4.83065538379e11,4.99070229147e11,4.71609869279e11,4.71492369998e11,4.58522950715e11,4.80960881323e11,4.91960762476e11,4.73412762655e11,4.69283546561e11,4.66574358844e11,4.67318993209e11,4.5724723899e11,4.7334516285e11]}]},"tags":["GPUInterpreter"]}]},"tags":[]}]]]
|
||||
[
|
||||
{
|
||||
"Julia": "1.11.5",
|
||||
"BenchmarkTools": {
|
||||
"major": 1,
|
||||
"minor": 6,
|
||||
"patch": 0,
|
||||
"prerelease": [],
|
||||
"build": []
|
||||
}
|
||||
},
|
||||
[
|
||||
[
|
||||
"BenchmarkGroup",
|
||||
{
|
||||
"data": {
|
||||
"GPUT": [
|
||||
"BenchmarkGroup",
|
||||
{
|
||||
"data": {
|
||||
"nikuradse_1": [
|
||||
"Trial",
|
||||
{
|
||||
"allocs": 1534044518,
|
||||
"gctimes": [
|
||||
3.162096218033e12,
|
||||
2.514920522839e12
|
||||
],
|
||||
"memory": 51380856414712,
|
||||
"params": [
|
||||
"Parameters",
|
||||
{
|
||||
"gctrial": true,
|
||||
"time_tolerance": 0.05,
|
||||
"evals_set": false,
|
||||
"samples": 50,
|
||||
"evals": 1,
|
||||
"gcsample": false,
|
||||
"seconds": 43200.0,
|
||||
"overhead": 0.0,
|
||||
"memory_tolerance": 0.01
|
||||
}
|
||||
],
|
||||
"times": [
|
||||
3.579290341907e13,
|
||||
3.6476991686227e13
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tags": [
|
||||
"GPUTranspiler"
|
||||
]
|
||||
}
|
||||
],
|
||||
"GPUI": [
|
||||
"BenchmarkGroup",
|
||||
{
|
||||
"data": {
|
||||
"nikuradse_1": [
|
||||
"Trial",
|
||||
{
|
||||
"allocs": 768767740,
|
||||
"gctimes": [
|
||||
1.4209871071e10,
|
||||
8.529233725e9,
|
||||
8.165943693e9,
|
||||
8.180014668e9,
|
||||
8.231263428e9,
|
||||
1.1110946388e10,
|
||||
1.3136749872e10,
|
||||
1.0515143897e10,
|
||||
1.2978886885e10,
|
||||
1.0709110363e10,
|
||||
1.2408937103e10,
|
||||
1.4486745203e10,
|
||||
1.3229416582e10,
|
||||
1.8353010658e10,
|
||||
1.32173253e10,
|
||||
1.1621004633e10,
|
||||
1.1136122325e10,
|
||||
9.614762707e9,
|
||||
1.4564265563e10,
|
||||
9.399404156e9,
|
||||
1.063983064e10,
|
||||
1.2513746965e10,
|
||||
9.039906393e9,
|
||||
1.2382209752e10,
|
||||
1.3127092115e10,
|
||||
1.2713843793e10,
|
||||
1.1111974511e10,
|
||||
1.5837882785e10,
|
||||
1.5005237417e10,
|
||||
1.2439743996e10,
|
||||
9.607861366e9,
|
||||
1.0680724758e10,
|
||||
1.4012997282e10,
|
||||
1.258804731e10,
|
||||
1.020862355e10,
|
||||
9.630750655e9,
|
||||
1.5428270551e10,
|
||||
1.746317266e10,
|
||||
1.3141055589e10,
|
||||
1.5009128259e10,
|
||||
8.453648604e9,
|
||||
1.6874341516e10,
|
||||
1.1411307067e10,
|
||||
1.2542892313e10,
|
||||
1.1232296452e10,
|
||||
1.3458245148e10,
|
||||
1.0818032806e10,
|
||||
9.239119183e9,
|
||||
1.7897566617e10,
|
||||
1.565065385e10
|
||||
],
|
||||
"memory": 54082712568,
|
||||
"params": [
|
||||
"Parameters",
|
||||
{
|
||||
"gctrial": true,
|
||||
"time_tolerance": 0.05,
|
||||
"evals_set": false,
|
||||
"samples": 50,
|
||||
"evals": 1,
|
||||
"gcsample": false,
|
||||
"seconds": 43200.0,
|
||||
"overhead": 0.0,
|
||||
"memory_tolerance": 0.01
|
||||
}
|
||||
],
|
||||
"times": [
|
||||
4.72169572882e11,
|
||||
5.0409909815e11,
|
||||
5.07815085942e11,
|
||||
5.10453558146e11,
|
||||
5.10478958938e11,
|
||||
4.97262381193e11,
|
||||
5.0260603513e11,
|
||||
4.99542972531e11,
|
||||
4.87993778737e11,
|
||||
4.89021704445e11,
|
||||
5.03746768492e11,
|
||||
4.89869107858e11,
|
||||
4.73146154356e11,
|
||||
4.8171801387e11,
|
||||
5.08579879922e11,
|
||||
4.949573335e11,
|
||||
4.72187897068e11,
|
||||
4.99229768599e11,
|
||||
4.60419913288e11,
|
||||
4.69019613895e11,
|
||||
4.50583091837e11,
|
||||
4.72792727311e11,
|
||||
4.72333754492e11,
|
||||
4.65152305777e11,
|
||||
4.82234976786e11,
|
||||
4.72238483765e11,
|
||||
4.73826923338e11,
|
||||
4.76267120461e11,
|
||||
4.87120033427e11,
|
||||
5.04120244741e11,
|
||||
4.69559064737e11,
|
||||
4.72201757593e11,
|
||||
4.69914031792e11,
|
||||
4.93629873162e11,
|
||||
4.71968584791e11,
|
||||
5.01452793581e11,
|
||||
4.80458931455e11,
|
||||
4.83065538379e11,
|
||||
4.99070229147e11,
|
||||
4.71609869279e11,
|
||||
4.71492369998e11,
|
||||
4.58522950715e11,
|
||||
4.80960881323e11,
|
||||
4.91960762476e11,
|
||||
4.73412762655e11,
|
||||
4.69283546561e11,
|
||||
4.66574358844e11,
|
||||
4.67318993209e11,
|
||||
4.5724723899e11,
|
||||
4.7334516285e11
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tags": [
|
||||
"GPUInterpreter"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
]
|
||||
]
|
||||
]
|
@ -12,6 +12,8 @@ The hardware configuration is the most important aspect of the benchmark environ
|
||||
\subsubsection{GPU}
|
||||
Especially the GPU is important, as different microarchitectures typically require different optimisations. While the evaluators can generally run on any Nvidia GPU with a compute capability of at least 6.1, they are tuned for the Ampere microarchitecture with a compute capability of 8.6. Despite the evaluators being tuned for this microarchitecture, more modern ones can be used as well. However, additional tuning is required to ensure the evaluators can utilise the hardware to its fullest potential.
|
||||
|
||||
Tuning must also be done on a per-problem basis. Especially the number of variable sets can impact how well the hardware is utilised. Therefore, it is important to see which configuration performs the best. In Section \ref{sec:results} a strategy for tuning the configuration to a new problem is described.
|
||||
|
||||
\subsubsection{CPU}
|
||||
Although the GPU plays a crucial role, work is also carried out on the CPU. The interpreter mainly uses the CPU for data transfer and the pre-processing step and is therefore more GPU-bound. However, the transpiler additionally needs the CPU to perform the transpilation step. This step produces a kernel for each expression and also involves sending these kernels to the driver for compilation, a process which is also performed by the CPU. By contrast, the interpreter only has one kernel that needs to be converted into PTX and compiled by the driver only once. Consequently, the transpiler is much more CPU-bound and variations in the used CPU have a much greater impact. Therefore, using a more powerful CPU benefits the transpiler more than the interpreter.
|
||||
|
||||
@ -30,23 +32,33 @@ With the requirements explained above in mind, the following hardware is used to
|
||||
|
||||
|
||||
\subsection{Software Configuration}
|
||||
Apart from the hardware, the performance of the evaluators can also be significantly affected by the software. Primarily these three software components are involved in the performance:
|
||||
Apart from the hardware, the performance of the evaluators can also be significantly affected by the software. Primarily these three software components or libraries are involved in the performance:
|
||||
\begin{itemize}
|
||||
\item GPU Driver
|
||||
\item Julia
|
||||
\item CUDA.jl
|
||||
\end{itemize}
|
||||
|
||||
Typically, newer versions of these components include performance improvements, among other things. This is why it is important to specify the version which is used for benchmarking. The GPU driver uses version \emph{561.17}, Julia uses version \emph{1.11.5}, and CUDA.jl uses version \emph{5.8.1}. As with the hardware configuration, this ensures that the results are reproducible and comparable to each other.
|
||||
Typically, newer versions of these components include performance improvements, among other things. This is why it is important to specify the version which is used for benchmarking. The GPU driver has version \emph{561.17}, Julia has version \emph{1.11.5}, and CUDA.jl has version \emph{5.8.1}. As with the hardware configuration, this ensures that the results are reproducible and comparable to each other.
|
||||
|
||||
|
||||
\subsection{Performance evaluation process}
|
||||
% explain the actual data
|
||||
% Nikuradse dataset (flowrate through rough pipes (fact check that again))
|
||||
% 250k expressions; ~300 variable sets; 100 parameter optimisation steps (simulated)
|
||||
% using Benchmarktools.jl as a tried and tested benchmark suite
|
||||
% 50 samples to eliminate any run-to-run variance
|
||||
\subsection{Performance Evaluation Process}
|
||||
With the hardware and software configuration being set, the process of benchmarking the implementations can be described. The process is designed to simulate the load and scenario these evaluators will be used in. The Nikuradse dataset \parencite{nikuradse_laws_1950} has been chosen as the source of the data. The dataset itself models the laws of flow in rough pipes and provides $362$ variable sets, with each set containing two variables. This dataset has first been used by \textcite{guimera_bayesian_2020} to benchmark a symbolic regression algorithm.
|
||||
|
||||
Because only the evaluators are benchmarked, the expressions to be evaluated, need to already exist. Generating the expressions is done, using the exhaustive symbolic regression algorithm proposed by \textcite{bartlett_exhaustive_2024} and the Nikuradse dataset. This ensures that the expressions are exemplary of what needs to be evaluated in a real use-case.
|
||||
|
||||
With roughly $250\,000$ expressions, the second-largest set has been used as the first benchmark. This means that all $250\,000$ expressions are evaluated in a single run, which is much more than what would be evaluated in a typical run. This benchmark is designed to show how the evaluators can handle large amounts of data. However, evaluating such high amount of expressions also has some drawbacks as will be explained in Section \ref{sec:results}.
|
||||
|
||||
A second benchmark with slight adaptations to the first one is also performed. Because GPUs are very good at executing work in parallel, the number of variable sets is increased in this benchmark. Therefore, the second benchmark consists of the same $250\,000$ expressions, but the number of variable sets has been increased by a factor of four to a total of $1\,4448$.
|
||||
|
||||
Lastly a third benchmark will be performed. This benchmark should mimic a realistic load. Therefore, the number of expressions has been reduced to roughly $10\,000$ and the number of variable sets is again $362$. The reason for this benchmark is to demonstrate how the evaluators will most likely perform in a typical run.
|
||||
|
||||
All three benchmarks will also simulate a parameter optimisation step, as this is the scenario, these evaluators will be used in. For parameter optimisation, $100$ steps have been used. This means, that all expressions will be evaluated $100$ times. During the benchmark, this process is simulated by re-transmitting the parameters instead of generating new ones. Generating new parameters is not part of the evaluators and is therefore not implemented. However, because the parameters are re-transmitted every time, the overhead of sending the data is taken into account. This is part of the evaluators and additional overhead the CPU implementation does not have and is therefore important to be measured.
|
||||
|
||||
\subsubsection{Measuring Performance}
|
||||
The performance measurements are taken, using the BenchmarkTools.jl\footnote{\url{https://juliaci.github.io/BenchmarkTools.jl/stable/}} package. It is the standard for benchmarking applications in Julia, which makes it an obvious choice for measuring the performance of the evaluators.
|
||||
|
||||
It offers extensive support for measuring and comparing results of different implementations and versions of the same implementation. Benchmark groups allow to categorise the different implementations, take performance measurements and compare them. When taking performance measurements, it also supports setting a timeout and most importantly, set the number of samples to be taken. This is especially important, as it ensures to produce stable results by combating run-to-run variance. For this thesis, a sample size of $50$ has been used. This means that each of the previously-mentioned benchmarks, gets executed $50$ times.
|
||||
|
||||
\section{Results}
|
||||
\label{sec:results}
|
||||
@ -54,6 +66,19 @@ talk about what we will see now (results only for interpreter, then transpiler a
|
||||
|
||||
BECAUSE OF RAM CONSTRAINTS, CACHING IS NOT USED TO THE FULL EXTEND AS IN CONTRAST TO HOW IT IS EXPLAINED IN THE IMPLEMENTATION CHAPTER. I hope I can cache the frontend. If only the finished kernels can not be cached, move this explanation to the transpiler section below and update the reference in subsubsection "System Memory"
|
||||
|
||||
% TODO: Do one run with
|
||||
% - 250k expressions
|
||||
% - increase variables to be 4 times as large (nr. of varsets should be 362 * 4)
|
||||
% - compare CPU with interpreter (probably also transpiler, but only to see if it takes even longer, or roughly the same considering that resources are still available on the GPU)
|
||||
% - This should demonstrate that bigger varsets lead to better performance (although I kinda doubt considering that the hardware is already fully utilised)
|
||||
|
||||
% TODO: Do another run with
|
||||
% - 10 000 expressions choose the file that is closest to these 10k
|
||||
% - nr. var sets stays the same
|
||||
% - compare CPU, interpreter and transpiler
|
||||
% - do a second run with kernel compilation being performed before parameter optimisation step (as 10 000 expressions shouldn't fill up the memory as much)
|
||||
% - depending on how much time I have, also do a run with 4 times as much var sets (if this is done, adapt the above subsection "Performance Evaluation Process")
|
||||
|
||||
\subsection{Interpreter}
|
||||
Results only for Interpreter (also contains final kernel configuration and probably quick overview/recap of the implementation used and described in Implementation section)
|
||||
\subsection{Performance Tuning}
|
||||
@ -62,8 +87,12 @@ Document the process of performance tuning
|
||||
Initial: no cache; 256 blocksize; exprs pre-processed and sent to GPU on every call; vars sent on every call; frontend + dispatch are multithreaded
|
||||
|
||||
1.) Done before parameter optimisation loop: Frontend, transmitting Exprs and Variables (improved runtime)
|
||||
2.) tuned blocksize to have as little wasted threads as possible (new blocksize 121 -> 3-blocks -> 363 threads but 362 threads needed per expression)
|
||||
2.) tuned blocksize to have as little wasted threads as possible (new blocksize 121 -> 3-blocks -> 363 threads but 362 threads needed per expression) (128 should lead to the same results. Talk here a bit what to look out for, so block-size should be a multiple of 32 and should divide the nr. of varsets as best as possible to a whole number without going over)
|
||||
3.) Minor optimisations. Reduced stacksize; reduced memory allocations on the CPU; reduced GC pressure
|
||||
|
||||
CPU and GPU are almost all the time at 100\% utilisation (GPU every now and then drops to 70\%), meaning it is quite balanced.
|
||||
Uncached but multithreaded frontend only makes up a small percentage of the total runtime (optimisations there are not really needed, which is good because enabling caching took up too much RAM)
|
||||
Most of the time is spent doing the parameter optimisation step
|
||||
|
||||
\subsection{Transpiler}
|
||||
Results only for Transpiler (also contains final kernel configuration and probably quick overview/recap of the implementation used and described in Implementation section
|
||||
@ -76,7 +105,9 @@ Document the process of performance tuning
|
||||
Initial: no cache; 256 blocksize; exprs pre-processed and transpiled on every call; vars sent on every call; frontend + transpilation + dispatch are multithreaded
|
||||
|
||||
1.) Done before parameter optimisation loop: Frontend, transmitting Exprs and Variables (improved runtime)
|
||||
2.) All expressions to execute are transpiled first (before they were transpiled for every execution, even in parameter optimisation scenarios). Compilation is still done every time, because too little RAM was available (compilation takes the most time, so this is only a minor boost)
|
||||
2.) All expressions to execute are transpiled first (before they were transpiled for every execution, even in parameter optimisation scenarios). Compilation is still done every time, because too little RAM was available (compilation takes the most time, so this is only a minor boost). Also tried blocksize of 121. However, kernel itself is very fast anyway, so this didn't make a difference (further proof that the CPU is the bottleneck here)
|
||||
|
||||
CPU at 100\% GPU at around 30\%. Heavily CPU bottlenecked. Mainly due to PTX compilation taking by far the longest (while kernels are finished more or less instantly)
|
||||
|
||||
\subsection{Comparison}
|
||||
Comparison of Interpreter and Transpiler as well as Comparing the two with CPU interpreter
|
||||
|
BIN
thesis/main.pdf
BIN
thesis/main.pdf
Binary file not shown.
@ -400,6 +400,7 @@
|
||||
author = {Winter, Martin and Parger, Mathias and Mlakar, Daniel and Steinberger, Markus},
|
||||
urldate = {2025-02-27},
|
||||
date = {2021-02-17},
|
||||
file = {PDF:C\:\\Users\\danwi\\Zotero\\storage\\UURX5BER\\Winter et al. - 2021 - Are dynamic memory managers on GPUs slow a survey and benchmarks.pdf:application/pdf},
|
||||
}
|
||||
|
||||
@article{bartlett_exhaustive_2024,
|
||||
@ -1253,6 +1254,28 @@
|
||||
author = {Faingnaert, Thomas and Besard, Tim and De Sutter, Bjorn},
|
||||
urldate = {2025-04-20},
|
||||
date = {2022-09},
|
||||
keywords = {Codes, Graphics processing units, graphics processors, high-level programming languages, Instruction sets, Kernel, Libraries, Matrix multiplication, Productivity, Programming},
|
||||
keywords = {Graphics processing units, Kernel, Programming, Instruction sets, Codes, graphics processors, high-level programming languages, Libraries, Matrix multiplication, Productivity},
|
||||
file = {Full Text PDF:C\:\\Users\\danwi\\Zotero\\storage\\QCJ6LSF3\\Faingnaert et al. - 2022 - Flexible Performant GEMM Kernels on GPUs.pdf:application/pdf},
|
||||
}
|
||||
|
||||
@report{nikuradse_laws_1950,
|
||||
title = {Laws of Flow in Rough Pipes},
|
||||
url = {https://digital.library.unt.edu/ark:/67531/metadc63009/},
|
||||
author = {Nikuradse, J.},
|
||||
date = {1950-11},
|
||||
}
|
||||
|
||||
@article{guimera_bayesian_2020,
|
||||
title = {A Bayesian machine scientist to aid in the solution of challenging scientific problems},
|
||||
volume = {6},
|
||||
url = {https://www.science.org/doi/10.1126/sciadv.aav6971},
|
||||
doi = {10.1126/sciadv.aav6971},
|
||||
abstract = {Closed-form, interpretable mathematical models have been instrumental for advancing our understanding of the world; with the data revolution, we may now be in a position to uncover new such models for many systems from physics to the social sciences. However, to deal with increasing amounts of data, we need “machine scientists” that are able to extract these models automatically from data. Here, we introduce a Bayesian machine scientist, which establishes the plausibility of models using explicit approximations to the exact marginal posterior over models and establishes its prior expectations about models by learning from a large empirical corpus of mathematical expressions. It explores the space of models using Markov chain Monte Carlo. We show that this approach uncovers accurate models for synthetic and real data and provides out-of-sample predictions that are more accurate than those of existing approaches and of other nonparametric methods.},
|
||||
pages = {eaav6971},
|
||||
number = {5},
|
||||
journaltitle = {Science Advances},
|
||||
author = {Guimerà, Roger and Reichardt, Ignasi and Aguilar-Mogas, Antoni and Massucci, Francesco A. and Miranda, Manuel and Pallarès, Jordi and Sales-Pardo, Marta},
|
||||
urldate = {2025-05-21},
|
||||
date = {2020-01-31},
|
||||
file = {Full Text PDF:C\:\\Users\\danwi\\Zotero\\storage\\HLG9FD4H\\Guimerà et al. - 2020 - A Bayesian machine scientist to aid in the solution of challenging scientific problems.pdf:application/pdf},
|
||||
}
|
||||
|
Reference in New Issue
Block a user