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

Function ds_quantize

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

Source from the content-addressed store, hash-verified

11
12template <typename T>
13at::Tensor ds_quantize(at::Tensor& vals, int groups, int bits)
14{
15 auto t_size = vals.sizes();
16 int size = 1;
17 for (auto dim : t_size) size *= dim;
18
19 if ((((size / groups) - 1) / 4096 + 1) <= 256) {
20 launch_fake_quantize_kernel(
21 (T*)vals.data_ptr(), size, groups, bits, at::cuda::getCurrentCUDAStream());
22 }
23 return vals;
24}
25
26template <typename T>
27at::Tensor ds_sr_quantize(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