You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to ask this in discourse and slack, but seems there is no solution for this feature at the moment.
I notice for packages like Flux.jl/Knet.jl etc. They provide functionality on CPU, but also available on GPU. It would be more convenient for package developers to add device dependent package (like CuArray) when it is available. (Since we don't want our user to care about what package they should install)
Moreover, currently, for those device dependent code, you have to copy the UUID everywhere like:
But with Pkg3, a simple workaround (like by detecting CUDA in the system) won't work, because when required condition is true and then use using CuArray will cause the Pkg a warning says you don't have this in the dependency.
I think simply add a device tag in Project.toml will solve this problem, so there won't be any error in Pkg while using CuArray and let another package to handle the dependency checking (e.g CUDAapi)
So the Project.toml may looks like:
[deps]
# some other deps
[device]
[device.cuda]
CuArrays = "3a865a2d-5b23-5a0f-bc46-62713ec82fae"
Or
[deps]
# some general deps
[deps.cuda]
# package require cuda
BTW, we can use a plugin to support the first syntax without changing stdlib in the main tree I guess.
The text was updated successfully, but these errors were encountered:
I tried to ask this in discourse and slack, but seems there is no solution for this feature at the moment.
I notice for packages like Flux.jl/Knet.jl etc. They provide functionality on CPU, but also available on GPU. It would be more convenient for package developers to add device dependent package (like CuArray) when it is available. (Since we don't want our user to care about what package they should install)
Moreover, currently, for those device dependent code, you have to copy the UUID everywhere like:
https://github.com/FluxML/Flux.jl/blob/73385b5dbd7c46dee13b71e8d543448ea6c58707/src/treelike.jl#L67
But with
Pkg3
, a simple workaround (like by detecting CUDA in the system) won't work, because when required condition istrue
and then useusing CuArray
will cause thePkg
a warning says you don't have this in the dependency.I think simply add a device tag in
Project.toml
will solve this problem, so there won't be any error inPkg
whileusing CuArray
and let another package to handle the dependency checking (e.gCUDAapi
)So the
Project.toml
may looks like:Or
BTW, we can use a plugin to support the first syntax without changing
stdlib
in the main tree I guess.The text was updated successfully, but these errors were encountered: