Skip to content
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

Catastrophically slow kernel in wfact! #3423

Open
charleskawczynski opened this issue Nov 6, 2024 · 0 comments
Open

Catastrophically slow kernel in wfact! #3423

charleskawczynski opened this issue Nov 6, 2024 · 0 comments

Comments

@charleskawczynski
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant