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

Class QuantizerBuilder

op_builder/quantizer.py:9–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class QuantizerBuilder(CUDAOpBuilder):
10 BUILD_VAR = "DS_BUILD_QUANTIZER"
11 NAME = "quantizer"
12
13 def __init__(self, name=None):
14 name = self.NAME if name is None else name
15 super().__init__(name=name)
16
17 def absolute_name(self):
18 return f'deepspeed.ops.quantizer.{self.NAME}_op'
19
20 def sources(self):
21 return [
22 'csrc/quantization/pt_binding.cpp',
23 'csrc/quantization/fake_quantizer.cu',
24 'csrc/quantization/quantize.cu',
25 'csrc/quantization/quantize_intX.cu',
26 'csrc/quantization/dequantize.cu',
27 'csrc/quantization/swizzled_quantize.cu',
28 'csrc/quantization/quant_reduce.cu',
29 ]
30
31 def include_paths(self):
32 return ['csrc/includes']
33
34 def extra_ldflags(self):
35 if not self.is_rocm_pytorch():
36 return ['-lcurand']
37 else:
38 return []

Callers 5

run_quantize_dsFunction · 0.90
run_dequantize_dsFunction · 0.90
run_quant_dequantFunction · 0.90
ds_quantizerFunction · 0.90

Calls

no outgoing calls

Tested by 4

run_quantize_dsFunction · 0.72
run_dequantize_dsFunction · 0.72
run_quant_dequantFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…