mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 15:28:40 +00:00
include/strata/quant/strata-quant-common.h replaces llama.cpp's ggml-common.h text (third_party/strata-ggml/strata-quant-common.h, deleted). tools/gen_quant_header.py writes it from tools/strata_quants.py BLOCK (every struct must add up to the bytes and values per block there, or nothing is written) and tools/strata_quant_tables.py (the codebooks; ksigns64 and iq1s_grid_gpu are computed from them). tools/test_quant_header.py: the header is current; every table equals strata_quant_tables.py and the GGUF reference (llama.cpp's ggml-common.h in the vendored test oracle) byte for byte; every declaration is the reference's token for token (comments and static_assert lines aside; the Metal iq1s_grid line is the one intended difference, Strata's since phase 1B); the static_asserts carry strata_quants' sizes; with a C++ compiler the header compiles and its sizes and tables hold at run time. The names (block_*, QK*, QI*/QR*, GGML_COMMON_DECL_* / GGML_COMMON_IMPL_*, GGML_TABLE_BEGIN) are unchanged, so every kernel compiles the same tokens. third_party/ggml/ggml-common.h forwards to the new file; src/quant/internal.hpp and the split engine's qdot.cuh include it by its new path; the Metal runtime's default path and the Mac package script take it from include/strata/quant. strata_quant_tables.py is now described as Strata's copy (gen_strata_quant_tables.py --check proves it still equals the reference). The trellis header (third_party/ggml/ggml-common-tq.h) is unchanged: Strata has no own copy of its codebook to generate it from.