CoolFace
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 2d agoView on Hugging Face
0likes1.1kdownloads
README.md55 linesDownload Raw Back to debug
1# llama.cpp/examples/debug2 3This is a utility intended to help debug a model by registering a callback that4logs GGML operations and tensor data. It can also store the generated logits or5embeddings as well as the prompt and token ids for comparison with the original6model.7 8### Usage9 10```shell11llama-debug \12  --hf-repo ggml-org/models \13  --hf-file phi-2/ggml-model-q4_0.gguf \14  --model phi-2-q4_0.gguf \15  --prompt hello \16  --save-logits \17  --verbose18```19The tensor data is logged as debug and required the --verbose flag. The reason20for this is that while useful for a model with many layers there can be a lot of21output. You can filter the tensor names using the `--tensor-filter` option.22 23A recommended approach is to first run without `--verbose` and see if the24generated logits/embeddings are close to the original model. If they are not,25then it might be required to inspect tensor by tensor and in that case it is26useful to enable the `--verbose` flag along with `--tensor-filter` to focus on27specific tensors.28 29### Options30This example supports all standard `llama.cpp` options and also accepts the31following options:32```console33$ llama-debug --help34...35 36----- example-specific params -----37 38--save-logits                           save final logits to files for verification (default: false)39--logits-output-dir PATH                directory for saving logits output files (default: data)40--tensor-filter REGEX                   filter tensor names for debug output (regex pattern, can be specified multiple times)41```42 43### Output Files44 45When `--save-logits` is enabled, the following files are created in the output46directory:47 48* `llamacpp-<model>[-embeddings].bin`        - Binary output (logits or embeddings)49* `llamacpp-<model>[-embeddings].txt`        - Text output (logits or embeddings, one per line)50* `llamacpp-<model>[-embeddings]-prompt.txt` - Prompt text and token IDs51* `llamacpp-<model>[-embeddings]-tokens.bin` - Binary token IDs for programmatic comparison52 53These files can be compared against the original model's output to verify the54converted model.55