Skip to content

Commit 79039d4

Browse files
Merge pull request #1683 from CliMA/ck/compromise
Fix inference using promote_op in multiply_matrix_at_index
2 parents 8c971e6 + 17e7900 commit 79039d4

File tree

5 files changed

+8
-24
lines changed

5 files changed

+8
-24
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ steps:
630630
- label: "Unit: bidiag matrix row example (GPU)"
631631
key: gpu_compat_bidiag_matrix_row
632632
command: "julia --color=yes --project=test test/MatrixFields/gpu_compat_bidiag_matrix_row.jl"
633-
soft_fail: true
634633
agents:
635634
slurm_gpus: 1
636635

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ ClimaCore.jl Release Notes
44
main
55
-------
66

7+
v0.13.4
8+
-------
9+
710
- ![][badge-🐛bugfix] We fixed some fieldvector broadcasting on Julia 1.9. PR [#1658](https://github.com/CliMA/ClimaCore.jl/pull/1658).
11+
- ![][badge-🚀performance] We fixed an inference failure with matrix field broadcasting. PR [#1683](https://github.com/CliMA/ClimaCore.jl/pull/1683).
812

913
v0.13.3
1014
-------

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ClimaCore"
22
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
33
authors = ["CliMA Contributors <[email protected]>"]
4-
version = "0.13.3"
4+
version = "0.13.4"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/MatrixFields/matrix_multiplication.jl

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -270,29 +270,11 @@ function Operators.right_interior_idx(
270270
end
271271
end
272272

273-
pick_inferred_type(
274-
::Type{Union{}},
275-
::Type{Y},
276-
) where {Y <: Geometry.LocalGeometry} = Y
277-
pick_inferred_type(
278-
::Type{X},
279-
::Type{Union{}},
280-
) where {X <: Geometry.LocalGeometry} = X
281-
pick_inferred_type(::Type{T}, ::Type{T}) where {T <: Geometry.LocalGeometry} = T
282-
pick_inferred_type(::Type{Union{}}, ::Type{Union{}}) =
283-
error("Both LGs are not inferred")
284-
pick_inferred_type(::Type{X}, ::Type{Y}) where {X, Y} =
285-
error("LGs do not match: X=$X, Y=$Y")
286-
287273
function Operators.return_eltype(
288274
::MultiplyColumnwiseBandMatrixField,
289275
matrix1,
290276
arg,
291277
)
292-
# LG1 = local_geometry_type(typeof(axes(matrix1)))
293-
# LG2 = local_geometry_type(typeof(axes(arg)))
294-
# LG = pick_inferred_type(LG1, LG2)
295-
# return Operators.return_eltype(op, matrix1, arg, LG)
296278
eltype(matrix1) <: BandMatrixRow || error(
297279
"The first argument of ⋅ must have elements of type BandMatrixRow, but \
298280
the given argument has elements of type $(eltype(matrix1))",
@@ -365,9 +347,8 @@ boundary_modified_ud(::BottomRightMatrixCorner, ud, column_space, i) =
365347
# matrix field broadcast expressions to take roughly 3 or 4 times longer to
366348
# evaluate, but this is less significant than the decrease in compilation time.
367349
function multiply_matrix_at_index(loc, space, idx, hidx, matrix1, arg, bc)
368-
# lg = Geometry.LocalGeometry(space, idx, hidx)
369-
# prod_type = Operators.return_eltype(⋅, matrix1, arg, typeof(lg))
370-
prod_type = Operators.return_eltype(, matrix1, arg)
350+
lg = Geometry.LocalGeometry(space, idx, hidx)
351+
prod_type = Operators.return_eltype(, matrix1, arg, typeof(lg))
371352

372353
column_space1 = column_axes(matrix1, space)
373354
ld1, ud1 = outer_diagonals(eltype(matrix1))

test/MatrixFields/operator_matrices.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ end
302302
ᶠuvw,
303303
ᶜadvect(ᶠuvw, ᶜwinterp(ᶠscalar, ᶠrbias(ᶜlbias(ᶠinterp(ᶜnested))))),
304304
)),
305-
time_ratio_limit = 20, # This case's ref function is fast on Buildkite.
305+
time_ratio_limit = 25, # This case's ref function is fast on Buildkite.
306306
test_broken_with_cuda = true, # TODO: Fix this.
307307
)
308308

0 commit comments

Comments
 (0)