-
Notifications
You must be signed in to change notification settings - Fork 732
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
base: main
Are you sure you want to change the base?
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. ❌ 1 New Failure, 2 Unrelated FailuresAs of commit 8083ea7 with merge base b4d72f1 ( NEW FAILURE - The following job has failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was 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
|
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.
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 Differential Revision: D87577206
f83f99d to
8083ea7
Compare
Differential Revision: D87577206