SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
Static Protected Member Functions | List of all members
smaug::smv::TilingOptimizerBase Class Reference
Inheritance diagram for smaug::smv::TilingOptimizerBase:
smaug::smv::bn::TilingOptimizer smaug::smv::conv::TilingOptimizer smaug::smv::fc::TilingOptimizer smaug::smv::pool::TilingOptimizer

Detailed Description

Definition at line 11 of file smv_tiling_base.h.

Static Protected Member Functions

static TilingDims findBestTilingDims (const TensorShape &shape, int maxTileSize, const std::vector< int > &minShape)
 Find the best set of dimensions to tile a given tensor shape. More...
 
static void enum2DTensorTilingConfigs (TensorShape shape, int maxTileSize, const std::vector< int > &minShape, const std::vector< int > &strides, std::vector< TensorShape > &configs)
 Enumerates all tiling configs for a two dimensional Tensor. More...
 
static void enum4DTensorTilingConfigs (TensorShape shape, int maxTileSize, const std::vector< int > &minShape, const std::vector< int > &strides, std::vector< TensorShape > &configs)
 Enumerates all tiling configs for a four dimensional Tensor. More...
 

Member Function Documentation

◆ enum2DTensorTilingConfigs()

void smaug::smv::TilingOptimizerBase::enum2DTensorTilingConfigs ( TensorShape  shape,
int  maxTileSize,
const std::vector< int > &  minShape,
const std::vector< int > &  strides,
std::vector< TensorShape > &  configs 
)
staticprotected

Enumerates all tiling configs for a two dimensional Tensor.

Parameters
shapeTensor shape.
maxTileSizeMaximum elements per tile.
minShapeMinimum per-tile shape
stridesStride lengths along the N and C channels.
configsOutput list of tiling configurations.

Definition at line 56 of file smv_tiling_base.cpp.

◆ enum4DTensorTilingConfigs()

void smaug::smv::TilingOptimizerBase::enum4DTensorTilingConfigs ( TensorShape  shape,
int  maxTileSize,
const std::vector< int > &  minShape,
const std::vector< int > &  strides,
std::vector< TensorShape > &  configs 
)
staticprotected

Enumerates all tiling configs for a four dimensional Tensor.

Parameters
shapeTensor shape.
maxTileSizeMaximum elements per tile.
minShapeMinimum per-tile shape
stridesStride lengths along the N and C channels.
configsOutput list of tiling configurations.

Definition at line 78 of file smv_tiling_base.cpp.

◆ findBestTilingDims()

TilingDims smaug::smv::TilingOptimizerBase::findBestTilingDims ( const TensorShape shape,
int  maxTileSize,
const std::vector< int > &  minShape 
)
staticprotected

Find the best set of dimensions to tile a given tensor shape.

The goal is to divide up a tensor into tiles that each are <= maxTileSize elements. The tensor layouts can be NC, NHWC or NCHW. The minimum tile size is specified via minShape. The preferences for tiling dimensions are as follows:

1) No tiling. 2) Dim-N tiling. N is the input batch. 3) Dim-NC tiling. After tiling by N, tile channelwise. Do not tile in HW. 4) Dim-NH tiling. After tiling by N, tile rowwise. Do not tile in WC. 5) Dim-NW tiling. After tiling by N, tile columnwise. Do not tile in HC. 6) Dim-NHW tiling. After tiling by N, tile rowwise and then columnwise. Do not tile in C. 7) Dim-NCH tiling. After tiling by N and channel dimensions, tile rowwise. Do not tile in W. 8) Dim-NCW tiling. After tiling by N and channel dimensions, tile columnwise. Do not tile in H.

Except Option 1, a minimum size for each dimension can be deduced from minShape. Note that for a 2D tensor shape, only options 1-5 are viable.

Definition at line 10 of file smv_tiling_base.cpp.


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