Add: test code for CoreMLExecutionProvider on a trial basis

Currently ONNXRuntime's CoreML support is not very good, and on my environment, I get errors like “coreml_execution_provider.cc:192 operator() Input (/sdp/flows.3/GatherND_2_output_0) has a dynamic shape ({-1,-1}) but the runtime shape ({0,10}) has zero elements. This is not supported by the CoreML EP.” and inference fails.
I hope this will be fixed in a future version of ONNXRuntime, and leave the test code as it is.
This commit is contained in:
tsukumi
2024-09-23 21:07:27 +09:00
parent b67e50fd8d
commit d935d30e4c
4 changed files with 17 additions and 2 deletions

View File

@@ -5,10 +5,12 @@ def torch_device_to_onnx_providers(
device: str,
) -> Sequence[Union[str, tuple[str, dict[str, Any]]]]:
if device.startswith("cuda"):
# cudnn_conv_algo_search を DEFAULT にすると推論速度が大幅に向上する
# ref: https://medium.com/neuml/debug-onnx-gpu-performance-c9290fe07459
return [
# cudnn_conv_algo_search を DEFAULT にすると推論速度が大幅に向上する
# ref: https://medium.com/neuml/debug-onnx-gpu-performance-c9290fe07459
("CUDAExecutionProvider", {"cudnn_conv_algo_search": "DEFAULT"}),
# CUDA が利用できない場合、可能であれば DirectML を利用する
("DmlExecutionProvider", {"device_id": 0}),
("CPUExecutionProvider", {}),
]
else: