Skip to content

Commit 977127d

Browse files
committed
oMerge branch 'int2'
2 parents 278094e + 722d08c commit 977127d

3 files changed

Lines changed: 266 additions & 156 deletions

File tree

src/kernels/dequantize.inl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ static auto PIQUANT_HOT dequant_generic(
9797
dequant_uint4_to_f32<ReduceOp>(static_cast<const uint4_t*>(in), static_cast<fp32_t*>(out), numel, scale, static_cast<std::int32_t>(zp));
9898
return;
9999
}
100+
if constexpr (std::is_same_v<In, std::uint8_t> && std::is_same_v<Out, bfp16_t>) {
101+
dequant_uint8_to_bf16<ReduceOp>(static_cast<const std::uint8_t*>(in), static_cast<bfp16_t*>(out), numel, scale, static_cast<std::int32_t>(zp));
102+
return;
103+
}
104+
if constexpr (std::is_same_v<In, uint4_t> && std::is_same_v<Out, bfp16_t>) {
105+
dequant_uint4_to_bf16<ReduceOp>(static_cast<const uint4_t*>(in), static_cast<bfp16_t*>(out), numel, scale, static_cast<std::int32_t>(zp));
106+
return;
107+
}
100108

101109

102110
if constexpr (std::is_same_v<uint4_t, In>) { // Special case for int4

0 commit comments

Comments
 (0)