Repository navigation
Qualcomm AI Engine Direct - Add composite lowering for aten.convolution_backward - #23610
quic-xiyushi wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23610
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled JobAs of commit 2fa76f4 with merge base 5b14a2f ( CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @quic-xiyushi! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
@pytorchbot label "release notes: qualcomm" |
|
@claude review this pr |
|
Claude finished @psiddh's task in 5m 31s —— View job PR Review: #23610This PR adds a composite QNN lowering of Detailed reviewSummaryThe PR adds a composite QNN lowering of I found no problems in the math (weight layout,
The diff was reviewed against merge base Infrastructure
Code Quality
Testing
Performance
RecommendationRequest Changes The blocker is the missing V68 / non-HTP gate: the PR itself says V68 can't compile this op, but it will still be delegated there. I'd also like to see the quantized-model guard tightened, and at least one fallback test added. |
…on_backward Co-authored-by: rajeswar277 <rajeswar@qti.qualcomm.com> Co-authored-by: quic-mohitgupta <guptam@qti.qualcomm.com>
|
@quic-xiyushi Can you look at the one blocker comment from Claude review ? looks reasonable to me |
94089b7 to
0adf1fb
Compare
0adf1fb to
2fa76f4
Compare
|
@psiddh Thanks! I agree that Claude’s reviews are very helpful. I addressed the V68 blocker by adding an HTP V69 capability gate in QnnOperatorSupport, following the existing per-channel-group pattern. V68 now falls back before the QNN support query, and I added coverage for the V68 fallback. I also tightened the ConvBackward quantization guard to check QCOM_QUANT_ATTRS on grad_output and the shared weight, rather than only checking for direct dequantize producers. |
Summary
Adds Qualcomm AI Engine Direct composite lowering for
aten.convolution_backward.defaultwhen only the input gradient is requested. This PR builds on work originally implemented by Rajeswaran C Ravindran @rajeswar277 and Mohit Gupta @quic-mohitgupta of the Qualcomm On-Device Learning team.The lowering reuses the static forward convolution weight, emits the required QNN layout transpose, and lowers the operation to QNN
TransposeConv2d. This avoids requiring a separate duplicated backward weight.This is implemented as a composite visitor rather than an ATen decomposition: the visitor must reuse the forward Conv2d QNN wrapper and retain the HWOI conversion as a runtime operation. An ATen decomposition would otherwise need another transformed static weight or changes to the forward Conv2d visitor.
Supported scope is static 2D non-transposed, non-dilated convolutions with
output_mask=[True, False, False].Quantized/custom-dequant ConvBackward lowering is intentionally out of scope for this PR and will be added separately.
Test plan
Structural lowering:
python -m pytest backends/qualcomm/tests/test_passes.py -k "conv_backward_composite_lowering or conv_backward_quantized_inputs_fallback or layout_transform_handles_multiple_tuple_getitems or skip_decomp_table_preserves_conv_backward" -qgrad_output/weight inputs, unsupported multi-output masks remain in PyTorch layout for fallback, and ConvBackward stays in the QNN skip-decomposition table.HTP rework:
test_conv_backwardpassed on V68, V69, V73, V75, V79, and V81.Shared pass coverage:
python -m pytest backends/qualcomm/tests/rework/passes/test.py -k "test_i64_to_i32 and not gpu and not lpai" -q(grad_input, None, None).On-device:
TestQNNFloatingPointOperator.test_qnn_backend_conv_backwardpassed on SM8850.Tuple-output layout regression coverage:
main.