MCPcopy Create free account
hub / github.com/Vahe1994/AQLM / accumulate_sizes

Function accumulate_sizes

inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:229–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229int4 accumulate_sizes(const torch::Tensor& codebook_partition_sizes)
230{
231 int4 cumulative_sizes;
232 auto cumulative_size = &cumulative_sizes.x;
233 int i = 0;
234 int last = 0;
235 assert(codebook_partition_sizes.size(0) <= 4);
236 for (; i < codebook_partition_sizes.size(0); ++i, ++cumulative_size)
237 {
238 *cumulative_size = codebook_partition_sizes[i].item<int>() + last;
239 last = *cumulative_size;
240 }
241 // fill in the rest with unreachable.
242 for (; i < 4; ++i, ++cumulative_size)
243 {
244 *cumulative_size = last*10;
245 }
246 return cumulative_sizes;
247}
248
249torch::Tensor code1x16_matmat_dequant(
250 const torch::Tensor& input,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected