3 #include "caffe2/core/operator.h" 4 #include "caffe2/core/tensor.h" 8 constexpr
size_t k2b1bXBits = 2;
19 using ParallelFor = std::function<void(size_t, std::function<void(size_t)>)>;
22 std::vector<std::unique_ptr<TensorCPU>> XQs;
23 std::vector<std::unique_ptr<TensorCPU>> YQs;
24 std::unique_ptr<TensorCPU> WQ;
26 std::unique_ptr<TensorCPU> WQPacked;
27 std::unique_ptr<TensorCPU> WQN;
28 std::unique_ptr<TensorCPU> WQL1Norm;
30 std::unique_ptr<TensorCPU> scratch;
31 std::unique_ptr<TensorCPU> scratchColBuffer;
33 std::unique_ptr<TensorCPU> bias;
35 ParallelFor parallelFor{
nullptr};
38 void uniformQuantize2b1b(
const TensorCPU& X,
39 const std::vector<std::unique_ptr<TensorCPU>>& XQ,
41 float inter_center_distance);
45 inline size_t divRoundUp(
size_t x,
size_t d) {
return (x + d - 1) / d; }
50 std::unique_ptr<QConvState> create2b1bConvState(
Workspace* ws,
61 const float* WQNVdata,
62 const float* YQs0Vdata,
63 const float* YQs1Vdata,
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 ...