speed up hardswish and hardsigmoid tests#38256
speed up hardswish and hardsigmoid tests#38256vkuzo wants to merge 3 commits intogh/vkuzo/63/basefrom
Conversation
Summary: Removes hypothesis to speed these tests up, as these tests were flagged as top slow tests in CI. At the same time, combines the fbgemm and qnnpack test cases together for better reuse. Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_hardswish python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid ``` Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Removes hypothesis to speed these tests up, as these tests were flagged as top slow tests in CI. At the same time, combines the fbgemm and qnnpack test cases together for better reuse. Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_hardswish python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 94bf814 Pull Request resolved: #38256
| max_sides = (3, 5) | ||
| side_lens = (1, 7, 8) | ||
| torch_types = (torch.quint8, torch.qint8) | ||
| engines = ('fbgemm', 'qnnpack') |
There was a problem hiding this comment.
Maybe use @override_qengines instead?
|
|
||
| qY = torch.nn.quantized.functional.hardsigmoid(qX) | ||
| self.assertEqual(qY, qY_hat, | ||
| message="Hardsigmoid failed: {} vs. {}".format(qY, qY_hat)) |
There was a problem hiding this comment.
Might help for debugging if we specify which backend this failed on.
💊 CI failures summary and remediationsAs of commit b467758 (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 14 times. |
|
Change looks good to me, but outside of CI environment test already finish in a reasonable amount of time: |
|
I've tried selecting different profiles, as defined in https://github.com/pytorch/pytorch/blob/master/torch/testing/_internal/common_utils.py#L659 but still can not get to 120 sec times reported during CircleCI runs |
Summary: Removes hypothesis to speed these tests up, as these tests were flagged as top slow tests in CI. At the same time, combines the fbgemm and qnnpack test cases together for better reuse. Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_hardswish python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D21506831](https://our.internmc.facebook.com/intern/diff/D21506831) [ghstack-poisoned]
Summary: Removes hypothesis to speed these tests up, as these tests were flagged as top slow tests in CI. At the same time, combines the fbgemm and qnnpack test cases together for better reuse. Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_hardswish python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: c510f9f Pull Request resolved: #38256
| if torch.backends.quantized.engine == 'qnnpack' and torch_type != torch.quint8: | ||
| continue | ||
|
|
||
| with override_quantized_engine(engine): |
There was a problem hiding this comment.
This can be removed as well. The override will take care of it at the test level.
|
I know why tests can be slow when run by CI, but fast during single runs: |
|
@vkuzo you might need to rebase your change against latest master as I've landed a PR that adds limit to max number of element for hypothesis generated tensors (and it touches the same files are your diff) |
thanks for the find, makes sense! |
Summary: Removes hypothesis to speed these tests up, as these tests were flagged as top slow tests in CI. At the same time, combines the fbgemm and qnnpack test cases together for better reuse. Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_hardswish python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D21506831](https://our.internmc.facebook.com/intern/diff/D21506831) [ghstack-poisoned]
Summary: Removes hypothesis to speed these tests up, as these tests were flagged as top slow tests in CI. At the same time, combines the fbgemm and qnnpack test cases together for better reuse. Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_hardswish python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 85abe95 Pull Request resolved: #38256
|
This pull request has been merged in ff76de8. |
Summary: Pull Request resolved: pytorch#38256 Removes hypothesis to speed these tests up, as these tests were flagged as top slow tests in CI. At the same time, combines the fbgemm and qnnpack test cases together for better reuse. Test Plan: ``` python test/test_quantization.py TestQuantizedOps.test_hardswish python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid ``` Imported from OSS Differential Revision: D21506831 fbshipit-source-id: 9ff70e4ec7ae30b6948fe808878f0187e631f4d8
Stack from ghstack:
Summary:
Removes hypothesis to speed these tests up, as these tests were flagged as top slow
tests in CI. At the same time, combines the fbgemm and qnnpack test
cases together for better reuse.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D21506831