Skip to content

Conversation

@cccclai
Copy link
Contributor

@cccclai cccclai commented Nov 12, 2025

It's reported from Discord and this pattern fails to lower to QNN

class EqualFromInplaceCopyDecomp(torch.nn.Module):
    def __init__(self, hidden_size=4):
        super().__init__()
        # a small state tensor
        self.register_buffer("h", torch.zeros((1, hidden_size)))

    def forward(self, x):
        self.h[0] = x
        return self.h[0]

Differential Revision: D86891707

@cccclai cccclai requested a review from kimishpatel as a code owner November 12, 2025 23:01
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 12, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 8d9c9af with merge base 8ab589a (image):

NEW FAILURE - The following job has 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 Nov 12, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 12, 2025

@cccclai has exported this pull request. If you are a Meta employee, you can view the originating Diff in D86891707.

@github-actions
Copy link

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.

Summary: Pull Request resolved: pytorch#15792

Differential Revision: D86891707
@cccclai
Copy link
Contributor Author

cccclai commented Nov 14, 2025

@haowhsu-quic @winskuo-quic @shewu-quic @DannyYuyang-quic Hi team, I might need some help for this pattern. I managed to lower the pattern to fp, but it's failing with the quantized version. I think a copy_ node shows up in the graph indicating it's a mutable buffer. Do you know the best way moving forward with this pattern?

@winskuo-quic
Copy link
Collaborator

@haowhsu-quic @winskuo-quic @shewu-quic @DannyYuyang-quic Hi team, I might need some help for this pattern. I managed to lower the pattern to fp, but it's failing with the quantized version. I think a copy_ node shows up in the graph indicating it's a mutable buffer. Do you know the best way moving forward with this pattern?

Hi @cccclai,

I am able to reproduce the issue where I get the following graph finalize error message:
No graph inputs present for graph [0]

I believe this has to do with the behavior of run_decomposition here:

program = program.run_decompositions({})

The input node is actually not connected to the graph after run_decomposition for quantization flow, as shown in the image below. The copy_ node also disappeared.

image

On the other hand, floating point flow is working properly because the input node is still connected to the graph after run_decomposition.
image

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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants