Skip to content

Qualcomm AI Engine Direct - Cast an int64 get_attr right before its first user - #24046

Open
msluszniak wants to merge 1 commit into
pytorch:mainfrom
msluszniak:ms/qnn-i64-cast-before-user
Open

msluszniak wants to merge 1 commit into
pytorch:mainfrom
msluszniak:ms/qnn-i64-cast-before-user

Conversation

@msluszniak

Copy link
Copy Markdown
Contributor

Summary

I64toI32 inserts the int32 cast of an int64 get_attr right after it, but create_const_node puts that get_attr above the graph inputs. lift_constant_tensor_pass then turns it into a placeholder after the inputs, leaving the cast ahead of its argument: "used before it has been defined". The cast now goes right before the first user. Hit by an int64 remainder by a scalar (YOLO26's top-k labels) in fp16.

Test plan

New constant_cast_order subtest of test_i64_to_i32 fails on main and passes here; no other result in rework/passes/test.py changes.

cc @cccclai @winskuo-quic @shewu-quic @haowhsu-quic @DannyYuyang-quic @cbilgin @abhinaykukkadapu @psiddh @nil-is-all

…irst user

create_const_node puts a get_attr ahead of the graph inputs, and I64toI32 inserted
its int32 cast right after it. lift_constant_tensor_pass then turns the get_attr into
a placeholder after the inputs, leaving the cast ahead of its argument, and lowering
fails with "used before it has been defined". Hit by an int64 remainder by a scalar
(YOLO26's top-k labels) in fp16.
@msluszniak
msluszniak requested a review from psiddh as a code owner October 21, 2026 06:56
@pytorch-bot

pytorch-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24046

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures

As of commit 0d118e0 with merge base e6cfbf8 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 21, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@executorch-triage executorch-triage Bot added the community: contribution PRs coming from community (excluding hardware partners) label Oct 21, 2026
@nil-is-all nil-is-all added partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ labels Oct 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. community: contribution PRs coming from community (excluding hardware partners) module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants