19 #include <immintrin.h> 20 #include "caffe2/core/context.h" 21 #include "caffe2/core/operator.h" 22 #include "caffe2/utils/conversions.h" 23 #include "caffe2/utils/math.h" 28 void fp32_to_bfp16(
const float* source,
size_t size,
float* dest);
31 void fp32_to_bfp24(
const float* source,
size_t size,
float* dest);
34 void fp32_to_bfp14(
const float* source,
size_t size,
float* dest);
36 void fp32_to_bfp16_scalar(
const float* source,
size_t size,
float* dest);
39 void fp32_to_fp16(
const float* source,
size_t size,
float* dest);
42 void fp32_to_bfp16_round(
const float* source,
size_t size,
float* dest);
46 void (*Q)(
const float*, size_t,
float*),
48 class Engine = DefaultEngine,
49 bool TransposeWeight =
true>
52 USE_OPERATOR_CONTEXT_FUNCTIONS;
55 axis_(this->
template GetSingleArgument<int32_t>(
"axis", 1)),
56 axis_w_(this->
template GetSingleArgument<int32_t>(
"axis_w", 1)),
58 this->
template GetSingleArgument<bool>(
"float16_compute",
false)) {}
69 bool RunOnDevice()
override {
83 vector<int64_t> Y_shape_cache_;
86 bool float16_compute_;
90 void (*Q)(
const float*, size_t,
float*),
93 bool TransposeWeight =
true>
96 USE_OPERATOR_CONTEXT_FUNCTIONS;
98 const OperatorDef& operator_def,
101 axis_(this->
template GetSingleArgument<int32_t>(
"axis", 1)),
102 axis_w_(this->
template GetSingleArgument<int32_t>(
"axis_w", 1)),
104 this->
template GetSingleArgument<bool>(
"float16_compute",
false)) {}
116 bool DoRunWithType();
118 bool RunOnDevice()
override {
119 return DoRunWithType<
134 bool float16_compute_;
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 ...