llama.cpp v.b9987 adds tensor shape accessors for GGUF models
New GGUF tensor shape introspection streamlines model development workflows
The latest release of llama.cpp, version b9987, brings a significant quality-of-life improvement for developers working with GGUF models. The core change is the addition of tensor shape accessors, specifically the new function `gguf_get_tensor_ne`, which returns tensor dimensions as a constant pointer to int64_t. This replaces the older `n_dims` accessor, providing a more standard and flexible way to query tensor shapes. The commit, signed with a verified GPG key, streamlines how AI engineers interact with model internals.
This release supports a wide range of platforms: macOS (Apple Silicon and Intel, with a KleidiAI-enabled variant for ARM), Linux builds for CPU (x64, arm64, s390x), Vulkan, ROCm 7.2, OpenVINO, and SYCL (FP32/FP16), as well as Windows versions for CPU, arm64, OpenCL Adreno, CUDA 12/13, Vulkan, and OpenVINO. Android arm64 and openEuler builds are also included. The update is particularly valuable for developers building custom tooling or inference pipelines that require granular control over model tensor layouts.
- New `gguf_get_tensor_ne` function returns tensor shape as `const int64_t*` for GGUF models
- Replaced the legacy `n_dims` accessor, standardizing tensor dimension queries
- Available across 20+ platform builds including macOS, Linux, Windows, Android, and openEuler
Why It Matters
Enables precise tensor shape inspection for GGUF model developers, simplifying model analysis and custom inference pipelines.