Fix instabilities in the launch! function#5745
Conversation
Refactor comments for clarity and readability.
…ananigans.jl into ss/fix-static-size-instability
|
We are starting to see the light on CPUs: [2026/06/30 17:09:00.053] INFO hydrostatic \| CPU \| flat : 479.0 KiB (≤ 2.7 MiB)
[2026/06/30 17:09:51.263] INFO hydrostatic \| CPU \| immersed : 497.2 KiB (≤ 2.9 MiB)
[2026/06/30 17:11:04.862] INFO hydrostatic \| CPU \| active_immersed : 329.9 KiB (≤ 3.0 MiB)
[2026/06/30 17:11:21.403] INFO nonhydrostatic \| CPU \| flat : 826.2 KiB (≤ 2.0 MiB)GPUs are still quite high, I think it has to do with our custom |
…ananigans.jl into ss/fix-static-size-instability
Add that as a test? Ensuring full inference on these things is quite important for high performance workloads. Also, update the allocations upper bounds? This is a significant drop! |
| Δyᵃᶠᵃ, Δyᵃᶜᵃ, yᵃᶠᵃ, yᵃᶜᵃ, z) | ||
| end | ||
|
|
||
| @generated function Base.size(grid::RectilinearGrid) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5745 +/- ##
==========================================
- Coverage 73.96% 73.92% -0.05%
==========================================
Files 418 419 +1
Lines 25279 25347 +68
==========================================
+ Hits 18698 18737 +39
- Misses 6581 6610 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ananigans.jl into ss/fix-static-size-instability
this PR is a clean extract of the workaround in PR #5729 to make sure the
launch!function is completely type stable.We always derive our
StaticSizefrom grid size and halo size information, which then need to be compile-time constants.By adding a
GridSizetype parameter to the grid we can always infer theStaticSizeof kernel and then squash the type instability.This is not possible for kernels that launch on the active cells map, but in that case, since the kernel is always 1D and the index is computed already with
length(map)inside the@indexmacro, we can safely use aDynamicSizeMWE:
on main:
on this PR