Skip to content

Conversation

kimishpatel
Copy link
Contributor

Summary:
When aten graph is modified for debug, for instance using int4 matmul, it wont have complete
overlap with debug handles recorded by the delegate. For example, original model will have
chose_qparams,q, dq, dq, linear nodes. Delegate will record debug hanlde for all of those.
Say those are (4, 5, 6, 7, 8). When int4 matmul rewrite pass, from torchao, is applied,
we just inherit from_node information from linear node. Thus only the last debug handle 8
is associated with custom op int4 node. Thus when we map delegate debug handles with custom op
we find overlap for 8 only.
This diff allows to look for overlapping match instead of exact match.
Plus it also changes the code for AOT debug handle so that we can look for all ancestor nodes
instead of just parent node. This is also needed so as to allow for numerical comparison despite
passes applied on original aten graph.

Reviewed By: Gasoonjia

Differential Revision: D82229367

Copy link

pytorch-bot bot commented Sep 15, 2025

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Unrelated Failure

As of commit acbf935 with merge base 0f066e0 (image):

NEW FAILURES - The following jobs have failed:

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.

@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 Sep 15, 2025
@facebook-github-bot
Copy link
Contributor

@kimishpatel has exported this pull request. If you are a Meta employee, you can view the originating diff in D82229367.

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.

…aph and runtime (pytorch#14306)

Summary:

When aten graph is modified for debug, for instance using int4 matmul, it wont have complete
overlap with debug handles recorded by the delegate. For example, original model will have
chose_qparams,q, dq, dq, linear nodes. Delegate will record debug hanlde for all of those.
Say those are (4, 5, 6, 7, 8). When int4 matmul rewrite pass, from torchao, is applied,
we just inherit from_node information from linear node. Thus only the last debug handle 8
is associated with custom op int4 node. Thus when we map delegate debug handles with custom op
we find overlap for 8 only.
This diff allows to look for overlapping match instead of exact match.
Plus it also changes the code for AOT debug handle so that we can look for all ancestor nodes
instead of just parent node. This is also needed so as to allow for numerical comparison despite
passes applied on original aten graph.

Reviewed By: Gasoonjia

Differential Revision: D82229367
@facebook-github-bot
Copy link
Contributor

@kimishpatel has exported this pull request. If you are a Meta employee, you can view the originating diff in D82229367.

@facebook-github-bot facebook-github-bot merged commit 7bcb6d3 into pytorch:main Sep 16, 2025
122 of 127 checks passed
StrycekSimon pushed a commit to nxp-upstream/executorch that referenced this pull request Sep 23, 2025
…aph and runtime

Differential Revision: D82229367

Pull Request resolved: pytorch#14306
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.

3 participants