Skip to content

Commit 420f782

Browse files
authored
[CPU] Fix ref path of DA8W4 cpp kernel (#2444)
1 parent 5a50667 commit 420f782

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torchao/csrc/cpu/da8w4_linear.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ da8w4_linear_prepack_impl(
7070
at::Tensor compensation = weight_sub_qzero.sum(-1);
7171
compensation = compensation.permute({0, 2, 1}).contiguous().to(at::kInt);
7272

73+
#if defined(CPU_CAPABILITY_AVX512)
7374
if (cpublas_could_pack()) {
7475
blocked_weight = at::empty({Nc, Kc, block_k, block_n / 2}, weight.options());
7576
auto weight_ptr = weight_reordered.data_ptr<uint8_t>();
@@ -105,7 +106,9 @@ da8w4_linear_prepack_impl(
105106
}
106107
}
107108
});
108-
} else {
109+
} else
110+
#endif
111+
{
109112
// Pack weight: two int4 -> one int8
110113
using namespace at::indexing;
111114
at::Tensor even_columns =

0 commit comments

Comments
 (0)