Skip to content

: constant fold None #10762

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

Merged
merged 1 commit into from
May 9, 2025

Conversation

ThomasJannaud
Copy link
Contributor

Summary:
Constant folding should fold 'None' and consider it a constant

This goes with D74350331 and D74349918 but keeping things separate

Differential Revision: D74350331

Copy link

pytorch-bot bot commented May 7, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit ce7b6f9 with merge base d25ce54 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

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

This pull request was exported from Phabricator. Differential Revision: D74350331

ThomasJannaud added a commit to ThomasJannaud/executorch that referenced this pull request May 8, 2025
Summary:

Constant folding should fold 'None' and consider it a constant

This goes with D74350331 and D74349918 but keeping things separate

Differential Revision: D74350331
ThomasJannaud added a commit to ThomasJannaud/executorch that referenced this pull request May 8, 2025
Summary:

Constant folding should fold 'None' and consider it a constant

This goes with D74350331 and D74349918 but keeping things separate

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

This pull request was exported from Phabricator. Differential Revision: D74350331

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74350331

ThomasJannaud added a commit to ThomasJannaud/executorch that referenced this pull request May 8, 2025
Summary:
Pull Request resolved: pytorch#10762

Constant folding should fold 'None' and consider it a constant

This goes with D74350331 and D74349918 but keeping things separate

Differential Revision: D74350331
ThomasJannaud added a commit to ThomasJannaud/executorch that referenced this pull request May 8, 2025
Summary:

Constant folding should fold 'None' and consider it a constant

This goes with D74350331 and D74349918 but keeping things separate

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

This pull request was exported from Phabricator. Differential Revision: D74350331

@@ -61,6 +61,8 @@ def is_const(
)
elif isinstance(arg, _PRIMITIVE_TYPES):
return True
elif arg is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was the problem before that const prop would skip nodes with None in the args?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think the issue is None is not a constant, and so if an op has args that include constants and None, it doesn't get constant folded.

ThomasJannaud added a commit to ThomasJannaud/executorch that referenced this pull request May 8, 2025
Summary:

Constant folding should fold 'None' and consider it a constant

This goes with D74280168 and D74349918 but keeping things separate

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

This pull request was exported from Phabricator. Differential Revision: D74350331

Summary:

Constant folding should fold 'None' and consider it a constant

This goes with D74280168 and D74349918 but keeping things separate

Reviewed By: metascroy

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

This pull request was exported from Phabricator. Differential Revision: D74350331

@facebook-github-bot facebook-github-bot merged commit b1b46ee into pytorch:main May 9, 2025
159 of 161 checks passed
jhelsby pushed a commit to jhelsby/executorch that referenced this pull request May 9, 2025
Differential Revision: D74350331

Pull Request resolved: pytorch#10762
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 topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants