Views
No views yet
tokenizer.ggml.scores or tokenizer.ggml.token_type arrays have fewer elements than the tokenizer.ggml.tokens array. ASan-confirmed at llama-vocab.cpp:2158.vocab_oob.gguf — PoC with short scores+toktypes arrays (2094 bytes)vocab_oob_toktype.gguf — Variant with only short toktypes (2486 bytes)craft_vocab_oob.py — Generator script for scores variantcraft_vocab_oob_toktype.py — Generator script for toktypes variant1# Build llama.cpp with ASan
2git clone https://github.com/ggerganov/llama.cpp && cd llama.cpp
3mkdir build-asan && cd build-asan
4cmake .. -DGGML_METAL=OFF -DGGML_BLAS=OFF \
5 -DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" \
6 -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" \
7 -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined" \
8 -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address,undefined" \
9 -DCMAKE_BUILD_TYPE=Debug
10cmake --build . -j8 --target llama-cli
11
12# Run - triggers ASan heap-buffer-overflow
13./bin/llama-cli -m vocab_oob.gguf