SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
Static Public Member Functions | Static Protected Member Functions | List of all members
smaug::smv::bn::TilingOptimizer Class Reference

Tiling optimizer for SMV batch norm kernel. More...

#include <smv_batch_norm_tiling.h>

Inheritance diagram for smaug::smv::bn::TilingOptimizer:
smaug::smv::TilingOptimizerBase

Detailed Description

Tiling optimizer for SMV batch norm kernel.

Definition at line 19 of file smv_batch_norm_tiling.h.

Static Public Member Functions

static std::array< TiledTensor, 3 > doTiling (SmvBatchNormOp *op)
 Runs the tiling optimizer on the given batch norm op. More...
 
static TilingConfig computeBasicTileShapes (Tensor *inputs, Tensor *weights, Tensor *outputs)
 Determine the best basic tiling shape for this batch norm layer. More...
 

Static Protected Member Functions

static std::array< TilingDims, 2 > determineBestTilingDims (Tensor *inputs, Tensor *weights, int maxTileSize)
 Determine the best tiling dimensions for running batch norm on SMV. More...
 
static void enumPostFCTilingConfigs (TensorShape inputsShape, TensorShape weightsShape, int maxTileSize, std::array< TilingDims, 2 > strategies, std::list< TilingConfig > &fullConfigs)
 
static void enumPostConvTilingConfigs (TensorShape inputsShape, TensorShape weightsShape, int maxTileSize, std::array< TilingDims, 2 > strategies, std::list< TilingConfig > &fullConfigs)
 

Member Function Documentation

◆ computeBasicTileShapes()

TilingConfig smaug::smv::bn::TilingOptimizer::computeBasicTileShapes ( Tensor inputs,
Tensor weights,
Tensor outputs 
)
static

Determine the best basic tiling shape for this batch norm layer.

The algorithm first determines the dimensions along which the inputs, weights, and outputs will be tiled. Then based on those dimensions, we enumerate all possible basic tile shapes for inputs, weights, and outputs. A basic shape is the shape that all but potentially the last tile along a set of dimensions will use. This triplet of tile shapes defines a TilingConfig. The TilingConfig that maximizes the total combined size of input, weights, and output tiles is chosen as the best.

This algorithm assumes that the maximum tile size for weights, inputs, and outputs are all the same and that they will reside in separate scratchpads (no sharing).

Parameters
inputsInputs tensor of the batch norm operator.
weightsA tensor that concatenates the four weights tensors of the batch norm operator.
outputsOutputs tensor of the batch norm operator.
Returns
The TilingConfig that describes the best tiling shapes.

Definition at line 207 of file smv_batch_norm_tiling.cpp.

◆ determineBestTilingDims()

std::array< TilingDims, 2 > smaug::smv::bn::TilingOptimizer::determineBestTilingDims ( Tensor inputs,
Tensor weights,
int  maxTileSize 
)
staticprotected

Determine the best tiling dimensions for running batch norm on SMV.

Returns: A 2-element array of TilingDims enums (inputs, weights).

Definition at line 13 of file smv_batch_norm_tiling.cpp.

◆ doTiling()

std::array< TiledTensor, 3 > smaug::smv::bn::TilingOptimizer::doTiling ( SmvBatchNormOp op)
static

Runs the tiling optimizer on the given batch norm op.

Returns
An array of tiled inputs, weights, and outputs.

Definition at line 260 of file smv_batch_norm_tiling.cpp.


The documentation for this class was generated from the following files: