Skip to content

Commit

Permalink
Make GWP GPU-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo authored and 谢萧涯 committed Sep 11, 2024
1 parent 72643ef commit 6987d2a
Show file tree
Hide file tree
Showing 14 changed files with 340 additions and 360 deletions.
12 changes: 12 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,18 @@ steps:
- group: "GPU"
steps:

- label: "GPU:Gravity waves"
command: >
julia --color=yes --project=examples examples/hybrid/driver.jl
--config_file $CONFIG_PATH/sphere_nonorographic_gravity_wave.yml
--job_id sphere_nonorographic_gravity_wave
artifact_paths: "sphere_nonorographic_gravity_wave/*"
env:
CLIMACOMMS_DEVICE: "CUDA"
agents:
slurm_gpus: 1
slurm_mem: 16G

- label: "GPU: baroclinic wave"
key: "sphere_baroclinic_wave_rhoe_gpu"
command: >
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
SurfaceFluxes = "49b00bb7-8bd4-4f2b-b78c-51cd0450215f"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
UnrolledUtilities = "0fe1646c-419e-43be-ac14-22321958931b"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
Expand Down
3 changes: 3 additions & 0 deletions config/model_configs/sphere_nonorographic_gravity_wave.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
t_end: "1500secs"
dt: "400secs"
non_orographic_gravity_wave: true
13 changes: 11 additions & 2 deletions examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.5"
manifest_format = "2.0"
project_hash = "f170b98e0622d3f170fe6045d8258f49ebd31345"
project_hash = "80a49694c1f1c79f9fbc30dce7fa2ef31c3b7f5c"

[[deps.ADTypes]]
git-tree-sha1 = "99a6f5d0ce1c7c6afdb759daa30226f71c54f6b0"
Expand Down Expand Up @@ -321,7 +321,7 @@ version = "0.5.7"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"

[[deps.ClimaAtmos]]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "FastGaussQuadrature", "Insolation", "Interpolations", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "RRTMGP", "SciMLBase", "StaticArrays", "Statistics", "SurfaceFluxes", "Thermodynamics", "YAML"]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "FastGaussQuadrature", "Insolation", "Interpolations", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "RRTMGP", "SciMLBase", "StaticArrays", "Statistics", "SurfaceFluxes", "Thermodynamics", "UnrolledUtilities", "YAML"]
path = ".."
uuid = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
version = "0.27.5"
Expand Down Expand Up @@ -2718,6 +2718,15 @@ git-tree-sha1 = "6cc9d682755680e0f0be87c56392b7651efc2c7b"
uuid = "9602ed7d-8fef-5bc8-8597-8f21381861e8"
version = "0.1.5"

[[deps.UnrolledUtilities]]
git-tree-sha1 = "d0b2aa2d71fa2f4494cb3cf69719a6807ea0df40"
uuid = "0fe1646c-419e-43be-ac14-22321958931b"
version = "0.1.4"
weakdeps = ["StaticArrays"]

[deps.UnrolledUtilities.extensions]
UnrolledUtilitiesStaticArraysExt = "StaticArrays"

[[deps.UnsafeAtomics]]
git-tree-sha1 = "6331ac3440856ea1988316b46045303bef658278"
uuid = "013be700-e6cd-48c3-b4a1-df204f14c38f"
Expand Down
1 change: 1 addition & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
UnrolledUtilities = "0fe1646c-419e-43be-ac14-22321958931b"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
Expand Down
96 changes: 45 additions & 51 deletions perf/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.5"
manifest_format = "2.0"
project_hash = "3ab1b0110c2d964d6e0dd21cb828e8bc3dc7f429"
project_hash = "60ff2f2149f6bed32474af38d1d150d3f8d327a6"

[[deps.ADTypes]]
git-tree-sha1 = "99a6f5d0ce1c7c6afdb759daa30226f71c54f6b0"
Expand Down Expand Up @@ -332,7 +332,7 @@ version = "0.5.6"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"

[[deps.ClimaAtmos]]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "FastGaussQuadrature", "Insolation", "Interpolations", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "RRTMGP", "SciMLBase", "StaticArrays", "Statistics", "SurfaceFluxes", "Thermodynamics", "YAML"]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "FastGaussQuadrature", "Insolation", "Interpolations", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "RRTMGP", "SciMLBase", "StaticArrays", "Statistics", "SurfaceFluxes", "Thermodynamics", "UnrolledUtilities", "YAML"]
path = ".."
uuid = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
version = "0.27.5"
Expand Down Expand Up @@ -574,12 +574,6 @@ git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"

[[deps.Cthulhu]]
deps = ["CodeTracking", "FoldingTrees", "InteractiveUtils", "JuliaSyntax", "PrecompileTools", "Preferences", "REPL", "TypedSyntax", "UUIDs", "Unicode", "WidthLimitedIO"]
git-tree-sha1 = "6dd420e944a3be328f91088d6a1af02576ccba4b"
uuid = "f68482b8-f384-11e8-15f7-abe071a5a75f"
version = "2.15.0"

[[deps.CubedSphere]]
deps = ["TaylorSeries"]
git-tree-sha1 = "51bb25de518b4c62b7cdf26e5fbb84601bb27a60"
Expand Down Expand Up @@ -932,12 +926,6 @@ git-tree-sha1 = "bd1aaf448be998ea427b1c7213b8acf2e278498b"
uuid = "08572546-2f56-4bcf-ba4e-bab62c3a3f89"
version = "1.0.0"

[[deps.FoldingTrees]]
deps = ["AbstractTrees", "REPL"]
git-tree-sha1 = "d94efd85f2fe192cdf664aa8b7c431592faed59e"
uuid = "1eca21be-9b9b-4ed8-839a-6d8ae26b1781"
version = "1.2.1"

[[deps.Fontconfig_jll]]
deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Zlib_jll"]
git-tree-sha1 = "db16beca600632c95fc8aca29890d83788dd8b23"
Expand Down Expand Up @@ -1309,10 +1297,18 @@ uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"

[[deps.JET]]
deps = ["InteractiveUtils", "JuliaInterpreter", "LoweredCodeUtils", "MacroTools", "Pkg", "PrecompileTools", "Preferences", "Revise", "Test"]
git-tree-sha1 = "6ff76fc594051832ce91078686bc0d3def6d42c5"
deps = ["CodeTracking", "InteractiveUtils", "JuliaInterpreter", "LoweredCodeUtils", "MacroTools", "Pkg", "PrecompileTools", "Preferences", "Test"]
git-tree-sha1 = "2be1a06ddab589ac6d09930eb36e4365416261b2"
uuid = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
version = "0.8.29"
version = "0.9.9"

[deps.JET.extensions]
JETCthulhuExt = "Cthulhu"
ReviseExt = "Revise"

[deps.JET.weakdeps]
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"

[[deps.JLD2]]
deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "PrecompileTools", "Requires", "TranscodingStreams"]
Expand Down Expand Up @@ -1346,21 +1342,16 @@ version = "3.0.3+0"

[[deps.JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "4b415b6cccb9ab61fec78a621572c82ac7fa5776"
git-tree-sha1 = "2984284a8abcfcc4784d95a9e2ea4e352dd8ede7"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.9.35"
version = "0.9.36"

[[deps.JuliaNVTXCallbacks_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "af433a10f3942e882d3c671aacb203e006a5808f"
uuid = "9c1d0b0a-7046-5b2e-a33f-ea22f176ac7e"
version = "0.2.1+0"

[[deps.JuliaSyntax]]
git-tree-sha1 = "937da4713526b96ac9a178e2035019d3b78ead4a"
uuid = "70703baa-626e-46a2-a12c-08ffd08c73b4"
version = "0.4.10"

[[deps.KLU]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"]
git-tree-sha1 = "07649c499349dad9f08dde4243a4c597064663e9"
Expand Down Expand Up @@ -1667,9 +1658,9 @@ weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"]

[[deps.LoweredCodeUtils]]
deps = ["JuliaInterpreter"]
git-tree-sha1 = "0b8cf121228f7dae022700c1c11ac1f04122f384"
git-tree-sha1 = "1ce1834f9644a8f7c011eb0592b7fd6c42c90653"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "2.3.2"
version = "3.0.1"

[[deps.Lz4_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand Down Expand Up @@ -2318,12 +2309,6 @@ git-tree-sha1 = "256eeeec186fa7f26f2801732774ccf277f05db9"
uuid = "ae5879a3-cd67-5da8-be7f-38c6eb64a37b"
version = "1.1.1"

[[deps.Revise]]
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"]
git-tree-sha1 = "85ddd93ea15dcd8493400600e09104a9e94bb18d"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.5.15"

[[deps.Rmath]]
deps = ["Random", "Rmath_jll"]
git-tree-sha1 = "f65dcb5fa46aee0cf9ed6274ccbd597adc49aa7b"
Expand Down Expand Up @@ -2376,9 +2361,9 @@ version = "0.6.43"

[[deps.SciMLBase]]
deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"]
git-tree-sha1 = "303a73db99326a8be43e695fbab9e076b02118ca"
git-tree-sha1 = "952e09c65264fe2a8155dd6aad60c188a0b83f69"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
version = "2.52.2"
version = "2.53.0"

[deps.SciMLBase.extensions]
SciMLBaseChainRulesCoreExt = "ChainRulesCore"
Expand Down Expand Up @@ -2495,16 +2480,28 @@ uuid = "45858cf5-a6b0-47a3-bbea-62219f50df47"
version = "0.1.3"

[[deps.SnoopCompile]]
deps = ["AbstractTrees", "Cthulhu", "FlameGraphs", "InteractiveUtils", "JET", "OrderedCollections", "Pkg", "Printf", "Profile", "Requires", "Serialization", "SnoopCompileCore", "YAML"]
git-tree-sha1 = "894e542ef8553c82ead28171e6c144d0fb492563"
deps = ["AbstractTrees", "FlameGraphs", "InteractiveUtils", "OrderedCollections", "Pkg", "Printf", "Profile", "Serialization", "SnoopCompileCore", "YAML"]
git-tree-sha1 = "d13633f779365415c877f5ffe07db8803ad73fba"
uuid = "aa65fe97-06da-5843-b5b1-d5d13cad87d2"
version = "2.10.8"
version = "3.0.0"

[deps.SnoopCompile.extensions]
CthulhuExt = "Cthulhu"
JETExt = ["JET", "Cthulhu"]
SCPrettyTablesExt = "PrettyTables"
SCPyPlotExt = "PyPlot"

[deps.SnoopCompile.weakdeps]
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"

[[deps.SnoopCompileCore]]
deps = ["Serialization"]
git-tree-sha1 = "0fc98257d960ec35b9339ca394b93954cfaf5ecd"
git-tree-sha1 = "32d1b8d669ee7a7d8ecb6bc2046d6e019f1e0571"
uuid = "e2b509da-e806-4183-be48-004708413034"
version = "2.10.1"
version = "3.0.0"

[[deps.Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
Expand Down Expand Up @@ -2794,12 +2791,6 @@ git-tree-sha1 = "ea3e54c2bdde39062abf5a9758a23735558705e1"
uuid = "781d530d-4396-4725-bb49-402e4bee1e77"
version = "1.4.0"

[[deps.TypedSyntax]]
deps = ["CodeTracking", "JuliaSyntax"]
git-tree-sha1 = "1b11092fc9eab26e21402ed313406a75d948634f"
uuid = "d265eb64-f81a-44ad-a842-4247ee1503de"
version = "1.4.1"

[[deps.URIs]]
git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b"
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
Expand Down Expand Up @@ -2829,6 +2820,15 @@ git-tree-sha1 = "6cc9d682755680e0f0be87c56392b7651efc2c7b"
uuid = "9602ed7d-8fef-5bc8-8597-8f21381861e8"
version = "0.1.5"

[[deps.UnrolledUtilities]]
git-tree-sha1 = "d0b2aa2d71fa2f4494cb3cf69719a6807ea0df40"
uuid = "0fe1646c-419e-43be-ac14-22321958931b"
version = "0.1.4"
weakdeps = ["StaticArrays"]

[deps.UnrolledUtilities.extensions]
UnrolledUtilitiesStaticArraysExt = "StaticArrays"

[[deps.UnsafeAtomics]]
git-tree-sha1 = "6331ac3440856ea1988316b46045303bef658278"
uuid = "013be700-e6cd-48c3-b4a1-df204f14c38f"
Expand Down Expand Up @@ -2863,12 +2863,6 @@ git-tree-sha1 = "8351f8d73d7e880bfc042a8b6922684ebeafb35c"
uuid = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
version = "0.2.0"

[[deps.WidthLimitedIO]]
deps = ["Unicode"]
git-tree-sha1 = "71142739e695823729a335e9bc124ef41ec1433a"
uuid = "b8c1c048-cf81-46c6-9da0-18c1d99e41f2"
version = "1.0.1"

[[deps.WoodburyMatrices]]
deps = ["LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "c1a7aa6219628fcd757dede0ca95e245c5cd9511"
Expand Down
3 changes: 2 additions & 1 deletion perf/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
UnrolledUtilities = "0fe1646c-419e-43be-ac14-22321958931b"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
Expand All @@ -89,7 +90,7 @@ ProfileCanvas = "0.1"
ProgressLogging = "0.1"
QuadGK = "2"
SciMLBase = "1, 2"
SnoopCompileCore = "2"
SnoopCompileCore = "3"
TOML = "1"
URIs = "1"
julia = "1.7"
Expand Down
2 changes: 1 addition & 1 deletion perf/inference_flame_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ using ProfileView
import Profile
Profile.clear_malloc_data()
Profile.clear()
tinf = @snoopi_deep begin
tinf = @snoop_inference begin
do_work!(integrator_args, integrator_kwargs)
end

Expand Down
4 changes: 2 additions & 2 deletions perf/invalidations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ ClimaComms.@import_required_backends
import ClimaAtmos as CA
redirect_stderr(IOContext(stderr, :stacktrace_types_limited => Ref(false)))

# From: https://timholy.github.io/SnoopCompile.jl/stable/snoopr/
# From: https://timholy.github.io/SnoopCompile.jl/dev/tutorials/invalidations/#Tutorial-on-@snoop_invalidations
using SnoopCompileCore
invalidations = @snoopr begin
invalidations = @snoop_invalidations begin
(; config_file, job_id) = CA.commandline_kwargs()
config = CA.AtmosConfig(config_file; job_id)
include(joinpath(dirname(@__DIR__), "examples", "hybrid", "driver.jl"))
Expand Down
Loading

0 comments on commit 6987d2a

Please sign in to comment.