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

use MLDataDevices.jl? #2482

Open
CarloLucibello opened this issue Sep 19, 2024 · 0 comments
Open

use MLDataDevices.jl? #2482

CarloLucibello opened this issue Sep 19, 2024 · 0 comments

Comments

@CarloLucibello
Copy link
Member

CarloLucibello commented Sep 19, 2024

I think we should rely on MLDataDevices.jl for data movement functionality.
This would allow to reduce the codebase here and share functionality with the rest of the ecosystem.
Moreover, MLDataDevices has more functionalities implemented.

Unfortunately, the mapping among the two is not perfect, and the function get_device acquires a different meaning. This is a loose map between the two:

Flux MLDataDevices
get_device(; [verbose]) gpu_device([device_id]; [force_gpu_usage])
get_device(backend::String, [idx]) cpu_device or gpu_device
gpu_backend!(backend::String) gpu_backend!(backend::String)
supported_devices() supported_gpu_backends()
X get_device(x) -> dev::AbstractDevice
X functional(x::AbstractDevice) or functional(::Type{<:AbstractDevice})
X set_device!(T::Type{<:AbstractDevice}, dev_or_id)
X loaded(x::AbstractDevice) or loaded(::Type{<:AbstractDevice})
X default_device_rng(x::AbstractDevice)

We should be able to deprecate the old interface in favor of the new without a sudden breaking change.

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

No branches or pull requests

1 participant