-
Notifications
You must be signed in to change notification settings - Fork 242
Add a performance benchmark pipeline #4375
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
Merged
Merged
Changes from 30 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
30b00c5
add the runbenchmarks
simone-silvestri f41f048
let's ty it out
simone-silvestri 95bbbfe
Merge branch 'main' into ss/performance-github-action
simone-silvestri e839d0e
trigger tests
simone-silvestri 7952af8
on everything
simone-silvestri d13f3c4
Merge branch 'ss/performance-github-action' of github.com:CliMA/Ocean…
simone-silvestri bd16eae
run the benchmarks
simone-silvestri 299c8e4
maybe this works
simone-silvestri 2155099
above project
simone-silvestri 88ea9e7
adding benchmarktools
simone-silvestri 3bb144d
try pushing on docs build
simone-silvestri 65fc0a4
Merge branch 'main' into ss/performance-github-action
simone-silvestri ee6fb83
Merge branch 'main' into ss/performance-github-action
simone-silvestri e38dc9b
try this once
simone-silvestri 1564c5f
correct queue
simone-silvestri 38b6885
try out the pipeline
simone-silvestri c11b8f3
no need for an architecture
simone-silvestri 4ce978e
use the oceananigans queue
simone-silvestri 65a13b5
add a trace
simone-silvestri a4b41bf
change output per group
simone-silvestri a4e021a
use GPU1 for the moment
simone-silvestri ef8a7f4
instantiate inside the test
simone-silvestri ed012b9
instantiate first
simone-silvestri 72bdc1e
try uploading an artifact
simone-silvestri 115f466
add an artifact
simone-silvestri 8c68e32
should work all in one pipeline
simone-silvestri 2d423e0
some bugfixes
simone-silvestri a6b7fba
runb the complete benchmark test suite
simone-silvestri aba63ef
load cheap advection
simone-silvestri 9c96189
fix cheap advection
simone-silvestri 227766b
Update .buildkite/pipeline-benchmarks.yml
simone-silvestri 78e277a
switch queue
glwagner cddc36f
add login to the benchmark pipeline
simone-silvestri 6349407
add login to the benchmark pipeline
simone-silvestri d0c9b02
same the main build name
simone-silvestri 694c417
add a condiitonal block
simone-silvestri a282496
add a conditional save
simone-silvestri d4808f7
not working?
simone-silvestri 268c8cc
conditional metadata save once again
simone-silvestri aaafd2d
add a comment
simone-silvestri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
env: | ||
JULIA_VERSION: "1.10.9" | ||
JULIA_MINOR_VERSION: "1.10" | ||
TARTARUS_HOME: "/storage5/buildkite-agent" | ||
JULIA_DEPOT_PATH: "$TARTARUS_HOME/.julia-$BUILDKITE_BUILD_NUMBER" | ||
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager | ||
JULIA_NUM_PRECOMPILE_TASKS: 24 | ||
JULIA_NUM_THREADS: 8 | ||
NSYS: "/storage6/simone/new_nsight/bin/nsys" | ||
CUDA_VISIBLE_DEVICES: "1" # Tartarus device for GPU Benchmarking | ||
TMPDIR: "$TARTARUS_HOME/tmp" | ||
|
||
agents: | ||
queue: "Oceananigans" | ||
|
||
steps: | ||
- label: "🏕️ initialize tartarus environment" | ||
key: "init" | ||
env: | ||
JULIA_DEPOT_PATH: "$TARTARUS_HOME/.julia-$BUILDKITE_BUILD_NUMBER" | ||
TEST_GROUP: "init" | ||
JULIA_BINDIR: "$TARTARUS_HOME/julia-$JULIA_VERSION/bin" | ||
command: | | ||
# Download julia binaries | ||
wget -N -P $TARTARUS_HOME https://julialang-s3.julialang.org/bin/linux/x64/$JULIA_MINOR_VERSION/julia-$JULIA_VERSION-linux-x86_64.tar.gz | ||
tar xf $TARTARUS_HOME/julia-$JULIA_VERSION-linux-x86_64.tar.gz -C $TARTARUS_HOME | ||
agents: | ||
queue: "Oceananigans" | ||
retry: | ||
automatic: | ||
- exit_status: 1 | ||
limit: 1 | ||
|
||
- wait | ||
|
||
- label: "🚀 Oceananigans GPU benchmarks" | ||
key: "benchmarks" | ||
agents: | ||
queue: "Oceananigans" | ||
command: | | ||
# Instantiate | ||
$TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes --project --check-bounds=no -e 'using Pkg; Pkg.instantiate()' | ||
|
||
# Run Periodic benchmarks | ||
export BENCHMARK_GROUP="periodic" | ||
$NSYS profile --output=periodic_output --trace=cuda $TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes --project --check-bounds=no test/benchmark_tests.jl | ||
$NSYS stats periodic_output.nsys-rep > periodic_output.txt | ||
|
||
# Remove generated output files | ||
rm periodic_output.nsys-rep | ||
rm periodic_output.sqlite | ||
|
||
# Run Bounded benchmarks | ||
export BENCHMARK_GROUP="bounded" | ||
$NSYS profile --output=bounded_output --trace=cuda $TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes --project --check-bounds=no test/benchmark_tests.jl | ||
$NSYS stats bounded_output.nsys-rep > bounded_output.txt | ||
|
||
# Remove generated output files | ||
rm bounded_output.nsys-rep | ||
rm bounded_output.sqlite | ||
|
||
# Run Periodic cheap advection benchmarks | ||
export BENCHMARK_GROUP="periodic_cheap_advection" | ||
$NSYS profile --output=periodic_cheap_advection_output --trace=cuda $TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes --project --check-bounds=no test/benchmark_tests.jl | ||
$NSYS stats periodic_cheap_advection_output.nsys-rep > periodic_cheap_advection_output.txt | ||
|
||
# Remove generated output files | ||
rm periodic_cheap_advection_output.nsys-rep | ||
rm periodic_cheap_advection_output.sqlite | ||
|
||
# Run Bounded cheap advection benchmarks | ||
export BENCHMARK_GROUP="bounded_cheap_advection" | ||
$NSYS profile --output=bounded_cheap_advection_output --trace=cuda $TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes --project --check-bounds=no test/benchmark_tests.jl | ||
$NSYS stats bounded_cheap_advection_output.nsys-rep > bounded_cheap_advection_output.txt | ||
|
||
# Remove generated output files | ||
rm bounded_cheap_advection_output.nsys-rep | ||
rm bounded_cheap_advection_output.sqlite | ||
|
||
# Run Immersed benchmarks | ||
export BENCHMARK_GROUP="immersed" | ||
$NSYS profile --output=immersed_output --trace=cuda $TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes --project --check-bounds=no test/benchmark_tests.jl | ||
$NSYS stats immersed_output.nsys-rep > immersed_output.txt | ||
|
||
# Remove generated output files | ||
rm immersed_output.nsys-rep | ||
rm immersed_output.sqlite | ||
|
||
artifact_paths: | ||
- "periodic_output.txt" | ||
- "bounded_output.txt" | ||
- "periodic_cheap_advection_output.txt" | ||
- "bounded_cheap_advection_output.txt" | ||
- "immersed_output.txt" | ||
soft_fail: | ||
- exit_status: 3 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using Oceananigans | ||
using Oceananigans.Units | ||
using Oceananigans.Architectures: on_architecture | ||
using Oceananigans.TurbulenceClosures.TKEBasedVerticalDiffusivities: CATKEVerticalDiffusivity | ||
using SeawaterPolynomials.TEOS10 | ||
using Random | ||
|
||
function ocean_benchmark(arch, Nx, Ny, Nz, topology, immersed, tracer_advection=WENO(order=7)) | ||
|
||
z_faces = collect(range(-6000, 0, length=Nz+1)) | ||
|
||
grid = RectilinearGrid(arch; size=(Nx, Ny, Nz), | ||
halo=(7, 7, 7), | ||
z=z_faces, | ||
x=(-1000kilometers, 1000kilometers), | ||
y=(-1000kilometers, 1000kilometers), | ||
topology) | ||
|
||
grid = if immersed | ||
Random.seed!(1234) | ||
bottom = Oceananigans.Architectures.on_architecture(arch, - 5000 .* rand(Nx, Ny) .- 1000) | ||
ImmersedBoundaryGrid(grid, GridFittedBottom(bottom); active_cells_map=true) | ||
else | ||
grid | ||
end | ||
|
||
@info "Grid is built" | ||
momentum_advection = WENOVectorInvariant() | ||
buoyancy = SeawaterBuoyancy(equation_of_state=TEOS10EquationOfState()) | ||
free_surface = SplitExplicitFreeSurface(grid; substeps=70) | ||
closure = CATKEVerticalDiffusivity() | ||
|
||
model = HydrostaticFreeSurfaceModel(; grid, | ||
momentum_advection, | ||
tracer_advection, | ||
buoyancy, | ||
closure, | ||
free_surface, | ||
tracers = (:T, :S, :e)) | ||
|
||
@info "Model is built" | ||
|
||
R = rand(size(model.grid)) | ||
|
||
# initialize variables with randomish values | ||
Tᵢ = 0.0001 .* R .+ 20 | ||
Sᵢ = 0.0001 .* R .+ 35 | ||
uᵢ = 0.0001 .* R | ||
vᵢ = 0.0001 .* R | ||
|
||
set!(model, T=Tᵢ, S=Sᵢ, e=1e-6, u=uᵢ, v=vᵢ) | ||
|
||
return model | ||
end | ||
|
||
function run_benchmark(model) | ||
for _ in 1:15 | ||
time_step!(model, 1.0) | ||
end | ||
end | ||
|
||
group = get(ENV, "BENCHMARK_GROUP", "all") |> Symbol | ||
|
||
const Nx = 500 | ||
const Ny = 200 | ||
const Nz = 60 | ||
|
||
arch = GPU() | ||
|
||
cheap_advection = FluxFormAdvection(WENO(order=7), WENO(order=7), Centered()) | ||
|
||
if group == :periodic | ||
model = ocean_benchmark(arch, Nx, Ny, Nz, (Periodic, Periodic, Bounded), false) | ||
run_benchmark(model) | ||
end | ||
|
||
if group == :bounded | ||
model = ocean_benchmark(arch, Nx, Ny, Nz, (Bounded, Bounded, Bounded), false) | ||
run_benchmark(model) | ||
end | ||
|
||
if group == :periodic_cheap_advection | ||
model = ocean_benchmark(arch, Nx, Ny, Nz, (Periodic, Periodic, Bounded), false, cheap_advection) | ||
run_benchmark(model) | ||
end | ||
|
||
if group == :bounded_cheap_advection | ||
model = ocean_benchmark(arch, Nx, Ny, Nz, (Bounded, Bounded, Bounded), false, cheap_advection) | ||
run_benchmark(model) | ||
end | ||
|
||
if group == :immersed | ||
model = ocean_benchmark(arch, Nx, Ny, Nz, (Periodic, Periodic, Bounded), true) | ||
run_benchmark(model) | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.