You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working with StableHLO to import graphs for inference from PyTorch, and I'm trying to understand what target independent graph-level optimizations are available (and currently missing) and how I can apply them.
Essentially something similar to Onnx-simplifier, or TVM's PassManager with o3.
For example, one I'm looking at is that in most cases for inference, batch normalization can be folded into the weights of the previous layer.
However, when I export a graph from PyTorch, I see that the batch normalization layer is still present in the graph. I'm wondering if there's a way to apply this optimization in StableHLO, or if it's something that's planned for the future.
For example, exporting this one-layer PyTorch model (using the forward stablehlo text):
I've been working with StableHLO to import graphs for inference from PyTorch, and I'm trying to understand what target independent graph-level optimizations are available (and currently missing) and how I can apply them.
Essentially something similar to Onnx-simplifier, or TVM's PassManager with
o3
.For example, one I'm looking at is that in most cases for inference, batch normalization can be folded into the weights of the previous layer.
However, when I export a graph from PyTorch, I see that the batch normalization layer is still present in the graph. I'm wondering if there's a way to apply this optimization in StableHLO, or if it's something that's planned for the future.
For example, exporting this one-layer PyTorch model (using the
forward
stablehlo text):The MLIR still has a batch norm in it:
Using existing passes doesn't seem to remove this op.
The text was updated successfully, but these errors were encountered: