diff --git a/examples/qed_bench.jl b/examples/qed_bench.jl index fbbf1d2..106bddc 100644 --- a/examples/qed_bench.jl +++ b/examples/qed_bench.jl @@ -44,14 +44,14 @@ if isfile(results_filename) df = CSV.read(results_filename, DataFrame) end -nInputs = 2^24 +nInputs = 2^20 function cpu_bench(compute_function, inputs) bench = @benchmark begin @inbounds Threads.@threads for i in eachindex($inputs) @invokelatest $compute_function($inputs[i]) end - end gcsample = true seconds = 300 + end gcsample = true samples = 20 evals = 1 time = median(bench.times) / 1e9 s = std(bench.times) / 1e9 @@ -67,9 +67,9 @@ function gpu_bench(kernel!, inputs) ts = 32 bs = Int(n / ts) bench = @benchmark begin - @cuda threads = ts blocks = bs always_inline = true kernel!.($inputs, $outputs, $n) + @cuda threads = $ts blocks = $bs always_inline = true $kernel!($inputs, $outputs, $n) CUDA.device_synchronize() - end gcsample = true seconds = 300 + end gcsample = true samples = 20 evals = 1 time = median(bench.times) / 1e9 s = std(bench.times) / 1e9 @@ -210,7 +210,7 @@ machine = Machine( # sadly cannot put these in functions because the world age must increase after the function is created which happens only in the global scope ## -- WARMUP TO COMPILE FUNCTIONS first - +#= optimizer = RandomWalkOptimizer(MersenneTwister(0)) # 2-photon compton @@ -230,7 +230,7 @@ opt_time = @elapsed optimize_to_fixpoint!(optimizer, graph) func_gen_time = @elapsed compute_func = get_compute_function(graph, process, machine) kernel! = get_cuda_kernel(graph, process, machine) bench_process(process, "warmup", graph, compute_func, kernel!, gen_time, opt_time, func_gen_time) - +=# ## -- WARMUP END optimizer = ReductionOptimizer() diff --git a/experiments/run_qed_exec.sh b/experiments/run_qed_exec.sh index 21fed28..a84ef8b 100755 --- a/experiments/run_qed_exec.sh +++ b/experiments/run_qed_exec.sh @@ -19,10 +19,10 @@ 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 --project=./ -e 'using Pkg; Pkg.instantiate(); Pkg.add(url="https://github.com/AntonReinhard/QEDbase.jl/tree/fix_bs_multiplication")' >> $LOG_FILE 2>&1 || exit 1 # need a specific fix for abs*bs multiplication for gpu -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 -julia --project -e 'using CUDA; CUDA.set_runtime_version!(VersionNumber("12.1"))' >> $LOG_FILE 2>&1 || echo "Failed to set CUDA version number" +#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 --project=./ -e 'using Pkg; Pkg.instantiate(); Pkg.add(url="https://github.com/AntonReinhard/QEDbase.jl/tree/fix_bs_multiplication")' >> $LOG_FILE 2>&1 || exit 1 # need a specific fix for abs*bs multiplication for gpu +#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 +#julia --project -e 'using CUDA; CUDA.set_runtime_version!(VersionNumber("12.1"))' >> $LOG_FILE 2>&1 || echo "Failed to set CUDA version number" echo "Benchmarking $i Threads" julia --project -O3 --threads=$i examples/qed_bench.jl >> $LOG_FILE 2>&1 || echo "-- Something went wrong, check logs --"