You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] oneAPI: indexing a slice with an index array ignores the slice's offset #3733
On the oneAPI backend, indexing a 1-D array that is a slice with a non-zero offset (e.g. data(af::seq(10, 29))) by an index array returns elements counted from the start of the underlying array instead of from the slice.
Description
Official Windows installer, ArrayFire v3.10.0 (build 492718b).
Backend: oneAPI only. The same binary on the same GPU gives correct results with the OpenCL backend and the CPU backend; CUDA / OpenCL / CPU on an NVIDIA machine are also correct.
af::lookup(slice, idx), indexing the slice with a seq, and indexing a copy() of the slice are all correct; only slice(idx_array) (and af::flat(slice)(idx_array)) are wrong.
Reproducible every run.
Workaround: use af::lookup(slice, idx) or slice.copy()(idx).
Expected: view(idx) equals af::lookup(view, idx), as on the other backends.
Found while training word2vec on the device: each mini-batch is a slice of the epoch's examples, and picking rows from it this way updated the wrong rows on oneAPI (the loss rose instead of falling).
Related: #3732 (another oneAPI indexing issue, indexed min / max along dim 1).
Activity
docs: oneAPI slice indexing filed as arrayfire/arrayfire#3733