oneDNN icon indicating copy to clipboard operation
oneDNN copied to clipboard

Fall back in the case of algorithm::convolution_winograd

Open alenik01 opened this issue 6 years ago • 4 comments

Hello.

According to oneDNN documentation for a convolution with Winograd algorithm set in the descriptor it should silently fall back to the direct algorithm if convolution parameters does not satisfy the constraints. However, if I consider performance_profiling.cpp as an example and change algorithm::convolution_direct to algorithm::convolution_winograd the following error will emerge:

oneDNN error caught: Status: unimplemented Message: could not create a primitive descriptor iterator

May you please comment, should not the code in this case fall back to the direct method (with a possible further fallback to GEMM-based) instead of producing an error?

Best wishes, Aleksandr

alenik01 avatar Oct 28 '20 18:10 alenik01

Hello @alenik01 ,

oneDNN supports Direct and Winograd algorithms. For Direct algorithm oneDNN supports implicit dispatching between optimized and GEMM-based implementations based on convolution and hardware configuration. To enable such implicit dispatching between algorithms algorithm::convolution_auto should be used. In this case if Winograd is not available convolution will fallback into one of Direct algorithm implementations.

Regards, Igor Safonov

igorsafo avatar Oct 28 '20 18:10 igorsafo

Good morning, @igorsafo .

Many thanks for the clarification. And is it correct, that dispatching is organised via going through a set of implementations in cpu_convolution_list.cpp and picking the first one, which fits all the requirements?

Best regards, Aleksandr Nikolaev

alenik01 avatar Oct 28 '20 18:10 alenik01

Yes, correct. As you can see there is a GEMM-based implementation after all optimized implementations which will be used in case they are not applicable.

Regards, Igor Safonov

igorsafo avatar Oct 28 '20 19:10 igorsafo

Thanks a lot, it is now much more clear!

Best wishes, Aleksandr Nikolav

alenik01 avatar Oct 28 '20 19:10 alenik01