AMDMIGraphX icon indicating copy to clipboard operation
AMDMIGraphX copied to clipboard

Lower unsupported pooling sizes for the CPU to Reference backend

Open umangyadav opened this issue 1 year ago • 2 comments

https://github.com/ROCm/AMDMIGraphX/pull/3081/files#r1638157103

umangyadav avatar Jun 13 '24 12:06 umangyadav

Hi @umangyadav , I would like to take this if no one is working on this.. (I am new to the graph compiler). Here is my rough idea-

Suggested Changes:

Upon checking OneDNN has a kernel size limitation (for Direct Algorithm on SIMD): specifies a maximum dimension size of 14 for the kernel ("weights tensor"). This is noe implemented in MIGraphX, which may lead to failures during execution.

Check Kernel Size and Padding: Add a check for the kernel size and padding limits before applying the OneDNN pooling operator.

Fallback to Reference Backend: If the condition fails (e.g., kernel size exceeds 14 ), replace the pooling operation with a reference backend operation. For invalid configurations, the pooling operation is replaced with a reference backend pooling operator (ref::pooling) CPU based fallback. Valid configurations continue to use the OneDNN pooling operation (dnnl::pooling)

let me know you have suggestions!

aditya-167 avatar Sep 16 '24 23:09 aditya-167

@aditya-167 Thanks for taking initiative. Your suggested changes look good. I suggest you raise a PR with suggested changes and tag @pfultz2 or @CharlieL7 as reviewers who can help you more with changes.

umangyadav avatar Sep 17 '24 12:09 umangyadav