mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
enable pybind for qnn ep (#14897)
enable python bindings for QNN EP. tested on Windows Dev Kit 2023 (ARM64) with python 3.11 (ARM64) from https://www.python.org/ftp/python/3.11.1/python-3.11.1-arm64.exe
This commit is contained in:
parent
f6c81d8aca
commit
289f7dbcdd
5 changed files with 21 additions and 0 deletions
|
|
@ -212,6 +212,7 @@ target_link_libraries(onnxruntime_pybind11_state PRIVATE
|
|||
${PROVIDERS_ARMNN}
|
||||
${PROVIDERS_XNNPACK}
|
||||
${PROVIDERS_AZURE}
|
||||
${PROVIDERS_QNN}
|
||||
onnxruntime_optimizer
|
||||
onnxruntime_providers
|
||||
onnxruntime_util
|
||||
|
|
|
|||
|
|
@ -82,6 +82,14 @@ constexpr ProviderInfo kProvidersInPriorityOrder[] =
|
|||
true,
|
||||
#else
|
||||
false,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
kQnnExecutionProvider,
|
||||
#ifdef USE_QNN
|
||||
true,
|
||||
#else
|
||||
false,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -758,6 +758,12 @@ std::unique_ptr<IExecutionProvider> CreateExecutionProviderInstance(
|
|||
} else if (type == kAzureExecutionProvider) {
|
||||
#ifdef USE_AZURE
|
||||
return onnxruntime::AzureProviderFactoryCreator::Create({})->CreateProvider();
|
||||
#endif
|
||||
} else if (type == kQnnExecutionProvider) {
|
||||
#ifdef USE_QNN
|
||||
auto cit = provider_options_map.find(type);
|
||||
return onnxruntime::QNNProviderFactoryCreator::Create(
|
||||
cit == provider_options_map.end() ? ProviderOptions{} : cit->second)->CreateProvider();
|
||||
#endif
|
||||
} else {
|
||||
// check whether it is a dynamic load EP:
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -82,6 +82,8 @@ elif parse_arg_remove_boolean(sys.argv, "--use_cann"):
|
|||
package_name = "onnxruntime-cann"
|
||||
elif parse_arg_remove_boolean(sys.argv, "--use_azure"):
|
||||
package_name = "onnxruntime-azure"
|
||||
elif parse_arg_remove_boolean(sys.argv, "--use_qnn"):
|
||||
package_name = "onnxruntime-qnn"
|
||||
|
||||
# PEP 513 defined manylinux1_x86_64 and manylinux1_i686
|
||||
# PEP 571 defined manylinux2010_x86_64 and manylinux2010_i686
|
||||
|
|
|
|||
|
|
@ -1950,6 +1950,7 @@ def build_python_wheel(
|
|||
use_dml,
|
||||
use_cann,
|
||||
use_azure,
|
||||
use_qnn,
|
||||
wheel_name_suffix,
|
||||
enable_training,
|
||||
nightly_build=False,
|
||||
|
|
@ -2010,6 +2011,8 @@ def build_python_wheel(
|
|||
args.append("--use_cann")
|
||||
elif use_azure:
|
||||
args.append("--use_azure")
|
||||
elif use_qnn:
|
||||
args.append("--use_qnn")
|
||||
|
||||
run_subprocess(args, cwd=cwd)
|
||||
|
||||
|
|
@ -2705,6 +2708,7 @@ def main():
|
|||
args.use_dml,
|
||||
args.use_cann,
|
||||
args.use_azure,
|
||||
args.use_qnn,
|
||||
args.wheel_name_suffix,
|
||||
args.enable_training,
|
||||
nightly_build=nightly_build,
|
||||
|
|
|
|||
Loading…
Reference in a new issue