Qualcomm/op reciprocal#18220
Conversation
- Add constant and enums for QNN ElementwiseUnary op - Add op_builder for reciprocal op - Add pass decompose reciprocal to div because HTP and GPU backend doesn't support reciprocal operation yet
- Add reciprocal decomposition in export transform
- Remove logic for inserting constant tensor (leverage lift constant pass) - Rename Reciprocal Builder to Unary - Remove redundant check for node.op=="call_function"
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18220
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Awaiting Approval, 2 New Failures, 1 Cancelled Job, 2 Pending, 2 Unrelated FailuresAs of commit 3af1b5e with merge base a81ef44 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
|
||
| @register_node_visitor | ||
| class Unary(NodeVisitor): | ||
| target = ["aten.reciprocal.default"] |
There was a problem hiding this comment.
Curious, why do we have a pass that converts reciprocal to div and yet have a op builder for reciprocal?
There was a problem hiding this comment.
Hi @abhinaykukkadapu
Thanks for the question.
The op builder is targeting Qualcomm CPU backend (currently not supported)
We will disable the decomposition pass for CPU backend in future.
|
|
||
|
|
||
| @register_node_visitor | ||
| class Unary(NodeVisitor): |
There was a problem hiding this comment.
Wondering if we intend to move all the unary ops under this class in future?
There was a problem hiding this comment.
Yes, we will move all unary ops into this NodeVisitor in future. (Will also do similar for elemetwise-binary ops)
Qualcomm AI Engine Direct - Add Reciprocal Operator Support for QNN
Summary:
Add reciprocal operator builder plumbing (op_unary.py) and QNN constants for ElementWiseUnary reciprocal.
Add DecomposeReciprocal pass and wire it into Qualcomm annotation/export pipelines to rewrite aten.reciprocal.default into aten.div.Tensor(1, x) for backend compatibility.
Add reciprocal model coverage in Qualcomm delegate tests (floating-point and quantized) and update the QNN operator
support table in README.
Test plan
python backends/qualcomm/tests/test_qnn_delegate.py -k TestQNNQuantizedOperator.test_qnn_backend_reciprocal -s
$DEVICE_SERIAL -m SM8650 -b build-android/