Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions olive/passes/onnx/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ def _run_for_config(
) -> ONNXModelHandler:
output_model_path = resolve_onnx_path(output_model_path)
model_ir = model.load_ir_model()
ir.external_data.load_to_model(model_ir)
version_converter.convert_version(model_ir, config.target_opset, fallback=True)
return ir_model_to_olive_model(model_ir, output_model_path, config)

Expand Down
1 change: 1 addition & 0 deletions olive/passes/onnx/hqq_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def _run_for_config(
return model
output_model_path = resolve_onnx_path(output_model_path, Path(model.model_path).name)
ir_model = model.load_ir_model()
ir.external_data.load_to_model(ir_model)
ir_model.graph.opset_imports[MSFT_DOMAIN] = 1
self._quantize_model(
ir_model,
Expand Down
4 changes: 3 additions & 1 deletion olive/passes/onnx/onnxscript_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pathlib import Path

from onnxscript.rewriter import ort_fusions
import onnx_ir as ir

from olive.hardware.accelerator import AcceleratorSpec
from olive.model import ONNXModelHandler
Expand All @@ -30,7 +31,8 @@ def _run_for_config(
output_model_path = resolve_onnx_path(output_model_path, Path(model.model_path).name)

model_ir = model.load_ir_model()

ir.external_data.load_to_model(model_ir)

# TODO(exporter team): Different fusions support different devices
model_ir, function_stats = ort_fusions.optimize_for_ort(model_ir)
logger.debug("Function stats: %s", function_stats)
Expand Down
1 change: 1 addition & 0 deletions olive/passes/onnx/rtn_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def _run_for_config(
) -> ONNXModelHandler:
output_model_path = resolve_onnx_path(output_model_path, Path(model.model_path).name)
ir_model = model.load_ir_model()
ir.external_data.load_to_model(ir_model)
ir_model.graph.opset_imports[MSFT_DOMAIN] = 1
self._quantize_model(
ir_model,
Expand Down