MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MklLayoutRewritePass

Class MklLayoutRewritePass

tensorflow/core/graph/mkl_layout_pass.cc:240–2040  ·  view source on GitHub ↗

This pass implements rewriting of graph to support following scenarios: (A) Merging nodes in the graph (B) Rewriting a node in the graph to a new node Rewrite happens under following scenario: - Propagating OneDnn layout as an additional output tensor (we will loosely call a tensor that carries OneDNN layout as OneDNN tensor henceforth.) from every OneDNN supported NN layer. Example of A : Mergin

Source from the content-addressed store, hash-verified

238// will set workspace_enabled attribute to false.
239//
240class MklLayoutRewritePass : public GraphOptimizationPass {
241 public:
242 MklLayoutRewritePass() {
243 // NOTE: names are alphabetically sorted.
244 csinfo_.addn = "AddN";
245 csinfo_.avg_pool = "AvgPool";
246 csinfo_.avg_pool_grad = "AvgPoolGrad";
247 csinfo_.avg_pool3d = "AvgPool3D";
248 csinfo_.avg_pool3d_grad = "AvgPool3DGrad";
249 csinfo_.batch_matmul = "BatchMatMul";
250 csinfo_.batch_matmul_v2 = "BatchMatMulV2";
251 csinfo_.bias_add = "BiasAdd";
252 csinfo_.bias_add_grad = "BiasAddGrad";
253 csinfo_.concat = "Concat";
254 csinfo_.concatv2 = "ConcatV2";
255 csinfo_.conjugate_transpose = "ConjugateTranspose";
256 csinfo_.conv2d = "Conv2D";
257 csinfo_.conv2d_with_bias = "__MklDummyConv2DWithBias";
258 csinfo_.conv2d_grad_input = "Conv2DBackpropInput";
259 csinfo_.conv2d_grad_filter = "Conv2DBackpropFilter";
260 csinfo_.conv2d_grad_filter_with_bias =
261 "__MklDummyConv2DBackpropFilterWithBias";
262 csinfo_.conv3d = "Conv3D";
263 csinfo_.conv3d_grad_input = "Conv3DBackpropInputV2";
264 csinfo_.conv3d_grad_filter = "Conv3DBackpropFilterV2";
265 csinfo_.depthwise_conv2d = "DepthwiseConv2dNative";
266 csinfo_.depthwise_conv2d_grad_input = "DepthwiseConv2dNativeBackpropInput";
267 csinfo_.depthwise_conv2d_grad_filter =
268 "DepthwiseConv2dNativeBackpropFilter";
269 csinfo_.dequantize = "Dequantize";
270 csinfo_.fused_batch_norm = "FusedBatchNorm";
271 csinfo_.fused_batch_norm_grad = "FusedBatchNormGrad";
272 csinfo_.fused_batch_norm_ex = "_FusedBatchNormEx";
273 csinfo_.fused_batch_norm_v2 = "FusedBatchNormV2";
274 csinfo_.fused_batch_norm_grad_v2 = "FusedBatchNormGradV2";
275 csinfo_.fused_batch_norm_v3 = "FusedBatchNormV3";
276 csinfo_.fused_batch_norm_grad_v3 = "FusedBatchNormGradV3";
277 csinfo_.fused_conv2d = "_FusedConv2D";
278 csinfo_.fused_depthwise_conv2d = "_FusedDepthwiseConv2dNative";
279 csinfo_.fused_matmul = "_FusedMatMul";
280 csinfo_.fused_batch_matmul = "_FusedBatchMatMul";
281 csinfo_.fused_batch_matmul_v2 = "_FusedBatchMatMulV2";
282 csinfo_.identity = "Identity";
283 csinfo_.leakyrelu = "LeakyRelu";
284 csinfo_.leakyrelu_grad = "LeakyReluGrad";
285 csinfo_.lrn = "LRN";
286 csinfo_.lrn_grad = "LRNGrad";
287 csinfo_.matmul = "MatMul";
288 csinfo_.max_pool = "MaxPool";
289 csinfo_.max_pool_grad = "MaxPoolGrad";
290 csinfo_.max_pool3d = "MaxPool3D";
291 csinfo_.max_pool3d_grad = "MaxPool3DGrad";
292 csinfo_.mkl_conv2d = "_MklConv2D";
293 csinfo_.mkl_conv2d_grad_input = "_MklConv2DBackpropInput";
294 csinfo_.mkl_conv2d_grad_filter = "_MklConv2DBackpropFilter";
295 csinfo_.mkl_conv2d_with_bias = "_MklConv2DWithBias";
296 csinfo_.mkl_conv2d_grad_filter_with_bias =
297 "_MklConv2DBackpropFilterWithBias";

Callers 1

RunMklLayoutRewritePassFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected