Unifying the CUDA Python Ecosystem
developer.nvidia.com
Unifying the CUDA Python Ecosystem
1–10 of 62 posts
Re: Unifying the CUDA Python Ecosystem
#2This blog post is great, and we need these kind of tools for sure, but we also need high level expressibility that doesn't require writing kernels in C. I know there are other projects that have taken up that cause, but it would be great to see NVIDIA double down on something like Copperhead.
Re: Unifying the CUDA Python Ecosystem
#3Re: Unifying the CUDA Python Ecosystem
#4I foolishly built an options pricing engine on top of PyTorch, thinking "oooh, it's a fast array library that supports CUDA transparently". Only to find out that array indexing is 100x slower than numpy.
Re: Unifying the CUDA Python Ecosystem
#5About 8 years ago an NVIDIA developer released a tool called Copperhead that let you write CUDA kernels in straight Python that were then compiled to C, no "C-in-a-string" like is shown here. I always thought it was so elegant and had great potential, and I introduced a lot of people in my circle to it, but then it seems NVIDIA buried it. This blog post is great, and we need these kind of tools for sure, but we also…
I think I found it here: https://github.com/bryancatanzaro/copperhead
But I'm not sure what the state is. Looks dead (last commit 8 years ago). Probably just a proof of concept. But why hasn't this been continued?
Blog post and example: https://developer.nvidia.com/blog/copperhead-data-parallel-p... https://github.com/bryancatanzaro/copperhead/blob/master/sam...
Btw, for compiling on-the-fly from a string, I made something similar for our RETURNN project. Example for LSTM: https://github.com/rwth-i6/returnn/blob/a5eaa4ab1bfd5f157628...
This is made in a way that it compiles automatically into an op for Theano or TensorFlow (PyTorch could easily be added as well) and for both CPU and CUDA/GPU.
Re: Unifying the CUDA Python Ecosystem
#6Re: Unifying the CUDA Python Ecosystem
#7https://juliagpu.gitlab.io/CUDA.jl/tutorials/introduction/
I don't think it's possible to achieve something like this in python because of how it's interpreted (but it sounds a bit like what another comment mentioned where the python was compiled to C)
Re: Unifying the CUDA Python Ecosystem
#8About 8 years ago an NVIDIA developer released a tool called Copperhead that let you write CUDA kernels in straight Python that were then compiled to C, no "C-in-a-string" like is shown here. I always thought it was so elegant and had great potential, and I introduced a lot of people in my circle to it, but then it seems NVIDIA buried it. This blog post is great, and we need these kind of tools for sure, but we also…
https://github.com/rapidsai/cudf/blob/branch-0.20/python/cud...
https://github.com/gmarkall/numba/blob/master/numba/cuda/com...
>but we also need high level expressibility that doesn't require writing kernels in C
the above are possible because C is actually just a frontend to PTX
https://docs.nvidia.com/cuda/parallel-thread-execution/index...
fundamentally you are not going to ever be able to have a way to write cuda kernels without thinking about cuda architecture anymore so than you'll ever be able to write async code without thinking about concurrency.
Re: Unifying the CUDA Python Ecosystem
#9About 8 years ago an NVIDIA developer released a tool called Copperhead that let you write CUDA kernels in straight Python that were then compiled to C, no "C-in-a-string" like is shown here. I always thought it was so elegant and had great potential, and I introduced a lot of people in my circle to it, but then it seems NVIDIA buried it. This blog post is great, and we need these kind of tools for sure, but we also…
Re: Unifying the CUDA Python Ecosystem
#10Just for contrast its interesting to look at an example of writing a similar kernel in Julia: https://juliagpu.gitlab.io/CUDA.jl/tutorials/introduction/ I don't think it's possible to achieve something like this in python because of how it's interpreted (but it sounds a bit like what another comment mentioned where the python was compiled to C)