`column` on grids are inconsistent and do not actually make views
- Dominant language
- Julia
- Stars
- 117
- Forks
- 19
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 41
Description
https://github.com/CliMA/ClimaCore.jl/pull/1487 fixed some issues, but [`column`](https://github.com/CliMA/ClimaCore.jl/blob/21d1f09f156aa3bdc09bb00889eb816ef26a2f43/src/Grids/column.jl#L42-L43) does not actually make a view, so the underlying DataLayout for a `VIJFH`-backed ExtrudedFiniteDifferenceSpace is still a `VIJFH` DataLayout.
The issue here is that `column` on a broadcasted object now contains a mixture of `VF` and `VIJFH` datalayouts. Memory access patterns for our metric terms are now "stuck" to those governed by `VIJFH`. i.e., we cannot make MArray-backed datalayouts.
This is a hard block, stopping https://github.com/CliMA/ClimaCore.jl/pull/1763 because we cannot make an MArray-backed `VIJFH` (as that would be huge), and we cannot reconstruct `ExtrudedFiniteDifferenceGrid` on the GPU, since it is mutable.
What we have now seems like a bad design in that I would expect `column` to recurse all the way down a broadcasted object, and it doesn't. It's also unfortunate that this is blocking https://github.com/CliMA/ClimaCore.jl/pull/1763.
The same is probably true for `slab`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/Grids/column.jl at lines 42–43 and inspect how column propagates through broadcasted objects and DataLayout values. Compare the corresponding slab behavior, focusing on VIJFH-backed ExtrudedFiniteDifferenceSpace and the MArray-backed layout constraint. Done means column, and likely slab, recurse consistently with coverage for broadcasted objects and the affected layouts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100