DepthToSpace and pointwise unary operations fusion (#986)
In migraphx, DepthToSpace (d2s) is implemented as reshape --> transpose --> contiguous --> reshape. This PR adds matcher to find d2s + unary pointwise ops. Application of the matcher moves the pointwise unary operation before the contiguous and reshape of the d2s. So it becomes reshape --> transpose --> unary --> contiguous --> reshape. Motivation is that, later pointwise module would be created out of unary --> contiguous --> reshape. Codegen for this pointwise module can write out buffer such that explicit contiguous and reshape wouldn't be required. This transformation is not always guaranteed to improve performance, since unary op will operate on non-standard shape. So, we would need some tuning mechanism to make decision. #905 pending PR for binary operations.
Showing
src/simplify_algebra.cpp
100755 → 100644
File mode changed from 100755 to 100644
Please register or sign in to comment