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

Symintifying slice ops #85196

Closed
wants to merge 15 commits into from
Closed

Conversation

Krovatkin
Copy link
Contributor

@Krovatkin Krovatkin commented Sep 16, 2022

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 16, 2022

🔗 Helpful Links

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

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

✅ No Failures

As of commit 698e8ef:
💚 Looks good so far! There are no failures yet. 💚

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

Krovatkin added a commit that referenced this pull request Sep 16, 2022
ghstack-source-id: c29710e68c31b61d63087d5a28bfd68e0f3beed6
Pull Request resolved: #85196
@ezyang
Copy link
Contributor

ezyang commented Sep 17, 2022

Testing?

Krovatkin added a commit that referenced this pull request Sep 19, 2022
ghstack-source-id: c385820d98ff186b0ba40e3bc25ead4e3caab508
Pull Request resolved: #85196
Krovatkin added a commit that referenced this pull request Sep 19, 2022
ghstack-source-id: ad285f4c3841cd043d6046728e6e9cc579cf5e1e
Pull Request resolved: #85196
Krovatkin added a commit that referenced this pull request Sep 20, 2022
ghstack-source-id: 50879dfed96d3bc0d9e7a0157702f78e2d2ab958
Pull Request resolved: #85196
@@ -175,7 +176,8 @@ def get_name(op):
torch._lazy.mark_step()
torch._lazy.wait_device_ops()
prefix = "aten" if op.name in FALLBACK_LIST else "lazy"
found = f"{prefix}::{op.name}" in remove_suffixes(torch._lazy.metrics.counter_names())
symint_suffix = "_symint" if op.name in HAS_SYMINT_SUFFIX else ""
found = f"{prefix}::{op.name}{symint_suffix}" in remove_suffixes(torch._lazy.metrics.counter_names())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Krovatkin added a commit that referenced this pull request Sep 20, 2022
ghstack-source-id: 2a2518e3c43a34db7a19386a8538093ec6bac249
Pull Request resolved: #85196
@ezyang ezyang mentioned this pull request Sep 21, 2022
Krovatkin added a commit that referenced this pull request Sep 21, 2022
ghstack-source-id: 13554fb4ff2a894fa1bca9b6bc393db4a6d799fb
Pull Request resolved: #85196
@pytorch-bot pytorch-bot bot added the release notes: vulkan release notes category label Sep 21, 2022
]:
yield i
slice = SliceOpInfo()
self.do_cross_ref('cpu', torch.float, slice, run_all=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weren't you going to move this into common_methods_invocations

Copy link
Contributor Author

@Krovatkin Krovatkin Sep 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it blows up spectacularly in #85314. I'd suggest we do it as a follow up if you don't mind. I'm usually pretty good at following up, lol :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but... like... that the OpInfo isn't working with the other tests implies that the OpInfo is wrong...

Copy link
Contributor Author

@Krovatkin Krovatkin Sep 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but... like... that the OpInfo isn't working with the other tests implies that the OpInfo is wrong...

It seems it just needs way more integration work to run all the tests we run with OpInfos

  • there are issues using torch.ops.aten.slice as OpInfo.op
  • it actually passes for more types than I specified
  • it also passes more forward/backward tests than I specified it should be passing.

For testing the forward of slice which I think was the main intent of Will's tests, it works pretty well as the part of decomp tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is going to be that hard to fix. I'm checking out your PR to try it.

@@ -13,6 +14,8 @@
from torch._prims_common.wrappers import out_wrapper
from torch.utils._pytree import tree_flatten, tree_map

old_slice = slice
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ded

ezyang added a commit that referenced this pull request Sep 23, 2022
ghstack-source-id: cac74891e54d687d10138ff63127c34021c27b20
Pull Request resolved: #85196

slice tests

rename slice to avoid hijacking builtins.slice

fix lintrunner

remove dead code

stuff

fix bbrks
ezyang added a commit that referenced this pull request Sep 23, 2022
ghstack-source-id: 886e4bd49a09b74c949e779f547267ccfe31be87
Pull Request resolved: #85196

slice tests

rename slice to avoid hijacking builtins.slice

fix lintrunner

remove dead code

stuff

fix bbrks
@ezyang
Copy link
Contributor

ezyang commented Sep 23, 2022

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here.
The merge job was triggered without a flag. This means that your change will be merged once all checks on your PR have passed (ETA: 0-4 Hours). If this is not the intended behavior, feel free to use some of the other merge options in the wiki.
Please reach out to the PyTorch DevX Team with feedback or questions!

@github-actions
Copy link

Hey @Krovatkin.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@facebook-github-bot facebook-github-bot deleted the gh/Krovatkin/21/head branch September 27, 2022 14:19
@@ -609,6 +610,58 @@ def slice_backward(
return torch.slice_scatter(grad_input, grad_output, dim, start, end, step)


@register_decomposition(aten.slice.Tensor)
def slice_forward(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dumb q: why do we need a python decomp for slice if we're already c10::SymInt-ifying the C++ implementation? Is the python impl still required for something? (either way, I totally see a python impl being useful to have).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look over the patch carefully. We did not, in fact, SymInt'ify the C++ implementation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

welp, thanks. Needed to scan the codegen again to remember how it works: If we put _symint at the end of the kernel name in native_functions.yaml, then the codegen will expect you to symint-ify the C++ kernel

@atalman
Copy link
Contributor

atalman commented Sep 27, 2022

@pytorchmergebot revert -m "Break internal build Exutorch" -c ghfirst

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Please reach out to the PyTorch DevX Team with feedback or questions!

@pytorchmergebot
Copy link
Collaborator

@Krovatkin your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Sep 27, 2022
This reverts commit 4c01c51.

Reverted #85196 on behalf of https://github.com/atalman due to Break internal build Exutorch
ezyang added a commit that referenced this pull request Sep 27, 2022
This reverts commit 3a171df.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Sep 27, 2022
This reverts commit 3a171df.

ghstack-source-id: 0e11cbd111a5090eb423d6746d646af23a74a1fe
Pull Request resolved: #85746
ezyang added a commit that referenced this pull request Sep 27, 2022
ezyang added a commit that referenced this pull request Sep 27, 2022
This reverts commit 3a171df.

ghstack-source-id: c7d350d19ee10c5f1f133f341c5e380525e0fc5b
Pull Request resolved: #85746
pytorchmergebot pushed a commit that referenced this pull request Sep 28, 2022
drisspg pushed a commit to drisspg/pytorch that referenced this pull request Sep 29, 2022
mehtanirav pushed a commit that referenced this pull request Oct 4, 2022
mehtanirav pushed a commit that referenced this pull request Oct 4, 2022
This reverts commit 4c01c51.

Reverted #85196 on behalf of https://github.com/atalman due to Break internal build Exutorch
mehtanirav pushed a commit that referenced this pull request Oct 4, 2022
alvgaona pushed a commit to alvgaona/pytorch that referenced this pull request Oct 11, 2022
alvgaona pushed a commit to alvgaona/pytorch that referenced this pull request Oct 11, 2022
This reverts commit 4c01c51.

Reverted pytorch#85196 on behalf of https://github.com/atalman due to Break internal build Exutorch
alvgaona pushed a commit to alvgaona/pytorch that referenced this pull request Oct 11, 2022
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.

None yet

6 participants