Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix broadcast defaulting to Mem.Unified() #2327

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Conversation

vpuri3
Copy link
Contributor

@vpuri3 vpuri3 commented Apr 15, 2024

On 5.3, Broadcast defaults to Mem.Unified().

julia> x = CUDA.ones(1, 4)
1×4 CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}:
 1.0  1.0  1.0  1.0

julia> y = CUDA.ones(1)
1-element CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}:
 1.0

julia> x .+ y
1×4 CuArray{Float32, 2, CUDA.Mem.UnifiedBuffer}:
 2.0  2.0  2.0  2.0

This PR defines an additional method so buffer of arguments is respected.

julia> x = CUDA.ones(1, 4)
1×4 CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}:
 1.0  1.0  1.0  1.0

julia> y = CUDA.ones(1)
1-element CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}:
 1.0

julia> x .+ y
1×4 CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}:
 2.0  2.0  2.0  2.0

@vpuri3
Copy link
Contributor Author

vpuri3 commented Apr 15, 2024

Test failed because of interrupt exception.

    nested task error: InterruptException:
    ...
Some tests did not pass: 275 passed, 0 failed, 1 errored, 0 broken.

https://buildkite.com/julialang/cuda-dot-jl/builds/4940#018ee34e-fcba-48c1-b575-24759cfbbfb4/348-594

@vpuri3 vpuri3 closed this Apr 15, 2024
@vpuri3 vpuri3 reopened this Apr 15, 2024
@maleadt
Copy link
Member

maleadt commented Apr 16, 2024

Thanks. Please consider adding a test next time.

@maleadt maleadt added bugfix This gets something working again. cuda array Stuff about CuArray. labels Apr 16, 2024
@maleadt maleadt merged commit c5fcd73 into JuliaGPU:master Apr 16, 2024
1 check was pending
@vpuri3 vpuri3 deleted the broadcast branch April 16, 2024 16:13
@vpuri3
Copy link
Contributor Author

vpuri3 commented Apr 16, 2024

Thanks @maleadt. can you do a release?

@maleadt
Copy link
Member

maleadt commented Apr 16, 2024

I will; waiting for some other hotfixes first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This gets something working again. cuda array Stuff about CuArray.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants