DeepSpeed
DeepSpeed copied to clipboard
add quant unit test
This PR adds unit test for ds_quantize kernel, In this example, we test over torch.float16 data format.
We tested in following two cases:
- INT8 quant/dequant over tensor in 1 group.
Here we form 1 single quantization group. We quantize
input_tensorwith data format oftorch.float16totorch.int8, and then convert back totorch.float16tensor.
- INT4 quant/dequant over tensor partitioned into 16 groups.
Here we form 16 quantization groups. We quantize
input_tensorwith data format oftorch.float16toint4, then convert back totorch.float16tensor.
TODOs:
- [x] fix unit-tests compiling error of
undefined symbol: curandSetPseudoRandomGeneratorSeedby adding-lcurandflag insideop_builder/quantizer.py - [x] create new folder for quantizer tests as
tests/unit/ops/quantizer
The C++/CUDA APIs of the kernels are subject to refactoring, but it will lead to another PR.
CC: @awan-10 @cmikeh2