AMDMIGraphX
AMDMIGraphX copied to clipboard
Longformer reshape simplification
Following pattern seen in Longformer:
@1473 = gpu::code_object[code_object=7552,symbol_name=mlir_reshape_reshape_transpose_reshape_dot,global=589824,local=256,](@1463,@1460,@1472) -> half_type, {144, 512, 512}, {262144, 512, 1}: 0.0601688ms, 1%
@1474 = reshape_lazy[dims={48, 3, 512, 1, 512}](@1473) -> half_type, {48, 3, 512, 1, 512}, {786432, 262144, 512, 512, 1}: 0.0006914ms, 1%
@1475 = transpose[permutation={0, 1, 2, 4, 3}](@1474) -> half_type, {48, 3, 512, 512, 1}, {786432, 262144, 512, 1, 512}: 0.00062502ms, 1%
@1476 = reshape_lazy[dims={48, 3, 512, 512}](@1475) -> half_type, {48, 3, 512, 512}, {786432, 262144, 512, 1}: 0.00064048ms, 1%
This should be simplified to a single reshape. Might be fixed by #3104