Hi Frank,

sorry for leaving this unresponded for a while. I'm far from an expert in
this, but it looks like no-one else jumped in, so here's my response.


Schlimbach, Frank schrieb am 06.01.20 um 12:09:
> I would like to work on extending cython with a way to offload cython code to 
> a GPU. I found to related CEPs 
> (https://github.com/cython/cython/wiki/enhancements-opencl and 
> https://github.com/cython/cython/wiki/enchancements-metadefintions).

So, just for a bit of context, these CEPs were written a decade ago, and
Cython's code base, feature set, and the general Python ecosystem have
evolved a lot since then. For example, "cython.parallel" and "prange()"
weren't even implemented back then.


> My current thinking is that a solution along the OpenCL CEP is most 
> effective, it does require many code changes and seems to provide a good 
> tradeoff between usability and efficiency.
> 
> I would like to suggest a few modifications to this approach, like
> 
>   *   using SYCL instead of OpenCL to closely follow existing parallel/prange 
> semantics more easily
>   *   selecting the device (CPU, GPU) per region rather than per file
>   *   maybe allowing calling appropriately annotated and written external 
> functions
> 
> I would be very grateful for any thoughts about this topic in general and for 
> any advice on how to approach this so that a solution is found that is most 
> broadly useful and most cythonic.

It would definitely be cool to generate GPU support from the existing
Cython patterns, in addition to the OpenMP code that we already generate.
If that can be done, then users could enable GPU support by adding a C
compiler define to their CFLAGS (rather than rerunning Cython), or even
select between the two versions at runtime.

If the GPU support is per region, then how is the code section shipped to
the GPU? Is the infrastructure for this provided by the OpenCL framework or
does the user or the module need to set something up in addition?

Finally, generally speaking:
- PR welcome
- simple approach preferred (at least to get this started and prototyped)
- discussion welcome on this mailing list
- GitHub feature ticket seems to be missing, with a link to the ML thread
https://mail.python.org/pipermail/cython-devel/2020-January/005262.html

Stefan
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to