Skip to content

Conversation

suo
Copy link
Member

@suo suo commented Jan 31, 2024

Summary:
Whenever we access a constant, we emit a get_attr node for it.

The lift_constants_pass was lifting every get_attr node unconditionally, even if the same target was already lifted. This diff fixes that.

I also took the liberty of adding some infra to make it easier to unit test passes. GraphBuilder lets you declaratively construct graphs with the right metadata, it's pretty useful for directly inducing the pattern you want to test against.

Test Plan: added unit test

Differential Revision: D53278161

Copy link

pytorch-bot bot commented Jan 31, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 77fc686 with merge base 7c609f0 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@angelayi angelayi left a comment

Choose a reason for hiding this comment

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

very cool graph builder 😎

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 31, 2024
@suo suo force-pushed the export-D53278161 branch from 1fe6b22 to 5f1f2da Compare January 31, 2024 22:13
@facebook-github-bot
Copy link
Contributor

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

suo added a commit to suo/pytorch that referenced this pull request Jan 31, 2024
Summary:

Whenever we access a constant, we emit a `get_attr` node for it.

The `lift_constants_pass` was lifting every `get_attr` node unconditionally, even if the same target was already lifted. This diff fixes that.

I also took the liberty of adding some infra to make it easier to unit test passes. GraphBuilder lets you declaratively construct graphs with the right metadata, it's pretty useful for directly inducing the pattern you want to test against.

Test Plan: added unit test

Reviewed By: khabinov, angelayi

Differential Revision: D53278161
@suo suo force-pushed the export-D53278161 branch from 5f1f2da to 76b0b87 Compare January 31, 2024 22:13
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@suo suo force-pushed the export-D53278161 branch from 6bbbaf6 to 5b9635f Compare February 1, 2024 20:52
@facebook-github-bot
Copy link
Contributor

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

@suo suo force-pushed the export-D53278161 branch from 5b9635f to 571b8c6 Compare February 1, 2024 21:54
@facebook-github-bot
Copy link
Contributor

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

@suo suo force-pushed the export-D53278161 branch from 571b8c6 to 68cee59 Compare February 1, 2024 21:55
@facebook-github-bot
Copy link
Contributor

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

@suo suo force-pushed the export-D53278161 branch from 68cee59 to e5a2c6f Compare February 1, 2024 22:27
@facebook-github-bot
Copy link
Contributor

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

@suo suo force-pushed the export-D53278161 branch from e5a2c6f to e89861a Compare February 1, 2024 22:28
@facebook-github-bot
Copy link
Contributor

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

@suo suo force-pushed the export-D53278161 branch from e89861a to 58a578f Compare February 2, 2024 00:05
@facebook-github-bot
Copy link
Contributor

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

Summary:

Whenever we access a constant, we emit a `get_attr` node for it.

The `lift_constants_pass` was lifting every `get_attr` node unconditionally, even if the same target was already lifted. This diff fixes that.

I also took the liberty of adding some infra to make it easier to unit test passes. GraphBuilder lets you declaratively construct graphs with the right metadata, it's pretty useful for directly inducing the pattern you want to test against.

Test Plan: added unit test

Reviewed By: khabinov, angelayi

Differential Revision: D53278161
@suo suo force-pushed the export-D53278161 branch from 58a578f to 77fc686 Compare February 2, 2024 00:06
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge -f 'Landed internally'

(Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorch-bot bot pushed a commit that referenced this pull request Feb 8, 2024
Summary:
Whenever we access a constant, we emit a `get_attr` node for it.

The `lift_constants_pass` was lifting every `get_attr` node unconditionally, even if the same target was already lifted. This diff fixes that.

I also took the liberty of adding some infra to make it easier to unit test passes. GraphBuilder lets you declaratively construct graphs with the right metadata, it's pretty useful for directly inducing the pattern you want to test against.

Test Plan: added unit test

Differential Revision: D53278161

Pull Request resolved: #118776
Approved by: https://github.com/angelayi, https://github.com/titaiwangms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants