[QNN EP] Fix soc_model string name support - #736
Conversation
quic-calvnguy
left a comment
There was a problem hiding this comment.
LGTM beyond a couple of nitpicks
minfhong-qti
left a comment
There was a problem hiding this comment.
This is a more motivation-based question.
I think qnn-net-run / qnn-context-binary-generator do not support specifying SoC name. In addition, I believe the enum type Qnn_SocModel_t has stopped updating (and I guess it's probably why your map misses Glymur).
Couldn't we ask user to check for QNN doc and map by themselves? And we can save the effort of maintaining the map.
|
Feedback from building this locally (PR #736 branch, Android + --use_qnn static_lib + --build_java)
|
Thanks for the feedback @ivaylo681-dev Will fix 1) and 2) as a separate PR. @huaychou Can you investigate the issue reported for QNN_HTP_FP16_CLAMP_OVERFLOW_AVAILABLE and make a fix if necessary. Thanks! |
Yeahh I agree with you, have updated the same in the documentation. Let me know if any other changes might be needed |
@ivaylo681-dev #744 fixes the first two issues reported! |
Description
Extends the
soc_modelprovider option to accept chip-family name strings (e.g."SM8750", case-insensitive) in addition to numeric IDs, and adds missing HTP V79 architecture support for the SM8750 (Pakala) SoC.Built on top of #707 with contributions from @quic-calvnguy
Motivation & Context
Issue: On Snapdragon SM8750P (soc_id=639),
deviceCreate()fails withQNN_DEVICE_ERROR_INVALID_CONFIGwhen users passsoc_model="SM8750". The root cause is thatParseSocModel()callsstd::stoi()directly, which throwsstd::invalid_argumenton any non-integer string. The exception is caught and silently swallowed,soc_modelfalls back toQNN_SOC_MODEL_UNKNOWN(0), causing the QNN backend to attempt auto-detection of the SoC from hardware. On SM8750P, this auto-detection fails because soc_id=639 is not in QNN's internal lookup table, producingQNN_DEVICE_ERROR_INVALID_CONFIG.Fix:
ParseSocModel()now first attempts a name lookup viasoc::SocModelFromName()before falling back tostoi(). A static map insoc_utils.cccovers entries fromQNN/QnnTypes.hwhich have native HTP support. The name lookup is case-insensitive (ASCII uppercase, no locale dependency).Why
soc_modeland not a new option:soc_modelalready flows directly intoQnnHtpDevice_CustomConfig_t.socModel, which bypasses QNN's hardware auto-detection entirely. On Android,GetSocId()always returns 0 (it is Windows/PPTT-only), so users on Android have always had to setsoc_modelmanually, string support makes this ergonomic without needing to look up the integer enum value.Supported Configuration
soc_model"69")"SM8750", case-insensitive)htp_arch"68","69","73","75","81""79"(HTP V79, SM8750)Confirmed name-to-value mappings for common chips:
Qnn_SocModel_tvalueSM8350SM8450SM8550SM8650SC8380XPSM8750SM8850Full table in
soc_utils.cc.Unsupported Configuration
"FOOBAR") — fall back toQNN_SOC_MODEL_UNKNOWN(0) with a warning. No throw."SM8250"— not present inQnn_SocModel_t; use numeric ID if needed.