Repository navigation
Invalid MIGraphX EP option: migraphx_load_compiled_path #25379
Description
Describe the issue
MIGraphXExecutionProvider: "migraphx_load_compiled_path" and "migraphx_save_compiled_path" are rejected as invalid options
According to the documentation here:
https://onnxruntime.ai/docs/execution-providers/MIGraphX-ExecutionProvider.html#session-variables
The MIGraphXExecutionProvider is supposed to support options like migraphx_load_compiled_path and migraphx_save_compiled_path to load or store a precompiled .mxr model.
However, these options trigger a runtime error when used in Python:
*************** EP Error ***************
EP Error /onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:966 std::unique_ptronnxruntime::IExecutionProvider onnxruntime::python::CreateExecutionProviderInstance(const onnxruntime::SessionOptions&, const std::string&, const onnxruntime::ProviderOptionsMap&) Invalid MIGraphX EP option: migraphx_load_compiled_path
when using [('MIGraphXExecutionProvider', {'device_id': '0', 'migraphx_fp16_enable': True, 'migraphx_load_compiled_model': True, 'migraphx_load_compiled_path': '2dfan4.mxr'})]
Falling back to ['CPUExecutionProvider'] and retrying.
This seems to contradict the current documentation, suggesting that these options are either not implemented or not exposed in the Python bindings.
important note, when not using either migraphx_load_compiled_path" and or "migraphx_save_compiled_path" the .mxr files are properly created and used, just on a non disclosed location rendering this process not useful as these files are not saved for future usage
System Info
- OS: Ubuntu 24.04.2 LTS
-GPU driver version: 6.12.12 - GPU: AMD RX 6800 XT
- ROCm: 6.4.1
- Python: 3.12.11 (in Conda env) conda list.txt
- ONNX Runtime:
onnxruntime-rocm==1.21.0fromhttps://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/
Despite successful inference (falling back to CPUExecutionProvider), MIGraphX EP fails to initialize due to the unrecognized option.
Is this a documentation mismatch, or are these options only supported in a specific build or version of ONNX Runtime?
If so, what would be the required version or build flags to enable support for these migraphx_*_compiled_path options in Python?
Thanks for your help!
To reproduce
Code to Reproduce
python
import numpy as np
import onnxruntime as ort
input_name = 'input'
input_shape = (1, 3, 256, 256)
dummy_input = np.random.rand(*input_shape).astype(np.float32)
session = ort.InferenceSession('2dfan4.onnx', providers=[
('MIGraphXExecutionProvider', {
'device_id': '0',
'migraphx_fp16_enable': True,
'migraphx_load_compiled_model': True,
'migraphx_load_compiled_path': '2dfan4.mxr',
})
])
outputs = session.run(None, {input_name: dummy_input})
print("Inference OK, output shape:", [o.shape for o in outputs])
link to model files: https://drive.google.com/file/d/1D3sHQyMCKksBmNZfA0zCufOPxpx493Pn/view
Urgency
No response
Platform
Linux
OS Version
Ubuntu 24.04.2 LTS
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.21.0
ONNX Runtime API
Python
Architecture
X64
Execution Provider
MIGraphX
Execution Provider Library Version
ROCm 6.4.1
Activity
ivancebellansanchez commentedon Aug 13, 2025
How great, just saw an email notification about this and turns out it's just an automated response, could anyone please check what happens with this issue?
TedThemistokleous commentedon Sep 2, 2025
Iván Cebellán Sánchez (@ivancebellansanchez) please use migraphx_model_cache_path instead of save/load/ Interface was changed and we're working on updating documentation for a later ROCM release for this to capture this change.
ivancebellansanchez commentedon Sep 2, 2025
Ted Themistokleous (@TedThemistokleous) thanks for your answer, I just tried it but doesn't seem to be working either I'm still getting the same kind of "Invalid MIGraphX EP option" error.
TedThemistokleous commentedon Sep 2, 2025
remove the use of migraphx_load_compiled_model, you dont need that flag anymore either.
If you set the model cache it will both save and load the model
If migraphx_modeL_cache_path is set it will look for the .mxr from pwd if you haven't specified an absolute path
ivancebellansanchez commentedon Sep 2, 2025
did that too, just copied the wrong output, but the same error remains even when I set migraphx_model_cache_path to ".caches" instead
code right now looks like this
TedThemistokleous commentedon Sep 2, 2025
If you're off main, its been changed to
"migraphx_model_cache_dir"
From migraphx_execution_provider_info.h
ivancebellansanchez commentedon Sep 2, 2025
OK, "migraphx_model_cache_dir" does seem to work
confirmed to be working
TedThemistokleous commentedon Sep 2, 2025
form

migraphx_execution_provider.ccDefined in

migraphx_execution_provider_info.hTedThemistokleous commentedon Sep 2, 2025
Iván Cebellán Sánchez (@ivancebellansanchez) Glad this worked. We've recently updated and amalgamated interfaces for a few different OS builds (*Nix/ Windows) so these flags have been in some flux for some time, especially for save/loading mxr files.
I'll get the documentation updated as we're slated for an upcoming ROCm release and sync our updates to major releases
Thanks for pointing this out and if you have any MIGraphX EP issues feel free to open issues here or on MIGraphX and ping me.
ivancebellansanchez commentedon Sep 2, 2025
thank you for spending some of your time to help me get this running
TedThemistokleous commentedon Sep 2, 2025
No Problem. If there's any issues, ping me. Its not a problem. Glad I could help
songding-sd commentedon Jul 11, 2026
Hi,
I'm trying to use INT8 quantization with the MIGraphX Execution Provider.
According to the documentation,
migraphx_int8_enablerequiresmigraphx_int8_calibration_table_nameto be set. However, I couldn't find anydocumentation describing how this calibration table should be generated.
I have a few questions:
migraphx_int8_calibration_table_name?(
migraphx_int8_use_native_calibration_table=1) and the JSON format(
migraphx_int8_use_native_calibration_table=0)?Any documentation or example would be greatly appreciated.
Thanks!
TedThemistokleous commentedon Jul 11, 2026
songding-sd I'm attaching an example from how we use the int8 calibration table
https://github.com/microsoft/onnxruntime-inference-examples/blob/main/quantization/nlp/bert/migraphx/e2e_migraphx_bert_example.py#L588
Answers inline
Its a flatbuffer - the EP will take a full precision run (fp32) and then use that to generate the calibration data so we can get an idea of how scales/biases are used for the int8 quant. You should use batch 1 to generate the table
No script - I have an example here - https://github.com/microsoft/onnxruntime-inference-examples/blob/main/quantization/nlp/bert/migraphx/e2e_migraphx_bert_example.py#L557
The table gets written by doing a fp32 run first and then using that data for int8 quant. Same process for fp8
Yes
Naitve is more for Nvidia native format. This is because we take similar format to handle int8. JSON is the default if its a non nvidia native table
No but there's other examples in microsoft/onnxruntime-inference-examples here's a few
resnet50 - https://github.com/microsoft/onnxruntime-inference-examples/blob/main/quantization/image_classification/migraphx/resnet50/e2e_migraphx_resnet_example.py
bert - https://github.com/microsoft/onnxruntime-inference-examples/blob/main/quantization/nlp/bert/migraphx/e2e_migraphx_bert_example.py
Documentation would be here
https://onnxruntime.ai/docs/execution-providers/MIGraphX-ExecutionProvider.html#docker-support
This will be moving in the coming months as we're compliant with the OnnxRT plugin system - so please ensure you're using Onnxruntime 1.23.x builds and the corresponding prebuilds.
Support matrix for ROCm and OnnxRT is here.
https://onnxruntime.ai/docs/execution-providers/MIGraphX-ExecutionProvider.html#requirements
Thanks for your question.
songding-sd commentedon Jul 13, 2026
Ted Themistokleous (@TedThemistokleous) Thanks for your reply! I'll try quantizing and running some FP32 YOLO ONNX models using the ONNX Runtime MIGraphX Execution Provider. I'll investigate this further and report back if I find anything useful.