-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix buildkite run so that unit tests run on GPU #739
Open
kmdeck
wants to merge
6
commits into
main
Choose a base branch
from
kd/buildkite_fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a328aad
fix buildkite GPU jobs
kmdeck cb7c14b
override broadcasting for retention models
juliasloan25 31ad582
use Array(parent) in tests
juliasloan25 53c2de0
use Ref for LandParameters
juliasloan25 a1dc829
increase slurm_mem limit
juliasloan25 f2833ae
add GPU reproducer
juliasloan25 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 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,64 @@ | ||
# Initially from soiltest.jl phase change source term test | ||
# To reproduce, run this script on GPU | ||
import ClimaComms | ||
ClimaComms.@import_required_backends | ||
using Statistics | ||
using ClimaCore | ||
import ClimaParams as CP | ||
using ClimaLand | ||
using ClimaLand.Domains: Column | ||
using ClimaLand.Soil | ||
import ClimaLand.Parameters as LP | ||
|
||
FT = Float64 | ||
earth_param_set = LP.LandParameters(FT) | ||
ν = FT(0.495) | ||
θ_r = FT(0.1) | ||
hydrology_cm = vanGenuchten{FT}(; α = FT(2.6), n = FT(2.0)) | ||
|
||
soil_domain = Column(; zlim = (FT(-1), FT(0)), nelements = 200) | ||
space_3d = soil_domain.space.subsurface # CenterFiniteDifferenceSpace | ||
|
||
θ_l = ClimaCore.Fields.ones(space_3d) | ||
θ_i = ClimaCore.Fields.ones(space_3d) | ||
T = ClimaCore.Fields.ones(space_3d) | ||
κ = ClimaCore.Fields.ones(space_3d) | ||
tau = ClimaCore.Fields.ones(space_3d) | ||
|
||
# This fails with dynamic function invocation when `LandParameters` | ||
# and `vanGenuchten` both use `tuple` for broadcasting, and it | ||
# passes when `Ref` is used for either `LandParameters` or `vanGenuchten` broadcasting | ||
@. -phase_change_source(θ_l, θ_i, T, tau, ν, θ_r, hydrology_cm, earth_param_set) | ||
|
||
|
||
# # Broadcasting f2 fails with the same error as the original matric_potential call | ||
# function f2(hydrology_cm, earth_param_set, ν, θ_r, θ_l) | ||
# _ρ_i = FT(LP.ρ_cloud_ice(earth_param_set)) | ||
# _ρ_l = FT(LP.ρ_cloud_liq(earth_param_set)) | ||
# _LH_f0 = FT(LP.LH_f0(earth_param_set)) | ||
# _T_freeze = FT(LP.T_freeze(earth_param_set)) | ||
# _grav = FT(LP.grav(earth_param_set)) | ||
# # According to Dall'Amico (text above equation 1), ψw0 corresponds | ||
# # to the matric potential corresponding to the total water content (liquid and ice). | ||
# θtot = min(_ρ_i / _ρ_l * θ_i + θ_l, ν) | ||
|
||
# matric_potential(hydrology_cm, effective_saturation(ν, θtot, θ_r)) | ||
# end | ||
|
||
# @. f2(hydrology_cm, earth_param_set, ν, θ_r, θ_l) | ||
|
||
|
||
# # Defining θtot either of these ways, then calling f doesn't fail | ||
# function f(hydrology_cm, ν, θtot, θ_r) | ||
# @. matric_potential(hydrology_cm, effective_saturation(ν, θtot, θ_r)) | ||
# end | ||
|
||
# _ρ_i = FT(LP.ρ_cloud_ice(earth_param_set)) | ||
# _ρ_l = FT(LP.ρ_cloud_liq(earth_param_set)) | ||
# _LH_f0 = FT(LP.LH_f0(earth_param_set)) | ||
# _T_freeze = FT(LP.T_freeze(earth_param_set)) | ||
# _grav = FT(LP.grav(earth_param_set)) | ||
# θtot = @. min(_ρ_i / _ρ_l * θ_i + θ_l, ν) # f returns [-0.0, -0.0, ..., -0.0] | ||
|
||
# # θtot = ClimaCore.Fields.ones(space_3d) # f returns [NaN, NaN, ..., NaN] | ||
# f(hydrology_cm, ν, θtot, θ_r) |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one @juliasloan25