Skip to content

[QNN EP] Accept htp_arch 79 (v79, Snapdragon 8 Elite) - #31638

Open
guptaishaan wants to merge 1 commit into
microsoft:mainfrom
guptaishaan:fix-31353
Open

[QNN EP] Accept htp_arch 79 (v79, Snapdragon 8 Elite)#31638
guptaishaan wants to merge 1 commit into
microsoft:mainfrom
guptaishaan:fix-31353

Conversation

@guptaishaan

Copy link
Copy Markdown
Contributor

Fixes #31353

ParseHtpArchitecture() handles 0/68/69/73/75/81 and has no case for 79, so htp_arch=79 is
logged as Invalid HTP architecture: 79 and silently downgraded to QNN_HTP_DEVICE_ARCH_NONE. v79 is
the HTP architecture of SM8750 (Snapdragon 8 Elite), and QNN_HTP_DEVICE_ARCH_V79 = 79 has been in
QNN/HTP/QnnHtpDevice.h for several QAIRT releases, so this is just a missing branch. The two
hardcoded supported_htp_archs sets in onnx_test_runner and onnxruntime_perf_test, and the
htp_arch list in the C API docs, had the same gap.

Scope note: this makes htp_arch=79 work on 8 Elite class parts, which is the workaround the
reporter tried and could not use. I could not confirm it resolves the
QNN_DEVICE_ERROR_INVALID_CONFIG they see with no provider options set - that comes back from
deviceCreate() with an empty config list, which points at SoC detection inside the QNN HTP backend
rather than at ORT.

Verified on Linux x86_64 with QAIRT 2.42.0.251225, the SDK version the Linux QNN CI leg pins:

  • New QnnHTPBackendTests.HTPArchV79 fails before the change (Invalid HTP architecture: 79 in the
    captured EP log) and passes after.
  • onnxruntime_perf_test -i "htp_arch|79" threw Wrong value for htp_arch. select from: 0,68,69,73,75,81 before, and is accepted after.
  • onnxruntime_provider_test --gtest_filter='Qnn*' gives an identical result set before and after.
  • lintrunner -m HEAD clean.

Not verified: no Snapdragon device was available, and the QAIRT x86_64 HTP library needs a newer
glibc than this host has, so deviceCreate() was never actually called with a v79 arch config. Only
the ORT side parsing was exercised. Windows, Android arm64 and the static_lib QNN build were not
compiled.

Thanks to @ivaylo681-dev for the detailed report, including the logcat that pinned the rejected
value to ParseHtpArchitecture.

ParseHtpArchitecture() handled 0/68/69/73/75/81 and had no case for 79,
so htp_arch=79 was logged as "Invalid HTP architecture: 79" and silently
downgraded to QNN_HTP_DEVICE_ARCH_NONE. No arch device config was then
pushed in CreateDevice(), leaving no way to pin the architecture on
SM8750 class parts. QNN_HTP_DEVICE_ARCH_V79 = 79 has been defined in
QNN/HTP/QnnHtpDevice.h for several QAIRT releases.

Also adds 79 to the hardcoded supported_htp_archs sets in
onnx_test_runner and onnxruntime_perf_test, which threw on it, and to the
htp_arch list in the C API docs.

New test QnnHTPBackendTests.HTPArchV79 creates a QNN EP with
htp_arch=79 under an Env with a capturing log callback and asserts the
"Invalid HTP architecture" warning is not emitted. It fails before this
change and passes after.

Verified on Linux x86_64 against QAIRT 2.42.0.251225. No Snapdragon
device was available, so deviceCreate() was never called with a v79 arch
config; only the option parsing was exercised.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant