Open
Description
We are having more and more graph-level passes for users to combine their own needs. But it could be inconvenient for the users who only want a standard combination (clear metadata, lift constants, and fold transpose): https://github.com/kunal-vaishnavi/phi4-mm/pull/1/files#r2069106112.
The optimize_model
api currently used in onnxruntime.
def optimize_model(
input: str | ModelProto,
model_type: str = "bert",
num_heads: int = 0,
hidden_size: int = 0,
optimization_options: FusionOptions | None = None,
opt_level: int | None = None,
use_gpu: bool = False,
only_onnxruntime: bool = False,
verbose: bool = False,
*,
provider: str | None = None,
) -> OnnxModel:
Activity
titaiwangms commentedon May 1, 2025
I think if we manage to apply this with
optimize=True
, we probably don't need a new api.justinchuby commentedon May 1, 2025
there is the
onnx_program.optimize()
method which currently doesn't take any params but we have left room to extend it. I wonder if some carefully designed options in the optiononnx_program.optimize()
will do?