Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
271f947
ggml-cuda: key the CUDA graph cache by shape
danielhanchen Aug 30, 2026
52d5360
llama: prefetch lazily read gather rows on macOS too
danielhanchen Oct 3, 2026
5ddb923
llama: keep the glm5-next indexer cache F16 under a quantized -ctk
danielhanchen Oct 3, 2026
b96a713
glm5-next : NextN (MTP) draft graph
danielhanchen Oct 3, 2026
9dd7972
Merge remote-tracking branch 'origin/master' into carry/superseded-pi…
danielhanchen Oct 7, 2026
0e8ffdc
ggml-cuda: drop the CUDA graph cache count cap, as upstream does
danielhanchen Oct 8, 2026
20dd977
Merge carry/superseded-pin-optimizations (#241) into fix/cuda-graph-c…
danielhanchen Oct 8, 2026
7fa42ff
ggml-cuda : graph key: handle a graph with no nodes
danielhanchen Oct 14, 2026
f5fb11c
Fix merge conflicts
danielhanchen Oct 24, 2026
48c9f08
common, grammar: add recursive depth limit, make it a requirement (#3…
ngxson Oct 25, 2026
d854d98
cuda : use std::string instead of VLA for archName (#30463)
angt Oct 25, 2026
a074215
deepseekv4.1: follow-up review fixes (#31137)
am17an Oct 26, 2026
48c3611
ci : drop the `macos-latest-x64` job (#31175)
ggerganov Oct 26, 2026
224d94c
ci : bump server timeout during startup (#31174)
ggerganov Oct 26, 2026
69b3cc4
ui: Sidebar resizing improvements (#31119)
allozaur Oct 26, 2026
dc9e3be
ui: UX improvements (#31030)
allozaur Oct 26, 2026
9b8446b
metal : stop overflow from happening in large matrix output offsets (…
feni6 Oct 26, 2026
9125a2e
ci : fix race in webgpu memset (#31162)
eapache Oct 26, 2026
fd8f845
tests : refactor test-llama-archs to not link internal libllama symbo…
ggerganov Oct 26, 2026
8b28c23
ggml-cpu : fix unused variables in arm arch (#31180)
CISC Oct 26, 2026
c6fb3b5
mtmd: add mtmd_helper_get_capabilities (#31183)
ngxson Oct 26, 2026
74b104c
common: pin model resolution on real HF repo layouts (#30548)
ServeurpersoCom Oct 26, 2026
5320c87
sycl : bound reorder temp memory to 32 MiB (#31062)
KyleHagy Oct 26, 2026
02269b4
sycl: add set_tensor_2d for faster tensor-split loading (#30358)
Captain-Tripps Oct 26, 2026
38645c2
sycl: template the per-quant concat impls (#31008)
Titaniumtown Oct 26, 2026
5cd62ff
sycl: template the plain MMVQ launch triples (#31013)
Titaniumtown Oct 26, 2026
70c5f26
vulkan: rms norm optimization using subgroup reductions (#29882)
virajwad Oct 26, 2026
4d71b42
ggml-cpu : rewrite concat as one row kernel for all types (#31179)
ServeurpersoCom Oct 26, 2026
4b851fb
models : replace ggml_tensor** out-params with output structs (#31142)
ggerganov Oct 26, 2026
a469940
llama : move no_alloc out of llama_hparams (#31141)
ggerganov Oct 26, 2026
caa8191
hexagon: MUL_MAT_ID row skipping optimizations and improvements (#31169)
max-krasnyansky Oct 26, 2026
63b4b30
opencl: write KV-cache views in set_tensor so a state restore is not …
wanghqc Oct 26, 2026
4244ad7
ci : add windows behavior check (#31191)
CISC Oct 26, 2026
961c376
llama : enable moe amax rescaling for laguna (#31147)
begcdn Oct 26, 2026
7aca0d2
hexagon: add GGML_HEXAGON_VTCM_SIZE (#31221)
ebateni Oct 26, 2026
f5892ca
ui: use shared confirmation dialog for conversation deletion (#31187)
allozaur Oct 27, 2026
bc262f3
ui: Open model details in a drawer without leaving the page (#31176)
allozaur Oct 27, 2026
1a97e38
ui: add conversation compaction (#27401)
ServeurpersoCom Oct 27, 2026
823df7d
ui: Highlight reasoning toggle on hover and align it with model selec…
allozaur Oct 27, 2026
a2b3e12
opencl: initial support for q3_k (#31172)
lhez Oct 27, 2026
d930fe3
opencl: refine mul mat id -1 index (#31170)
lhez Oct 27, 2026
0d5ca60
ui: list org-less models first in the model selector (#31215)
allozaur Oct 27, 2026
7a2e5ab
llama : remove obsolete n_pad from memory instances (#31200)
ggerganov Oct 27, 2026
6666a73
tests : fix multi-seq split replay and partial-state cases for traine…
ggerganov Oct 27, 2026
de5122d
ggml : relax scale to non-contiguous views (#31146)
ggerganov Oct 27, 2026
a8276b7
ci : force python 3.12 on ubuntu 26.04 (#31222)
CISC Oct 27, 2026
fae9ac5
ci : use ccache depend mode for ROCm release builds (#31231)
sreeram-11 Oct 27, 2026
d78f40d
glm5-next : QSA without kq_mask (+ DSA) (#31009)
sanmai Oct 27, 2026
2763785
metal : add GGML_OP_TOP_K_MASK (#31230)
ggerganov Oct 27, 2026
7eed6b7
model: Add MiniCPM-OCR-Jev (#30980)
tc-mb Oct 27, 2026
74a1fd3
common : --model or -hf is required (#31242)
julien-c Oct 27, 2026
85cc432
server: add router device memory margin parameter for dynamic unloadi…
0cc4m Oct 27, 2026
3ab37ae
ui: fix system message row stretching to full prompt height in WebKit…
allozaur Oct 27, 2026
0c8c59e
mtmd-cli: Reduced scope of batch pointer (#31155) (#31165)
SamMalayek Oct 27, 2026
922f53e
vulkan: fix CI llvmpipe by allowing dim 3 broadcast in MUL_MAT (#31239)
ServeurpersoCom Oct 27, 2026
8542e94
tests : speed up tensor data generation and model saving (#31145)
ggerganov Oct 27, 2026
7ecb57f
rpc : catch std::length_error in recv_msg (#31204)
sohaibharraoui Oct 27, 2026
82b228d
Fix merge conflicts
danielhanchen Oct 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/behavior-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,52 @@ jobs:
source .venv/bin/activate
cd build
ctest -L behavior -LE 'model|backend' --verbose --timeout 900

windows:
runs-on: windows-2025

cache-mode: write
permissions:
actions: write
contents: read

steps:
- name: Clone
id: checkout
uses: actions/checkout@v6

- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
key: behavior-check-windows-2025
evict-old-files: 1d
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}

- name: Python Dependencies
id: python_depends
shell: bash
run: |
python3 -m venv .venv
source .venv/Scripts/activate
pip install jinja2==3.1.6

- name: Build
id: cmake_build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
cmake -B build -G "Ninja Multi-Config" ^
-DCMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake ^
-DCMAKE_BUILD_TYPE=Release ^
-DGGML_NATIVE=OFF ^
-DGGML_BACKEND_DL=OFF
set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
cmake --build build --config Release -j %NINJA_JOBS%

- name: Test
id: cmake_test
shell: bash
run: |
source .venv/Scripts/activate
cd build
ctest -C Release -L behavior -LE 'model|backend' --verbose --timeout 900
56 changes: 0 additions & 56 deletions .github/workflows/build-apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,62 +107,6 @@ jobs:
# ref: https://github.com/ggml-org/llama.cpp/pull/19802#issuecomment-4013704023
ctest -L main -E "test-llama-archs|test-llama-context|test-speculative-rejection-sampling" --verbose --timeout 900

macos-latest-x64:
runs-on: macos-15-intel

steps:
- name: Clone
id: checkout
uses: actions/checkout@v6

- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
restore: false
save: false

- name: ccache-buckets-restore
uses: ./.github/actions/ccache-buckets
env:
HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
with:
key: apple-x64
folder: llama.cpp
hf_bucket: ggml-org/cache

- name: Build
id: cmake_build
run: |
sysctl -a
# Metal is disabled due to intermittent failures with Github runners not having a GPU:
# https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
cmake -B build \
-DCMAKE_BUILD_RPATH="@loader_path" \
-DLLAMA_FATAL_WARNINGS=ON \
-DLLAMA_BUILD_BORINGSSL=ON \
-DGGML_METAL=OFF \
-DGGML_RPC=ON \
-DCMAKE_OSX_DEPLOYMENT_TARGET=13.3
time cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)

- name: ccache-buckets-save
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: ./.github/actions/ccache-buckets
env:
HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
with:
key: apple-x64
folder: llama.cpp
evict-old-files: 1d
hf_bucket: ggml-org/cache
save: true

- name: Test
id: cmake_test
run: |
cd build
ctest -L main --verbose --timeout 900

macos-latest-ios-xcode:
runs-on: macos-latest

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci-self-hosted-webgpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y build-essential cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan1 mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 libssl-dev time unzip wget python3 python3-venv python3-pip
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y build-essential cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan1 mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 libssl-dev time unzip wget python3.12 python3.12-venv
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
sudo update-alternatives --config python3

- name: ccache
uses: ggml-org/ccache-action@v1.2.24
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,11 @@ jobs:
evict-old-files: 1d
max-size: "1G"

- name: Tune ccache for ROCm
run: |
# since ROCm 10.1, clang -E output has no GPU code, so the preprocessor fallback can reuse objects with old GPU code
ccache --set-config=depend_mode=true

# - name: Cache ROCm Installation
# id: cache-rocm
# uses: actions/cache@v5
Expand Down Expand Up @@ -1545,6 +1550,8 @@ jobs:
# builds hit.
ccache --set-config=compiler_check=content
ccache --set-config=sloppiness=time_macros,include_file_mtime,include_file_ctime
# since ROCm 10.1, clang -E output has no GPU code, so the preprocessor fallback can reuse objects with old GPU code
ccache --set-config=depend_mode=true

- name: Dependencies
id: depends
Expand Down
9 changes: 8 additions & 1 deletion common/arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ static bool common_params_parse_ex(int argc, char ** argv, common_params_context
// TODO @ngxson : maybe show a list of available models in CLI in this case
bool can_skip_model = params.usage || params.completion || !params.server_base.empty();
if (!can_skip_model && params.model.path.empty()) {
throw std::invalid_argument("error: --model is required\n");
throw std::invalid_argument("error: --model or -hf is required\n");
}
}

Expand Down Expand Up @@ -3708,6 +3708,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.models_max = value;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_MODELS_MAX"));
add_opt(common_arg(
{"--models-memory-margin"}, "N",
string_format("for router server, MiB of device memory to keep free per device, unload LRU models until a new one fits (default: %d, 0 = disabled)", params.models_memory_margin),
[](common_params & params, int value) {
params.models_memory_margin = value;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_MODELS_MEMORY_MARGIN"));
add_opt(common_arg(
{"--models-autoload"},
{"--no-models-autoload"},
Expand Down
163 changes: 90 additions & 73 deletions common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,50 +742,56 @@ static inline bool glob_class_match(const char c, const char * pattern, const ch
}

// simple glob: * matches non-/ chars, ** matches anything including /, [] matches character class
static inline bool glob_match(const char * pattern, const char * str) {
if (*pattern == '\0') {
return *str == '\0';
}
if (pattern[0] == '*' && pattern[1] == '*') {
const char * p = pattern + 2;
if (glob_match(p, str)) return true;
if (*str != '\0') return glob_match(pattern, str + 1);
// only wildcards recurse, too many wildcards: no match
static bool glob_match(const char * pattern, const char * str, int depth = 0) {
if (depth >= COMMON_RECURSIVE_LIMIT) {
return false;
}
if (*pattern == '*') {
const char * p = pattern + 1;
for (; *str != '\0' && *str != '/'; str++) {
if (glob_match(p, str)) return true;
}
return glob_match(p, str);
}
if (*pattern == '?' && *str != '\0' && *str != '/') {
return glob_match(pattern + 1, str + 1);
}
if (*pattern == '[') {
const char * class_end = pattern + 1;
// If first character after '[' is ']' or '-', treat it as literal
if (*class_end == ']' || *class_end == '-') {
class_end++;
}
while (*class_end != '\0' && *class_end != ']') {
class_end++;
while (*pattern != '\0') {
if (pattern[0] == '*' && pattern[1] == '*') {
const char * p = pattern + 2;
for (;; str++) {
if (glob_match(p, str, depth + 1)) return true;
if (*str == '\0') return false;
}
}
if (*class_end == ']') {
if (*str == '\0') return false;
bool matched = glob_class_match(*str, pattern + 1, class_end);
return matched && glob_match(class_end + 1, str + 1);
} else {
if (*str == '[') {
return glob_match(pattern + 1, str + 1);
if (*pattern == '*') {
const char * p = pattern + 1;
for (; *str != '\0' && *str != '/'; str++) {
if (glob_match(p, str, depth + 1)) return true;
}
return false;
return glob_match(p, str, depth + 1);
}
if (*pattern == '?' && *str != '\0' && *str != '/') {
pattern++;
str++;
continue;
}
if (*pattern == '[') {
const char * class_end = pattern + 1;
// If first character after '[' is ']' or '-', treat it as literal
if (*class_end == ']' || *class_end == '-') {
class_end++;
}
while (*class_end != '\0' && *class_end != ']') {
class_end++;
}
if (*class_end == ']') {
if (*str == '\0' || !glob_class_match(*str, pattern + 1, class_end)) return false;
pattern = class_end + 1;
str++;
continue;
}
if (*str != '[') return false;
pattern++;
str++;
continue;
}
if (*pattern != *str) return false;
pattern++;
str++;
}
if (*pattern == *str) {
return glob_match(pattern + 1, str + 1);
}
return false;
return *str == '\0';
}

bool glob_match(const std::string & pattern, const std::string & str) {
Expand Down Expand Up @@ -1181,6 +1187,7 @@ static const std::map<common_decision_type, std::string> COMMON_DECISION_TYPE_NA
{ COMMON_DECISION_TYPE_LFM2_D1_OMNI, "lfm2-d1-omni" },
{ COMMON_DECISION_TYPE_GRANITE_SWITCH, "granite-switch"},
{ COMMON_DECISION_TYPE_H2O_LIGHTNING, "h2o-lightning" },
{ COMMON_DECISION_TYPE_MINICPM_OCR_JEV, "openbmb-minicpm-ocr-jev" },
// for future models, ALWAYS add org name prefix to avoid name collisions, e.g. "orgname-modelname"
};

Expand Down Expand Up @@ -1246,44 +1253,50 @@ common_gguf_info common_get_gguf_info(const std::string & fname) {
return info;
}

common_init_result::common_init_result(common_params & params, bool model_only) :
pimpl(new impl{}) {
auto mparams = common_model_params_to_llama(params);
auto cparams = common_context_params_to_llama(params);
void common_fit_apply(common_params & params, llama_model_params & mparams, llama_context_params & cparams) {
if (!params.fit_params) {
return;
}

if (params.fit_params) {
COM_TRC("%s", "fitting params to device memory ...\n");
COM_TRC("%s", "(for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on)\n");
COM_TRC("%s", "fitting params to device memory ...\n");
COM_TRC("%s", "(for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on)\n");

// the draft context is created from the same base params and follows the main context, fit both together
const bool has_draft = params.speculative.has_dft();
const bool spec_mtp = std::find(params.speculative.types.begin(), params.speculative.types.end(),
COMMON_SPECULATIVE_TYPE_DRAFT_MTP) != params.speculative.types.end();
// the draft context is created from the same base params and follows the main context, fit both together
const bool has_draft = params.speculative.has_dft();
const bool spec_mtp = std::find(params.speculative.types.begin(), params.speculative.types.end(),
COMMON_SPECULATIVE_TYPE_DRAFT_MTP) != params.speculative.types.end();

common_params params_dft = common_base_params_to_speculative(params);
common_params params_dft = common_base_params_to_speculative(params);

auto mparams_dft = common_model_params_to_llama(params_dft);
auto cparams_dft = common_context_params_to_llama(params_dft);
if (spec_mtp) {
cparams_dft.ctx_type = LLAMA_CONTEXT_TYPE_MTP;
}
cparams_dft.n_rs_seq = 0;
auto mparams_dft = common_model_params_to_llama(params_dft);
auto cparams_dft = common_context_params_to_llama(params_dft);
if (spec_mtp) {
cparams_dft.ctx_type = LLAMA_CONTEXT_TYPE_MTP;
}
cparams_dft.n_rs_seq = 0;

const common_fit_extra_model extra = {
/*.path_model =*/ params_dft.model.path.c_str(),
/*.mparams =*/ &mparams_dft,
/*.cparams =*/ &cparams_dft,
/*.shares_model =*/ !has_draft, // an MTP context runs on the weights of the main model
};
const common_fit_extra_model extra = {
/*.path_model =*/ params_dft.model.path.c_str(),
/*.mparams =*/ &mparams_dft,
/*.cparams =*/ &cparams_dft,
/*.shares_model =*/ !has_draft, // an MTP context runs on the weights of the main model
};

common_fit_params(params.model.path.c_str(), &mparams, &cparams,
params.tensor_split,
params.tensor_buft_overrides.data(),
params.fit_params_target.data(),
params.fit_params_min_ctx,
has_draft || spec_mtp ? &extra : nullptr,
params.verbosity >= LOG_LEVEL_DEBUG ? GGML_LOG_LEVEL_DEBUG : GGML_LOG_LEVEL_ERROR);
}
common_fit_params(params.model.path.c_str(), &mparams, &cparams,
params.tensor_split,
params.tensor_buft_overrides.data(),
params.fit_params_target.data(),
params.fit_params_min_ctx,
has_draft || spec_mtp ? &extra : nullptr,
params.verbosity >= LOG_LEVEL_DEBUG ? GGML_LOG_LEVEL_DEBUG : GGML_LOG_LEVEL_ERROR);
}

common_init_result::common_init_result(common_params & params, bool model_only) :
pimpl(new impl{}) {
auto mparams = common_model_params_to_llama(params);
auto cparams = common_context_params_to_llama(params);

common_fit_apply(params, mparams, cparams);

llama_model * model = llama_model_load_from_file(params.model.path.c_str(), mparams);
if (model == NULL) {
Expand All @@ -1301,13 +1314,17 @@ common_init_result::common_init_result(common_params & params, bool model_only)
// these decision models return a score for each token via the embeddings output
// TODO: maybe improve this in the future
const auto decision_type = common_get_decision_type(model);
// minicpm-ocr-jev reads its class scores from the pooled output, the pooling type is the one of the GGUF
if (decision_type == COMMON_DECISION_TYPE_LAYA || decision_type == COMMON_DECISION_TYPE_KEV || decision_type == COMMON_DECISION_TYPE_CLEF ||
decision_type == COMMON_DECISION_TYPE_LFM2_D1_OMNI || decision_type == COMMON_DECISION_TYPE_VLLM_DECISION2) {
decision_type == COMMON_DECISION_TYPE_LFM2_D1_OMNI || decision_type == COMMON_DECISION_TYPE_VLLM_DECISION2 ||
decision_type == COMMON_DECISION_TYPE_MINICPM_OCR_JEV) {
const auto pooling_type = decision_type == COMMON_DECISION_TYPE_MINICPM_OCR_JEV ? LLAMA_POOLING_TYPE_UNSPECIFIED : LLAMA_POOLING_TYPE_NONE;

params.embedding = true;
params.pooling_type = LLAMA_POOLING_TYPE_NONE;
params.pooling_type = pooling_type;

cparams.embeddings = true;
cparams.pooling_type = LLAMA_POOLING_TYPE_NONE;
cparams.pooling_type = pooling_type;
cparams.n_outputs_max = cparams.n_batch;
cparams.n_outputs_max_per_seq = 1;

Expand Down
Loading
Loading