Skip to content

Catastrophically slow kernel in wfact! #3423

@charleskawczynski

Description

@charleskawczynski

Found in the nsight report for the aquaplanet dyamond on the latest main build. This corresponds to the two largest stencils mentioned here

Screenshot 2024-11-06 at 10 32 43 AM

The kernel looks like this on the atmos side:

precip_info =
    ((@name(c.ρq_rai), @name(ᶜwᵣ)), (@name(c.ρq_sno), @name(ᶜwₛ)))
MatrixFields.unrolled_foreach(precip_info) do (ρqₚ_name, wₚ_name)
    MatrixFields.has_field(Y, ρqₚ_name) || return

    ∂ᶜρqₚ_err_∂ᶜρqₚ = matrix[ρqₚ_name, ρqₚ_name]
    ᶜwₚ = MatrixFields.get_field(p, wₚ_name)
    ᶠtmp = p.ᶠtemp_CT3
    @. ᶠtmp = CT3(unit_basis_vector_data(CT3, ᶠlg)) * ᶠwinterp(ᶜJ, ᶜρ)

    # very slow
    @. ∂ᶜρqₚ_err_∂ᶜρqₚ +=
        dtγ * -(ᶜprecipdivᵥ_matrix())  DiagonalMatrixRow(ᶠtmp) 
        ᶠright_bias_matrix()  DiagonalMatrixRow(-(ᶜwₚ) / ᶜρ)
end

We should probably make a reproducer in ClimaCore and figure out why this is so slow.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions