Add FusedConv Op to ROCm (#11792)
* [ROCm] Add FusedConv Op.
* Enable ROCm for FusedConvTest
* [ROCm] Implement FusedConv Op. with Fusion API
The old code path was left as the fallback since some combinations are
not supported (e.g., FusedConvTest.Conv2D_Bias_Z_Relu as of ROCM 5.1,
where to bias layers are needed).
* [ROCM] Suppress duplicated warnings in unsupported Fusion API usage.
Know limitation for current MIOpen (verified with ROCM 5.2): Only one
bias layer may present in the Fusion Plan. Adding the second bias
operation to the Fusion plan will end up with miopenStatusUnsupportedOp.
In this case the fallback code path will be taken to complete required
FusedConv operation.
However, previously this failure was not detected and cached, and
applications that create multiple FusedConv Ops with both z and bias
will keep printing error messages, which is annoying to end users
while this message is mainly for developers.
This commit will let it print the first error message as a reminder, and
skip the Fusion API code path in following calls if both z and bias
present. (Note: the skipping applies to all newly created FusedConv Ops).
* [ROCM] Add cache mechanism for FusedConv Op.
Now the operator with the same configuration will share the same Fusion
Plan object, and the creation result will also be cached.
Two benefits:
1. No duplicated Fusion plan creation, which is a presumably very costly
process.
2. Failures due to MIOpen limitations (like z and b cannot present at
the same time) will only be triggered once.
Know limits:
Due to the limitation of MIOpen Interface, the tensor order of the
convolution operator can only be guessed.