Skip to content
Merged
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
3 changes: 2 additions & 1 deletion olive/cli/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _get_pass_list(self, precision, algo, impl, is_hf_model):

if not pass_list:
raise ValueError(
f"Quantiation for precision {precision}, algorithm {algo} and implementation {impl} "
f"Quantization for precision {precision}, algorithm {algo} and implementation {impl} "
f"with QDQ {self.args.use_qdq_encoding} is not supported"
)

Expand Down Expand Up @@ -237,6 +237,7 @@ def run(self):
# TODO(jambayk): consider exposing the activation bits through the act_precision argument
{"impl_name": ImplName.SPINQUANT, "pass_type": "SpinQuant"},
{"impl_name": ImplName.AWQ, "pass_type": "AutoAWQQuantizer"},
{"impl_name": ImplName.OLIVE, "pass_type": "Gptq"},
{"impl_name": ImplName.AUTOGPTQ, "pass_type": "GptqQuantizer"},
]

Expand Down
8 changes: 6 additions & 2 deletions olive/common/ort_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ def ort_supports_ep_devices() -> bool:

def maybe_register_ep_libraries(ep_paths: dict[str, str]):
"""Register execution provider libraries if onnxruntime supports it."""
if not ort_supports_ep_devices():
try:
import onnxruntime as ort
except ImportError:
logger.debug("Skipping EP registration since onnxruntime is not installed")
return

import onnxruntime as ort
if not ort_supports_ep_devices():
return

# providers that ort was built with such as CUDA, QNN, VitisAI but need registration
for provider in set(ort.get_available_providers()):
Expand Down