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

Method dequantized

deepspeed/linear/quantization.py:67–76  ·  view source on GitHub ↗

Return a tensor containing the dequantized weights of this parameter.

(self)

Source from the content-addressed store, hash-verified

65 assert tensor.dtype == self.quantization_config.q_dtype
66
67 def dequantized(self) -> torch.Tensor:
68 """
69 Return a tensor containing the dequantized weights of this parameter.
70 """
71 if get_accelerator().on_accelerator(self.data) and self.data.dtype == self.quantization_config.q_dtype:
72 with get_accelerator().stream(get_accelerator().current_stream(self.data.device)):
73 return self.quantizer.dequantize(self.data,
74 q_bits=self.quantization_config.q_bits,
75 q_mantisa_bits=self.quantization_config.mantissa_bits)
76 return self.data
77
78 def offload(self, revert=False):
79 if getattr(self, 'ds_offload', False):

Callers 3

full_weightMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80

Calls 5

get_acceleratorFunction · 0.90
on_acceleratorMethod · 0.45
streamMethod · 0.45
current_streamMethod · 0.45
dequantizeMethod · 0.45

Tested by

no test coverage detected