diff --git a/data/evaluate_full_node_bench.jl b/data/evaluate_full_node_bench.jl new file mode 100644 index 0000000..b49cf71 --- /dev/null +++ b/data/evaluate_full_node_bench.jl @@ -0,0 +1,200 @@ +using CSV +using DataFrames +using Plots +using StatsPlots +using LaTeXStrings + +if (length(ARGS) < 1) + println("Please use with \"input_file.csv\"") +end + +processes = [ + "QED Process: 'ke->ke'", + "QED Process: 'ke->kke'", + "QED Process: 'ke->kkke'", + "QED Process: 'ke->kkkke'", + "QED Process: 'ke->kkkkke'", +] + +function proc_to_n(str::AbstractString) + parts = split(str, "'") + parts = split(parts[2], "->") + k_count = count(c -> c == 'k', parts[2]) + return k_count +end + +function beautify_title(str::AbstractString) + parts = split(str, "'") + + preprefix = parts[1] + infix = parts[2] + sufsuffix = parts[3] + + parts = split(infix, "->") + + prefix = parts[1] + suffix = parts[2] + + k_count = count(c -> c == 'k', suffix) + B_count = count(c -> c == 'B', suffix) + + if k_count == 1 || B_count == 1 + new_suffix = suffix + elseif k_count >= 1 + new_suffix = replace(suffix, r"k+" => "k^$k_count") + elseif B_count >= 1 + new_suffix = replace(suffix, r"B+" => "B^$B_count") + end + + return "QED Compton Scattering Process " * L"%$prefix \rightarrow %$new_suffix" * sufsuffix +end + +input_file = ARGS[1] +df = CSV.read(input_file, DataFrame) +n_inputs = df[:, "n_inputs"][1] +gpus = df.gpu_devices[1] +cpus = df.cpu_threads[1] + +power = Int(round(log2(n_inputs))) + +chunk_sizes = ["1024", "4096", "16384", "65536", "262144", "1048576"] + +best_times = Vector{Float64}() +best_times_std = Vector{Float64}() + +# plotting with threads as x axis +for process_name in processes + df_filt = filter(:process_name => x -> x == process_name, df) + + df_filt.cpu_ratio = df_filt.cpu_chunks ./ (df_filt.cpu_chunks .+ df_filt.gpu_chunks) .* 100.0 + df_filt.gpu_ratio = df_filt.gpu_chunks ./ (df_filt.cpu_chunks .+ df_filt.gpu_chunks) .* 100.0 + + push!(best_times, minimum(df_filt.time)) + + bar(chunk_sizes, df_filt.cpu_ratio, label = "workload completed by \$$(cpus)\$ CPU threads (%)") + bar!( + chunk_sizes, + [100, 100, 100, 100, 100, 100], + label = "workload completed by $(gpus) GPUs (%)", + fillto = df_filt.cpu_ratio, + ) + + plot!( + title = "$(beautify_title(process_name))\nComputing $(n_inputs) (\$2^{$(power)}\$) Matrix Elements", + yscale = :linear, + #xticks = [1024 4096 16384 65536 262144 1048576], + ylim = (0, 105), + legend = :outerbottom, + legendcolumns = 1, + legend_font_pointsize = 10, + size = (800, 600), + ylabel = "contribution (%)", + xlabel = "chunk size (#)", + ) + + savefig("full_node_chunk_size_$(process_name)_ratio.pdf") + + + scatter( + chunk_sizes, + df_filt.rate, + label = "total execution rate (\$s^{-1}\$)", + title = "$(beautify_title(process_name))\nComputing $(n_inputs) (\$2^{$(power)}\$) Matrix Elements", + yscale = :log10, + #xticks = [1024 4096 16384 65536 262144 1048576], + legend = :outerbottom, + legendcolumns = 1, + legend_font_pointsize = 10, + size = (800, 600), + ylabel = "rate (\$s^{-1}\$)", + xlabel = "chunk size (#)", + markersize = 7, + ) + + savefig("full_node_chunk_size_$(process_name)_rate.pdf") + + + scatter( + chunk_sizes, + df_filt.time, + yerror = df_filt.std, + label = "total execution time (s)", + title = "$(beautify_title(process_name))\nComputing $(n_inputs) (\$2^{$(power)}\$) Matrix Elements", + #xticks = [1024 4096 16384 65536 262144 1048576], + ylim = (0, maximum(df_filt.time) * 1.05), + legend = :outerbottom, + legendcolumns = 1, + legend_font_pointsize = 10, + size = (800, 600), + ylabel = "time (s)", + xlabel = "chunk size (#)", + markersize = 7, + ) + + savefig("full_node_chunk_size_$(process_name)_time.pdf") + +end + + +# plotting with process size as x axis +A100_rates = [2.530045276927587e9, 1.16972304616864e9, 2.0002725972692013e8, 3.495722925446318e7, 4.792187095617111e6] +CPU_32threads_rates = + [3.2691139045711152e7, 1.1578342663759507e7, 3.1670680975577887e6, 731037.7069429948, 115001.5594731802] + +theory_rates = (A100_rates .+ CPU_32threads_rates) .* 4 + +scatter( + proc_to_n.(processes), + best_times, + label = "full node best achieved time (s)", + title = "QED N-Photon Compton Scattering\nComputing $(n_inputs) (\$2^{$(power)}\$) Matrix Elements", + ylim = (0, maximum(best_times) * 1.05), + legend = :outerbottom, + legendcolumns = 1, + legend_font_pointsize = 10, + size = (800, 600), + ylabel = "time (s)", + xlabel = "process size (#)", + markersize = 7, +) + +savefig("full_node_process_best_time.pdf") + + +scatter( + proc_to_n.(processes), + (n_inputs ./ best_times), + label = "full node best achieved rate (\$s^{-1}\$)", + title = "QED N-Photon Compton Scattering\nComputing $(n_inputs) (\$2^{$(power)}\$) Matrix Elements", + ylim = (0, maximum(n_inputs ./ best_times) * 1.05), + legend = :outerbottom, + legendcolumns = 1, + legend_font_pointsize = 10, + size = (800, 600), + ylabel = "rate (\$s^{-1}\$)", + xlabel = "process size (#)", + markersize = 7, +) + +savefig("full_node_process_best_rate.pdf") + + + +scatter( + proc_to_n.(processes), + [(n_inputs ./ best_times) theory_rates], + label = ["full node best achieved rate (\$s^{-1}\$)" "theoretical rate from previous benchmarks (\$s^{-1}\$)"], + title = "QED N-Photon Compton Scattering\nComputing $(n_inputs) (\$2^{$(power)}\$) Matrix Elements", + #ylim = (0, max(maximum(n_inputs ./ best_times), maximum(theory_rates)) * 1.05), + yscale = :log10, + legend = :outerbottom, + legendcolumns = 1, + legend_font_pointsize = 10, + size = (800, 600), + ylabel = "rate (\$s^{-1}\$)", + xlabel = "process size (#)", + markersize = 7, +) + +savefig("full_node_process_best_rate_plus_theory.pdf") + diff --git a/data/full_node_bench_hemera_32t_4a100_371467c.csv b/data/full_node_bench_hemera_32t_4a100_371467c.csv new file mode 100644 index 0000000..dfa4135 --- /dev/null +++ b/data/full_node_bench_hemera_32t_4a100_371467c.csv @@ -0,0 +1,31 @@ +process_name,cpu_threads,gpu_devices,n_inputs,chunk_size,time,std,rate,cpu_chunks,gpu_chunks,memory_est +QED Process: 'ke->ke',124,4,67108864,1024,3.498023189,0.3076721764605935,1.9184796776371513e7,45294.0,20242.0,1.447298688e10 +QED Process: 'ke->ke',124,4,67108864,4096,2.401494263,0.17013104933519752,2.7944628073425464e7,8872.5,7511.5,1.340607224e10 +QED Process: 'ke->ke',124,4,67108864,16384,2.040338948,0.11818602853354224,3.2891037082726903e7,1942.0,2154.0,1.2850894448e10 +QED Process: 'ke->ke',124,4,67108864,65536,1.9094240825,0.0703634619424293,3.514612841382763e7,431.0,593.0,1.2549270576e10 +QED Process: 'ke->ke',124,4,67108864,262144,1.663800835,0.09683669072918406,4.033467383131828e7,124.0,132.0,1.3304598192e10 +QED Process: 'ke->ke',124,4,67108864,1048576,4.363178006,0.15362201468327347,1.5380730263059545e7,60.0,4.0,1.635789408e10 +QED Process: 'ke->kke',124,4,67108864,1024,3.595792702,0.22982494201906578,1.8663162635230247e7,38403.0,27133.0,1.6004835648e10 +QED Process: 'ke->kke',124,4,67108864,4096,2.759823507,0.1517042378902089,2.431636074907887e7,7680.5,8703.5,1.521632832e10 +QED Process: 'ke->kke',124,4,67108864,16384,2.438895872,0.2675005760041791,2.7516084130712736e7,1666.0,2430.0,1.4017263776e10 +QED Process: 'ke->kke',124,4,67108864,65536,2.102141753,0.19062540340211018,3.19240431356391e7,372.0,652.0,1.4542648832e10 +QED Process: 'ke->kke',124,4,67108864,262144,1.963817117,0.270899103650203,3.417266476550423e7,124.0,132.0,1.5452095984e10 +QED Process: 'ke->kke',124,4,67108864,1048576,4.678252536,0.24347387468900175,1.4344857077206746e7,60.0,4.0,1.885768088e10 +QED Process: 'ke->kkke',124,4,67108864,1024,3.922357603,0.5369159040482943,1.7109318117417965e7,25347.0,40189.0,1.672316376e10 +QED Process: 'ke->kkke',124,4,67108864,4096,2.363901747,0.2856164398652175,2.8389024241454653e7,3829.0,12555.0,1.5615308512e10 +QED Process: 'ke->kkke',124,4,67108864,16384,1.893031068,0.15072532448179204,3.545048210481879e7,744.0,3352.0,1.5101105104e10 +QED Process: 'ke->kkke',124,4,67108864,65536,2.137146225,0.12041389223719733,3.140115693300303e7,248.0,776.0,1.5780112288e10 +QED Process: 'ke->kkke',124,4,67108864,262144,2.776542017,0.01817299764175009,2.4169943616596095e7,124.0,132.0,1.7599575872e10 +QED Process: 'ke->kkke',124,4,67108864,1048576,9.735021382,0.14312958275274476,6.89355075522319e6,60.0,4.0,2.1005184928e10 +QED Process: 'ke->kkkke',124,4,67108864,1024,13.24530958,1.1412505488619353,5.066613475107616e6,24940.0,40596.0,1.8619863968e10 +QED Process: 'ke->kkkke',124,4,67108864,4096,6.654388343,2.053901855132858,1.0084903456317563e7,3588.5,12795.5,1.7528517888e10 +QED Process: 'ke->kkkke',124,4,67108864,16384,4.255322572,0.4138751997857821,1.5770570353837797e7,496.0,3600.0,1.7020825088e10 +QED Process: 'ke->kkkke',124,4,67108864,65536,3.756418218,2.7132996417968327,1.78651204699274e7,124.0,900.0,1.701754576e10 +QED Process: 'ke->kkkke',124,4,67108864,262144,12.8016601195,0.06866851952937757,5.24220010323326e6,124.0,132.0,1.974705816e10 +QED Process: 'ke->kkkke',124,4,67108864,1048576,45.664600753,0.4542000947311946,1.4696036512613369e6,62.0,2.0,2.3504986032e10 +QED Process: 'ke->kkkkke',124,4,67108864,1024,56.517159165,NaN,1.1874068865364918e6,24819.0,40717.0,2.1017071136e10 +QED Process: 'ke->kkkkke',124,4,67108864,4096,30.239194471,8.720258576297342,2.2192675821559583e6,2980.0,13404.0,1.940682472e10 +QED Process: 'ke->kkkkke',124,4,67108864,16384,12.192125241,2.800688574554207,5.5042794158908855e6,275.0,3821.0,1.8713809728e10 +QED Process: 'ke->kkkkke',124,4,67108864,65536,19.262260871,0.18994391422350254,3.483955723029103e6,124.0,900.0,1.9165067936e10 +QED Process: 'ke->kkkkke',124,4,67108864,262144,74.888312523,NaN,896119.3240853072,124.0,132.0,2.1894531872e10 +QED Process: 'ke->kkkkke',124,4,67108864,1048576,269.327736071,NaN,249171.7525235084,61.5,2.5,2.5652469296e10 diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_rate.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_rate.pdf new file mode 100644 index 0000000..4583e43 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_rate.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_ratio.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_ratio.pdf new file mode 100644 index 0000000..91d8140 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_ratio.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_time.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_time.pdf new file mode 100644 index 0000000..834878a Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->ke'_time.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_rate.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_rate.pdf new file mode 100644 index 0000000..ace7dfa Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_rate.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_ratio.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_ratio.pdf new file mode 100644 index 0000000..6e61eec Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_ratio.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_time.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_time.pdf new file mode 100644 index 0000000..a367c49 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kke'_time.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_rate.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_rate.pdf new file mode 100644 index 0000000..f53a2c1 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_rate.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_ratio.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_ratio.pdf new file mode 100644 index 0000000..3c8d848 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_ratio.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_time.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_time.pdf new file mode 100644 index 0000000..e939e17 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkke'_time.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_rate.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_rate.pdf new file mode 100644 index 0000000..7e57d8b Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_rate.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_ratio.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_ratio.pdf new file mode 100644 index 0000000..f860268 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_ratio.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_time.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_time.pdf new file mode 100644 index 0000000..0f454b2 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkke'_time.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_rate.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_rate.pdf new file mode 100644 index 0000000..5660543 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_rate.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_ratio.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_ratio.pdf new file mode 100644 index 0000000..ac00fdd Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_ratio.pdf differ diff --git a/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_time.pdf b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_time.pdf new file mode 100644 index 0000000..cd94272 Binary files /dev/null and b/images/full_node/full_node_chunk_size_QED Process: 'ke->kkkkke'_time.pdf differ diff --git a/images/full_node/full_node_process_best_rate.pdf b/images/full_node/full_node_process_best_rate.pdf new file mode 100644 index 0000000..5edbaaa Binary files /dev/null and b/images/full_node/full_node_process_best_rate.pdf differ diff --git a/images/full_node/full_node_process_best_rate_plus_theory.pdf b/images/full_node/full_node_process_best_rate_plus_theory.pdf new file mode 100644 index 0000000..50b398b Binary files /dev/null and b/images/full_node/full_node_process_best_rate_plus_theory.pdf differ diff --git a/images/full_node/full_node_process_best_time.pdf b/images/full_node/full_node_process_best_time.pdf new file mode 100644 index 0000000..8a28775 Binary files /dev/null and b/images/full_node/full_node_process_best_time.pdf differ