[QNN:Bugfix] Fix StridedSlice NC4HW4 layout and improve QNNPerf robustness - #4583
Open
lanling-47 wants to merge 1 commit into
Open
[QNN:Bugfix] Fix StridedSlice NC4HW4 layout and improve QNNPerf robustness#4583lanling-47 wants to merge 1 commit into
lanling-47 wants to merge 1 commit into
Conversation
…tness StridedSlice improvements: - Support NC4HW4 tensor format by remapping NCHW ranges to NHWC order that QNN expects - Handle optional stride input for fromType=1 (4 or 5 inputs) - Replace crash-prone MNN_ASSERT with graceful nullptr returns and diagnostic MNN_PRINT logging - Add null-check for StridedSliceParam QNNPerf improvements: - Add null-pointer guards for deviceGetInfrastructure result - Check infraType and createPowerConfigId before use - Guard all setPowerConfig/destroyPowerConfigId calls against null function pointers and zero config IDs - Prevents crashes when HTP perf infrastructure is unavailable
Collaborator
|
Thanks for the contribution. The QNNPerf guard changes are useful and the NC4HW4 StridedSlice support is needed, but there are several issues to address before merging:
Please add focused device validation for NC4HW4 slicing on N/C/H/W axes, begin/end/shrink masks, 3/4/5-input forms, negative axes, malformed parameter lengths, and unavailable QNN performance infrastructure. The current environment here has no connected QNN device, so these findings are based on static review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix QNN StridedSlice operator for NC4HW4 tensor format and add null-pointer guards to QNNPerf infrastructure calls.
StridedSlice Improvements
fromType=1with 4 inputs (no stride tensor) — default stride to 1MNN_ASSERTwith gracefulnullptrreturns + diagnosticMNN_PRINTloggingStridedSliceParambefore accessingQNNPerf Improvements
deviceGetInfrastructureresultinfraTypeandcreatePowerConfigIdbefore usesetPowerConfig/destroyPowerConfigIdcalls against null function pointers and zero config IDsTesting
Tested on Snapdragon 8 Gen 3 and 8 Elite devices with YOLO and MobileCLIP models that use StridedSlice with NC4HW4 tensors.