Skip to content

Conversation

@angelayi
Copy link
Contributor

Differential Revision: D87577206

Copilot AI review requested due to automatic review settings November 20, 2025 23:22
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 20, 2025

🔗 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 Failures

As of commit 8083ea7 with merge base b4d72f1 (image):

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.

@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 20, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 20, 2025

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

@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.

Copilot finished reviewing on behalf of angelayi November 20, 2025 23:24
Copy link
Contributor

Copilot AI left a 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_gm from torch._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
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 topic: not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants