Skip to content

[quant][graphmode] Add support for quantized conv1d + relu fusion#38441

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

[quant][graphmode] Add support for quantized conv1d + relu fusion#38441
supriyar wants to merge 4 commits intogh/supriyar/120/basefrom
gh/supriyar/120/head

Conversation

@supriyar
Copy link
Copy Markdown
Contributor

@supriyar supriyar commented May 13, 2020

Stack from ghstack:

Summary:

Test Plan:
python test/test_quantization.py test_quantized_conv1d_relu

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D21575919

Summary:

Test Plan:
python test/test_quantization.py test_quantized_conv1d_relu

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@supriyar supriyar requested a review from apaszke as a code owner May 13, 2020 21:55
supriyar added a commit that referenced this pull request May 13, 2020
Summary:

Test Plan:
python test/test_quantization.py test_quantized_conv1d_relu

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 7142438
Pull Request resolved: #38441
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label May 13, 2020
@supriyar supriyar requested a review from jerryzh168 May 13, 2020 21:59
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 13, 2020

💊 CI failures summary and remediations

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


💚 💚 Looks good so far! There are no failures yet. 💚 💚


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 17 times.

// aten::conv1d - aten::relu
std::string conv1d_relu = R"(
graph(%a_quant, %packed_params, %r_scale, %r_zero_point, %r_dtype, %stride, %padding, %dilation, %groups):
%a_dequant = aten::dequantize(%a_quant)
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.

For my understanding, where is the pack op inserted for the weights? I was expecting to see a wt->q->pack->unpack->dq->Conv

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.

yes, it's inserted before, here we just fuse unpack - dq - conv - q to quantized::conv2d

// These are the IR patterns we match to skip inserting observers.
// They are compiled once on construction and used repeatedly within
// the pass.
const PatternInfo conv1d_functional_relu = PatternInfo::parse_from_str(R"(
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.

let's use naming convention suggested by @z-a-f : nn_conv1d_f_relu, similar for others

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.

Sure

… fusion"

Summary:

Test Plan:
python test/test_quantization.py test_quantized_conv1d_relu

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
supriyar added 2 commits May 13, 2020 18:14
… fusion"

Summary:

Test Plan:
python test/test_quantization.py test_quantized_conv1d_relu

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
… fusion"

Summary:

Test Plan:
python test/test_quantization.py test_quantized_conv1d_relu

Reviewers:

Subscribers:

Tasks:

Tags:

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

This pull request has been merged in 8e73251.

@facebook-github-bot facebook-github-bot deleted the gh/supriyar/120/head branch May 18, 2020 14:16
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…torch#38441)

Summary: Pull Request resolved: pytorch#38441

Test Plan:
python test/test_quantization.py test_quantized_conv1d_relu

Imported from OSS

Differential Revision: D21575919

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

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants