NVIDIA NvNeural SDK
2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
|
Defines a fusing rule that can be applied during model loading. More...
#include <nvneural/CoreTypes.h>
Public Attributes | |
const char * | pFusingRule |
This is the fusing rule text, encoded in UTF-8. More... | |
std::uint32_t | syntaxVersion |
This is the version number of the fusing rule grammar. More... | |
Defines a fusing rule that can be applied during model loading.
Multiple versions of fusing rule syntax are supported by the framework.
Fusing rule syntax v2 adds the ability to scope the rule to specific tensor formats. This prevents layers from fusing into "faster" layers that are only defined for a different tensor format, which can cause unexpected hits in performance as tensors are reshaped into the fused layer's preferred layout and then back out to the default tensor format preferred by the rest of the network.
rule := [ scope ] layer_type [ "[" condition "]" ] [ "{" inputs "}" ]; scope := [ fp16 | fp32 ] [ "|" nchw | nhwc ] "|"; condition := and { "||" and }; and := operand { "&&" operand }; operand := "(" condition ")" | value bool_expr value; bool_expr := "<" | ">" | "<=" | ">=" | "==" | not_equal; not_equal := "<>"; value: = layer_parameter | INTEGER | FLOAT | STRING | DIMENSION; //example for DIMENSION(w=32 h=16 c=3): 32x16x3 layer_parameter := ID [ "." ID ]; //example for activation alpha value: act.alpha inputs := selection [range] { "," selection [range] }; range := ":" from [ "~" [ to ] ]; selection := element [ "!" ] { "|" element [ "!" ] }; element := any_layer | rule | "(" inputs ")"; from := to := INTEGER; layer_type := ID; any_layer := "?";
This is the original syntax supported by NvNeural.
rule := layer_type [ "[" condition "]" ] [ "{" inputs "}" ]; condition := and { "||" and }; and := operand { "&&" operand }; operand := "(" condition ")" | value bool_expr value; bool_expr := "<" | ">" | "<=" | ">=" | "==" | not_equal; not_equal := "<>"; value: = layer_parameter | INTEGER | FLOAT | STRING | DIMENSION; //example for DIMENSION(w=32 h=16 c=3): 32x16x3 layer_parameter := ID [ "." ID ]; //example for activation alpha value: act.alpha inputs := selection [range] { "," selection [range] }; range := ":" from [ "~" [ to ] ]; selection := element [ "!" ] { "|" element [ "!" ] }; element := any_layer | rule | "(" inputs ")"; from := to := INTEGER; layer_type := ID; any_layer := "?";
const char* nvneural::FusingRule::pFusingRule |
This is the fusing rule text, encoded in UTF-8.
Syntax varies by version.
std::uint32_t nvneural::FusingRule::syntaxVersion |
This is the version number of the fusing rule grammar.
Only syntax versions 1 and 2 are currently supported by the framework.