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

[MLDataDevices] devices don't preserve identity #1129

Closed
CarloLucibello opened this issue Dec 7, 2024 · 2 comments · Fixed by #1133
Closed

[MLDataDevices] devices don't preserve identity #1129

CarloLucibello opened this issue Dec 7, 2024 · 2 comments · Fixed by #1133

Comments

@CarloLucibello
Copy link
Contributor

I was under the impression that these used to return true

julia> cdev = cpu_device()
(::CPUDevice) (generic function with 2 methods)

julia> cdev(x) === x
false

julia> gdev = gpu_device()
(::CUDADevice{Nothing}) (generic function with 2 methods)

julia> a = gdev(x)
2-element CuArray{Float32, 1, CUDA.DeviceMemory}:
 0.048840165
 0.6700894

julia> a === gdev(a)
false
@avik-pal
Copy link
Member

This is coming from:

julia> x = rand(3, 3)
3×3 Matrix{Float64}:
 0.0299446  0.637261   0.0907949
 0.877796   0.0118281  0.0779904
 0.708503   0.445012   0.690353

julia> Array(x) === x
false

@avik-pal
Copy link
Member

We need to add dispatches to avoid this for all the devices (except reactant where ConcreteRArray already implements this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants