Skip to content

Commit d7f7bf2

Browse files
authored
Remove meta linear operation in cpp.
Differential Revision: D79401818 Pull Request resolved: #2731
1 parent 5bf05b6 commit d7f7bf2

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

torchao/experimental/ops/groupwise_lowbit_weight_lut/op_groupwise_lowbit_weight_lut-impl.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -104,30 +104,6 @@ Tensor linear_cpu(
104104
}
105105
#endif // USE_ATEN
106106

107-
#ifdef USE_ATEN
108-
template <int weight_nbit>
109-
at::Tensor linear_meta(
110-
const at::Tensor& activations,
111-
const at::Tensor& packed_weights,
112-
const int64_t& scale_group_size,
113-
const int64_t& lut_group_size,
114-
const int64_t& n,
115-
const int64_t& k) {
116-
auto input_sizes = activations.sizes().vec();
117-
TORCH_CHECK(
118-
!input_sizes.empty() && input_sizes.back() == k,
119-
"The last dimension of `activations` is ",
120-
input_sizes.back(),
121-
" but it must be equal to k=",
122-
k);
123-
124-
auto output_sizes = input_sizes;
125-
output_sizes.back() = n;
126-
127-
return at::empty(output_sizes, activations.options());
128-
}
129-
#endif // USE_ATEN
130-
131107
#ifdef USE_ATEN
132108
template <int weight_nbit>
133109
Tensor pack_weights_with_lut_cpu(

torchao/experimental/ops/groupwise_lowbit_weight_lut/op_groupwise_lowbit_weight_lut_aten.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@
3737
"_linear_groupwise_" #weight_nbit "bit_weight_with_lut.out", \
3838
&linear_out_cpu<weight_nbit>);
3939

40-
#define DEFINE_LINEAR_META_IMPL(weight_nbit) \
41-
m.impl( \
42-
"_linear_groupwise_" #weight_nbit "bit_weight_with_lut", \
43-
&linear_meta<weight_nbit>); \
44-
45-
4640
TORCH_LIBRARY_FRAGMENT(torchao, m) {
4741
DEFINE_PACK_OP(1);
4842
DEFINE_PACK_OP(2);
@@ -72,9 +66,4 @@ TORCH_LIBRARY_IMPL(torchao, Meta, m) {
7266
DEFINE_PACK_META_IMPL(2);
7367
DEFINE_PACK_META_IMPL(3);
7468
DEFINE_PACK_META_IMPL(4);
75-
76-
DEFINE_LINEAR_META_IMPL(1);
77-
DEFINE_LINEAR_META_IMPL(2);
78-
DEFINE_LINEAR_META_IMPL(3);
79-
DEFINE_LINEAR_META_IMPL(4);
8069
}

0 commit comments

Comments
 (0)