Skip to content
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

Add script to tune parameters #179

Merged
merged 23 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
17aa1d5
Add script to tune parameters [skip benchmarks]
thomasfaingnaert Nov 15, 2023
51aba69
Small tweaks
thomasfaingnaert Dec 4, 2023
7835c1c
Apply suggestions from code review
thomasfaingnaert Dec 4, 2023
f92717a
Don't re-instantiate.
maleadt Dec 4, 2023
6882b8b
Simplify log output path.
maleadt Dec 4, 2023
8d7843d
Distribute tuning across multiple processes.
maleadt Dec 4, 2023
bad0c56
Fix/improve distributed execution.
maleadt Dec 4, 2023
425ab49
Tweaks.
maleadt Dec 4, 2023
9a782d7
More fine tuning.
maleadt Dec 4, 2023
54bcadb
Lock GPU clock speeds during tuning
thomasfaingnaert Dec 6, 2023
e184391
Extend set of WMMA operator shapes
thomasfaingnaert Dec 7, 2023
a2791c4
Merge remote-tracking branch 'origin/tf/more-wmma-sizes' into tf/para…
thomasfaingnaert Dec 12, 2023
900f2a4
Perform sweep over different WMMA shapes
thomasfaingnaert Dec 12, 2023
e490dcc
Add NVML data to benchmark dataframe
thomasfaingnaert Dec 12, 2023
1bacdfe
Use serial profiling
thomasfaingnaert Dec 12, 2023
97e2e7f
Allow selecting a GPU.
maleadt Dec 12, 2023
88da82c
Fix manifest loading.
maleadt Dec 13, 2023
83dccd7
Remove LocalArray size check
thomasfaingnaert Jan 2, 2024
90e307a
Lock to max frequency by default
thomasfaingnaert Jan 2, 2024
48467c5
Use time as stop criterion for plot
thomasfaingnaert Jan 2, 2024
abba6db
Sleep if throttling is detected
thomasfaingnaert Jan 2, 2024
cd6a190
Run kernels in batches
thomasfaingnaert Jan 2, 2024
1bc133e
Merge branch 'master' into tf/parameter-tuning
thomasfaingnaert Jan 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test/Manifest.toml
Manifest.toml
tuning/.CondaPkg/
24 changes: 13 additions & 11 deletions configs/configs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using GemmKernels
using LinearAlgebra
using ForwardDiff
using Octavian

struct Configuration
name # Human-readable name of the configuration.
Expand Down Expand Up @@ -64,7 +65,8 @@ function generate_inputs(cf::Configuration)
new_b_h = cf.transpose_b ? transpose(b_h) : b_h

(cf.calc_reference)(c_h, new_a_h, new_b_h, cf.alpha, cf.beta)
c_h, a, b, c, d
c_ref = CuArray(c_h)
c_ref, a, b, c, d
end

# Run the GEMM.
Expand All @@ -88,21 +90,21 @@ function run_baseline(cf::Configuration, a, b, c, d)
end

# Verify results.
function verify(cf::Configuration, c_h, d)
cf.verify(c_h, d)
function verify(cf::Configuration, c_ref, d)
cf.verify(c_ref, d)
end

function verify_default(c_h, d)
isapprox(c_h, Array(d))
function verify_default(c_ref, d)
isapprox(c_ref, d)
end

function verify_bias(c_h, d, bias)
c_h .+ Array(bias)Array(d)
function verify_bias(c_ref, d, bias)
c_ref .+ bias ≈ d
end

function verify_dual(c_h, d)
c_dual = reinterpret(ForwardDiff.Dual{Float32,Float32,1}, c_h)
d_dual = reinterpret(ForwardDiff.Dual{Float32,Float32,1}, Array(d))
function verify_dual(c_ref, d)
c_dual = reinterpret(ForwardDiff.Dual{Float32,Float32,1}, c_ref)
d_dual = reinterpret(ForwardDiff.Dual{Float32,Float32,1}, d)
isapprox(c_dual, d_dual)
end

Expand Down Expand Up @@ -238,7 +240,7 @@ macro get_wmma_config()
CD_type,
transpose_a,
transpose_b,
mul!,
Octavian.matmul!,
Epilogue.Default(),
verify_default,
kernel,
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Octavian = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
XUnit = "3e3c03f2-1a94-11e9-2981-050a4ca824ab"
14 changes: 14 additions & 0 deletions tuning/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
Hyperopt = "93e5fe13-2215-51db-baaf-2e9a34fb2712"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
Octavian = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Loading