furiosa.optimizer.frontend.onnx.transformer.experimental package

Submodules

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

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

Bases: Transformer

from: Softmax -> graph_output to: graph_output

Assume NCHW Input

transform(model: ModelProto) ModelProto

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

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

Bases: 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: NodeProto) bool
pattern_condition_checker(nodes_to_check: Iterable[NodeProto]) bool
pattern_matching(base_node)
class furiosa.optimizer.frontend.onnx.transformer.experimental.embedding_bag_porting.EmbeddingBagPorting(batch_size: int | None = 128)

Bases: Transformer

transform(model: ModelProto) ModelProto

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

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

Bases: Transformer

Only works for some BERT Models

transform(model: ModelProto) ModelProto
transform_matmul_add(model)

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

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

Bases: Transformer

from: MatMul + Add to: Conv

Assume NCHW Input

transform(model: ModelProto) ModelProto
transform_matmul_add(model)

Module contents