Skip to content

Misc. bug: llama-quantize clobbers input file + crashes when output file matches #12753

Open
@m18coppola

Description

@m18coppola

Name and Version

version: 5029 (833e2b7)
built with cc (GCC) 13.2.0 for x86_64-unknown-linux-gnu

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

llama-quantize

Command line

llama-quantize ./Llama-3.2-1B-Instruct-f16.gguf Llama-3.2-1B-Instruct-f16.gguf 7

Problem description & steps to reproduce

If the input and output files point to the same location, the program crashes:

[1]    12928 bus error  llama-quantize ./Llama-3.2-1B-Instruct-f16.gguf Llama-3.2-1B-Instruct-f16.ggu

This also clobbers the input file, rendering it nearly empty, and unusable:

$ du -sh ./Llama-3.2-1B-Instruct-f16.gguf
7.5M    ./Llama-3.2-1B-Instruct-f16.gguf

First Bad Commit

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions