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
Change list striding parameters to take optional integer (preceding work for #49352) #48719
Change list striding parameters to take optional integer (preceding work for #49352) #48719
Conversation
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 0f2eee98d29ba2ef3bbd8f53b2898ce92c6a7b82 Pull Request resolved: #48719
💊 CI failures summary and remediationsAs of commit 23aaf43 (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages: pytorch_xla_linux_bionic_py3_6_clang9_build (1/1)Step: "Build" (full log | diagnosis details | 🔁 rerun)
|
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 36634034caedb2cefdc9bcc26786c6c7bf62c77f Pull Request resolved: #48719
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: b8f40e468b77d1b93324fe21c8a2d8d9e7248c7e Pull Request resolved: #48719
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: fdf82e4c58b24e22ab5787490d26803537761de8 Pull Request resolved: #48719
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is actually changing here? It would be nice to have the codemod in a separate PR.
Yea, agreed with alban, it might be easier to review this once the whole stack is out |
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 74bc6d79a75331aab5452d9034f8753891fe3ca3 Pull Request resolved: #48719
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 548d1980f7bb99375e25a26e85c862c466c6e8a6 Pull Request resolved: #48719
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
cc @ailzhang XLA failure |
Some context: we are fixing the lists slicing logic with a negative index. Part of this change involves changing the ir emission for aten::slice to emit None for non-present step value instead of INT_MAX. Rather than have special case logic for all of the builtins type that may or may not support negative striding (lists, tensors, strs) we are updating their implementations so that they can all take in optionals. Actual negative slicing of Tensors is still NYI, but making the schema changes here makes future implementation easier and makes the logic in ir emission cleaner. |
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Nice job wading through the tracer code.
I have two comments:
- I don't think we actually need to make
step
optional, I think python just defaults it to 1 - I'm not sure about the
TenssorShape.cpp
changes, I think it would be better to error at negative step within TensorShape instead of trying to implement it for this PR.
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 97ed8fba46c77a185c586b35b23f081873207a67 Pull Request resolved: #48719
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Ship it! Great job! We might want to sanity check the same forward-compatibility checks we did previously with the newest changes, just to be safe. But up to you.
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, ship it! We should wait a couple weeks or so before landing PT2 so we dont run into FC issues.
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change. Test Plan: None for this PR, but new tests will be added for the second part. Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25929902](https://our.internmc.facebook.com/intern/diff/D25929902) [ghstack-poisoned]
This pull request has been merged in 1a38fa9. |
TORCH_CHECK(step == 1, "Slicing a string only supports step=1"); | ||
|
||
const int64_t size = string.size(); | ||
int64_t start_val = start.has_value() ? start.value() : INT64_MAX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this default to INT64_MAX
? Why not just set it to 0? cc @eellison this is impeding SymInt-ification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, I forget, but I think that was mirroring how the python slice handling code went where None
would be encoded as INT64_MAX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may have also been a forward compatible thing because None support had to land in multiple parts
Stack from ghstack:
Summary: Attempt to break this PR (#33019) into two parts. As per our discussion with @eellison, the first part is to make sure our aten::slice operator take optional parameters for begin/step/end. This will help with refactoring ir_emitter.cpp for genering handling for list and slice striding. Once this PR merged, we will submit a second PR with compiler change.
Test Plan: None for this PR, but new tests will be added for the second part.
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D25929902