Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add qnnpack path for hardtanh #35779

Closed
wants to merge 10 commits into from
Closed

add qnnpack path for hardtanh #35779

wants to merge 10 commits into from

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Mar 31, 2020

Stack from ghstack:

Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D20778588

Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 31, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: b21c33d69aa4100b97dc9e1b488c732f74d0ef7a
Pull Request resolved: #35779
@dr-ci
Copy link

dr-ci bot commented Mar 31, 2020

💊 Build failures summary and remediations

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


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

🕵️ 1 new failure recognized by patterns

The following build failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_backward_compatibility_check_test (1/1)

Step: "Test" (full log | pattern match details | 🔁 rerun)

May 04 19:13:47 The PR is introducing backward incompatible changes to the operator library. Please contact PyTorch team to confirm whether this change is wanted or not.
May 04 19:13:47 processing existing schema:  aten::_weight_norm_cuda_interface_backward(Tensor grad_w, Tensor saved_v, Tensor saved_g, Tensor saved_norms, int dim) -> (Tensor, Tensor) 
May 04 19:13:47 processing existing schema:  aten::_weight_norm_differentiable_backward(Tensor grad_w, Tensor saved_v, Tensor saved_g, Tensor saved_norms, int dim) -> (Tensor, Tensor) 
May 04 19:13:47 processing existing schema:  aten::zeros_like(Tensor self, *, int? dtype=None, int? layout=None, Device? device=None, bool? pin_memory=None, int? memory_format=None) -> (Tensor) 
May 04 19:13:47 processing existing schema:  aten::_sparse_sum(Tensor self) -> (Tensor) 
May 04 19:13:47 processing existing schema:  aten::_sparse_sum.dtype(Tensor self, *, int dtype) -> (Tensor) 
May 04 19:13:47 processing existing schema:  aten::_sparse_sum.dim(Tensor self, int[1] dim) -> (Tensor) 
May 04 19:13:47 processing existing schema:  aten::_sparse_sum.dim_dtype(Tensor self, int[1] dim, *, int dtype) -> (Tensor) 
May 04 19:13:47 processing existing schema:  aten::rsub.Tensor(Tensor self, Tensor other, *, Scalar alpha=1) -> (Tensor) 
May 04 19:13:47 processing existing schema:  aten::rsub.Scalar(Tensor self, Scalar other, Scalar alpha=1) -> (Tensor) 
May 04 19:13:47 processing existing schema:  aten::_sparse_addmm(Tensor self, Tensor sparse, Tensor dense, *, Scalar beta=1, Scalar alpha=1) -> (Tensor) 
May 04 19:13:47 The PR is introducing backward incompatible changes to the operator library. Please contact PyTorch team to confirm whether this change is wanted or not.  
May 04 19:13:47  
May 04 19:13:47 Broken ops: [ 
May 04 19:13:47 	aten::as_tensor.float(float t, *, int? dtype=None, Device? device=None) -> (Tensor) 
May 04 19:13:47 	aten::as_tensor.int(int t, *, int? dtype=None, Device? device=None) -> (Tensor) 
May 04 19:13:47 	aten::as_tensor.bool(bool t, *, int? dtype=None, Device? device=None) -> (Tensor) 
May 04 19:13:47 	aten::tensor.float(float t, *, int? dtype=None, Device? device=None, bool requires_grad=False) -> (Tensor) 
May 04 19:13:47 	aten::tensor.int(int t, *, int? dtype=None, Device? device=None, bool requires_grad=False) -> (Tensor) 
May 04 19:13:47 	aten::tensor.bool(bool t, *, int? dtype=None, Device? device=None, bool requires_grad=False) -> (Tensor) 
May 04 19:13:47 	_caffe2::GatherRanges(Tensor data, Tensor ranges, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor, Tensor) 
May 04 19:13:47 	aten::channel_shuffle(Tensor self, int groups) -> (Tensor) 

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

@vkuzo vkuzo self-assigned this Mar 31, 2020
@vkuzo vkuzo added the oncall: quantization Quantization support in PyTorch label Mar 31, 2020
dtype=torch_type)

qY_hat = torch.nn.quantized.functional.hardtanh(qX, min_val, max_val)
self.assertEqual(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also compare the results against the server implementation? I think we can combine the test for server and mobile for this op.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, we can reuse the body of the test, it probably does have to live in a separate wrapper though (check out the specs on class TestQNNPackOps for motivation)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems like only a few lines would be able to be reused, so left it as is for now (seemed overkill), but flexible - lmk!

Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Apr 2, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 11c805543082ad2e4f9e1a83df3594a96a0e99d8
Pull Request resolved: #35779
Copy link
Contributor

@z-a-f z-a-f left a comment

Choose a reason for hiding this comment

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

LGTM

Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Apr 20, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 1dc64fc6d4fa4b685602e9f35ff7eb69701714fe
Pull Request resolved: #35779
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Apr 21, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: db7fb2aaef0707081d40d2c788d7c9ad4899e77f
Pull Request resolved: #35779
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Apr 27, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 119e4896c4eccfa99a0d24f6cc27917c6b950e72
Pull Request resolved: #35779
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Apr 28, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: de4b2f262befd2ee83fbd12685bf1093b2ea14da
Pull Request resolved: #35779
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Apr 30, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 790d2993cb28b8cdd3806ea08545c5bbe70d0375
Pull Request resolved: #35779
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request May 4, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: fdc8e6a4fde1a57a1b5925e3b28a70f1182164c0
Pull Request resolved: #35779
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request May 4, 2020
Summary:

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:

python test/test_quantized.py TestQNNPackOps.test_hardtanh

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: b3ce84ced26309c11a31ecb45b7958e62246d46a
Pull Request resolved: #35779
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in faad00a.

ShawnZhong pushed a commit to ShawnZhong/pytorch that referenced this pull request May 5, 2020
Summary:
Pull Request resolved: pytorch#35779

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:
python test/test_quantized.py TestQNNPackOps.test_hardtanh

Imported from OSS

Differential Revision: D20778588

fbshipit-source-id: 537de42e795a9c67924e1acb1d33b370beb9dbf5
bharatr21 pushed a commit to bharatr21/pytorch that referenced this pull request May 5, 2020
Summary:
Pull Request resolved: pytorch#35779

Adds a QNNPack path for the clamp kernel, which is useful for
hardtanh.

Test Plan:
python test/test_quantized.py TestQNNPackOps.test_hardtanh

Imported from OSS

Differential Revision: D20778588

fbshipit-source-id: 537de42e795a9c67924e1acb1d33b370beb9dbf5
@facebook-github-bot facebook-github-bot deleted the gh/vkuzo/21/head branch May 8, 2020 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged oncall: quantization Quantization support in PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants