Skip to content

[quant][graphmode] Support ops with fixed quantization parameters#38278

Closed
jerryzh168 wants to merge 9 commits intogh/jerryzh168/312/basefrom
gh/jerryzh168/312/head
Closed

[quant][graphmode] Support ops with fixed quantization parameters#38278
jerryzh168 wants to merge 9 commits intogh/jerryzh168/312/basefrom
gh/jerryzh168/312/head

Conversation

@jerryzh168
Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 commented May 11, 2020

Stack from ghstack:

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:

  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;

Ops supported:

  • hardsigmoid
  • sigmoid
  • tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D21559811

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 11, 2020

💊 CI failures summary and remediations

As of commit 3587871 (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 35 times.

…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request May 12, 2020
Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 6c0d47e
Pull Request resolved: #38278
…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request May 12, 2020
Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 6c0d47e
Pull Request resolved: #38278
…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
Comment thread torch/csrc/jit/passes/quantization/helper.cpp
Comment thread torch/csrc/jit/passes/quantization/helper.cpp Outdated

// IR pattern common to all ops with fixed quantization parameters for
// asymetric quantization
std::string asym_fixed_qparam_op_suffix = 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.

can we also add some comments on the magic numbers here, even if we can't pull them out into constants?

…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D21559811](https://our.internmc.facebook.com/intern/diff/D21559811)

[ghstack-poisoned]
…ameters"

Summary:
Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D21559811](https://our.internmc.facebook.com/intern/diff/D21559811)

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

This pull request has been merged in 504637a.

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

Summary:
Pull Request resolved: pytorch#38278

Support ops like aten::hardsigmoid that has a fixed quantization parameters:
```
  constexpr float o_scale = 1.0f / 256.0f;
  constexpr int32_t o_zero_point = 0;
```

Ops supported:
- hardsigmoid
- sigmoid
- tanh

Test Plan: Imported from OSS

Differential Revision: D21559811

fbshipit-source-id: 26f3c9c3389dea4f07b350172e2974fac8c5c470
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.

4 participants