artyom-beilis / pytorch_dlprim

DLPrimitives/OpenCL out of tree backend for pytorch
http://blog.dlprimitives.org/
MIT License
264 stars 17 forks source link

Example fallback #23

Closed albanD closed 1 year ago

albanD commented 1 year ago

@artyom-beilis if you want to improve the error message when an op is not implemented for ocl (first commit) or make it fallback to using the CPU for ops that are not implemented (second commit).

You don't have to merge this, but I felt it was the simplest way to share the idea with you! If you want some other variation of this, feel free to share it and we can see what can be done!

artyom-beilis commented 1 year ago

Thanks a lot.

I think I got the idea. I merged it so I can see how to use it. Actually I had several cases when automatic CPU fallback have saved me lots of troubles!

artyom-beilis commented 1 year ago

Looks like I'll need to add aten::_copy_from_and_resize to make it work properly

Thanks again :-)

albanD commented 1 year ago

No worries! Happy this helps!