TensorOperations.jl icon indicating copy to clipboard operation
TensorOperations.jl copied to clipboard

Consider splitting out CuArrays?

Open amilsted opened this issue 4 years ago • 2 comments

Hi @Jutho, hope you're well!

I was just wondering if you have considered splitting out the CUDA implementation into a separate package. CUDA is quite a heavy dependency that is superfluous for many users and this would make other packages more likely to choose to require TensorOperations.jl.

What do you think?

amilsted avatar Aug 24 '21 21:08 amilsted

Hi @amilsted. My apologies for the late response; I was on holidays. This is probably a good suggestion. I initially developed the CUDA wrappers in a separate package (https://github.com/Jutho/CuTensorOperations.jl ), and then integrated them in TensorOperations.jl, hoping that I would not need to depend on CUDA.jl (or CuArrays.jl at the time) by using conditional loading with Requires.jl. However, it seems that this strategy is incompatible with how Julia's package manages expects dependencies to behave, so that CUDA.jl has now indeed become a dependency of TensorOperations.jl. I guess I was hoping that the solution to the problem of conditional dependencies would come sooner ( https://github.com/JuliaLang/Pkg.jl/issues/1285 ). I think this problem was mentioned to be high on the priority list in the "State of Julia" talk at JuliaCon.

Jutho avatar Aug 30 '21 10:08 Jutho

Hope the holidays were fun! Good to know this is a priority item. It certainly seems important.

If you do decide to split out CuTensorOperations.jl again, I guess a prominent link on the README here is enough to make people aware. It's hard enough to make CUDA work properly (driver/CUDA version mismatches, blah blah) that I guess installing an extra package doesn't mean much additional overhead.

amilsted avatar Aug 31 '21 17:08 amilsted

After a long due update, there is progress. In the upcoming version 4 (current master), CUDA support will be managed via the package extension mechanism (if on Julia 1.9), so it only becomes a weak dependency.

Jutho avatar Jul 15 '23 00:07 Jutho