sparse icon indicating copy to clipboard operation
sparse copied to clipboard

GPU/Parallelism support

Open hameerabbasi opened this issue 5 years ago • 9 comments

According to the paper: https://arxiv.org/abs/2001.00532

hameerabbasi avatar Jul 07 '20 11:07 hameerabbasi

Hi @hameerabbasi ! Do we have any progress on parallelism?

NominHanggai avatar Feb 06 '21 08:02 NominHanggai

Hi! This will take quite a while; it's a large project. It's on the back burner for now.

If you would like parallelism today, please consider using Dask to wrap PyData/Sparse arrays. That works.

hameerabbasi avatar Feb 06 '21 10:02 hameerabbasi

Hi! This will take quite a while; it's a large project. It's on the back burner for now.

If you would like parallelism today, please consider using Dask to wrap PyData/Sparse arrays. That works.

Thank you @hameerabbasi !

NominHanggai avatar Feb 07 '21 00:02 NominHanggai

@hameerabbasi Sir I think this should also help.

H4R5H1T-007 avatar Apr 14 '21 04:04 H4R5H1T-007

I saw the roadmap and it is mentioned that cupy integration will follow. Do you plan a straightforward integration by replacing straightforward API calls? Or do you have another plan in mind? I am asking because cupy integration would be something I am very much looking forward.

alexandrupaler avatar Jun 14 '21 10:06 alexandrupaler

@alexandrupaler It isn't as simple as that as we also use Numba to do some algorithmic stuff, and translating that to the GPU is non-trivial.

hameerabbasi avatar Jun 14 '21 10:06 hameerabbasi

I understand. The particular method that would be great to have with cupy support is https://github.com/pydata/sparse/blob/d33bf5f4693fbe8bb26c5491a900ea41ac8a2d67/sparse/_common.py#L89 Is at any point numba called behind the scenes there? The documentation mentions that it is mostly similar to the numpy original.

alexandrupaler avatar Jun 14 '21 10:06 alexandrupaler

Yes, the tensordot is converted to a 2D dot which is then executed via Numba.

hameerabbasi avatar Jun 14 '21 11:06 hameerabbasi

Would using NUMBA_DISABLE_JIT and enabling CuPy through a flag not be a (temporary) solution?

alexandrupaler avatar Jun 14 '21 21:06 alexandrupaler