JuliaGPU / JuliaGPU/GPUArrays.jl

Support for subarrays in linalg

Open
#589 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
450
Forks
104
Avg merge
1d 4h
Merged PRs (30d)
10

Description

Hello,

I would like to use the triu! and transpose! functions on a non-contiguous view (eg. view(a', 1:2:6,4:2:8)) - is there a way make this possible (ideally for all functions in src/host/linalg.jl; and for copyto! in src/host/abstractarray) without severly increasing runtimes/compiletimes due to multiple-dispatch overhead?

Earlier discussions on this topic:
https://github.com/JuliaGPU/GPUArrays.jl/pull/452
https://github.com/JuliaGPU/GPUArrays.jl/pull/458
https://github.com/JuliaGPU/CUDA.jl/pull/1778
https://github.com/JuliaGPU/CUDA.jl/issues/2078

Perhaps some type of a union of subarrays. transposes, and abstractarrays (to avoid switching to AnyGPUArrays; also AnyGPUArrays does not include transposes) ?

Edit: I just saw IndexGPUArray might be an option, if it were expanded with ` SubArray{T, <:Any, <:LinearAlgebra.Adjoint{T, <:AbstractGPUArray }}`

Let me know your thoughts and happy to draft a PR
@maleadt @vchuravy

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the linalg functions in src/host/linalg.jl and copyto! in src/host/abstractarray, then review the linked GPUArrays.jl and CUDA.jl discussions. Done means supporting non-contiguous views such as the stated SubArray and adjoint example across the requested operations without severely increasing runtime or compile-time overhead.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.