-
Notifications
You must be signed in to change notification settings - Fork 24.3k
[Nested Tensor] Support NT construction inside PT2 graph #118446
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
Comments
This is a good question. Symbolic SymInts support more operations than non-symbolic SingletonSymInts do (e.g. multiplication). It might be theoretically possible to add any support needed by PT2 downstream to non-symbolic SingletonSymInts; it's just a decent amount of work. cc @soulitzer in case there he is aware of any theoretical issues preventing us from adding this support |
@jbschlosser what I meant was, whether we can do this: #118577 (still waiting on CI to see if anything fails...) (edit: the PR has changed since when I originally wrote the comment... originally it just removed the check for symbolic sizes, but that fails; now the PR is testing other stuff) |
… from inputs" Creating symbolic nested ints within the graph is difficult. Using unbacked symints should solve the most important(?) cases in the mean time. See #118446 Known gaps: - creating NJT from intermediate offsets (offsets created within the graph, as opposed to being offsets passed in as inputs) - when the same offsets is also passed in as a input to the graph. We are not smart enough to realize that the offsets from that input is the same and therefore would fail when the sizes are compare ("s0 cannot be compared with u0") cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
…ph using offsets from inputs" Creating symbolic nested ints within the graph is difficult. Using unbacked symints should solve the most important(?) cases in the mean time. See #118446 Known gaps: - creating NJT from intermediate offsets (offsets created within the graph, as opposed to being offsets passed in as inputs) - when the same offsets is also passed in as a input to the graph. We are not smart enough to realize that the offsets from that input is the same and therefore would fail when the sizes are compare ("s0 cannot be compared with u0") cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
… from inputs" Creating symbolic nested ints within the graph is difficult. Using unbacked symints should solve the most important(?) cases in the mean time. See #118446 Known gaps: - creating NJT from intermediate offsets (offsets created within the graph, as opposed to being offsets passed in as inputs) - when the same offsets is also passed in as a input to the graph. We are not smart enough to realize that the offsets from that input is the same and therefore would fail when the sizes are compare ("s0 cannot be compared with u0") cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
…ph using offsets from inputs" Creating symbolic nested ints within the graph is difficult. Using unbacked symints should solve the most important(?) cases in the mean time. See #118446 Known gaps: - creating NJT from intermediate offsets (offsets created within the graph, as opposed to being offsets passed in as inputs) - when the same offsets is also passed in as a input to the graph. We are not smart enough to realize that the offsets from that input is the same and therefore would fail when the sizes are compare ("s0 cannot be compared with u0") cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
… from inputs" Creating symbolic nested ints within the graph is difficult. Using unbacked symints should solve the most important(?) cases in the mean time. See #118446 Known gaps: - creating NJT from intermediate offsets (offsets created within the graph, as opposed to being offsets passed in as inputs) - when the same offsets is also passed in as a input to the graph. We are not smart enough to realize that the offsets from that input is the same and therefore would fail when the sizes are compare ("s0 cannot be compared with u0") cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
Doing issue scrapping. The repro does not fail, closing. |
Uh oh!
There was an error while loading. Please reload this page.
🚀 The feature, motivation and pitch
Repro:
values
tensor has dynamic shapes in the non-batch dimensions:values
is dynamic, then when we constructself._strides = (ragged_size * stride[self._ragged_idx - 1], *stride)
:stride
isvalues.stride()
; ifstride[self._ragged_idx - 1]
is symbolic, thenragged_size * stride[..]
is a multiplication of a singleton symbolic symint and a normal python symbolic symint; this is not supported.__tensor_unflatten__
needsvalues
to be symbolic in order to identify that we can update the_tensor_symint_registry
. When a NT is an input, we know about dynamism properties because ofmark_dynamic
in the NT constructor. However, when the NT is constructed inside, we don't know about those dynamism properties until after we trace through (and we probably need to check trace order etc. to make sure the dynamism is marked at a point early enough...)Alternatives
No response
Additional context
No response
cc @cpuhrsch @jbschlosser @bhosmer @drisspg @soulitzer @ezyang @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang
The text was updated successfully, but these errors were encountered: