ggml icon indicating copy to clipboard operation
ggml copied to clipboard

Introduce semantic versioning

Open danbev opened this issue 4 months ago • 0 comments

Semantic versioning in GGML

This task is about implementing semantic versioning in GGML.

📝 Note: This is a work in progress and the current content is a starting point/suggestion, and open for discussion and change.

Background

Currently the version of GGML is generated using git and is a build number (numberof commits):

$ git rev-list --count HEAD
2471

And the version might then look like this:

Version: 0.0.2471

Considerations

Currently, the main development of GGML happens in llama.cpp and changes are synced back to GGML when they are mature enough. This is the current workflow and something that version management should take into account.

So we have a few use cases for GGML in projects:

  • As a copy of the source code in another project (llama.cpp, whisper.cpp)
  • As a submodule in another project
  • Used with CMake's FetchContent
    • This works with git urls and commits but can also be more efficient if a zip file of the project is available in a github release.

Semantic Versioning

The idea is to introduce semantic versioning, which consists of three mandatory parts: major, minor, and patch.

The suggested version format is:

major.minor.patch[-dev][-dirty]

So for a release build:

0.9.0

And for development builds:

0.9.0-dev

And for development builds with modifications to ggml sources:

0.9.0-dev-dirty

Release management

To make a new release the following steps would be taken:

  • Sync the changes from llama.cpp/whisper.cpp into ggml
  • Update CMakeLists.txt changing the version appropriately, and remove the -dev suffix.
  • Commit the changes to CMakeLists.txt with a message like "ggml : bump version to 1.0.0"
  • Create a new git tag with the version number and push the tag
  • Update the version in CMakeLists.txt increment the minor or patch version and set the -dev suffix part. Perhaps to 1.1.0-dev or 1.0.1-dev

Checking the version

To check the version in ggml the following command can be used:

$ cat << 'EOF' | gcc -Iggml/include -L build/bin -x c -o test_ggml - -lggml-base && LD_LIBRARY_PATH=build/bin ./test_ggml && rm test_ggml
#include "ggml.h"
#include <stdio.h>

int main() {
    printf("ggml version: %s\n", ggml_version());
    return 0;
}
EOF
ggml version: 0.9.0-dev-dirty

To check the ggml version used with llama.cpp, the following command can be used:

$ ./build/bin/llama-cli --version
version: 6242 (4b80a93ed)
built with cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 for x86_64-linux-gnu
ggml version: 0.9.0-dev-dirty

danbev avatar Aug 22 '25 04:08 danbev