diff --git a/torchao/experimental/ops/linear_8bit_act_xbit_weight/op_linear_8bit_act_xbit_weight_aten.cpp b/torchao/experimental/ops/linear_8bit_act_xbit_weight/op_linear_8bit_act_xbit_weight_aten.cpp index 24d4008969..0307f05192 100644 --- a/torchao/experimental/ops/linear_8bit_act_xbit_weight/op_linear_8bit_act_xbit_weight_aten.cpp +++ b/torchao/experimental/ops/linear_8bit_act_xbit_weight/op_linear_8bit_act_xbit_weight_aten.cpp @@ -60,7 +60,7 @@ "_linear_8bit_act_" #weight_nbit "bit_weight", \ &linear_meta); -TORCH_LIBRARY(torchao, m) { +TORCH_LIBRARY_FRAGMENT(torchao, m) { DEFINE_OP(1); DEFINE_OP(2); DEFINE_OP(3); diff --git a/torchao/experimental/ops/mps/linear_fp_act_xbit_weight_aten.mm b/torchao/experimental/ops/mps/linear_fp_act_xbit_weight_aten.mm index 162b5ab83c..2aeb7f4460 100644 --- a/torchao/experimental/ops/mps/linear_fp_act_xbit_weight_aten.mm +++ b/torchao/experimental/ops/mps/linear_fp_act_xbit_weight_aten.mm @@ -163,7 +163,7 @@ Tensor pack_weights_cpu_kernel(const Tensor& W) { return B; } -TORCH_LIBRARY(torchao, m) { +TORCH_LIBRARY_FRAGMENT(torchao, m) { m.def("_pack_weight_1bit(Tensor W) -> Tensor"); m.def("_pack_weight_2bit(Tensor W) -> Tensor"); m.def("_pack_weight_3bit(Tensor W) -> Tensor");