tensorflow/compiler/mlir/tfrt/jit/tf_jitrt_pipeline.cc
// Adds Linalg passes to perform fusion, tiling, peeling and vectorization.
Adds Linalg passes to perform fusion, tiling, peeling and vectorization.
Adds Linalg passes to perform fusion tiling peeling and vectorization .
void AddLinalgTransformations(OpPassManager& pm,
                              const TfJitRtPipelineOptions& options) {
  pm.addNestedPass<FuncOp>(CreateFusionPass());
  if (!options.vectorize) return;
  pm.addNestedPass<FuncOp>(CreateDetensorizeLinalgPass());
  mlir::SmallVector<int64_t, 2> reduction_2d_tile_sizes = {4, 4};
  if (options.reduction_2d_tile_sizes.hasValue()) {
    reduction_2d_tile_sizes.assign(options.reduction_2d_tile_sizes.begin(),
                                   options.reduction_2d_tile_sizes.end());
  }
  pm.addNestedPass<FuncOp>(CreateTileReductionPass(
      options.vector_size, options.reduction_1d_tile_size,
      reduction_2d_tile_sizes));
  if (options.vectorize && options.codegen_transpose)
    pm.addNestedPass<FuncOp>(CreateTileTransposePass());
  pm.addNestedPass<FuncOp>(CreateTileCWisePass(options.vector_size));
  if (options.peel) {
    pm.addNestedPass<FuncOp>(CreatePeelTiledLoopsPass());
  }
  pm.addNestedPass<FuncOp>(mlir::createCSEPass());
  pm.addPass(mlir::createCanonicalizerPass());
  if (options.fuse_fill) {
    pm.addNestedPass<FuncOp>(CreateFuseFillIntoTiledReductionPass());
  }
  pm.addNestedPass<FuncOp>(CreateTileFillPass(options.vector_size));
  pm.addNestedPass<FuncOp>(CreateVectorizeTiledOpsPass());
}
void AddLinalgTransformations ( OpPassManager & pm , const TfJitRtPipelineOptions & options ) { pm . addNestedPass < FuncOp > ( CreateFusionPass ( ) ) ; if ( ! options . vectorize ) return ; pm . addNestedPass < FuncOp > ( CreateDetensorizeLinalgPass ( ) ) ; mlir :: SmallVector < int64_t , 2 > reduction_2d_tile_sizes = { 4 , 4 } ; if ( options . reduction_2d_tile_sizes . hasValue ( ) ) { reduction_2d_tile_sizes . assign ( options . reduction_2d_tile_sizes . begin ( ) , options . reduction_2d_tile_sizes . end ( ) ) ; } pm . addNestedPass < FuncOp > ( CreateTileReductionPass ( options . vector_size , options . reduction_1d_tile_size , reduction_2d_tile_sizes ) ) ; if ( options . vectorize && options . codegen_transpose ) pm . addNestedPass < FuncOp > ( CreateTileTransposePass ( ) ) ; pm . addNestedPass < FuncOp > ( CreateTileCWisePass ( options . vector_size ) ) ; if ( options . peel ) { pm . addNestedPass < FuncOp > ( CreatePeelTiledLoopsPass ( ) ) ; } pm . addNestedPass < FuncOp > ( mlir :: createCSEPass ( ) ) ; pm . addPass ( mlir :: createCanonicalizerPass ( ) ) ; if ( options . fuse_fill ) { pm . addNestedPass < FuncOp > ( CreateFuseFillIntoTiledReductionPass ( ) ) ; } pm . addNestedPass < FuncOp > ( CreateTileFillPass ( options . vector_size ) ) ; pm . addNestedPass < FuncOp > ( CreateVectorizeTiledOpsPass ( ) ) ; }
Adds Linalg passes to perform fusion, tiling, peeling and vectorization.
Adds Linalg passes to perform fusion tiling peeling and vectorization .
// Unfortunately, at the moment there is no way to provide default values for // ListOption. That's why we have to provide them here. When // https://github.com/llvm/llvm-project/issues/52667 feature request is // accepted and implemented, this line will have to be removed.