Unbacked SymInt support for pointwise and multiple boolean masks#94790
Closed
ezyang wants to merge 9 commits intogh/ezyang/1815/basefrom
Closed
Unbacked SymInt support for pointwise and multiple boolean masks#94790ezyang wants to merge 9 commits intogh/ezyang/1815/basefrom
ezyang wants to merge 9 commits intogh/ezyang/1815/basefrom
Conversation
Signed-off-by: Edward Z. Yang <ezyang@meta.com> [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/94790
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Feb 14, 2023
Closed
Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
… masks" This PR adds support for some more unbacked SymInt cases extracted from CrystalDPR * You can do pointwise operations with tensors that have unbacked SymInts; fixes involve making broadcasting avoid touching unbacked SymInts if not necessary (in both PrimTorch and the fake tensor fastpath), switching PrimTorch decomp for elementwise operations to use `empty_permuted and short circuiting if inputs are contiguous. I added `definitely_true` and `parallel_or` helpers to handle this case elegantly; see docblocks for more discussion. * The `is_contiguous` change requires me to update PrimTorch to let `is_contiguous` through directly, which seems fine. * Add a new `constrain_unify` helper which lets you specify that two unbacked SymInts are the same. This addresses the case when you use the same boolean mask to index into different tensors; the resulting slices have the same shapes but we do not currently know this statically. Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Closed
… masks" This PR adds support for some more unbacked SymInt cases extracted from CrystalDPR * You can do pointwise operations with tensors that have unbacked SymInts; fixes involve making broadcasting avoid touching unbacked SymInts if not necessary (in both PrimTorch and the fake tensor fastpath), switching PrimTorch decomp for elementwise operations to use `empty_permuted and short circuiting if inputs are contiguous. I added `definitely_true` and `parallel_or` helpers to handle this case elegantly; see docblocks for more discussion. * The `is_contiguous` change requires me to update PrimTorch to let `is_contiguous` through directly, which seems fine. * Add a new `constrain_unify` helper which lets you specify that two unbacked SymInts are the same. This addresses the case when you use the same boolean mask to index into different tensors; the resulting slices have the same shapes but we do not currently know this statically. Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
ngimel
reviewed
Feb 21, 2023
… masks" This PR adds support for some more unbacked SymInt cases extracted from CrystalDPR * You can do pointwise operations with tensors that have unbacked SymInts; fixes involve making broadcasting avoid touching unbacked SymInts if not necessary (in both PrimTorch and the fake tensor fastpath), switching PrimTorch decomp for elementwise operations to use `empty_permuted and short circuiting if inputs are contiguous. I added `definitely_true` and `parallel_or` helpers to handle this case elegantly; see docblocks for more discussion. * The `is_contiguous` change requires me to update PrimTorch to let `is_contiguous` through directly, which seems fine. * Add a new `constrain_unify` helper which lets you specify that two unbacked SymInts are the same. This addresses the case when you use the same boolean mask to index into different tensors; the resulting slices have the same shapes but we do not currently know this statically. Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
This was referenced Feb 21, 2023
… masks" This PR adds support for some more unbacked SymInt cases extracted from CrystalDPR * You can do pointwise operations with tensors that have unbacked SymInts; fixes involve making broadcasting avoid touching unbacked SymInts if not necessary (in both PrimTorch and the fake tensor fastpath), switching PrimTorch decomp for elementwise operations to use `empty_permuted and short circuiting if inputs are contiguous. I added `definitely_true` and `parallel_or` helpers to handle this case elegantly; see docblocks for more discussion. * The `is_contiguous` change requires me to update PrimTorch to let `is_contiguous` through directly, which seems fine. * Add a new `constrain_unify` helper which lets you specify that two unbacked SymInts are the same. This addresses the case when you use the same boolean mask to index into different tensors; the resulting slices have the same shapes but we do not currently know this statically. Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
… masks" This PR adds support for some more unbacked SymInt cases extracted from CrystalDPR * You can do pointwise operations with tensors that have unbacked SymInts; fixes involve making broadcasting avoid touching unbacked SymInts if not necessary (in both PrimTorch and the fake tensor fastpath), switching PrimTorch decomp for elementwise operations to use `empty_permuted and short circuiting if inputs are contiguous. I added `definitely_true` and `parallel_or` helpers to handle this case elegantly; see docblocks for more discussion. * The `is_contiguous` change requires me to update PrimTorch to let `is_contiguous` through directly, which seems fine. * Add a new `constrain_unify` helper which lets you specify that two unbacked SymInts are the same. This addresses the case when you use the same boolean mask to index into different tensors; the resulting slices have the same shapes but we do not currently know this statically. Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
… masks" This PR adds support for some more unbacked SymInt cases extracted from CrystalDPR * You can do pointwise operations with tensors that have unbacked SymInts; fixes involve making broadcasting avoid touching unbacked SymInts if not necessary (in both PrimTorch and the fake tensor fastpath), switching PrimTorch decomp for elementwise operations to use `empty_permuted and short circuiting if inputs are contiguous. I added `definitely_true` and `parallel_or` helpers to handle this case elegantly; see docblocks for more discussion. * The `is_contiguous` change requires me to update PrimTorch to let `is_contiguous` through directly, which seems fine. * Add a new `constrain_unify` helper which lets you specify that two unbacked SymInts are the same. This addresses the case when you use the same boolean mask to index into different tensors; the resulting slices have the same shapes but we do not currently know this statically. Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
This PR adds support for some more unbacked SymInt cases extracted from CrystalDPR
empty_permutedand short circuiting if inputs are contiguous. I addeddefinitely_trueandparallel_orhelpers to handle this case elegantly; see docblocks for more discussion.is_contiguouschange requires me to update PrimTorch to letis_contiguousthrough directly, which seems fine.constrain_unifyhelper which lets you specify that two unbacked SymInts are the same. This addresses the case when you use the same boolean mask to index into different tensors; the resulting slices have the same shapes but we do not currently know this statically.Signed-off-by: Edward Z. Yang ezyang@meta.com