Skip to content

[quant] Add support for Quantized Conv1d and ConvRELU1d#38283

Closed
supriyar wants to merge 4 commits intogh/supriyar/114/basefrom
gh/supriyar/114/head
Closed

[quant] Add support for Quantized Conv1d and ConvRELU1d#38283
supriyar wants to merge 4 commits intogh/supriyar/114/basefrom
gh/supriyar/114/head

Conversation

@supriyar
Copy link
Copy Markdown
Contributor

@supriyar supriyar commented May 11, 2020

Stack from ghstack:

Summary:
Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D21553665

Summary:
Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@supriyar supriyar requested a review from apaszke as a code owner May 11, 2020 23:50
supriyar added a commit that referenced this pull request May 11, 2020
Summary:
Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 838bcd5
Pull Request resolved: #38283
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 11, 2020

💊 CI failures summary and remediations

As of commit f8740dc (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


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 on the GitHub issue tracker.

See how this bot performed.

This comment has been revised 15 times.

@supriyar supriyar requested a review from raghuramank100 May 12, 2020 00:35
Comment thread torch/nn/quantized/modules/conv.py Outdated

# We are using Conv2d to run the Conv1d. For that we need to know which
# dimension is squeezed/unsqueezed.
_SQUEEZE_DIM = -2 # -2 is faster than -1.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what if you remove this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah this is the culprit. I kept it around since I had to call _packed_params.unpack() (which calls conv2d unpack) so the output weight had to be squeezed for Conv1d. Let me directly try calling quantized::conv1d_unpack op instead.

Summary:
Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
Summary:
Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
supriyar added a commit that referenced this pull request May 12, 2020
Summary:
Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 99b52e3
Pull Request resolved: #38283
Comment on lines +181 to +183
at::Tensor new_weight = weight.clone();
new_weight = new_weight.squeeze_(quant_utils::kConv1dSqueezeDim + 2);
return std::tuple<at::Tensor, c10::optional<at::Tensor>>(new_weight, bias);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this change belong to pervious PR?

Summary:
Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in f6626aa.

@facebook-github-bot facebook-github-bot deleted the gh/supriyar/114/head branch May 17, 2020 14:18
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#38283

Adds support for the modules and tests

Test Plan:
python test/test_quantization.py TestStaticQuantizedModule.test_conv1d_api

Imported from OSS

Differential Revision: D21553665

fbshipit-source-id: 7ea28da024bdf59f87f300d616c266f2b41f0bcd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants