restructure some compilation units

This commit is contained in:
Concedo
2026-07-01 18:51:25 +08:00
parent 983dec9a54
commit 849ec89bad
11 changed files with 139 additions and 55 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
//
//kcpp: use a global flag to toggle pipeline parallelism to avoid messing with ctx params
static bool kcpp_pipeline_parallelism = false;
bool kcpp_pipeline_parallelism = false;
static llm_graph_type ctx_type_to_graph_type(llama_context_type ctx_type) {
switch (ctx_type) {
+1 -1
View File
@@ -36,7 +36,7 @@ using candidates_memos = std::unordered_map<size_t, llama_grammar_candidates>;
using stack_memos = std::unordered_map<size_t, candidates_memos>;
static stack_memos memo_cache;
static void llama_grammar_reset_memos() {
void llama_grammar_reset_memos() {
memo_cache.clear();
}
+2
View File
@@ -78,6 +78,8 @@ const llama_grammar_rules & llama_grammar_get_rules (const struct llama_grammar
// positions
void llama_grammar_accept(struct llama_grammar * grammar, uint32_t chr);
void llama_grammar_reset_memos();
std::vector<llama_grammar_candidate> llama_grammar_reject_candidates_for_stack(
const llama_grammar_rules & rules,
const llama_grammar_stack & stack,
+2 -2
View File
@@ -11,8 +11,8 @@
// llama_kv_cache_iswa
//
//kcpp: use a global flag to adjust swa padding
static int kcpp_extra_swa_padding = 0;
static int kcpp_active_swa_size = 0;
int kcpp_extra_swa_padding = 0;
int kcpp_active_swa_size = 0;
llama_kv_cache_iswa::llama_kv_cache_iswa(
const llama_model & model,
+1 -1
View File
@@ -27,7 +27,7 @@
// helpers
//
static bool OldBPETokenizerMode = false;
bool OldBPETokenizerMode = false;
struct naive_trie {
naive_trie() : has_value(false), value(0) {
-5
View File
@@ -19,7 +19,6 @@
#include "llama-memory-recurrent.cpp"
#include "llama-model-loader.cpp"
#include "llama-model-saver.cpp"
#include "llama-model.cpp"
#include "llama-quant.cpp"
#include "llama-hparams.cpp"
#include "llama-graph.cpp"
@@ -47,10 +46,6 @@
#include <iostream>
#include <vector>
#ifdef GGML_USE_CUDA
# include "ggml-cuda.h"
#endif
#if defined(_MSC_VER)
#pragma warning(disable: 4244 4267) // possible loss of data
#endif
+2 -3
View File
@@ -210,9 +210,8 @@ static ggml_tensor * dsv4_build_kq_zero_bias(
return ggml_fill(ctx, res, 0.0f);
}
//kcpp: avoid redefine conflict
// static constexpr int64_t DSV4_CSA_RATIO = 4;
// static constexpr int64_t DSV4_HCA_RATIO = 128;
static constexpr int64_t DSV4_CSA_RATIO = 4;
static constexpr int64_t DSV4_HCA_RATIO = 128;
static ggml_tensor * dsv4_hc_affine(
ggml_context * ctx,