3 #include "caffe2/core/operator.h" 4 #include "caffe2/operators/conv_op.h" 5 #include "caffe2/quantization/server/conv_pool_dnnlowp_op_base.h" 6 #include "caffe2/quantization/server/fbgemm_pack_blob.h" 7 #include "caffe2/quantization/server/fully_connected_dnnlowp_op.h" 11 using FCFp32Op = FullyConnectedOp<CPUContext>;
14 :
public DNNLowPOp<std::uint8_t, FCFp32Op> {
17 const OperatorDef& operator_def,
21 bool RunOnDevice()
override;
25 bool quantize_channelwise_;
26 int nbits_in_non_outlier_;
28 INPUT_TAGS(FILTER, BIAS);
49 USE_CONV_POOL_DNNLOWP_OPERATOR_BASE_FUNCTIONS(std::uint8_t,
ConvFp32Op);
52 bool RunOnDevice()
override;
55 bool TakeDepthWise3x3FastPath_();
56 bool TakeDepthWise3x3x3FastPath_();
57 bool TakeGConvFastPath_();
59 bool quantize_groupwise_;
60 int nbits_in_non_outlier_;
62 INPUT_TAGS(FILTER, BIAS);
73 vector<dnnlowp::TensorQuantizationParams>& qparams,
74 vector<
typename std::make_signed<T>::type>& w_quantized,
78 void ComputeColumnOffsets(
82 const vector<dnnlowp::TensorQuantizationParams>& qparams,
83 vector<int32_t>& col_offsets);
88 fbgemm::CompressedSparseColumn* ExtractOutlierMatrix(
92 int nbits_in_non_outlier,
93 vector<std::int8_t>& W_quantized);
Blob is a general container that hosts a typed pointer.
The CPU Context, representing the bare minimum of what a Context class in Caffe2 should implement...
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Pack a weight matrix that can be used by DNNLOWP Int8Conv operators.
A convenient base class for C2 operators with DNNLOWP engine.