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

Method to

deepspeed/linear/quantization.py:118–126  ·  view source on GitHub ↗

Move the parameter to the given device. Then, if the device is a cuda device, quantize it.

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

116 return self.to(device, non_blocking=non_blocking)
117
118 def to(self, *args, **kwargs):
119 """
120 Move the parameter to the given device. Then, if the device is a cuda device,
121 quantize it.
122 """
123 tensor = super().to(*args, **kwargs)
124 self.quantizer.to(*args, **kwargs)
125 self._ensure_quantized(tensor)
126 return tensor
127
128
129class QuantizedLinear(nn.Linear):

Callers 4

offloadMethod · 0.95
cudaMethod · 0.95

Calls 1

_ensure_quantizedMethod · 0.95

Tested by 2