JuliaGPU / JuliaGPU/AMDGPU.jl

Suport for non-bits types

Open
#795 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
344
Forks
79
Avg merge
2d 23h
Merged PRs (30d)
27

Description

Hi,
Triggered from an issue coming up in ClimaOcean.jl https://github.com/CliMA/ClimaOcean.jl/issues/570, it seems that CUDA.jl has support for Union types that contain missing, but that is not working on AMDGPU.jl. Simple reproducer:

julia> using AMDGPU

julia> data = [missing, 3.0]::Array{Union{Missing, Float64}}
2-element Vector{Union{Missing, Float64}}:
  missing
 3.0

julia> a = ROCArray(data)
ERROR: AssertionError: ROCArray only supports bits types
Stacktrace:
 [1] ROCArray{Union{Missing, Float64}, 1, AMDGPU.Runtime.Mem.HIPBuffer}(::UndefInitializer, dims::Tuple{Int64})
   @ AMDGPU ~/.julia/packages/AMDGPU/a1MFN/src/array.jl:9
 [2] ROCArray{Union{Missing, Float64}, 1, AMDGPU.Runtime.Mem.HIPBuffer}(x::Vector{Union{Missing, Float64}})
   @ AMDGPU ~/.julia/packages/AMDGPU/a1MFN/src/array.jl:129
 [3] (ROCArray{Union{Missing, Float64}, 1})(x::Vector{Union{Missing, Float64}})
   @ AMDGPU ~/.julia/packages/AMDGPU/a1MFN/src/array.jl:134
 [4] ROCArray(A::Vector{Union{Missing, Float64}})
   @ AMDGPU ~/.julia/packages/AMDGPU/a1MFN/src/array.jl:137
 [5] top-level scope
   @ REPL[3]:1

I'm not sure how much plumbing this requires.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Union{Missing, Float64} conversion shown in the issue and inspect src/array.jl, especially the constructors in the stack trace. Compare the relevant CUDA.jl behavior if needed, then determine the required support and add coverage for ROCArray conversion; done means the reproducer no longer fails because the element type is non-bits.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.