Repository navigation
gguf-radar 0.1.2
This release checks every tensor and six more block types for hidden data in zero-scale blocks, and it fixes a false positive in the readable text check.
Upgrade with:
pip install --upgrade git+https://github.com/Root0ne/gguf-radar@v0.1.2
Added
- Zero-scale blocks are now checked and cleaned in
Q4_0,Q5_0,Q2_K,Q3_K,Q5_KandQ6_Ktensors, as well as inQ8_0andQ4_Ktensors. File signatures and readable text are looked for in all of them. The flatness test is used forQ2_K,Q3_K,Q4_0andQ6_K, where real quantizer output was measured to be clearly apart from random bytes. It is not used forQ5_KandQ5_0, where it was not. - In
Q2_K,Q4_KandQ5_K, a block with a zerodand a non-zerodminis now counted, checked and cleaned. Its values are unused, and in a test model with very small weights most of the affectedQ4_Kblocks were of this kind.
Changed
- All tensors are scanned for zero-scale bytes. Before, the scan stopped after 128 tensors, so data in a later tensor was not seen.
scan_local_ggufandscan_dead_blocksstill accept a limit. - Tensors are read in pieces of 64 MiB, in the scan and in
sanitize, so a tensor of several gigabytes no longer has to fit into memory. A program header or readable text that crosses the border between two pieces is still found, and the report does not depend on the size of the pieces. - A scale stored as negative zero is a finding only in
Q8_0andQ4_K. The quantizers ofQ4_0,Q5_0,Q3_KandQ6_Kwrite negative zero themselves, so it counts there as an ordinary zero scale. - A scan of a local file now reads the whole file, so it takes about as long as reading the file once. Before, most of the weights were skipped.
- Readable text in zero-scale bytes is reported only when it fills at least 128 bytes in consecutive blocks, uses at least 16 different characters and contains spaces or line breaks in the way that text does. How the checks work lists the conditions. Text with few or no spaces, such as Base64 data, is no longer reported as text, except in a
Q8_0block that the quantizer cannot have written. - A tensor with more
MZmarkers than the scan can follow is reported as holding an excessive number of Windows program markers. sanitizeno longer scans the zero-scale blocks of the input a second time. It reads each tensor once.
Fixed
- A clean
Q4_Kmodel is no longer reported asMALICIOUSbecause its leftover bytes look like text. This happened in 0.1.1 with a real quantizer run on a tensor that held a tight group of very small positive weights and a few larger ones. - A Windows program hidden in zero-scale bytes is now found even when many
MZbyte pairs that are not programs come before it.