Symintify getitem and add the required helper functions#86207
Symintify getitem and add the required helper functions#86207
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86207
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit 4afd107: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
aten/src/ATen/TensorIndexing.h
Outdated
| real_dim, | ||
| " with size ", | ||
| size); | ||
| size.guard_int(__FILE__, __LINE__)); |
There was a problem hiding this comment.
@ezyang The guard here should be fine as the error message is never evaluated right?
There was a problem hiding this comment.
Yes, is fine. But cc @Chillee was talking about making it so we always print the concrete values when printing symints, which would have made direct size print ok too.
| out = nn.Conv2d(1, 1, 3)(a) | ||
| self.assertEqual(out.grad_fn._saved_bias_sym_sizes_opt, (1,)) # c10::optional<SymIntArrayRef> -> SymInt[]? | ||
| out = nn.Conv2d(1, 1, 3, bias=False)(a) | ||
| # TODO: This is BAD! we converted a c10::nullopt into a (0,) |
There was a problem hiding this comment.
I don't know how to fix that one off the top of my head and this is already a big PR. Will fix in a follow up.
There was a problem hiding this comment.
👀 is this not caught by opinfos? (only nn.Conv2d)
Oh or maybe it already is and we have them xfail'd
There was a problem hiding this comment.
OpInfo don't look at the python bindings for stuff saved in the backward.
These are debug-only APIs so this is not a big deal.
| auto size = self.size(dim); | ||
| if (index < -size || index >= size) { | ||
| auto size = self.sym_sizes()[dim]; | ||
| if (size < -index_ || size <= index_) { |
There was a problem hiding this comment.
Did this condition change?
There was a problem hiding this comment.
No it did not. But the SymInt has to be on the left side and cannot have -SymInt. So just moved stuff around :)
There was a problem hiding this comment.
should just add enough overloads to SymInt.h so that we don't have to do this...
There was a problem hiding this comment.
What is the overload that should be implemented for int64_t < SymInt ?
torch/_meta_registrations.py
Outdated
|
|
||
| @register_meta(aten.index_put.default, register_dispatcher=False) | ||
| def meta_index_put(self, indices, values, accumulate=False): | ||
| return self.new_empty(self.size()) |
There was a problem hiding this comment.
torch.empty_like() to follow the same convention we have for most other python meta kernels?
Probably doesn't matter too much.
|
@pytorchbot merge |
|
@pytorchbot successfully started a merge job. Check the current status here. |
|
The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot. |
|
@pytorchbot merge -g |
|
@pytorchbot successfully started a merge job. Check the current status here. |
|
The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot. |
|
@pytorchbot merge -f "circle ci is in outage so skipping circle CI functorch tests that are already in the main test" |
|
@pytorchbot successfully started a merge job. Check the current status here. |
|
Actually rebased on top of master and fixed land race issues |
|
@pytorchbot merge -g I'm very optimistic ! |
|
@pytorchbot successfully started a merge job. Check the current status here. |
Merge failedReason: 2 additional jobs have failed, first few of them are: trunk ,trunk / macos-12-py3-x86-64 / build Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -f "infra failure" |
|
@pytorchbot successfully started a merge job. Check the current status here. |
|
Hey @albanD. |
|
@pytorchbot revert -c ghfirst -m " Fails internal tests, see: https://www.internalfb.com/intern/sandcastle/job/22517998926071860/insights" |
|
Hello! This is failing internal tests on an xplat target like so: From: internalfb.com/intern/sandcastle/job/22517998926071860/insights |
|
@pytorchbot successfully started a revert job. Check the current status here. |
Reverting PR 86207 failedReason: Command Details for Dev Infra teamRaised by workflow job |
symintify split_with_sizes, dropout, fused_fake_obs_quant. meta for padding_2d ops add meta_bernoulli_ meta kernel for at::gather get pytorch_struct to pass: meta for scatter_add, fix backward symintify split ops Pull Request resolved: #86334 Approved by: https://github.com/ezyang
…ch (#86334)" This reverts commit 08e3999. Reverted #86334 on behalf of https://github.com/seemethere due to Trying to revert #86207, this PR causes merge conflicts with the initial revert so will have to revert this as well
|
@pytorchbot revert -c ghfirst -m " Fails internal tests, see: https://www.internalfb.com/intern/sandcastle/job/22517998926071860/insights" |
|
@pytorchbot successfully started a revert job. Check the current status here. |
|
@albanD your PR has been successfully reverted. |
…)" This reverts commit fd5085c. Reverted #86207 on behalf of https://github.com/seemethere due to Fails internal tests, see: https://www.internalfb.com/intern/sandcastle/job/22517998926071860/insights
…86207) Note that this might not cover every use of the function (we know it doesn't) But this is enough to get few models passing. [ghstack-poisoned]
…required helper functions (#86207)" Note that this might not cover every use of the function (we know it doesn't) But this is enough to get few models passing. [ghstack-poisoned]
…functions (#86207)" Note that this might not cover every use of the function (we know it doesn't) But this is enough to get few models passing. [ghstack-poisoned]
…86207) (#86487) Note that this might not cover every use of the function (we know it doesn't) But this is enough to get few models passing. Pull Request resolved: #86487 Approved by: https://github.com/ezyang
…86207) (#86487) (#86487) Summary: Note that this might not cover every use of the function (we know it doesn't) But this is enough to get few models passing. Pull Request resolved: #86487 Approved by: https://github.com/ezyang Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/55663b7f8174db5d71d611403078ebcec4075b1a Reviewed By: DanilBaibak Differential Revision: D40232593 Pulled By: DanilBaibak fbshipit-source-id: 6927cce33b26b86793670eaab0e027e90c54f613
Note that this might not cover every use of the function (we know it doesn't)
But this is enough to get few models passing.