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

Method mixed_fp16_quantize

deepspeed/runtime/quantize.py:123–127  ·  view source on GitHub ↗
(self, input, input_q, index)

Source from the content-addressed store, hash-verified

121 return output
122
123 def mixed_fp16_quantize(self, input, input_q, index):
124 if self.q_mixed_fp16 and self.q_start_bits[index] >= (self.q_target_bits - 1):
125 input_q = input * self.quantize_real_ratio + (1 - self.quantize_real_ratio) * input_q
126 return input_q
127 return input_q
128
129 def compute_quantization(self, input, index=0, factor=1):
130 # fixing the quantization bits based on the training steps

Callers 1

compute_quantizationMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected