-
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
Snowy land #834
Snowy land #834
Conversation
6395539
to
863e666
Compare
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.
That was indeed a big PR! I left a lot of comments - happy to discuss in person if you have any questions
experiments/long_runs/snowy_land.jl
Outdated
regridder_type, | ||
regridder_kwargs = (; extrapolation_bc,), | ||
) | ||
x = parent(vg_α) |
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 might need to be x = Array(parent(vg_α))
for GPU compatibility. On GPU, wrapping in Array()
would force the CuArray
returned by parent
to be converted to an Array
, so that operations on it happen on the CPU instead of GPU. Without this, I think we would get a scalar indexing error in line 133
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.
I dont think we actually need the parent...let me check
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.
not using parent would be ideal :)
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.
We do.... I think because if x is a Field, and we do x .> 0, it seems like it is trying to convert a field of booleans into a field of floats:
julia> typeof(x)
ClimaCore.Fields.Field{ClimaCore.DataLayouts.VIJFH{Float64, 15, 2, CUDA.CuArray{Float64, 5, CUDA.DeviceMemory}}, ClimaCore.Spaces.ExtrudedFiniteDifferenceSpace{ClimaCore.Grids.ExtrudedFiniteDifferenceGrid{ClimaCore.Grids.SpectralElementGrid2D{ClimaCore.Topologies.Topology2D{ClimaComms.SingletonCommsContext{ClimaComms.CUDADevice}, ClimaCore.Meshes.EquiangularCubedSphere{ClimaCore.Domains.SphereDomain{Float64}, ClimaCore.Meshes.NormalizedBilinearMap}, CartesianIndices{3, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, LinearIndices{3, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, CUDA.CuArray{Tuple{Int64, Int64, Int64, Int64, Bool}, 1, CUDA.DeviceMemory}, Vector{Tuple{Int64, Int64, Int64, Int64, Bool}}, CUDA.CuArray{Tuple{Int64, Int64}, 1, CUDA.DeviceMemory}, CUDA.CuArray{Int64, 1, CUDA.DeviceMemory}, CUDA.CuArray{Tuple{Bool, Int64, Int64}, 1, CUDA.DeviceMemory}, CUDA.CuArray{Int64, 1, CUDA.DeviceMemory}, CUDA.CuArray{Int64, 1, CUDA.DeviceMemory}, @NamedTuple{}, CUDA.CuArray{Tuple{Int64, Int64}, 1, CUDA.DeviceMemory}}, ClimaCore.Quadratures.GLL{2}, ClimaCore.Geometry.SphericalGlobalGeometry{Float64}, ClimaCore.DataLayouts.IJFH{ClimaCore.Geometry.LocalGeometry{(1, 2), ClimaCore.Geometry.LatLongPoint{Float64}, Float64, StaticArraysCore.SMatrix{2, 2, Float64, 4}}, 2, CUDA.CuArray{Float64, 4, CUDA.DeviceMemory}}, ClimaCore.DataLayouts.IJFH{Float64, 2, CUDA.CuArray{Float64, 4, CUDA.DeviceMemory}}, ClimaCore.DataLayouts.IFH{ClimaCore.Geometry.SurfaceGeometry{Float64, ClimaCore.Geometry.UVVector{Float64}}, 2, CUDA.CuArray{Float64, 3, CUDA.DeviceMemory}}, @NamedTuple{}}, FiniteDifferenceGrid{IntervalTopology{ClimaComms.SingletonCommsContext{ClimaComms.CUDADevice}, ClimaCore.Meshes.IntervalMesh{ClimaCore.Domains.IntervalDomain{ClimaCore.Geometry.ZPoint{Float64}, Tuple{Symbol, Symbol}}, Vector{ClimaCore.Geometry.ZPoint{Float64}}}, @NamedTuple{bottom::Int64, top::Int64}}, ClimaCore.Geometry.CartesianGlobalGeometry, ClimaCore.DataLayouts.VF{ClimaCore.Geometry.LocalGeometry{(3,), ClimaCore.Geometry.ZPoint{Float64}, Float64, StaticArraysCore.SMatrix{1, 1, Float64, 1}}, 15, CUDA.CuArray{Float64, 2, CUDA.DeviceMemory}}, ClimaCore.DataLayouts.VF{ClimaCore.Geometry.LocalGeometry{(3,), ClimaCore.Geometry.ZPoint{Float64}, Float64, StaticArraysCore.SMatrix{1, 1, Float64, 1}}, 16, CUDA.CuArray{Float64, 2, CUDA.DeviceMemory}}}, ClimaCore.Grids.Flat, ClimaCore.Geometry.ShallowSphericalGlobalGeometry{Float64}, ClimaCore.DataLayouts.VIJFH{ClimaCore.Geometry.LocalGeometry{(1, 2, 3), ClimaCore.Geometry.LatLongZPoint{Float64}, Float64, StaticArraysCore.SMatrix{3, 3, Float64, 9}}, 15, 2, CUDA.CuArray{Float64, 5, CUDA.DeviceMemory}}, ClimaCore.DataLayouts.VIJFH{ClimaCore.Geometry.LocalGeometry{(1, 2, 3), ClimaCore.Geometry.LatLongZPoint{Float64}, Float64, StaticArraysCore.SMatrix{3, 3, Float64, 9}}, 16, 2, CUDA.CuArray{Float64, 5, CUDA.DeviceMemory}}}, ClimaCore.Grids.CellCenter}}
julia> μ = mean(x[x .> 0]);
ERROR: Struct type Bool cannot be represented using base type Float64
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] macro expansion
@ ~/.julia/packages/ClimaCore/SvZXu/src/DataLayouts/struct.jl:34 [inlined]
[3] check_basetype(::Type{Float64}, ::Type{Bool})
@ ClimaCore.DataLayouts ~/.julia/packages/ClimaCore/SvZXu/src/DataLayouts/struct.jl:33
[4] (ClimaCore.DataLayouts.VIJFH{Bool, 15, 2})(array::CUDA.CuArray{Float64, 5, CUDA.DeviceMemory})
@ ClimaCore.DataLayouts ~/.julia/packages/ClimaCore/SvZXu/src/DataLayouts/DataLayouts.jl:918
[5] similar(bc::Base.Broadcast.Broadcasted{ClimaCore.DataLayouts.VIJFHStyle{…}, Nothing, typeof(>), Tuple{…}}, ::Type{Bool}, ::Val{15})
@ ClimaCore.DataLayouts ~/.julia/packages/ClimaCore/SvZXu/src/DataLayouts/broadcast.jl:377
[6] similar(bc::Base.Broadcast.Broadcasted{ClimaCore.DataLayouts.VIJFHStyle{…}, Nothing, typeof(>), Tuple{…}}, ::Type{Bool})
@ ClimaCore.DataLayouts ~/.julia/packages/ClimaCore/SvZXu/src/DataLayouts/broadcast.jl:364
[7] similar(bc::Base.Broadcast.Broadcasted{…}, ::Type{…})
@ ClimaCore.Fields ~/.julia/packages/ClimaCore/SvZXu/src/Fields/broadcast.jl:142
[8] copy(bc::Base.Broadcast.Broadcasted{ClimaCore.Fields.FieldStyle{…}, ClimaCore.Spaces.ExtrudedFiniteDifferenceSpace{…}, typeof(>), Tuple{…}})
@ ClimaCore.Fields ~/.julia/packages/ClimaCore/SvZXu/src/Fields/broadcast.jl:95
[9] materialize(bc::Base.Broadcast.Broadcasted{ClimaCore.Fields.FieldStyle{…}, Nothing, typeof(>), Tuple{…}})
@ Base.Broadcast ./broadcast.jl:867
[10] top-level scope
@ REPL[54]:1
Some type information was truncated. Use `show(err)` to see complete types.
but, that said, these scripts are running on GPU, so for some reason the parent call is OK:
julia> x = parent(vg_α);
julia> μ = mean(x[x .> 0]);
julia> typeof(x)
CUDA.CuArray{Float64, 5, CUDA.DeviceMemory}
so I will leave this as is
It looks like the Niwot Fluxnet experiment is unstable :( - it failed with
|
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.
I am very excited for this PR! Amazing work, thank you Kat!
I think the GPU bucket failure might be the same issue we saw in #739. I added a reproducer in CliMA/ClimaCore.jl#2062, but still in the process of debugging The only change I see in src that might affect the bucket is here. I suggested a change - maybe that will help? |
f9473d9
to
6dc381f
Compare
Purpose
Snowy land. Closes #630
Note: I will turn back on the long runs before merging, after incorporating review comments, to save running a lot on clima
ClimaLand with snow (note that the IC is zero snow) from global run:
To-do
This PR is already so big!
Tutorial?
Tests?
Assess conservation in future PR, also addressing #847. Branch is kd/assess_conservation
Content