FluxML / FluxML/OneHotArrays.jl

GPU array scalar indexing edge cases

Open
#48 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
19
Forks
10
PR merge metrics
No merged PRs in 30d

Description

This issue came up during #47.

There are some rather awkward cases where it is not clear how to elide scalar indexing into GPU arrays. For example
```
y = onehotbatch(ones(3), 1:2) |> cu
y = reshape(y, 3, 2)
gA = rand(2, 3) |> cu

@test LinearAlgebra.mul!(similar(gA, 2, 2), gA, y) ≈ gA*y
```
Both sides of this test are currently broken. The failure currently in main is a method ambiguity, however it's not entirely clear how to fix this as there don't seem to be easy answers about what to do in this case. I doubt it is possible to cover every conceivable such edge case, at some point users should have to materialize the array.

I think probably what needs to be done here is to add documentation and possibly convenience methods describing circumstances in which arrays should be materialized. Even though there's no clear answer to this I'm opening this issue because as of now the handling of this is extremely wonky, and any users not intimately familiar with Julia array packages will be justifiably confused.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.