-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common API - Network Definition API #188
Comments
Input
Wraps an mgx::parameter kACTIVATION
Activations which require non-default alpha and/or beta params, must set them after the layer is created via the appropriate method
ActivationTypes that map to a combination of MGX operators:
Unsure:
Not part of ONNX:
kLRN
Maps to a single MGX operator - "lrn" kSCALE
Doesn't seem to have ONNX equivalent kSOFTMAX
Axis must be set after the layer is created kCONCATENATION
Axis must be set after the layer is created kELEMENTWISE
Operation can be changed after the layer is created
ElementWiseOperations without mapping to mgx operators:
kUNARY
Operation can be changed after the layer is created
kSHUFFLE
This layer shuffles data by applying in sequence: a transpose operation, a reshape operation and a second transpose operation. The dimension types of the output are those of the reshape dimension. The layer has an optional second input. If present, it must be a 1D Int32 shape tensor, and the reshape dimensions are taken from it. Maps to a combination of mgx operators (transpose and reshape). kONEHOT
Axis can be changed after the layer is created kREDUCE
Operation, Axes, and KeepDimensions can be changed after the layer is created
kTOPK
Operation, K, and reduceAxes can be changed after the layer is created kGATHER
GatherMode must be set after the layer is created, unless kDEFAULT is desired
For mode kND the mgx "gathernd" operator can be used directly
See above kRAGGED_SOFTMAX
No equivalent ONNX or MGX operator KMATRIX_MULTIPLY
Op0 and Op1 can be changed after the layer is created kNON_ZERO
Implemented via "nonzero" mgx op if input is not a constant, a literal is inserted otherwise kCONSTANT
Wraps an mgx literal kIDENTITY
Directly maps to mgx id operator kCAST
toType can be changed after the layer is created kPARAMETRIC_RELU
Maps to mgx "prelu" operator kCONVOLUTION
Input, nbOutputMaps, kernelSize, kernelWeights, and biasWeights can be changed after the layer is created
PrePadding and PostPadding amount to the same things as the pads attribute in ONNX. The difference being that ONNX prohibits pads being used when auto_pad is used, while TRT gives precedence to auto_pad/PaddingMode if both are used. kPOOLING
Corresponds to ONNX MaxPool, AveragePool, GlobalMaxPool and GlobalAveragePool kDECONVOLUTION
Corresponds to ONNX ConvTranspose operator kSCALE
TODO kRESIZE
Implemented as a combination of mgx operators kLOOP
TODO kCONDITION
TODO kSELECT
Equivalent to the "where" mgx/ONNX op kASSERTION
No equivalent ONNX or MGX operator kFILL
Covers the RandomNormal and RandomNormalLike ONNX operators for KillOperation::kRANDOM_NORMAL, and RandomUniform and RandomUniformLike for FillOperation::kRANDOM_UNIFORM.
kPADDING
Pre and post padding can be changed after the layer is created kDEQUANTIZE
TODO kSCATTER
Covers the ONNX ScatterElements and ScatterND operators for ScatterMode::kElement and ScatterMode::kND respectively ... |
The initial approach will be to wrap both layers and tensors around instructions. This approach allow us to use existing infrastructure for both instruction modification, which needs to be reflected in downstream instructions if the output type changes, and for creating composite operators, by reusing existing parsing code. A difficulty that presents itself for any approach and this one especially are ONNX operators that hold subgraphs. |
The way INetworkDefinition tracks input and output tensors needs to be modified. MGX does not guarantee that output parameters will be inserted after input parameters, nor seemingly the relative ordering of the parameters. |
Create an MGX API to mimic the TRT network definition APIs.
Once the APIs are created, attempt to combine it with the TRT ONNX parser so that the network definition and layer manipulation APIs can be used on a network created by parsing an ONNX file.
The text was updated successfully, but these errors were encountered: