pytorch/benchmarks/static_runtime
Raghavan Raman 60bda4d06b [Static Runtime] Fix handling relu in quantized linear relu dynamic op
Summary:
The implementation of `PackedLinearWeightFp16::apply_dynamic_impl` [here](https://www.internalfb.com/code/fbsource/[b1ef7c31f022]/fbcode/caffe2/aten/src/ATen/native/quantized/cpu/qlinear_dynamic.cpp?lines=393) does not handle `relu`. It completely ignores the `ReluFused` boolean template parameter.

At this point, callers of that function handle `relu` explicitly. While the correct thing to do would be to handle the `ReluFused` parameter in that implementation, it is not clear if that semantics is being followed in this code. So, we are handling this in SR's out-variant implementation, until the owner fixes that issue.

This issue resulted in incorrect results when Static Runtime was enabled for the MRS video model.

Test Plan:
```
buck run mode/opt //caffe2/benchmarks/static_runtime:static_runtime_cpptest -- --gtest_filter=StaticRuntime.QuantizedLinearReluDynamicFp16
```

Reviewed By: mikeiovine

Differential Revision: D35366309

fbshipit-source-id: e60126e3590d52681ceaee5583b81c4c0b5404d9
(cherry picked from commit cabeb96a792339e7dbfd16cb51a3ac9039812137)
2022-04-04 22:16:22 +00:00
..
CMakeLists.txt [Static Runtime] Add auto-generated out variant dispatchers (#72603) 2022-02-28 08:39:10 +00:00
deep_wide_pt_bench.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for some folders in caffe2/* (#67746) 2021-11-03 12:23:14 -07:00
deep_wide_pt.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for some folders in caffe2/* (#67746) 2021-11-03 12:23:14 -07:00
deep_wide_pt.h [NOOP][clangformat][codemod] Enable CLANGFORMAT for some folders in caffe2/* (#67746) 2021-11-03 12:23:14 -07:00
test_cpu_fusion.cc [Static Runtime] Add test that runs NNC fused kernels in parallel (#73256) 2022-02-28 17:44:45 +00:00
test_generated_ops.cc [Static Runtime] Fix a broken test & Add an out variant wrapper for mse_loss (#73574) 2022-03-02 04:36:31 +00:00
test_static_module.cc [SR] Force split_and_squeeze usage via graph transformation (#74274) 2022-03-29 19:13:40 +00:00
test_static_runtime.cc [Static Runtime] Fix handling relu in quantized linear relu dynamic op 2022-04-04 22:16:22 +00:00
test_utils.cc [Static Runtime] Enable all tests to run with TensorExpr fuser (#73263) 2022-02-24 00:34:34 +00:00
test_utils.h [SR] Graph pass to create owned refs of special IValues (#69835) 2022-02-02 19:30:50 +00:00