Commit Graph

65 Commits

Author SHA1 Message Date
Summer Deng
509fb77b70 Adjust bound_shape_inferencer to take 4 inputs for FCs (#41934)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41934

The model exported from online training workflow with int8 quantization contains FCs with 4 inputs. The extra input is the quant_param blob. This diff is to adjust the bound_shape_inferencer and int8 op schema to get shape info for the quant_param input.

Test Plan:
```
buck test caffe2/caffe2/opt:bound_shape_inference_test
```

Reviewed By: yinghai

Differential Revision: D22683554

fbshipit-source-id: 684d1433212a528120aba1c37d27e26b6a31b403
2020-08-05 18:44:48 -07:00
Ashkan Aliabadi
c8deca8ea8 Update pthreadpool to pthreadpool:029c88620802e1361ccf41d1970bd5b07fd6b7bb. (#40524)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/40524

Reviewed By: ezyang

Differential Revision: D22215742

Pulled By: AshkanAliabadi

fbshipit-source-id: ef594e0901337a92b21ddd44e554da66c723eb7c
2020-07-09 10:00:36 -07:00
Shai Szulanski
0ddaaf6a92 [codemod][caffe2] Run clang-format - 5/7
Summary:
This directory is opted-in to clang-format but is not format-clean. This blocks continuous formatting from being enabled on fbcode, and causes hassle for other codemods that leave inconsistent formatting. This diff runs clang-format, which is widely used and considered safe.

If you are unhappy with the formatting of a particular block, please *accept this diff* and then in a stacked commit undo the change and wrap that code in `// clang-format off` and `// clang-format on`, or `/* clang-format off */` and `/* clang-format on */`.

drop-conflicts

Test Plan: sandcastleit

Reviewed By: jerryzh168

Differential Revision: D22311706

fbshipit-source-id: 1ca59a82e96156a4a5dfad70ba3e64d44c5e762a
2020-06-30 15:45:11 -07:00
Summer Deng
597cb04b2f Use Int8QuantParamsBlob to pass the scale and zeropoint params (#40494)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40494

Resubmit the diff because D22124313 (1ec4337b7d) was reverted due to CI test failures
Added the int8_gen_quant_params.cc to CMakeList.txt to fix the CI failures

Test Plan: buck test caffe2/caffe2/quantization/server:

Reviewed By: hx89

Differential Revision: D22204244

fbshipit-source-id: a2c8b668f199cc5b0c5894086f554f7c459b1ad7
2020-06-24 10:20:16 -07:00
Luca Wehrstedt
2acee6dc93 Revert D22124313: Use Int8QuantParamsBlob to pass the scale and zeropoint params
Test Plan: revert-hammer

Differential Revision:
D22124313

Original commit changeset: 6b5c1974c0fc

fbshipit-source-id: 87a9a64c323be40db5d7d584029efa10c779dfa1
2020-06-23 05:54:44 -07:00
Summer Deng
1ec4337b7d Use Int8QuantParamsBlob to pass the scale and zeropoint params (#40390)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40390

Change the Int8FC/Int8Quantize op interface to use Int8QuantParamsBlob as the qparam input blob format when needed.

Test Plan:
```
 buck test caffe2/caffe2/quantization/server:
```

Reviewed By: hx89

Differential Revision: D22124313

fbshipit-source-id: 6b5c1974c0fc5928f72773495f0da8d0eb9b98c9
2020-06-23 00:45:21 -07:00
Haixin Liu
ddd45ae919 Extend int8 FC op to take scale and zero point from input
Summary: Extend int8 FC op to take scale and zero point from input to support int8 PTQ productization of online training models.

Test Plan: buck test caffe2/caffe2/quantization/server:fully_connected_dnnlowp_op_test

Reviewed By: csummersea

Differential Revision: D21944884

fbshipit-source-id: 2094827da903f3993afe4f8cf6e70286b195321d
2020-06-13 02:34:45 -07:00
Haixin Liu
2bab9149cc Extend int8 quantize op to take scale and zero point from input
Summary: Extend int8 quantize op to take scale and zero point from input to support int8 PTQ productization of online training models.

Test Plan: buck test caffe2/caffe2/quantization/server:quantize_dnnlowp_op_test

Reviewed By: csummersea

Differential Revision: D21939660

fbshipit-source-id: 7ce2fbf9cd8a990c270f2187a49b1578ce76bc37
2020-06-12 09:28:51 -07:00
Michael Ranieri
af9c3a3652 uniform_int_distribution does not support uint8_t (#37260)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37260

List of supported types here:
https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution

Test Plan: CircleCI green, test compiles and passes on msvc.

Reviewed By: malfet

Differential Revision: D21237280

fbshipit-source-id: 51b09b87511e35bfe8a57ecd48ed772d587dba9b
2020-04-27 13:09:39 -07:00
James Donald
7ad03855dc Fix 'template' keyword warning with clang-cl and clang.exe (#32104)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/32104

Fixes these warnings:
```
xplat\caffe2\caffe2Windows#header-mode-symlink-tree-only,headers\caffe2\operators\quantized\int8_conv_op.h(96,17): warning: use 'template' keyword to treat 'data' as a dependent template name
            W.t.data<uint8_t>(),
                ^
                template
xplat\caffe2\caffe2Windows#header-mode-symlink-tree-only,headers\caffe2\operators\quantized\int8_conv_op.h(97,17): warning: use 'template' keyword to treat 'data' as a dependent template name
            B.t.data<int32_t>(),
                ^
                template
```

Test Plan: Tested locally with clang-cl and CI for other toolchains

Reviewed By: boguscoder

Differential Revision: D19353563

fbshipit-source-id: c28afb8c1ad72fd77ef82556ba89fcf09100d1f9
2020-01-14 20:09:35 -08:00
Supriya Rao
6d9a9e379d Fix segfault in caffe2 slice test (#31801)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31801

Try to fix issue #30764

Test Plan:
python test/onnx/test_utility_funs.py TestUtilityFuns

Imported from OSS

Differential Revision: D19315046

fbshipit-source-id: de3595969280e4ebe762cb098ff0891f8b5a9a90
2020-01-08 17:13:29 -08:00
Sebastian Messmer
643ca5def2 Replace c10::guts::stuff with std::stuff (#30915)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30915

Since we now have C++14, we don't need these c10::guts helpers anymore
ghstack-source-id: 95777609

Test Plan: waitforsandcastle

Differential Revision: D18869639

fbshipit-source-id: 97716f932297c64c6e814410ac47b444c33d4e2e
2019-12-16 13:57:19 -08:00
Supriya Rao
980aead1f8 Add support for quantized slice conversion (#30498)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30498

Updated Int8SliceOp to accept dim, start and end index similar to Pytorch.

Test Plan:
python test/onnx/test_pytorch_onnx_caffe2_quantized.py TestQuantizedOps.test_slice

Imported from OSS

Differential Revision: D18740519

fbshipit-source-id: 2313f37a4936edb150ce04911b241e591e191801
2019-12-03 14:37:59 -08:00
Brian Wignall
e7fe64f6a6 Fix typos (#30606)
Summary:
Should be non-semantic.

Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30606

Differential Revision: D18763028

Pulled By: mrshenli

fbshipit-source-id: 896515a2156d062653408852e6c04b429fc5955c
2019-12-02 20:17:42 -08:00
Supriya Rao
2599b9b551 Add output_size argument to caffe2 Int8ResizeNearest (#30202)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30202

Pytorch Upsample operator has output_size as an argument.
For quantized tensor inputs we cannot get the input_size to calculate the width and height scale factor.
Instead we pass the output_size directly to caffe2 to calculate the scale factors.

Test Plan:
python test/onnx/test_pytorch_onnx_caffe2_quantized.py TestQuantizedOps.test_upsample

Imported from OSS

Differential Revision: D18631478

fbshipit-source-id: 38a39129bc863f4ecf2293acc068e40ab7edc825
2019-11-26 06:54:02 -08:00
David Reiss
77e8dba620 Disable Int8Transpose test
Summary: It's failing in the FB internal build because we don't enable that op.

Test Plan: buck test //xplat/caffe2:caffe2_testAndroid

Reviewed By: supriyar

Differential Revision: D17139694

fbshipit-source-id: 8091b71ff826466f3e2e1b4d6f87b9b50d1def20
2019-08-30 15:21:23 -07:00
Yanghan Wang
8cd45b4c46 relax roi_width/roi_height check to non-negative
Summary: Pull Request resolved: https://github.com/fairinternal/detectron2/pull/260

Test Plan: sandcastle.

Reviewed By: ppwwyyxx

Differential Revision: D17127067

fbshipit-source-id: ddca51fa0dab1e683f8c3709e105b6cbdf8b78b0
2019-08-29 21:18:40 -07:00
David Reiss
d704097d33 Add Int8Transpose operator (#16382)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16382

Adding an Int8TransposeOp that inherits from TransposeOp.
Small refactoring to normal TransposeOp to move main logic into a TransposeImpl
function.

Test Plan: int8_test.cc

Reviewed By: supriyar

Differential Revision: D13822715

fbshipit-source-id: a4d61bdf8e4e1d3f2e30b86d325810ed44c21635
2019-08-29 16:06:25 -07:00
Yanghan Wang
ad64789a1e add aligned option to RoIAlign
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23706

Reviewed By: ppwwyyxx

Differential Revision: D16615823

fbshipit-source-id: fd9152af8bc979cb04044413e66af349b032a99d
2019-08-07 21:22:33 -07:00
Haixin Liu
7f130c8494 Expose the quantized inputs and output of dynamic quantized int8 FC operator for debugging (#23566)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23566

Currently if we use dynamic quantization we don't have the access to the internally quantized inputs and output for debugging.

To make the debugging easier, this diff adds a debug feature to expose the quantized X, W and Y for debugging if debug outputs are attached to the operator and caffe2_dnnlowp_force_slow_path flag is set.

The quantized inputs and output are exposed as the extra outputs.

The example Int8FC op with debug outputs appended looks like:
```
op {
  input: "X"
  input: "W"
  input: "b"
  output: "Y"
  output: "X_q"
  output: "W_q"
  output: "Y_q"
  name: ""
  type: "Int8FC"
  arg {
    name: "axis"
    i: 1
  }
  ...
}
```

Next need to expose the quantization parameters.

Reviewed By: jspark1105

Differential Revision: D16566753

fbshipit-source-id: acd855a172ee7993ddba8808f2af81b628ff9c02
2019-08-02 21:23:43 -07:00
Rui Zhu
19fe2b9db4 Adding quantized tensor shape/type info support for caffe2=>glow in caffe2 side (#18621)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18621

This diff added caffe2 support for onnxifi quantization.

Reviewed By: yinghai

Differential Revision: D14648767

fbshipit-source-id: 4ddb492cacbba6142305866e6dbb875880acaea3
2019-03-31 17:42:27 -07:00
Lutz Roeder
195cba500f Fix Caffe2 operator schemas (#15462) (#13229) (#18109)
Summary:
Maratyszcza harouwu yinghai

This is broken since #13065. `c_str()` returns a pointer that isn't permanent.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18109

Differential Revision: D14516622

Pulled By: ezyang

fbshipit-source-id: 7113d92eac4f61479c4c7b323cf78cc8aa00b17e
2019-03-18 21:00:43 -07:00
Jongsoo Park
39423fbdd4 add tensor and cost inference functions (#17684)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17684

Adding tensor and cost inference functions to more int8 operators.

Reviewed By: yinghai

Differential Revision: D14174746

fbshipit-source-id: dfad975fa75899565c8fb61f1b7747a9206ebd22
2019-03-06 23:34:02 -08:00
Sebastian Messmer
28b5df1c8f refactor caffe2 operator constructors - 6/9 (#17087)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17087

clangr codemod

Reviewed By: ezyang

Differential Revision: D14078525

fbshipit-source-id: 7cc03b30b0d4eb99818e35406be4119b27bdb1bc
2019-02-28 14:23:57 -08:00
Sebastian Messmer
8db403b9dc refactor caffe2 operator constructors - 7/9 (#17088)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17088

clangr codemod

also manually moved the constructor of a class from the .cpp file to the .h file.

Reviewed By: ezyang

Differential Revision: D14078531

fbshipit-source-id: 2adb4ac0ce523742da6cce3bc3b6c177b816c299
2019-02-28 14:23:53 -08:00
Oleg Bogdanov
260facfdea caffe2 | added missing operator source file (#17272)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17272

after windows-specific fixes were applied new file was left out of CMakeLists

Reviewed By: orionr

Differential Revision: D14140419

fbshipit-source-id: 6a6c652048ed196ec20241bc2a1d08cbe2a4e155
2019-02-20 09:28:29 -08:00
eyyub.sari@epitech.eu
e661dc27ff Int8GivenTensorFill Operator Schema fix typo (#16204)
Summary:
Hi,
caffe2/operators/quantized/int8_given_tensor_fill_op.cc expects the value array to be named "values" but the operator schema describe "value" (no s). I guess it is a little typo but it made me losing a bit of time before understanding why I had this error by passing "value" instead of "values":
```
[F int8_given_tensor_fill_op.h:95] Check failed: output->t.numel() == values_.numel() output size: 3 given size: 0
Aborted (core dumped)
```

Thanks,
Eyyüb Sari
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16204

Differential Revision: D14020476

Pulled By: ezyang

fbshipit-source-id: a8a46bfc44ec125e7925ce4b7c79fdf99c890a50
2019-02-10 20:08:45 -08:00
Oleg Bogdanov
30a6feda84 caffe2 | MSVS compatibility fixes (#16765)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16765

Code changes required to build caffe2 for windows with toolchain used by FB.

Reviewed By: orionr

Differential Revision: D13953258

fbshipit-source-id: 651823ec9d81ac70e32d4cce5bc2472434104733
2019-02-06 09:47:01 -08:00
Jerry Zhang
2af95d8e3e Back out "[pt1][tensor] Change ConvPoolOp<Context>::SetOutputSize to ConvPoolOp<Context>::GetOutputSize" (#16516)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16516

Original commit changeset: 64abce3dbaed

Reviewed By: dzhulgakov

Differential Revision: D13863715

fbshipit-source-id: f1923fdca4a1a82768d9c280a8493ff15a7eb2ba
2019-01-30 12:50:38 -08:00
Jerry Zhang
52ca4b86db Change SetOutputSize in ConvTransposeUnpoolBaseOp (#16179)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16179

to avoid passing partially initialized Tensor around.

Reviewed By: ezyang

Differential Revision: D13744009

fbshipit-source-id: 4c545765e1cd164b3e87ce08ec4c1cb1e37e2b8f
2019-01-28 18:28:11 -08:00
Jerry Zhang
ff963d4b9f Change ConvPoolOp<Context>::SetOutputSize to ConvPoolOp<Context>::GetOutputSize (#16273)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16273

Previously we have SetOutputSize which accept a partially initialized Output Tensor and set it to the correct size,
the diff change this to GetOutputSize that returns the correct size instead.
e.g.
```
auto* Y = Output(0);
ConvPoolOp<Context>::SetOutputSize(X, Y, channels);
...
Y->mutable_data<T>...
```
-->
```
auto sizes = ConvPoolOp<Context>::GetOutputSize(X, channels);
auto* Y = Output(0, sizes, at::dtype<T>());
```

Reviewed By: dzhulgakov

Differential Revision: D13736281

fbshipit-source-id: 64abce3dbaed0b375098463333dfd0ea5a3b1945
2019-01-28 15:56:34 -08:00
JerryShih
0dfdc2cbdb Update int8_simd.h (#13859)
Summary:
If we use clang with sse4 support, we will have the function redefinition
error between [1] and [2]. This patch try to add some checkings to fix this
problem.

I just turn on USE_NATIVE_ARCH with clang, then I hit the redefinition error.

[1]
caffe2/operators/quantized/int8_simd.h
[2]
third_party/gemmlowp/gemmlowp/fixedpoint/fixedpoint_sse.h
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13859

Differential Revision: D13095694

Pulled By: ezyang

fbshipit-source-id: c65166e4d5a04bb54e2b82c52740af00116ccb0d
2019-01-16 23:19:46 -08:00
Jerry Zhang
d277f77da2 Tensor reinitialization codemod - 3/5 (#15912)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15912

Codemod generated with clangr shard mode, 25 files per diff,
To eliminiate partially initialized Tensor, we split the initialization of local Tensor variables into two steps, first declare un uninitialized Tensor, and
call `ReinitializeTensor` to initialize it.
motivation: https://github.com/pytorch/pytorch/pull/12407

Reviewed By: dzhulgakov

Differential Revision: D13586734

fbshipit-source-id: 8485d2c51225343961351c7a2e8f95055534f9a9
2019-01-16 19:49:01 -08:00
Jerry Zhang
fd0ed2e298 Tensor reinitialization codemod - 4/5 (#15967)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15967

Codemod generated with clangr shard mode, 25 files per diff,
To eliminiate partially initialized Tensor, we split the initialization of local Tensor variables into two steps, first declare un uninitialized Tensor, and
call `ReinitializeTensor` to initialize it.
motivation: https://github.com/pytorch/pytorch/pull/12407

Reviewed By: smessmer

Differential Revision: D13586735

fbshipit-source-id: eae2d79e1107a2e813ce3809e690af4706aaa9ca
2019-01-11 16:41:19 -08:00
Marat Dukhan
9ad6ada9de Update QNNPACK (#15561)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15561

- Update QNNPACK submodule to master (API-incompatible)
- Do matching changes in Caffe2 Int8 operators

Reviewed By: dreiss

Differential Revision: D13551322

fbshipit-source-id: 066f9087061167f7d7cfbc1c8f8628dfa93d056e
2018-12-27 11:59:54 -08:00
Jerry Zhang
994f72ee3e Tensor construction codemod(ResizeLike) - 6/7 (#15137)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15137

Codemod generated with clangr shard mode, 25 files per diff,
motivation: https://github.com/pytorch/pytorch/pull/12407

Reviewed By: ezyang

Differential Revision: D13419736

fbshipit-source-id: f4ad7b9582c2f809258169b7fef9adbca7063d99
2018-12-13 12:47:33 -08:00
Marat Dukhan
bf1d411dbf Switch Int8Softmax, Int8Relu, and Int8LeakyRelu to QNNPACK (#14933)
Summary:
Int8Softmax: 4x-5x speedup compared to previous implementation
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14933

Differential Revision: D13406820

Pulled By: Maratyszcza

fbshipit-source-id: ea8cbe1b861ddb7ff1b851d06d52c6fd6d04ed01
2018-12-11 00:49:06 -08:00
Marat Dukhan
b0909ea6a0 Switch Int8Sigmoid to QNNPACK (#14883)
Summary:
50x-100x speedup compared to current version.
Also, fixes a bug in the current version when batch size exceeds 1 (current version processes only the first image in this case).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14883

Differential Revision: D13390655

Pulled By: Maratyszcza

fbshipit-source-id: 1b33a97bf2d0866d38faa2b42e64fd2859017898
2018-12-08 02:47:29 -08:00
Marat Dukhan
bd3eb87258 Switch Int8MaxPool operator to QNNPACK (#14832)
Summary:
1.6-2.4X speedup on ARM when compiled with gcc
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14832

Differential Revision: D13358160

Pulled By: Maratyszcza

fbshipit-source-id: 39e9791886fac62650bb53a9df341889f0bb5d49
2018-12-06 15:14:28 -08:00
Marat Dukhan
55092b1cc6 Validate matching input shapes in Int8Add operator (#14520)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14520

Default engine doesn't support broadcast semantics in Int8Add operator. This patch adds a check that shapes are equivalent.

Reviewed By: bertmaher

Differential Revision: D13250922

fbshipit-source-id: 8526d07723bd9a34d54dee04d121c57f8b33c481
2018-12-05 12:00:23 -08:00
Marat Dukhan
90b1196ac4 Switch Int8AveragePool operator to QNNPACK (#14783)
Summary:
2.2-2.9X better performance on ARM when compiled with gcc (same bad perf when compiled with Clang)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14783

Differential Revision: D13332680

Pulled By: Maratyszcza

fbshipit-source-id: 4c1138500c6b3026335e9bfe5f6be43b1ae2cefb
2018-12-05 10:18:42 -08:00
Marat Dukhan
9e1805d38e Switch Int8ChannelShuffle operator to QNNPACK (#14362)
Summary:
1.8-2.2X better performance on ARM devices
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14362

Reviewed By: jerryzh168

Differential Revision: D13192312

Pulled By: Maratyszcza

fbshipit-source-id: 0d3dff067e300c7d741c42615b61246cbf09a829
2018-11-26 17:43:32 -08:00
Marat Dukhan
2681852438 Switch Int8Add operator to QNNPACK (#14089)
Summary:
- Improved single-threaded performance due to optimized low-level micro-kernels
- Improved parallelization (previously was parallelized across images in a batch and pixels only, now within channels as well)
- Slightly different result due to different implementation of fixed-point arithmetics (no accuracy loss expected)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14089

Differential Revision: D13110135

Pulled By: Maratyszcza

fbshipit-source-id: 1f149394af5c16940f79a3fd36e183bba1be2497
2018-11-18 23:57:57 -08:00
Marat Dukhan
6d9a7d0e60 Rename neon2sse.h to NEON_2_SSE.h to match upstream repo
Summary:
- NEON2SSE is a header that implements NEON intrinsics on top fo SSE intrinsics
- Upstream repo provides NEON_2_SSE.h header, but internally it was imported as neon2sse.h
- This patch fix incompatibilities between internal and upstream versions

Reviewed By: hlu1

Differential Revision: D13096755

fbshipit-source-id: 65e1df9a2a5e74bd52c9aee9be27469ba938cd8c
2018-11-16 21:41:53 -08:00
Jongsoo Park
90ea61800f operators/quantized/server -> quantization/server (#13660)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13660

Any change in server side quantized operator was triggering ios-sanity-check with more than 5 hours testing time. I suspect this was because the operator code was synced with xplat directory. This diff moves server side quantized operators to caffe2/caffe2/quantization/server to avoid this issue.

Reviewed By: hx89

Differential Revision: D12955420

fbshipit-source-id: b6c824b9de5e2a696f8c748e1b2c77d81d46746b
2018-11-07 22:54:13 -08:00
Jongsoo Park
216c5d0bdc caching packed matrix (#13626)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13626

Reuse pack matrix of weights.

Reviewed By: dskhudia

Differential Revision: D12916630

fbshipit-source-id: f0ec5734f5506134a79d9c0601146488e15c3afe
2018-11-07 12:03:39 -08:00
Yiming Wu
94fe8faa00 new QNNPACK dwconv support and tests (#13652)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13652

new dwconv 3x3 5x5 tests provided

Reviewed By: Maratyszcza

Differential Revision: D12951866

fbshipit-source-id: f853bb7412a724de594ed36c6b2b69ec268d6464
2018-11-07 12:03:35 -08:00
Jongsoo Park
10fdcf748a swap with empty vector to force deallocation (#13625)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13625

v.clear() doesn't guarantee deallocation and it was causing memory capacity issues

Reviewed By: jianyuh

Differential Revision: D12941938

fbshipit-source-id: b9c80828b122a44e883b32f43b5d8dfb36065773
2018-11-07 08:33:34 -08:00
Jerry Zhang
4794da03f8 Rename ndim() -> dim() - 4/6
Summary:
Codemod generated with clangr shard mode, 50 files per diff,
clangr code(ndim()->dim()): diffusion/FBS/browse/master/fbcode/caffe2/caffe2/fb/codemods/TensorMethodRename.cpp

Reviewed By: ezyang

Differential Revision: D12935774

fbshipit-source-id: 2a7cb7da534da73b61f01eb0ff124abf193309ee
2018-11-07 07:30:09 -08:00
Marat Dukhan
7d64c9df39 Remove C2GEMMContext (#13443)
Summary:
C2GEMMContext is a remnant of old times when Int8 ops used gemmlowp.
It is no longer needed: formerly gemmlowp-based ops use QNNPACK with pthreadpool interface, and other ops (Int8Add, Int8ChannelShuffle) use Caffe2 thread pool interface directly.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13443

Differential Revision: D12887773

Pulled By: Maratyszcza

fbshipit-source-id: bd2732e2c187b399c8a82efebdd244457720256b
2018-11-06 21:50:53 -08:00