MCPcopy
hub / github.com/deepspeedai/DeepSpeed / get_q_props

Function get_q_props

tests/unit/ops/quantizer/test_quantize.py:40–47  ·  view source on GitHub ↗
(q_bits)

Source from the content-addressed store, hash-verified

38
39
40def get_q_props(q_bits):
41 q_range = 2**q_bits
42 q_min = -(2**(q_bits - 1))
43 q_max = (2**(q_bits - 1) - 1)
44
45 q_min = torch.IntTensor([q_min]).to(device=get_accelerator().device_name())
46 q_max = torch.IntTensor([q_max]).to(device=get_accelerator().device_name())
47 return q_range, q_max, q_min
48
49
50def get_scale_zero_point(q_bits, is_symmetric_quant, max, min, absmax, scales=None, zero_points=None):

Callers 2

get_scale_zero_pointFunction · 0.85
run_float_quantizeFunction · 0.85

Calls 4

get_acceleratorFunction · 0.90
toMethod · 0.45
IntTensorMethod · 0.45
device_nameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…