File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
torchao/experimental/ops/groupwise_lowbit_weight_lut Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < torchao/experimental/ops/groupwise_lowbit_weight_lut/op_groupwise_lowbit_weight_lut-impl.h>
2
+
3
+ #define DEFINE_OP (weight_nbit ) \
4
+ Tensor _op_out_##weight_nbit( \
5
+ RuntimeContext& ctx, \
6
+ const Tensor& activations, \
7
+ const Tensor& packed_weights, \
8
+ const int64_t & scale_group_size, \
9
+ const int64_t & lut_group_size, \
10
+ const int64_t & n, \
11
+ const int64_t & k, \
12
+ Tensor& out) { \
13
+ (void )ctx; \
14
+ linear_out_cpu<weight_nbit>( \
15
+ activations, \
16
+ packed_weights, \
17
+ scale_group_size, \
18
+ lut_group_size, \
19
+ n, \
20
+ k, \
21
+ out); \
22
+ return out; \
23
+ } \
24
+ EXECUTORCH_LIBRARY ( \
25
+ torchao, \
26
+ " _linear_groupwise_" #weight_nbit " bit_weight_with_lut.out" , \
27
+ _op_out_##weight_nbit)
28
+
29
+ DEFINE_OP(1 );
30
+ DEFINE_OP (2 );
31
+ DEFINE_OP (3 );
32
+ DEFINE_OP (4 );
You can’t perform that action at this time.
0 commit comments