Skip to content

Commit 1bad64b

Browse files
caogaofacebook-github-bot
authored andcommitted
Deprecate old quanzation / dequantization util functions. (#630)
Summary: Pull Request resolved: #630 Deprecate FloatToFusedNBitRowwiseQuantizedSBHalf, FusedNBitRowwiseQuantizedSBHalfToFloat, FloatToFused8BitRowwiseQuantizedSBFloat, and Fused8BitRowwiseQuantizedSBFloatToFloat. Reviewed By: dskhudia Differential Revision: D29121252 fbshipit-source-id: ea7eac6c0402f2a91a0319092ed5f3fc3ff53516
1 parent 201df1d commit 1bad64b

File tree

2 files changed

+0
-102
lines changed

2 files changed

+0
-102
lines changed

include/fbgemm/QuantUtils.h

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -254,23 +254,6 @@ FBGEMM_API void Requantize(
254254
int thread_id = 0,
255255
int num_threads = 1);
256256

257-
/**
258-
* Convert float inputs to rowwise quantized outputs.
259-
* bitrate specifies the number of bits in quantized output.
260-
* Scale and Bias are in fp16. Each row's Scale and Bias are stored in
261-
* the row itself (fused) at the end.
262-
*
263-
* @param bit_rate can be 2, 4, or 8
264-
* TODO(T91361248): deprecate and replace with
265-
* FloatOrHalfToFusedNBitRowwiseQuantizedSBHalf.
266-
*/
267-
FBGEMM_API void FloatToFusedNBitRowwiseQuantizedSBHalf(
268-
int bit_rate,
269-
const float* input,
270-
int input_rows,
271-
int input_columns,
272-
std::uint8_t* output);
273-
274257
/**
275258
* Convert float (fp32 or fp16) inputs to rowwise quantized outputs.
276259
* bitrate specifies the number of bits in quantized output.
@@ -287,22 +270,6 @@ FBGEMM_API void FloatOrHalfToFusedNBitRowwiseQuantizedSBHalf(
287270
int input_columns,
288271
std::uint8_t* output);
289272

290-
/**
291-
* Convert fused rowwise quantized inputs to float.
292-
* bitrate specifies the number of bits in quantized input.
293-
* Scale and Bias are in fp16. Each row's Scale and Bias are stored in
294-
* the row itself (fused) at the end.
295-
*
296-
* @param bit_rate can be 2, 4, or 8
297-
* TODO(T91361248): deprecate and replace with FusedNBitRowwiseQuantizedSBToFloatOrHalf.
298-
*/
299-
FBGEMM_API void FusedNBitRowwiseQuantizedSBHalfToFloat(
300-
int bit_rate,
301-
const uint8_t* input,
302-
int input_rows,
303-
int input_columns,
304-
float* output);
305-
306273
/**
307274
* Convert fused rowwise quantized inputs to float (fp32 or fp16).
308275
* bitrate specifies the number of bits in quantized input.
@@ -319,22 +286,6 @@ FBGEMM_API void FusedNBitRowwiseQuantizedSBHalfToFloatOrHalf(
319286
int input_columns,
320287
OutputType* output);
321288

322-
/**
323-
* Convert float inputs to rowwise quantized (8-bit) outputs.
324-
* Scale and Bias are in float. Each row's Scale and Bias are stored in
325-
* the row itself (fused) at the end.
326-
*
327-
* This version intentionally supports only 8-bit because we want to discourage
328-
* the usage of float scale and bias with 2 and 4 bit cases as that diminishes
329-
* the overall memory savings.
330-
* TODO(T91361248): deprecate and replace with FloatOrHalfToFused8BitRowwiseQuantizedSBFloat.
331-
*/
332-
FBGEMM_API void FloatToFused8BitRowwiseQuantizedSBFloat(
333-
const float* input,
334-
int input_rows,
335-
int input_columns,
336-
std::uint8_t* output);
337-
338289
/**
339290
* Convert float or half inputs to rowwise quantized (8-bit) outputs.
340291
* Scale and Bias are in float. Each row's Scale and Bias are stored in
@@ -351,21 +302,6 @@ FBGEMM_API void FloatOrHalfToFused8BitRowwiseQuantizedSBFloat(
351302
int input_columns,
352303
std::uint8_t* output);
353304

354-
/**
355-
* Convert fused rowwise quantized (8-bit) inputs to float outputs.
356-
* Scale and Bias are in float. Each row's Scale and Bias are stored in
357-
* the row itself (fused) at the end.
358-
*
359-
* This version intentionally supports only 8-bit because
360-
* the corresponding quantize version only supports 8-bit.
361-
* TODO(T91361248): deprecate and replace with Fused8BitRowwiseQuantizedSBFloatToFloatOrHalf.
362-
*/
363-
FBGEMM_API void Fused8BitRowwiseQuantizedSBFloatToFloat(
364-
const uint8_t* input,
365-
int input_rows,
366-
int input_columns,
367-
float* output);
368-
369305
/**
370306
* Convert fused rowwise quantized (8-bit) inputs to float or half outputs.
371307
* Scale and Bias are in float. Each row's Scale and Bias are stored in

src/QuantUtils.cc

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -609,16 +609,6 @@ void FloatOrHalfToFusedNBitRowwiseQuantizedSBHalf(
609609
}
610610
}
611611

612-
void FloatToFusedNBitRowwiseQuantizedSBHalf(
613-
int bit_rate,
614-
const float* input,
615-
int input_rows,
616-
int input_columns,
617-
std::uint8_t* output) {
618-
FloatOrHalfToFusedNBitRowwiseQuantizedSBHalf<float>(
619-
bit_rate, input, input_rows, input_columns, output);
620-
}
621-
622612
template <typename InputType>
623613
void FloatOrHalfToFused8BitRowwiseQuantizedSBFloatRef(
624614
const InputType* input,
@@ -674,15 +664,6 @@ void FloatOrHalfToFused8BitRowwiseQuantizedSBFloat(
674664
}
675665
}
676666

677-
void FloatToFused8BitRowwiseQuantizedSBFloat(
678-
const float* input,
679-
int input_rows,
680-
int input_columns,
681-
std::uint8_t* output) {
682-
FloatOrHalfToFused8BitRowwiseQuantizedSBFloat<float>(
683-
input, input_rows, input_columns, output);
684-
}
685-
686667
template <typename OutputType>
687668
void FusedNBitRowwiseQuantizedSBHalfToFloatOrHalfRef(
688669
int bit_rate,
@@ -751,16 +732,6 @@ void FusedNBitRowwiseQuantizedSBHalfToFloatOrHalf(
751732
}
752733
}
753734

754-
void FusedNBitRowwiseQuantizedSBHalfToFloat(
755-
int bit_rate,
756-
const uint8_t* input,
757-
int input_rows,
758-
int input_columns,
759-
float* output) {
760-
FusedNBitRowwiseQuantizedSBHalfToFloatOrHalf<float>(
761-
bit_rate, input, input_rows, input_columns, output);
762-
}
763-
764735
template <typename OutputType>
765736
void Fused8BitRowwiseQuantizedSBFloatToFloatOrHalfRef(
766737
const std::uint8_t* input,
@@ -802,15 +773,6 @@ void Fused8BitRowwiseQuantizedSBFloatToFloatOrHalf(
802773
}
803774
}
804775

805-
void Fused8BitRowwiseQuantizedSBFloatToFloat(
806-
const uint8_t* input,
807-
int input_rows,
808-
int input_columns,
809-
float* output) {
810-
Fused8BitRowwiseQuantizedSBFloatToFloatOrHalf<float>(
811-
input, input_rows, input_columns, output);
812-
}
813-
814776
#define INSTANTIATE_QuantizationFunctions(type) \
815777
template FBGEMM_API void \
816778
FloatOrHalfToFusedNBitRowwiseQuantizedSBHalfRef<type>( \

0 commit comments

Comments
 (0)