-
Notifications
You must be signed in to change notification settings - Fork 754
Fix fake mode detection #15931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fake mode detection #15931
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15931
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit d1e0727 with merge base 33ec615 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the fake mode detection in the lift_constant_tensor_pass function by using the more robust _detect_fake_mode_from_gm utility function instead of directly accessing the fake mode from the first node's metadata. This addresses a known issue where the first node may not always have the expected metadata structure, particularly when the first node is a scalar.
- Replaces brittle metadata access with a dedicated utility function
- Imports
_detect_fake_mode_from_gmfromtorch._export.utils - Adds a blank line for better code formatting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f83f99d to
8083ea7
Compare
Summary: it's not necessarily true that the 0th placeholder's meta["val"] contains a tensor. replaced this with _detect_fake_mode_from_gm which is safer Reviewed By: cccclai Differential Revision: D87577206
8083ea7 to
d1e0727
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi this might have broken something in the Cortex-M backend. |
Differential Revision: D87577206