-
Notifications
You must be signed in to change notification settings - Fork 22.2k
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
dynamic range constraint API #98779
Conversation
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]
🔗 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 PendingAs of commit 56f2208: 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]
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/)
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]
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/)
@pytorchbot merge -f "bogus lint for line with <100 chars" |
Merge startedYour 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 |
@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 |
@pytorchbot successfully started a revert job. Check the current status here. |
Can't revert PR that was landed via phabricator as D44847318. Please revert by going to the internal diff and clicking Unland. |
@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. |
Fixes lint errors introduced by [#98433](#98779) Pull Request resolved: #98873 Approved by: https://github.com/huydhn, https://github.com/malfet
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