| 7 | |
| 8 | |
| 9 | class 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 [] |
no outgoing calls
searching dependent graphs…