furiosa.quantizer.frontend.onnx.transformer.experimental package

Submodules

furiosa.quantizer.frontend.onnx.transformer.experimental.eliminate_detection_postprocess module

class furiosa.quantizer.frontend.onnx.transformer.experimental.eliminate_detection_postprocess.EliminateSSDDetectionPostprocess(ssd_outputs: List)

Bases: furiosa.quantizer.interfaces.transformer.Transformer

from: Softmax -> graph_output to: graph_output

Assume NCHW Input

transform(model: onnx.onnx_ml_pb2.ModelProto) onnx.onnx_ml_pb2.ModelProto

furiosa.quantizer.frontend.onnx.transformer.experimental.embedding_bag_porting module

class furiosa.quantizer.frontend.onnx.transformer.experimental.embedding_bag_porting.EmbeddingBagPattern(model, name_nodes=True)

Bases: furiosa.quantizer.frontend.onnx.transformer.ONNXTransformer

Apply to the DLRM model only. Transform onnx-exported EmbeddingBag graph to be equivalent to torch.EmbeddingBag If not applied on DLRM model, onnx simplifier doesn’t work because transformed embeddingbag can’t handle empty bag. https://github.com/pytorch/pytorch/blob/55d479aca5e959c5f2fe3089e162db710bb7632d/torch/onnx/symbolic_opset11.py#L836-L902

check_condition_3(node: onnx.onnx_ml_pb2.NodeProto) bool
pattern_condition_checker(nodes_to_check: Iterable[onnx.onnx_ml_pb2.NodeProto]) bool
pattern_matching(base_node)
class furiosa.quantizer.frontend.onnx.transformer.experimental.embedding_bag_porting.EmbeddingBagPorting(batch_size: Optional[int] = 128)

Bases: furiosa.quantizer.interfaces.transformer.Transformer

transform(model: onnx.onnx_ml_pb2.ModelProto) onnx.onnx_ml_pb2.ModelProto

furiosa.quantizer.frontend.onnx.transformer.experimental.fuse_div_for_bert module

class furiosa.quantizer.frontend.onnx.transformer.experimental.fuse_div_for_bert.FuseDivForBert

Bases: furiosa.quantizer.interfaces.transformer.Transformer

Only works for some BERT Models

transform(model: onnx.onnx_ml_pb2.ModelProto) onnx.onnx_ml_pb2.ModelProto
transform_matmul_add(model)

furiosa.quantizer.frontend.onnx.transformer.experimental.reify_conv_for_bert module

class furiosa.quantizer.frontend.onnx.transformer.experimental.reify_conv_for_bert.ReifyConvForBert

Bases: furiosa.quantizer.interfaces.transformer.Transformer

from: MatMul + Add to: Conv

Assume NCHW Input

transform(model: onnx.onnx_ml_pb2.ModelProto) onnx.onnx_ml_pb2.ModelProto
transform_matmul_add(model)

Module contents