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

Function quantize_weight

deepspeed/module_inject/module_quantize.py:24–25  ·  view source on GitHub ↗
(weight)

Source from the content-addressed store, hash-verified

22 """
23
24 def quantize_weight(weight):
25 return weight.to(torch.int8)
26
27 def megatron_layer_quantize(layer):
28 layer.attention.query_key_value.weight.data = quantize_weight(layer.attention.query_key_value.weight.data)

Callers 2

megatron_layer_quantizeFunction · 0.85
bert_layer_quantizeFunction · 0.85

Calls 1

toMethod · 0.45

Tested by

no test coverage detected