Repository navigation
Qualcomm AI Engine Direct - Add composite lowering for aten.convolution_backward - #23610
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. ❌ 2 New Failures, 1 Unrelated FailureAs of commit 907494a with merge base 14b5e1d ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
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. |
d5f2f9d to
3687f8f
Compare
3687f8f to
d3030b5
Compare
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 filter wrapper shared with the forward Conv2d, emits the required runtime HWIO→HWOI QNN 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 HTP V69+, floating-point static 2D convolution filters with
groups=1,transposed=False,dilation=[1, 1], andoutput_mask=[True, False, False]. The gradient input/output and filter must be rank-4.Quantized and custom-dequant ConvBackward lowering is intentionally out of scope for this PR and will be added separately.
Test plan
Structural lowering:
python -m pytest -q backends/qualcomm/tests/test_passes.py -k "skip_decomp_table_preserves_conv_backward or conv_backward_composite_lowering or conv_backward_quantized_inputs_fallback or layout_transform_tuple_outputs"Noneoutputs, and malformed users).HTP rework:
test_conv_backwardpassed on V68, V69, V73, V75, V79, and V81.Rework pass coverage:
python -m pytest -q backends/qualcomm/tests/rework/passes/test.py -k "test_layout_transform or test_i64_to_i32"(grad_input, None, None).On-device:
TestQNNFloatingPointOperator.test_qnn_backend_conv_backwardpassed on SM8850.Tuple-output layout regression coverage:
main.