MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / ds_sr_quantize

Function ds_sr_quantize

deepspeed/ops/csrc/quantization/pt_binding.cpp:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename T>
27at::Tensor ds_sr_quantize(at::Tensor& vals, int groups, int bits)
28{
29 auto t_size = vals.sizes();
30 int size = 1;
31 for (auto dim : t_size) size *= dim;
32
33 if (((size / groups) / 4 / 1024) <= 256) {
34 launch_sr_fake_quantize_kernel(
35 (T*)vals.data_ptr(), size, groups, bits, at::cuda::getCurrentCUDAStream());
36 }
37 return vals;
38}
39
40template <typename T>
41at::Tensor ds_quantize_asym(at::Tensor& vals, int groups, int bits)

Callers

nothing calls this directly

Calls 2

data_ptrMethod · 0.80
sizesMethod · 0.45

Tested by

no test coverage detected