jni / using-python-for-science

The essential guide to using Python for scientists
Other
7 stars 2 forks source link

cupy + cucim #20

Open haesleinhuepf opened 3 years ago

haesleinhuepf commented 3 years ago

Hi @jni ,

if you're interested, I would offer to add a section to the GPU chapter. E.g. this blog post about image processing with cupy/cucim could fit. I'm also happy to extend the section if you tell me what information might be missing.

Let me know what you think!

Cheers, Robert

jni commented 3 years ago

That looks great! Coming from you though I would be very disappointed if there wasn't a section on Clesperanto and the benefits of OpenCL vs CUDA. ;) Also the point of the chapter is speed so it would need to have some minor benchmarks. Perhaps a 3D dataset would be more appropriate such as skimage.data.cells3d?

Also, RAPIDS has cudf so I wonder whether you can go directly from regionprops_table to cudf.DataFrame. Wanna check? 😃

haesleinhuepf commented 3 years ago

I'm actually here to have some practical experience / advice with jupyter books. Thus, my blog posts are your blog posts. ;-)

Coming from you though I would be very disappointed if there wasn't a section on Clesperanto and the benefits of OpenCL vs CUDA. ;)

I'm happy to also contribute the blog post about clesperanto. Shall we have a third GPU-acceleration overview page where we can write pro/cons of CUDA, OpenCL, and what else comes up?

Also, RAPIDS has cudf so I wonder whether you can go directly from regionprops_table to cudf.DataFrame. Wanna check? 😃

I wasn't aware of that. I have to give it a try! Thanks :-)

haesleinhuepf commented 3 years ago

Also the point of the chapter is speed so it would need to have some minor benchmarks.

It will be hard to show it in general. I tend to write things like this and point people to resources like that (contains CUDA and OpenCL). I could make a fourth benchmarking page out of that. Even though I think others use more sophisticated benchmarking techniques than I do. Maybe some volunteer can team up with me on this front :-)

jni commented 3 years ago

I don't mean sophisticated benchmarks that take everything into account, rather simple timings that show what can be achieved with GPUs and that also illustrate the transfer overhead. I like the table in the gputools README. On the CL vs CUDA front I'd suggest showing the timings on a Mac with an AMD card vs the error message when you try to use CUDA there. 😂

Oh another side point: in the GPU blog post, it would be nicer to use np.asarray(cupy_array) rather than cupy_array.asnumpy(), since the latter is non-standard while the former is a standard pattern that should work for most things, though as you know that is a work in progress. 😅

Maybe some volunteer can team up with me on this front :-)

As you know my time is bookable at https://harmonizely.com/jni. ;) Though I only have 2h slots for Europe-friendly times. 😬

haesleinhuepf commented 3 years ago

As you know my time is bookable at https://harmonizely.com/jni. ;) Though I only have 2h slots for Europe-friendly times. 😬

I only see slots in the middle of the European night :-(

I'll make a first draft, likely on July 9th. Then we can talk, suggest changes and see what's missing. :-)

jni commented 3 years ago

@haesleinhuepf Choose a pair programming slot and check out upcoming weeks