Repository navigation
Qualcomm AI Engine Direct - Test a constant-only I64toI32 cast partition stays on CPU - #24051
msluszniak wants to merge 3 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24051
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 6f0b2dd with merge base ec5e3cf ( 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. |
This PR needs a
|
A partition fed only by constants has no graph input, and QNN cannot build such a
graph ("No graph inputs present"). It happens when an int64 buffer's I64toI32 cast
is supported but the buffer's consumer is not, e.g. an index into a lookup table
with indices from an op left on CPU. Mutable buffers still count as runtime inputs.
Backport of pytorch/executorch#24051 (on top of the #23915 backport, whose orphaned-dequant filter runs first).
|
Tagging @qti-horodnic, @shewu-quic, @winskuo-quic, @chenweng-quic, @DannyYuyang-quic, @quic-boyuc, @qti-mmadhava, @zhaoxul-qti, @jethroqti to review. @msluszniak rebasing should resolve the unrelated CI failures. Do resolve merge conflicts as well, thanks |
…ion stays on CPU pytorch#24222 drops HTP partitions without runtime inputs. Cover the case of an int64 buffer whose I64toI32 cast is left without a delegated consumer.
4507227 to
7e17575
Compare
|
Rebased. #24222 landed the same fix, so I dropped it here and kept only the test, which covers the I64toI32 cast case. Happy to close this if the existing test is enough. |
qti-horodnic
left a comment
There was a problem hiding this comment.
Thanks @msluszniak, I checked that this test fails without the #24222 partitioner fix and passes with it. I left two small nits inline, should be gtg after those are addressed.
| skip_node_op_set={"aten.index.Tensor", "aten.topk.default"}, | ||
| ) | ||
| except RuntimeError as e: | ||
| if "QNN" in str(e) or "qnn" in str(e): |
There was a problem hiding this comment.
"QNN" in str(e) also matches QNN compile errors. Today the bug raises an AssertionError, so the test still fails. But a later RuntimeError that contains "QNN" would make the test skip. Match "Failed to initialize QNN backend", like the tests that #24222 added.
| """An int64 buffer gets an int32 cast from I64toI32. When the buffer's consumer is | ||
| not delegated, that cast alone would form a partition with no graph input, which | ||
| QNN cannot compile ("No graph inputs present"). | ||
| """ |
There was a problem hiding this comment.
Minor: test_partitioner_keeps_constant_only_subgraph_on_cpu already covers _drop_partitions_without_runtime_inputs. Please say in the docstring that this test covers the case where I64toI32 makes the constant-only node so that these two tests are not merged later by mistake.
…t covers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qti-horodnic
left a comment
There was a problem hiding this comment.
LGTM, thanks @msluszniak
Summary
The partitioner fix landed in #24222, so this now only adds
test_constant_only_partition_stays_on_cpu, covering an int64 buffer whoseI64toI32cast has no delegated consumer.Test plan
The new test failed on main before #24222.
cc @cccclai @winskuo-quic @shewu-quic @haowhsu-quic @DannyYuyang-quic @cbilgin @abhinaykukkadapu @psiddh @nil-is-all