MCPcopy Create free account
hub / github.com/Niko1221/Strata / block_bytes

Function block_bytes

engine/metal/src/ref_quant.cpp:44–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44int block_bytes(int t) {
45 switch (t) {
46 case F32: return 4; case F16: case BF16: return 2;
47 case Q4_0: return 18; case Q5_0: return 22; case Q5_1: return 24; case Q8_0: return 34; case IQ4_NL: return 18; case Q2_0: return 18; case NVFP4: return 36;
48 case Q2_K: return 84; case Q3_K: return 110; case Q4_K: return 144; case Q5_K: return 176; case Q6_K: return 210;
49 case IQ2_XXS: return 66; case IQ2_XS: return 74; case IQ2_S: return 82; case IQ3_XXS: return 98;
50 case IQ3_S: return 110; case IQ4_XS: return 136; case IQ1_S: return 50; case IQ1_M: return 56;
51 case TQ2_T: return 34; case TQK6: return 26; case TQK7: return 30;
52 case TQP5: return 42; case TQP6: return 50; case TQP7: return 58;
53 }
54 std::fprintf(stderr, "ref: unknown type %d\n", t);
55 std::exit(2);
56}
57
58float f16_to_f32(uint16_t h) {
59 const uint32_t sign = (uint32_t)(h >> 15) & 1u;

Callers 9

dequantFunction · 0.70
random_blocksFunction · 0.70
type_geometryFunction · 0.70
row_bytesFunction · 0.70
mainFunction · 0.50
syntheticFunction · 0.50
geometry_testsFunction · 0.50
check_typeFunction · 0.50
mainFunction · 0.50

Calls 1

exitFunction · 0.85

Tested by 5

mainFunction · 0.40
syntheticFunction · 0.40
geometry_testsFunction · 0.40
check_typeFunction · 0.40
mainFunction · 0.40