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

qnnpack quantized activations: fix memory format issues #46077

Closed
wants to merge 2 commits into from

Commits on Oct 9, 2020

  1. qnnpack quantized activations: fix memory format issues

    Summary:
    
    Some of QNNPACK quantized kernels were not handling NHWC correctly,
    the data written respected the input format but the memory flag
    was always set to contiguous.  This PR
    1. adds testing for NHWC for qnnpack activations
    2. fixes those activations which did not set the memory format on the output
    
    Test Plan:
    
    ```
    python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid
    python test/test_quantization.py TestQuantizedOps.test_leaky_relu
    python test/test_quantization.py TestQuantizedOps.test_hardswish
    python test/test_quantization.py TestQNNPackOps.test_qnnpack_tanh
    python test/test_quantization.py TestQNNPackOps.test_qnnpack_sigmoid
    ```
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    [ghstack-poisoned]
    vkuzo committed Oct 9, 2020
    Copy the full SHA
    ffea8c7 View commit details
    Browse the repository at this point in the history
  2. rebase on "qnnpack quantized activations: fix memory format issues"

    Summary:
    
    Some of QNNPACK quantized kernels were not handling NHWC correctly,
    the data written respected the input format but the memory flag
    was always set to contiguous.  This led to incorrect outputs.  This PR
    1. adds testing for NHWC for qnnpack activations
    2. fixes those activations which did not set the memory format on the output so that the new tests pass
    
    Test Plan:
    
    ```
    python test/test_quantization.py TestQuantizedOps.test_qhardsigmoid
    python test/test_quantization.py TestQuantizedOps.test_leaky_relu
    python test/test_quantization.py TestQuantizedOps.test_hardswish
    python test/test_quantization.py TestQNNPackOps.test_qnnpack_tanh
    python test/test_quantization.py TestQNNPackOps.test_qnnpack_sigmoid
    ```
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    Differential Revision: [D24213257](https://our.internmc.facebook.com/intern/diff/D24213257)
    
    [ghstack-poisoned]
    vkuzo committed Oct 9, 2020
    Copy the full SHA
    349e579 View commit details
    Browse the repository at this point in the history