MCPcopy Create free account
hub / github.com/microsoft/BitNet / gen_preprocess_code

Function gen_preprocess_code

utils/codegen_tl1.py:310–319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308 return kernel_code
309
310def gen_preprocess_code():
311 kernel_code = "\n\
312template<int K>\n\
313void preprocessor_k(void* B, void* LUT_Scales, void* QLUT) {{\n\
314 partial_max_reset((&(((bitnet_float_type*)LUT_Scales)[0])));\n\
315 per_tensor_quant(K, (&(((bitnet_float_type*)LUT_Scales)[0])), (&(((bitnet_float_type*)B)[0])));\n\
316 \n\
317 lut_ctor<K>((&(((int8_t*)QLUT)[0])), (&(((bitnet_float_type*)B)[0])), (&(((bitnet_float_type*)LUT_Scales)[0])));\n\
318}}\n"
319 return kernel_code
320
321def gen_transform_code(kernel_shape):
322 kernel_code = "\n\

Callers 1

codegen_tl1.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected