Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 34be3b6d89d94ac218678e7f6ada201a1bcba4c1 Mon Sep 17 00:00:00 2001
From 7e292e39190998abf873f50a8445d50b701cdb69 Mon Sep 17 00:00:00 2001
From: Mesh-LLM CI <ci@mesh-llm.local>
Date: Fri, 26 Jun 2026 13:47:52 +1000
Subject: [PATCH 01/45] Add Skippy ABI and package writer foundation
Subject: [PATCH 01/47] Add Skippy ABI and package writer foundation

Squashes the initial Skippy ABI headers, model info entrypoints, single-stage runtime baseline, runtime-slice tensor filtering, activation-frame execution, GGUF slice writing, and package part composition.
---
Expand All @@ -19,10 +19,10 @@ Squashes the initial Skippy ABI headers, model info entrypoints, single-stage ru
create mode 100644 src/skippy.cpp

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81f23d7e..50ad6e57 100644
index 3df1d82d..ad7652a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -245,6 +245,7 @@ set(LLAMA_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Location o
@@ -254,6 +254,7 @@ set(LLAMA_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Location o

set(LLAMA_PUBLIC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/llama.h
Expand Down Expand Up @@ -346,7 +346,7 @@ index 320784c3..5298c337 100644
unicode-data.cpp
unicode.cpp
diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp
index c8ecb0a2..660dee46 100644
index 6d1c8f4e..137dc9da 100644
--- a/src/llama-graph.cpp
+++ b/src/llama-graph.cpp
@@ -21,6 +21,20 @@
Expand All @@ -370,7 +370,7 @@ index c8ecb0a2..660dee46 100644
// dedup helpers

static ggml_tensor * build_attn_inp_kq_mask(
@@ -2173,28 +2187,32 @@ ggml_tensor * llm_graph_context::build_inp_embd(ggml_tensor * tok_embd) const {
@@ -2184,28 +2198,32 @@ ggml_tensor * llm_graph_context::build_inp_embd(ggml_tensor * tok_embd) const {
{
auto & cur = inps[0];

Expand Down Expand Up @@ -444,7 +444,7 @@ index 7ed490ce..a7986a87 100644
enum llm_graph_type {
LLM_GRAPH_TYPE_DEFAULT,
diff --git a/src/llama-model-loader.cpp b/src/llama-model-loader.cpp
index 43447f57..7f23dbbc 100644
index 510586e9..6254771a 100644
--- a/src/llama-model-loader.cpp
+++ b/src/llama-model-loader.cpp
@@ -18,6 +18,16 @@ static const size_t kiB = 1024;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0f00b168cc09677e844bf8822040aa3d71f304b5 Mon Sep 17 00:00:00 2001
From 4a3154e28533e87a29222f219f882ef0ec28dce7 Mon Sep 17 00:00:00 2001
From: Mesh-LLM CI <ci@mesh-llm.local>
Date: Fri, 26 Jun 2026 13:47:52 +1000
Subject: [PATCH 02/45] Add early staged model-family and chat support
Subject: [PATCH 02/47] Add early staged model-family and chat support

Squashes the first Qwen MoE staged-runtime support, native KV page basics, session reset, token EOG exposure, batched token verification, chat-template ABI, and the first wider model-family support pass.
---
Expand Down Expand Up @@ -32,7 +32,7 @@ Squashes the first Qwen MoE staged-runtime support, native KV page basics, sessi
create mode 100644 common/stage-chat.cpp

diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 99688f53..3928ba17 100644
index 799d2275..a3cfaec1 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -98,6 +98,7 @@ add_library(${TARGET}
Expand All @@ -42,7 +42,7 @@ index 99688f53..3928ba17 100644
+ stage-chat.cpp
speculative.cpp
speculative.h
trie.cpp
subproc.cpp
diff --git a/common/stage-chat.cpp b/common/stage-chat.cpp
new file mode 100644
index 00000000..39d6331a
Expand Down Expand Up @@ -319,7 +319,7 @@ index 7ab93d35..23a46e0f 100644
const char * path,
struct skippy_model_info ** out_info,
diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp
index 660dee46..cca99a8f 100644
index 137dc9da..bed11342 100644
--- a/src/llama-graph.cpp
+++ b/src/llama-graph.cpp
@@ -22,6 +22,7 @@
Expand Down Expand Up @@ -455,7 +455,7 @@ index a7986a87..33d57061 100644
public:
llm_graph_input_pos(uint32_t n_pos_per_embd) : n_pos_per_embd(n_pos_per_embd) {}
diff --git a/src/llama-kv-cache.cpp b/src/llama-kv-cache.cpp
index e25464c5..d7c7c220 100644
index 44cb1668..638c9664 100644
--- a/src/llama-kv-cache.cpp
+++ b/src/llama-kv-cache.cpp
@@ -4,6 +4,7 @@
Expand All @@ -466,7 +466,7 @@ index e25464c5..d7c7c220 100644

#include <algorithm>
#include <cassert>
@@ -1224,6 +1225,352 @@ ggml_tensor * llama_kv_cache::get_k_storage(int32_t il) const {
@@ -1337,6 +1338,352 @@ ggml_tensor * llama_kv_cache::get_k_storage(int32_t il) const {
return layers[ikv].k;
}

Expand Down Expand Up @@ -820,7 +820,7 @@ index e25464c5..d7c7c220 100644
uint32_t result = 0;

diff --git a/src/llama-kv-cache.h b/src/llama-kv-cache.h
index 531d99db..d9301c19 100644
index d5a92f44..e421bd1c 100644
--- a/src/llama-kv-cache.h
+++ b/src/llama-kv-cache.h
@@ -6,12 +6,14 @@
Expand Down Expand Up @@ -863,7 +863,7 @@ index 531d99db..d9301c19 100644
// graph_build API
//
diff --git a/src/llama-model-loader.cpp b/src/llama-model-loader.cpp
index 7f23dbbc..c94aca78 100644
index 6254771a..be9233c2 100644
--- a/src/llama-model-loader.cpp
+++ b/src/llama-model-loader.cpp
@@ -1082,13 +1082,6 @@ struct ggml_tensor * llama_model_loader::create_tensor(
Expand Down Expand Up @@ -929,10 +929,10 @@ index 7f23dbbc..c94aca78 100644
if (info.op == GGML_OP_NONE || (flags & TENSOR_SKIP)) {
const size_t nbytes = ggml_nbytes(t_meta);
diff --git a/src/llama-model.cpp b/src/llama-model.cpp
index b100f601..07d3f4f3 100644
index be0a0df5..4152ee61 100644
--- a/src/llama-model.cpp
+++ b/src/llama-model.cpp
@@ -1398,13 +1398,13 @@ bool llama_model_base::load_tensors(llama_model_loader & ml) {
@@ -1403,13 +1403,13 @@ bool llama_model_base::load_tensors(llama_model_loader & ml) {
}

// MoE expert weight scales (per-expert, shape {n_expert})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ab8b97e2a7169c1f6081a27c49f6bc64959f79a1 Mon Sep 17 00:00:00 2001
From b2d816ab8938faef60abdd2d1f95fe3cc2a1e9d1 Mon Sep 17 00:00:00 2001
From: Mesh-LLM CI <ci@mesh-llm.local>
Date: Fri, 26 Jun 2026 13:47:52 +1000
Subject: [PATCH 03/45] Add staged sampling, checkpoints, and part loading
Subject: [PATCH 03/47] Add staged sampling, checkpoints, and part loading

Squashes sampling configuration, batched verification frames, recurrent/native session checkpoints, logit bias, session trim, verification handoff fixes, split-metadata stripping, thinking toggle support, and ordered GGUF part loading.
---
Expand Down Expand Up @@ -49,10 +49,10 @@ index 39d6331a..60d53fc4 100644

for (size_t i = 0; i < message_count; ++i) {
diff --git a/include/llama.h b/include/llama.h
index 9fab6931..e54b64dc 100644
index 3c6d22be..99efc134 100644
--- a/include/llama.h
+++ b/include/llama.h
@@ -514,6 +514,13 @@ extern "C" {
@@ -515,6 +515,13 @@ extern "C" {
size_t n_paths,
struct llama_model_params params);

Expand Down Expand Up @@ -245,7 +245,7 @@ index 23a46e0f..4dd985da 100644
size_t output_text_capacity,
size_t * out_text_bytes,
diff --git a/src/llama-model-loader.cpp b/src/llama-model-loader.cpp
index c94aca78..ecafbdf2 100644
index be9233c2..3070a8c6 100644
--- a/src/llama-model-loader.cpp
+++ b/src/llama-model-loader.cpp
@@ -532,6 +532,7 @@ llama_model_loader::llama_model_loader(
Expand Down Expand Up @@ -321,10 +321,10 @@ index 92ad6430..f73fa907 100644
llama_load_mode load_mode,
bool check_tensors,
diff --git a/src/llama-quant.cpp b/src/llama-quant.cpp
index caf7733a..7a3d105a 100644
index 92ebc11b..03a6c34f 100644
--- a/src/llama-quant.cpp
+++ b/src/llama-quant.cpp
@@ -885,7 +885,7 @@ static void llama_model_quantize_impl(const std::string & fname_inp, const std::
@@ -893,7 +893,7 @@ static void llama_model_quantize_impl(const std::string & fname_inp, const std::
const llama_model_kv_override * kv_overrides = params->kv_overrides;
std::vector<std::string> splits = {};
llama_model_loader ml(/*metadata*/ nullptr, /*set_tensor_data*/ nullptr, /*set_tensor_data_ud*/ nullptr,
Expand All @@ -334,10 +334,10 @@ index caf7733a..7a3d105a 100644

auto mparams = llama_model_default_params();
diff --git a/src/llama.cpp b/src/llama.cpp
index 11ac9656..48c578ee 100644
index d22e4c81..37ddf52f 100644
--- a/src/llama.cpp
+++ b/src/llama.cpp
@@ -299,9 +299,9 @@ static bool llama_prepare_model_devices(const llama_model_params & params, llama
@@ -302,9 +302,9 @@ static bool llama_prepare_model_devices(const llama_model_params & params, llama

// Returns 0 on success, -1 on error, and -2 on cancellation via llama_progress_callback
static std::pair<int, llama_model *> llama_model_load(struct gguf_context * metadata, llama_model_set_tensor_data_t set_tensor_data, void * set_tensor_data_ud,
Expand All @@ -349,15 +349,15 @@ index 11ac9656..48c578ee 100644
params.check_tensors, params.no_alloc, params.kv_overrides, params.tensor_buft_overrides);

ml.print_info();
@@ -366,6 +366,7 @@ static struct llama_model * llama_model_load_from_file_impl(
@@ -369,6 +369,7 @@ static struct llama_model * llama_model_load_from_file_impl(
void * set_tensor_data_ud,
const std::string & path_model,
std::vector<std::string> & splits,
+ bool ordered_parts,
FILE * file,
struct llama_model_params params) {
{
@@ -408,7 +409,7 @@ static struct llama_model * llama_model_load_from_file_impl(
@@ -411,7 +412,7 @@ static struct llama_model * llama_model_load_from_file_impl(
};
}

Expand All @@ -366,7 +366,7 @@ index 11ac9656..48c578ee 100644
GGML_ASSERT(status <= 0);
if (status < 0) {
if (status == -1) {
@@ -436,7 +437,7 @@ struct llama_model * llama_model_init_from_user(
@@ -439,7 +440,7 @@ struct llama_model * llama_model_init_from_user(
std::vector<std::string> splits = {};
params.load_mode = LLAMA_LOAD_MODE_NONE;
params.use_extra_bufts = false;
Expand All @@ -375,7 +375,7 @@ index 11ac9656..48c578ee 100644
}
// deprecated
struct llama_model * llama_load_model_from_file(
@@ -449,7 +450,7 @@ struct llama_model * llama_model_load_from_file(
@@ -452,7 +453,7 @@ struct llama_model * llama_model_load_from_file(
const char * path_model,
struct llama_model_params params) {
std::vector<std::string> splits = {};
Expand All @@ -384,7 +384,7 @@ index 11ac9656..48c578ee 100644
}

struct llama_model * llama_model_load_from_splits(
@@ -465,7 +466,27 @@ struct llama_model * llama_model_load_from_splits(
@@ -468,7 +469,27 @@ struct llama_model * llama_model_load_from_splits(
for (size_t i = 0; i < n_paths; ++i) {
splits.push_back(paths[i]);
}
Expand Down Expand Up @@ -413,7 +413,7 @@ index 11ac9656..48c578ee 100644
}

struct llama_model * llama_model_load_from_file_ptr(FILE * file, struct llama_model_params params) {
@@ -475,7 +496,7 @@ struct llama_model * llama_model_load_from_file_ptr(FILE * file, struct llama_mo
@@ -478,7 +499,7 @@ struct llama_model * llama_model_load_from_file_ptr(FILE * file, struct llama_mo
}
std::string path_model;
std::vector<std::string> splits = {};
Expand All @@ -422,7 +422,7 @@ index 11ac9656..48c578ee 100644
}

void llama_model_save_to_file(const struct llama_model * model, const char * path_model) {
@@ -600,4 +621,3 @@ const char * llama_print_system_info(void) {
@@ -603,4 +624,3 @@ const char * llama_print_system_info(void) {

return s.c_str();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 59cdfb7bf5cf5e112f229ebec9a4e0fa3d954547 Mon Sep 17 00:00:00 2001
From aec3d7b74786f7434166c15be069d882cdb39ea8 Mon Sep 17 00:00:00 2001
From: Mesh-LLM CI <ci@mesh-llm.local>
Date: Fri, 26 Jun 2026 13:47:52 +1000
Subject: [PATCH 04/45] Add lanes, external media, and chat grammar support
Subject: [PATCH 04/47] Add lanes, external media, and chat grammar support

Squashes Qwen3 MoE staged execution, KV cache type and generation signal ABI, backend device selection, external media prefill, shared execution lanes, batch/flash-attention config, tool-aware chat templates, and chat grammar sampling.
---
Expand Down Expand Up @@ -573,7 +573,7 @@ index 4dd985da..3ffdb879 100644
const char * path,
struct skippy_model_info ** out_info,
diff --git a/src/llama-kv-cache.cpp b/src/llama-kv-cache.cpp
index d7c7c220..f74bb495 100644
index 638c9664..41962096 100644
--- a/src/llama-kv-cache.cpp
+++ b/src/llama-kv-cache.cpp
@@ -196,12 +196,10 @@ llama_kv_cache::llama_kv_cache(
Expand All @@ -593,7 +593,7 @@ index d7c7c220..f74bb495 100644
}

// [TAG_V_CACHE_VARIABLE]
@@ -1225,352 +1223,6 @@ ggml_tensor * llama_kv_cache::get_k_storage(int32_t il) const {
@@ -1338,352 +1336,6 @@ ggml_tensor * llama_kv_cache::get_k_storage(int32_t il) const {
return layers[ikv].k;
}

Expand Down Expand Up @@ -947,7 +947,7 @@ index d7c7c220..f74bb495 100644
uint32_t result = 0;

diff --git a/src/llama-kv-cache.h b/src/llama-kv-cache.h
index d9301c19..92394d4c 100644
index e421bd1c..6c92186d 100644
--- a/src/llama-kv-cache.h
+++ b/src/llama-kv-cache.h
@@ -13,8 +13,6 @@ struct llama_cparams;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
From 8d4cf568f56593d1fa8223ad12ca2965d680fee6 Mon Sep 17 00:00:00 2001
From df9fea9e4a0d7bd91ce128ca3820ed9618aef466 Mon Sep 17 00:00:00 2001
From: Mesh-LLM CI <ci@mesh-llm.local>
Date: Fri, 26 Jun 2026 13:47:52 +1000
Subject: [PATCH 05/45] Add resident prefix cache and session refinements
Subject: [PATCH 05/47] Add resident prefix cache and session refinements

Squashes resident prefix cache support, exact-prefix state restoration, borrowed prefix sessions, lazy generation signals, single-token allocation avoidance, server-like thread defaults, prefix cache borrowing, lane preservation, and recurrent-state remapping.
---
include/skippy.h | 119 +++++-
src/llama-kv-cache.cpp | 369 +++++++++++++++++++
src/llama-kv-cache.cpp | 369 ++++++++++++++++++
src/llama-kv-cache.h | 21 ++
src/skippy.cpp | 821 ++++++++++++++++++++++++++++++++++++++++-
4 files changed, 1320 insertions(+), 10 deletions(-)
Expand Down Expand Up @@ -196,10 +196,10 @@ index 3ffdb879..deb5151e 100644
struct skippy_model * model,
const char * text,
diff --git a/src/llama-kv-cache.cpp b/src/llama-kv-cache.cpp
index f74bb495..41a4e0de 100644
index 41962096..942a1a4a 100644
--- a/src/llama-kv-cache.cpp
+++ b/src/llama-kv-cache.cpp
@@ -1223,6 +1223,375 @@ ggml_tensor * llama_kv_cache::get_k_storage(int32_t il) const {
@@ -1336,6 +1336,375 @@ ggml_tensor * llama_kv_cache::get_k_storage(int32_t il) const {
return layers[ikv].k;
}

Expand Down Expand Up @@ -576,7 +576,7 @@ index f74bb495..41a4e0de 100644
uint32_t result = 0;

diff --git a/src/llama-kv-cache.h b/src/llama-kv-cache.h
index 92394d4c..be51c3c7 100644
index 6c92186d..beaf005e 100644
--- a/src/llama-kv-cache.h
+++ b/src/llama-kv-cache.h
@@ -13,6 +13,8 @@ struct llama_cparams;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7432fb6267d078b2e6c79df8cc301517913cf6c0 Mon Sep 17 00:00:00 2001
From 95a491c6dd9fd92ba8b7b3406b632c8821cbc5a6 Mon Sep 17 00:00:00 2001
From: Mesh-LLM CI <ci@mesh-llm.local>
Date: Fri, 26 Jun 2026 13:47:53 +1000
Subject: [PATCH 06/45] Expand staged execution across dense and recurrent
Subject: [PATCH 06/47] Expand staged execution across dense and recurrent
families

Squashes the dense and decoder family support waves through LFM2, Mamba, Jamba, RWKV6, Qwen2MoE, and native sequence id exposure.
Expand Down Expand Up @@ -51,10 +51,10 @@ index deb5151e..84169398 100644
const struct skippy_session * session);

diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp
index cca99a8f..f2618710 100644
index bed11342..ad8f2fc6 100644
--- a/src/llama-graph.cpp
+++ b/src/llama-graph.cpp
@@ -2269,10 +2269,15 @@ ggml_tensor * llm_graph_context::build_inp_embd(ggml_tensor * tok_embd) const {
@@ -2280,10 +2280,15 @@ ggml_tensor * llm_graph_context::build_inp_embd(ggml_tensor * tok_embd) const {

res->t_inp_embd = cur;

Expand Down
Loading
Loading