MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __init__

Method __init__

deepspeed/inference/quantization/utils.py:103–108  ·  view source on GitHub ↗
(self, config: Dict, dtype: torch.dtype)

Source from the content-addressed store, hash-verified

101class DeQuantizer:
102
103 def __init__(self, config: Dict, dtype: torch.dtype) -> None:
104 self.config = config
105 self.dtype = dtype
106 assert self.config['num_bits'] == 4 or self.config[
107 'num_bits'] == 8, 'Only INT4 and INT8 quantization is supported.'
108 assert self.config['symmetric'] == False, 'Only asymmetric quantization is supported at this moment.'
109
110 def dequantize(self, tensor: Tensor, quant_scale: Tensor, quant_min: Tensor) -> Tensor:
111 # Use customized CUDA quantization kernel if possible.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected