JuliaArrays / JuliaArrays/OffsetArrays.jl
`Int8` Offsets
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 212
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
Hello, first of all, thanks for the beautiful package. Over at Oceananigans.jl and ClimaOcean.jl, we use offset arrays to store the underlying data of our Field types. However, now that we are increasing the complexity of the model, we are having increasingly frequent problems with GPU parameter space when launching kernels that require many offset array inputs.
We think that this has to do with the fact that offsets are Int64 types, which consume quite a lot of parameter space, however, we typically need offsets in the range of -10 .. 10, so Int8 would be enough for our scope.
However, it looks like the Int type is hardcoded in the OffsetArray type.
https://github.com/JuliaArrays/OffsetArrays.jl/blob/5972e9e7fa148e87f127cc2b0152bce1e94dfd16/src/OffsetArrays.jl#L114
Is there a specific reason for having offsets as Int64s or would it be possible to allow flexibility in the sizes of the offsets?
In the latter case, could I attempt a PR allowing lower-sized offsets?
cc @glwagner
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/OffsetArrays.jl at the OffsetArray definition linked in the issue, and review the existing discussion about why offsets use Int. Determine how allowing smaller integer offset types would affect the package's current indexing behavior and GPU parameter use. Done means lower-sized offsets are supported where appropriate without breaking existing offset-array behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100