Skip to content
Snippets Groups Projects
Commit 88fa485b authored by Maxence Naud's avatar Maxence Naud
Browse files

update recipes header file with 'foldConstantOfShape'

parent b316b3f0
No related branches found
No related tags found
1 merge request!357[upd] 'removeConstantOfShape' recipe
Pipeline #66517 canceled
......@@ -51,11 +51,14 @@ void matMulToFC(std::shared_ptr<GraphView> graphView);
size_t removeNode(std::shared_ptr<GraphView> graphView, const std::string& type, bool incProducers = false);
/**
* @brief Fuses constant => Generic | constantOfShape and transforms it into a Producer
* @param graph Graph to manipulate
* @return size_t Number of replacement
* @brief Compute the output of any ConstantOfShape with a constant input and
* replaces it with a Producer.
* @details Replace "constant->GenericOperator|ConstantOfShape" with "Producer".
* @note Currently, this function only matches the query "Producer->ConstantOfShape".
* @param graph GraphView to transform.
* @return std::size_t Number of replacements.
*/
size_t removeConstantOfShape(std::shared_ptr<GraphView> graph_view);
std::size_t foldConstantOfShape(std::shared_ptr<GraphView> view);
/**
* @brief Remove ``Dropout`` Node.
......@@ -139,16 +142,16 @@ void expandMetaOps(std::shared_ptr<GraphView> graph, bool recursive = false);
/**
* @brief Tile any :cpp:function:`Aidge::MatMul` operator to several fixed size matrix multiplications.
* For instance, for a MatMul of size 80x80 and a tiling of 16x16, this will tile
* For instance, for a MatMul of size 80x80 and a tiling of 16x16, this will tile
* the MatMul operator to 25 (5 by 5) MatMul operators of size 16x16, with Slice
* operators inserted at the inputs and Concat operators inserted at the outputs.
*
* This is especially useful when matrix multiplication must be mapped to fixed
* maximum size hardware TPU (Tensor Processing Unit) or MMA (Matrix Multiplication
* Accelerator). This recipe can be combined with the :cpp:function:`Aidge::convToMatMul` recipe in
* order to convert convolutions to matrix multiplication beforehand, and
*
* This is especially useful when matrix multiplication must be mapped to fixed
* maximum size hardware TPU (Tensor Processing Unit) or MMA (Matrix Multiplication
* Accelerator). This recipe can be combined with the :cpp:function:`Aidge::convToMatMul` recipe in
* order to convert convolutions to matrix multiplication beforehand, and
* :cpp:function:`Aidge::constantFolding` recipe to fold sliced constant tensors.
*
*
* @param matMul MatMul operator to be tiled.
* @param maxDims Maximum output dimensions of the tiled MatMul operators.
*/
......@@ -181,7 +184,7 @@ size_t convToMatMul(std::shared_ptr<GraphView> graph);
/**
* @brief Adapt a graph to the available kernels of a backend.
*
*
* @param graph Graph to manipulate
*/
void adaptToBackend(std::shared_ptr<GraphView> graph);
......@@ -189,18 +192,18 @@ void adaptToBackend(std::shared_ptr<GraphView> graph);
/**
* @brief Create a GenericOp from an Operator and replace it
*
*
* @param node Node which Operator will be changed into a generic Operator
*/
void toGenericOp(std::shared_ptr<Node> node);
/**
* @brief The node passed contains an operator which input of index 1 is supposed be be weights of type Int4, Int3, Int2, binary.
* This recipie only operates memory transformations on the weight tensor.
* This recipie only operates memory transformations on the weight tensor.
* First, permutes the dimensions to match the dataformat NHWC
* Second, compact the last dimension of the weights (Channel dimension) into 8bits
*
* @param node Node
* Second, compact the last dimension of the weights (Channel dimension) into 8bits
*
* @param node Node
*/
void applyWeightInterleaving(std::shared_ptr<Node> node);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment