quantized tensor: add preliminary support for advanced indexing, try 2#49346
Closed
vkuzo wants to merge 6 commits intogh/vkuzo/188/basefrom
Closed
quantized tensor: add preliminary support for advanced indexing, try 2#49346vkuzo wants to merge 6 commits intogh/vkuzo/188/basefrom
vkuzo wants to merge 6 commits intogh/vkuzo/188/basefrom
Conversation
Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
jerryzh168
reviewed
Dec 14, 2020
…for advanced indexing, try 2" Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25539365](https://our.internmc.facebook.com/intern/diff/D25539365) [ghstack-poisoned]
…dexing, try 2" Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25539365](https://our.internmc.facebook.com/intern/diff/D25539365) [ghstack-poisoned]
vkuzo
added a commit
that referenced
this pull request
Dec 14, 2020
Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 9540251 Pull Request resolved: #49346
jerryzh168
reviewed
Dec 14, 2020
…ed indexing, try 2" Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25539365](https://our.internmc.facebook.com/intern/diff/D25539365) [ghstack-poisoned]
vkuzo
added a commit
that referenced
this pull request
Dec 14, 2020
Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: c319b52 Pull Request resolved: #49346
Contributor
💊 CI failures summary and remediationsAs of commit e788c68 (more details on the Dr. CI page):
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. This comment has been revised 10 times. |
…exing, try 2" Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25539365](https://our.internmc.facebook.com/intern/diff/D25539365) [ghstack-poisoned]
jerryzh168
reviewed
Dec 16, 2020
| TORCH_INTERNAL_ASSERT( | ||
| self.qscheme() == c10::kPerTensorAffine || | ||
| self.qscheme() == c10::kPerTensorSymmetric, | ||
| "Indexing for per-channel quantized Tensors is not supported."); |
Contributor
There was a problem hiding this comment.
nit: message should probably be only per-tensor quantized Tensor is supported
jerryzh168
approved these changes
Dec 16, 2020
Contributor
jerryzh168
left a comment
There was a problem hiding this comment.
LG, thanks for addressing the comments. had one nit comment inline.
…exing, try 2" Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25539365](https://our.internmc.facebook.com/intern/diff/D25539365) [ghstack-poisoned]
vkuzo
added a commit
that referenced
this pull request
Dec 16, 2020
Summary: This is less ambitious redo of #49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 7591b5f Pull Request resolved: #49346
Codecov Report
@@ Coverage Diff @@
## gh/vkuzo/188/base #49346 +/- ##
==================================================
Coverage 80.62% 80.62%
==================================================
Files 1875 1875
Lines 202771 202781 +10
==================================================
+ Hits 163488 163497 +9
- Misses 39283 39284 +1 |
Contributor
|
This pull request has been merged in a9137ae. |
hwangdeyu
pushed a commit
to hwangdeyu/pytorch
that referenced
this pull request
Jan 6, 2021
pytorch#49346) Summary: Pull Request resolved: pytorch#49346 This is less ambitious redo of pytorch#49129. We make the ``` xq_slice = xq[:, [0], :, :] ``` indexing syntax work if `xq` is a quantized Tensor. For now, we are making the code not crash, with an in efficient `dq -> index -> q` implementation. A future PR can optimize performance by removing the unnecessary memory copies (which will require some non-trivial changes to TensorIterator). Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_advanced_indexing ``` Imported from OSS Reviewed By: jerryzh168 Differential Revision: D25539365 fbshipit-source-id: 98485875aaaf5743e1a940e170258057691be4fa
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:
Summary:
This is less ambitious redo of
#49129.
We make the
indexing syntax work if
xqis a quantized Tensor. For now, we aremaking the code not crash, with an in efficient
dq -> index -> qimplementation. A future PR can optimize performance by removing
the unnecessary memory copies (which will require some non-trivial
changes to TensorIterator).
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D25539365