[quant] Add support for quantized::conv1d operator#38248
Closed
supriyar wants to merge 6 commits intogh/supriyar/112/basefrom
Closed
[quant] Add support for quantized::conv1d operator#38248supriyar wants to merge 6 commits intogh/supriyar/112/basefrom
supriyar wants to merge 6 commits intogh/supriyar/112/basefrom
Conversation
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 85b68b1 (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis 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 on the GitHub issue tracker. This comment has been revised 16 times. |
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
| if (ctx.qEngine() == at::QEngine::QNNPACK) { | ||
| TORCH_CHECK( | ||
| kSpatialDim == 2, | ||
| "quantized::conv2d_unpack (qnnpack): QNNPACK only supports Conv2d " |
Contributor
There was a problem hiding this comment.
The comment here is in error, we do support unpack for Qconv1d here.
| input_channels_per_group, (length, ), | ||
| output_channels_per_group, groups, kernel, [stride], [pad], | ||
| [dilation], X_scale, X_zero_point, W_scale, W_zero_point, | ||
| Y_scale, Y_zero_point, use_bias, use_relu, use_channelwise |
Contributor
There was a problem hiding this comment.
For the work to be complete, the following need to be done (can be done in later PRs)
- Ensure that conv1d quantized module calls these ops + module level tests https://github.com/pytorch/pytorch/blob/master/torch/nn/quantized/modules/conv.py#L224
- Support for Conv1dRelu module
- Op level benchmarks for Conv1d (Please align shapes with float benchmark so that we can compare speedup easily) (https://github.com/pytorch/pytorch/blob/master/benchmarks/operator_benchmark/pt/qconv_test.py#L62)
- Fusion support: https://github.com/pytorch/pytorch/blob/master/torch/quantization/fuse_modules.py#L95 (For Conv1d+Relu, Conv1d+Bn1d+Relu)
- QAT support for Conv1d+Bn1d (This can be low priority)
Contributor
Author
There was a problem hiding this comment.
@raghuramank100 1, 2 and 3 are done (with graph mode support) in this stack. I'll work on the fusion support next.
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
This was referenced May 12, 2020
jerryzh168
reviewed
May 12, 2020
| } | ||
| }; | ||
|
|
||
| template <int kSpatialDim, bool kReluFused> |
Contributor
There was a problem hiding this comment.
is kSpatialDim always 2 here? maybe remove if that is the case?
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
jerryzh168
approved these changes
May 13, 2020
This was referenced May 13, 2020
Contributor
|
This pull request has been merged in 2d221df. |
titaiwangms
added a commit
that referenced
this pull request
Oct 5, 2022
According to #38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. [ghstack-poisoned]
titaiwangms
added a commit
that referenced
this pull request
Oct 5, 2022
According to #38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. [ghstack-poisoned]
pytorchmergebot
pushed a commit
that referenced
this pull request
Oct 25, 2022
According to #38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. [ghstack-poisoned]
pytorchmergebot
pushed a commit
that referenced
this pull request
Oct 25, 2022
According to #38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. [ghstack-poisoned]
pytorchmergebot
pushed a commit
that referenced
this pull request
Oct 25, 2022
According to #38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. Pull Request resolved: #85997 Approved by: https://github.com/BowenBao
kulinseth
pushed a commit
to kulinseth/pytorch
that referenced
this pull request
Nov 5, 2022
According to pytorch#38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. Pull Request resolved: pytorch#85997 Approved by: https://github.com/BowenBao
kulinseth
pushed a commit
to kulinseth/pytorch
that referenced
this pull request
Dec 10, 2022
According to pytorch#38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. Pull Request resolved: pytorch#85997 Approved by: https://github.com/BowenBao
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Pull Request resolved: pytorch#38248 Test Plan: Imported from OSS Differential Revision: D21553661 fbshipit-source-id: 430b4c3244be0cf1a18bdf16788a2023c524c10b
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 25, 2026
According to pytorch#38248, quantized::conv1d_relu shares packing parameters with Conv2D (kspatialDim is also 2), and needs a different unpacking way. Therefore, a new `QuantizedParamsType=Conv1D` is used to differentiate the two, and has to extract 1D information from 2D packed parameters. Pull Request resolved: pytorch#85997 Approved by: https://github.com/BowenBao
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:
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D21553661