Qualcomm AI Engine Direct - Adding QNN backend support for scatter_reduce.two and scatter_add core ATen ops - #22157
Conversation
…duce.two and scatter_add core ATen ops
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22157
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit eb2fddb with merge base a77eb9f ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: qualcomm" |
|
@claude review this |
|
Claude finished @psiddh's task in 3m 54s —— View job Code ReviewI reviewed the diff against the current branch. This is a clean, well-reasoned PR — the design of routing capability decisions through the builder's Tasks
✅ Strengths
🔸 Minor / discussion
Nits
Overall: LGTM pending confirmation on point #4 (the conftest fix) and a nice-to-have on point #2. Nothing blocking in the builder/partition/quantizer logic itself. |
|
Regarding Claude's comments: |
Summary
Added support for the
aten.scatter_add.defaultandaten.scatter_reduce.twocore ATen ops. Extended the existingaten.scatter.srcbuilder into a unifiedScatterElementsimplementation. Reductions map as:scatter.src→ NONE,scatter_add→ ADD,scatter_reducesum → ADD / prod → MUL.Note the following limitations:
scatter_add/scatter_reduce: QNN opScatterElementswithreduction != NONEis only supported in quantized mode.mean,amax,aminfall back to CPU.include_self=Falsenot supported: QNN always accumulates onto existingselfvalues; falls back to CPU.Note this PR also includes a minor bug fix:
I64toI32._cast_op_args_to_i64now derives the inserted cast node'sFakeTensorfrom the argument being cast rather than from the op output. This incidentally fixes a latent wrong-shapemeta["val"]on the pre-existingaten.scatter.srcpath:index.shape == output.shapeforgather(no behavior change there), butscatter*outputs take the shape ofself, which may differ.Test plan