Skip to content
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

dynamic range constraint API #98779

Closed

Conversation

avikchaudhuri
Copy link
Contributor

@avikchaudhuri avikchaudhuri commented Apr 10, 2023

Stack from ghstack (oldest at bottom):

This diff adds the ability to specify range constraints on dynamic dimensions. (Previously we only supported declaring a dynamic dimension, which gets the default range [2, sympy.oo].)

One point worth calling out: our initial design called for compound expressions like lower <= dynamic_dim(x, d) <= upper. However this seems difficult to support, because of a combination of desugaring and overloading semantics for such compound expressions in Python. Rather than silently doing the wrong thing, we explicitly error in this case and recommend users to specify multiple constraints, which is supported.

Differential Revision: D44847318

cc @soumith @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire

This diff adds the ability to specify range constraints on dynamic dimensions. (Previously we only supported declaring a dynamic dimension, which gets the default range `[-2, sympy.oo]`.)

One point worth calling out: our initial design called for compound expressions like `lower <= dynamic_dim(x, d) <= upper`. However this seems difficult to support, because of a combination of desugaring and overloading semantics for such compound expressions in Python. Rather than silently doing the wrong thing, we explicitly error in this case and recommend users to specify multiple constraints, which is supported.

Differential Revision: [D44847318](https://our.internmc.facebook.com/intern/diff/D44847318/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Apr 10, 2023

🔗 Helpful Links

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

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

❌ 1 Failures, 1 Pending

As of commit 56f2208:

NEW FAILURES - The following jobs have failed:

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

This diff adds the ability to specify range constraints on dynamic dimensions. (Previously we only supported declaring a dynamic dimension, which gets the default range `[-2, sympy.oo]`.)

One point worth calling out: our initial design called for compound expressions like `lower <= dynamic_dim(x, d) <= upper`. However this seems difficult to support, because of a combination of desugaring and overloading semantics for such compound expressions in Python. Rather than silently doing the wrong thing, we explicitly error in this case and recommend users to specify multiple constraints, which is supported.

Differential Revision: [D44847318](https://our.internmc.facebook.com/intern/diff/D44847318/)

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
avikchaudhuri added a commit that referenced this pull request Apr 10, 2023
Pull Request resolved: #98779

This diff adds the ability to specify range constraints on dynamic dimensions. (Previously we only supported declaring a dynamic dimension, which gets the default range `[-2, sympy.oo]`.)

One point worth calling out: our initial design called for compound expressions like `lower <= dynamic_dim(x, d) <= upper`. However this seems difficult to support, because of a combination of desugaring and overloading semantics for such compound expressions in Python. Rather than silently doing the wrong thing, we explicitly error in this case and recommend users to specify multiple constraints, which is supported.
ghstack-source-id: 185611460

Differential Revision: [D44847318](https://our.internmc.facebook.com/intern/diff/D44847318/)
torch/_dynamo/eval_frame.py Outdated Show resolved Hide resolved
torch/_dynamo/eval_frame.py Outdated Show resolved Hide resolved
This diff adds the ability to specify range constraints on dynamic dimensions. (Previously we only supported declaring a dynamic dimension, which gets the default range `[2, sympy.oo]`.)

One point worth calling out: our initial design called for compound expressions like `lower <= dynamic_dim(x, d) <= upper`. However this seems difficult to support, because of a combination of desugaring and overloading semantics for such compound expressions in Python. Rather than silently doing the wrong thing, we explicitly error in this case and recommend users to specify multiple constraints, which is supported.

Differential Revision: [D44847318](https://our.internmc.facebook.com/intern/diff/D44847318/)

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
avikchaudhuri added a commit that referenced this pull request Apr 11, 2023
Pull Request resolved: #98779

This diff adds the ability to specify range constraints on dynamic dimensions. (Previously we only supported declaring a dynamic dimension, which gets the default range `[2, sympy.oo]`.)

One point worth calling out: our initial design called for compound expressions like `lower <= dynamic_dim(x, d) <= upper`. However this seems difficult to support, because of a combination of desugaring and overloading semantics for such compound expressions in Python. Rather than silently doing the wrong thing, we explicitly error in this case and recommend users to specify multiple constraints, which is supported.
ghstack-source-id: 185715525

Differential Revision: [D44847318](https://our.internmc.facebook.com/intern/diff/D44847318/)
@avikchaudhuri
Copy link
Contributor Author

@pytorchbot merge -f "bogus lint for line with <100 chars"

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

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

@huydhn
Copy link
Contributor

huydhn commented Apr 11, 2023

@pytorchbot revert -m 'Sorry for reverting your PR, but lint job is breaking trunk https://hud.pytorch.org/pytorch/pytorch/commit/88dae230d012f2bc834f7bcc7ed9b891ad0763cb and it needs to be fixed before relanding' -c ignoredsignal

@huydhn huydhn reopened this Apr 11, 2023
@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

Can't revert PR that was landed via phabricator as D44847318. Please revert by going to the internal diff and clicking Unland.

@malfet
Copy link
Contributor

malfet commented Apr 11, 2023

@pytorchbot merge -f "bogus lint for line with <100 chars"

@avikchaudhuri can you please elaborate what do you mean by that? Pushing a revert directly to trunk.

@PaliC PaliC mentioned this pull request Apr 11, 2023
@huydhn huydhn closed this Apr 11, 2023
PaliC added a commit that referenced this pull request Apr 11, 2023
Fixes lint errors introduced by [#98433](#98779)

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
@avikchaudhuri
Copy link
Contributor Author

@pytorchbot merge -f "bogus lint for line with <100 chars"

@avikchaudhuri can you please elaborate what do you mean by that? Pushing a revert directly to trunk.

Sorry. Formatting on VSCode is, I think, configured to 100 chars and the line was well within that, so VSCode wasn't complaining. I didn't realize that we're enforcing 80 chars instead (and this would break trunk), otherwise would have just fixed.

pytorchmergebot pushed a commit that referenced this pull request Apr 11, 2023
Fixes lint errors introduced by [#98433](#98779)

Pull Request resolved: #98873
Approved by: https://github.com/huydhn, https://github.com/malfet
@facebook-github-bot facebook-github-bot deleted the gh/avikchaudhuri/12/head branch June 8, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants