`show` errors on buffers and `Managed`, because `sizeof` returns a `UInt64`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start with src/runtime/memory/hip.jl at the sizeof methods around lines 73 and 168, then search their callers for assumptions about UInt64. Confirm that returning an Int fixes display of HIP buffers and Managed values, including the failing @test scenario, without breaking callers that consume the size.
Written by the indexing model from the issue text.
Description
Base.sizeof is supposed to return an Int. For HIP buffers it returns a UInt64, and Managed passes that on:
https://github.com/JuliaGPU/AMDGPU.jl/blob/f0d05021/src/runtime/memory/hip.jl#L73
https://github.com/JuliaGPU/AMDGPU.jl/blob/f0d05021/src/runtime/memory/hip.jl#L168
Base's default show asserts sizeof(x)::Int, so any object that holds one of these can't be printed:
julia> a = ROCArray([1]);
julia> a.buf[]
Error showing value of type AMDGPU.Managed{AMDGPU.Runtime.Mem.HIPBuffer}:
ERROR: TypeError: in typeassert, expected Int64, got a value of type UInt64
This also hits @test when it prints a failing expression that has a Managed argument, e.g. @test isnothing(a.buf[]). The failure is then reported as an error from show, not as the actual failure. Returning Int(b.bytesize) from both sizeof methods should fix it, but callers that rely on getting a UInt64 would need checking.
- Dominant language
- Julia
- Stars
- 346
- Forks
- 81
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 49
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from JuliaGPU/AMDGPU.jl
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
JuliaGPU/AMDGPU.jl#1040 · 8 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
JuliaGPU/AMDGPU.jl#1153 · 1 comment ·
Maintainers usually reply within 1 day
-
Device min/max on floats ignore NaNs, unlike Julia's min/maxPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
All issues in JuliaGPU/AMDGPU.jl
Similar issues
-
code-review
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaNLSolvers/Optim.jl#1296 ·
-
OptimizationCUTEst jobs fail: gfortran not installed on the runnerPossibly taken @ChrisRackauckas-Claude claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SciML/SciMLBenchmarks.jl#1946 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
JuliaSmoothOptimizers/NCL.jl#101 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100