Add new GPU data point; Add smaller diagram number function

This commit is contained in:
Anton Reinhard 2024-02-13 16:22:18 +01:00
parent 5be483c4c1
commit 6a02f3bee6
8 changed files with 44 additions and 50 deletions

View File

@ -5,6 +5,8 @@ QED Process: 'ke->kke' no optimization,0.011560896,0.0,0.166822706,77,101,19175.
QED Process: 'ke->kke' reduced,0.011560896,0.067716005,0.014070132,59,77,16383.0,8,1000000,16835,4.00165268947644e8,0.0024989674956794813,4.207011778976407e-8,NVIDIA A30,4.5467275652879584e8,0.0021993840309116187,3.70266301603971e-8
QED Process: 'ke->kkke' no optimization,0.032403395,0.0,0.082379401,356,493,85898.0,8,1000000,127663,2.047233999655914e9,0.0004884639470466364,6.235877287181474e-8,NVIDIA A30,2.53188631039759e9,0.0003949624419917049,5.042209023198702e-8
QED Process: 'ke->kkke' reduced,0.032403395,0.183699028,0.031991448,148,221,43962.0,8,1000000,43407,8.954736112291666e8,0.00111672749197752,4.847379024426821e-8,NVIDIA A30,1.4135596722016807e9,0.0007074338775118397,3.0707582321156425e-8
QED Process: 'ke->kkkke' no optimization,0.502179994,0.0,3.738385104,2183,3015,504653.0,8,1000000,830042,1.3143839308454546e10,7.608127096903622e-5,6.315065031768076e-8,NVIDIA A30,1.84391171835625e10,5.423253131074232e-5,4.5015278754231176e-8
QED Process: 'ke->kkkke' reduced,0.502179994,5.320319119,0.113738175,543,885,166661.0,8,1000000,164502,3.096394581197183e9,0.0003229562556634375,5.31269499691468e-8,NVIDIA A30,5.367842921893617e9,0.0001862945720563726,3.064582969241741e-8
ABC Process: 'AB->AB' no optimization,0.000433092,0.0,0.017023325,34,37,8624.0,8,1000000,41,8.381314010084033e7,0.011931303358839001,4.89183437712399e-10,NVIDIA A30,1.8635275427480917e7,0.05366166998129408,2.2001284692330575e-9
ABC Process: 'AB->AB' reduced,0.000433092,0.065024113,0.007775533,34,37,9296.0,8,1000000,41,8.377098068354431e7,0.01193730802528896,4.894296290368474e-10,NVIDIA A30,1.8622735923664123e7,0.05369780273419915,2.2016099121021654e-9
ABC Process: 'AB->ABBB' no optimization,0.000342619,0.0,0.055432922,280,385,69428.0,8,1000000,555,1.185642213930131e8,0.00843424760227818,4.681007419264389e-9,NVIDIA A30,1.7535707459770113e7,0.0570264987765204,3.164970682096882e-8

1 process_name graph_gen_time optimization_time function_generation_time graph_nodes graph_edges graph_mem cpu_threads n_inputs nflops_likwid cpu_time cpu_rate cpu_gflops gpu_name gpu_time gpu_rate gpu_gflops
5 QED Process: 'ke->kke' reduced 0.011560896 0.067716005 0.014070132 59 77 16383.0 8 1000000 16835 4.00165268947644e8 0.0024989674956794813 4.207011778976407e-8 NVIDIA A30 4.5467275652879584e8 0.0021993840309116187 3.70266301603971e-8
6 QED Process: 'ke->kkke' no optimization 0.032403395 0.0 0.082379401 356 493 85898.0 8 1000000 127663 2.047233999655914e9 0.0004884639470466364 6.235877287181474e-8 NVIDIA A30 2.53188631039759e9 0.0003949624419917049 5.042209023198702e-8
7 QED Process: 'ke->kkke' reduced 0.032403395 0.183699028 0.031991448 148 221 43962.0 8 1000000 43407 8.954736112291666e8 0.00111672749197752 4.847379024426821e-8 NVIDIA A30 1.4135596722016807e9 0.0007074338775118397 3.0707582321156425e-8
8 QED Process: 'ke->kkkke' no optimization 0.502179994 0.0 3.738385104 2183 3015 504653.0 8 1000000 830042 1.3143839308454546e10 7.608127096903622e-5 6.315065031768076e-8 NVIDIA A30 1.84391171835625e10 5.423253131074232e-5 4.5015278754231176e-8
9 QED Process: 'ke->kkkke' reduced 0.502179994 5.320319119 0.113738175 543 885 166661.0 8 1000000 164502 3.096394581197183e9 0.0003229562556634375 5.31269499691468e-8 NVIDIA A30 5.367842921893617e9 0.0001862945720563726 3.064582969241741e-8
10 ABC Process: 'AB->AB' no optimization 0.000433092 0.0 0.017023325 34 37 8624.0 8 1000000 41 8.381314010084033e7 0.011931303358839001 4.89183437712399e-10 NVIDIA A30 1.8635275427480917e7 0.05366166998129408 2.2001284692330575e-9
11 ABC Process: 'AB->AB' reduced 0.000433092 0.065024113 0.007775533 34 37 9296.0 8 1000000 41 8.377098068354431e7 0.01193730802528896 4.894296290368474e-10 NVIDIA A30 1.8622735923664123e7 0.05369780273419915 2.2016099121021654e-9
12 ABC Process: 'AB->ABBB' no optimization 0.000342619 0.0 0.055432922 280 385 69428.0 8 1000000 555 1.185642213930131e8 0.00843424760227818 4.681007419264389e-9 NVIDIA A30 1.7535707459770113e7 0.0570264987765204 3.164970682096882e-8

View File

@ -44,7 +44,7 @@ if isfile(results_filename)
df = CSV.read(results_filename, DataFrame)
end
nInputs = 1_000
nInputs = 1_000_000
function cpu_bench(compute_function, inputs)
bench = @benchmark begin
@ -80,7 +80,7 @@ function bench_process(
gen_time::Float64,
opt_time::Float64,
func_time::Float64;
use_likwid = true,
use_likwid = false,
use_gpu = true,
)
log("\n--- Benchmarking $(process_name) ---")

View File

@ -41,7 +41,7 @@ if isfile(results_filename)
df = CSV.read(results_filename, DataFrame)
end
nInputs = 1_000
nInputs = 1_000_000
# use "mock" machine that only uses cpu
machine = Machine(
@ -79,7 +79,7 @@ function bench_process(
gen_time::Float64,
opt_time::Float64,
io::IO = stdout;
use_likwid = true,
use_likwid = false,
)
log("\n--- Benchmarking $(process_name) ---")

View File

@ -18,9 +18,9 @@ nvidia-smi > results/cuda_gpu_$i.txt
lsblk > results/storage_$i.txt
lspci > results/pci_$i.txt
echo "Initiating julia..."
julia --threads=8 --project=./ -e 'using Pkg; Pkg.instantiate(); Pkg.add(url="https://github.com/QEDjl-project/QEDprocesses.jl/")' >> $LOG_FILE 2>&1 || exit 1 # need current dev version of QEDprocesses
julia --threads=8 -e 'using Pkg; Pkg.add("CSV"); Pkg.add("DataFrames"); Pkg.add("LIKWID"); Pkg.add("CUDA"); Pkg.add("Random"); Pkg.add("BenchmarkTools"); Pkg.add("Dates")' >> $LOG_FILE 2>&1 || exit 1 # add requirements for the bench script
#echo "Initiating julia..."
#julia --threads=8 --project=./ -e 'using Pkg; Pkg.instantiate(); Pkg.add(url="https://github.com/QEDjl-project/QEDprocesses.jl/")' >> $LOG_FILE 2>&1 || exit 1 # need current dev version of QEDprocesses
#julia --threads=8 -e 'using Pkg; Pkg.add("CSV"); Pkg.add("DataFrames"); Pkg.add("LIKWID"); Pkg.add("CUDA"); Pkg.add("Random"); Pkg.add("BenchmarkTools"); Pkg.add("Dates")' >> $LOG_FILE 2>&1 || exit 1 # add requirements for the bench script
echo "Benchmarking $i Threads"
julia --project --threads=$i examples/qed_bench.jl >> $LOG_FILE 2>&1 || echo "-- Something went wrong, check logs --"

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 95,
"metadata": {},
"outputs": [],
"source": [
@ -11,13 +11,13 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 96,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"num_diagrams (generic function with 3 methods)"
"num_diagrams_small_form (generic function with 3 methods)"
]
},
"metadata": {},
@ -28,80 +28,72 @@
"function num_diagrams(m::Int, e::Int, u::Int = 0, t::Int = 0)\n",
" n = e + u + t\n",
" return Int(factorial(3n-3) / factorial(2n-1)) * binomial(m+3n-3, 3n-3) * factorial(m) * factorial(e) * factorial(u) * factorial(t)\n",
"end\n",
"\n",
"function num_diagrams_small_form(m::Int, e::Int, u::Int = 0, t::Int = 0)\n",
" n = e + u + t\n",
" return Int(factorial(m+3n-3) / factorial(2n-1)) * factorial(e) * factorial(u) * factorial(t)\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 97,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"8"
]
},
"metadata": {},
"output_type": "display_data"
"name": "stdout",
"output_type": "stream",
"text": [
"8\n",
"8\n"
]
}
],
"source": [
"# Trident:\n",
"num_diagrams(1, 2)"
"println(num_diagrams(1, 2))\n",
"println(num_diagrams_small_form(1, 2))"
]
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 98,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"7-element Vector{Int64}:\n",
" 2\n",
" 6\n",
" 24\n",
" 120\n",
" 720\n",
" 5040\n",
" 40320"
]
},
"metadata": {},
"output_type": "display_data"
"name": "stdout",
"output_type": "stream",
"text": [
"[2, 6, 24, 120, 720, 5040, 40320]\n",
"[2, 6, 24, 120, 720, 5040, 40320]\n"
]
}
],
"source": [
"# n-Photon Compton:\n",
"[num_diagrams(n, 1) for n in 2:8]"
"println([num_diagrams(n, 1) for n in 2:8])\n",
"println([num_diagrams_small_form(n, 1) for n in 2:8])"
]
},
{
"cell_type": "code",
"execution_count": 62,
"execution_count": 99,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6-element Vector{Int64}:\n",
" 2\n",
" 36\n",
" 1728\n",
" 158400\n",
" 23587200\n",
" 5181926400"
]
},
"metadata": {},
"output_type": "display_data"
"name": "stdout",
"output_type": "stream",
"text": [
"[2, 36, 1728, 158400, 23587200, 5181926400]\n",
"[2, 36, 1728, 158400, 23587200, 5181926400]\n"
]
}
],
"source": [
"# fermion scattering\n",
"[num_diagrams(0, n) for n in 2:7]"
"println([num_diagrams(0, n) for n in 2:7])\n",
"println([num_diagrams_small_form(0, n) for n in 2:7])"
]
}
],