Skip to content

Commit bf3769e

Browse files
committed
Merge remote-tracking branch 'upstream/HEAD'
* upstream/HEAD: (25 commits) metal : optimize pad + cpy (ggml-org#23354) snapdragon: update toolchain to v0.6 (ggml-org#23369) ggml-cuda: tune RDNA3 Q6_K MMVQ nwarps (ggml-org#23349) opencl: add MoE support for q4_k, q5_k, q6_k on Adreno (ggml-org#23303) hexagon: add MROPE and IMROPE support in HTP rope op (ggml-org#23317) refactor: Chat Screen UI rendering (ggml-org#23333) github: mention --log-file in issue templates (ggml-org#23277) common: fix --help for --verbosity (ggml-org#23278) common: fix --fit verbosity with --verbosity 4 (ggml-org#23282) convert : update mtp related help (ggml-org#23334) hexagon: enable support for NORM op (ggml-org#23319) model : clarify MTP layer comment in qwen35.cpp [no ci] (ggml-org#23338) llama : MTP clean-up (ggml-org#23269) ui: Bump packages + address build warnings (ggml-org#23300) ci : install libssl-dev (ggml-org#23325) ci : install server kleidiai runner dependencies (ggml-org#23259) server-context: guarantee there is at least 1 token to decode (ggml-org#23280) server : print graphs reused in slot timings (ggml-org#23279) save-load-state : refactor tests and improve readability (ggml-org#23196) llama-eval : add per-task summary stats (ggml-org#23151) ...
2 parents d39c3fc + 57ebaf4 commit bf3769e

89 files changed

Lines changed: 4060 additions & 748 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/011-bug-results.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ body:
100100
label: Relevant log output
101101
description: >
102102
Please copy and paste any relevant log output, including the command that you entered and any generated text.
103-
For very long logs (thousands of lines), preferably upload them as files instead.
104-
On Linux you can redirect console output into a file by appending ` > llama.log 2>&1` to your command.
103+
For very long logs (thousands of lines), please upload them as files instead; the `--log-file` CLI argument can be used for this purpose.
104+
On Linux you can alternatively redirect the console output of any command into a file by appending ` > llama.log 2>&1` to your command.
105105
value: |
106106
<details>
107107
<summary>Logs</summary>

.github/ISSUE_TEMPLATE/019-bug-misc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ body:
8888
description: >
8989
If applicable, please copy and paste any relevant log output, including any generated text.
9090
If you are encountering problems specifically with the `llama_params_fit` module, always upload `--verbose` logs as well.
91-
For very long logs (thousands of lines), please upload them as files instead.
92-
On Linux you can redirect console output into a file by appending ` > llama.log 2>&1` to your command.
91+
For very long logs (thousands of lines), please upload them as files instead; the `--log-file` CLI argument can be used for this purpose.
92+
On Linux you can alternatively redirect the console output of any command into a file by appending ` > llama.log 2>&1` to your command.
9393
value: |
9494
<details>
9595
<summary>Logs</summary>

.github/workflows/build-and-test-snapdragon.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
android-ndk-snapdragon:
3232
runs-on: ubuntu-latest
3333
container:
34-
image: 'ghcr.io/snapdragon-toolchain/arm64-android:v0.3'
34+
image: 'ghcr.io/snapdragon-toolchain/arm64-android:v0.6'
3535
defaults:
3636
run:
3737
shell: bash
@@ -61,7 +61,7 @@ jobs:
6161
linux-iot-snapdragon:
6262
runs-on: ubuntu-latest
6363
container:
64-
image: 'ghcr.io/snapdragon-toolchain/arm64-linux:v0.1'
64+
image: 'ghcr.io/snapdragon-toolchain/arm64-linux:v0.6'
6565
defaults:
6666
run:
6767
shell: bash

.github/workflows/server-self-hosted.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,33 @@ jobs:
152152
fetch-depth: 0
153153
ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
154154

155+
- name: Dependencies
156+
id: depends
157+
run: |
158+
set -euxo pipefail
159+
sudo apt-get update
160+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
161+
apt-get install -y \
162+
build-essential \
163+
libssl-dev \
164+
python3-venv \
165+
gpg \
166+
wget \
167+
time \
168+
git-lfs
169+
170+
git lfs install
171+
172+
# install the latest cmake
173+
sudo install -d /usr/share/keyrings
174+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
175+
| gpg --dearmor \
176+
| sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
177+
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \
178+
| sudo tee /etc/apt/sources.list.d/kitware.list
179+
sudo apt-get update
180+
sudo apt-get install -y cmake
181+
155182
- name: Build
156183
id: cmake_build
157184
run: |

.github/workflows/ui-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
ui-checks:
4242
name: UI Checks
4343
needs: ui-build
44-
runs-on: ubuntu-slim
44+
runs-on: ubuntu-latest
4545
continue-on-error: true
4646
steps:
4747
- name: Checkout code
@@ -93,7 +93,7 @@ jobs:
9393
e2e-tests:
9494
name: E2E Tests
9595
needs: ui-build
96-
runs-on: ubuntu-slim
96+
runs-on: ubuntu-latest
9797
steps:
9898
- name: Checkout code
9999
uses: actions/checkout@v6

.pi/gg/SYSTEM.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Pull requests (PRs):
2222
Commits:
2323
- On every commit that you make, include a "Assisted-by: llama.cpp:local pi" tag
2424
- Do not explicitly set the git author in commits - rely on the default git config
25+
- Always use `--no-gpg-sign` when committing
26+
- Never `git push` without explicit confirmation from the user
2527

2628
Resources (read on demand):
2729
- [CONTRIBUTING.md](CONTRIBUTING.md)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ Instructions for adding support for new models: [HOWTO-add-model.md](docs/develo
280280
| [Metal](docs/build.md#metal-build) | Apple Silicon |
281281
| [BLAS](docs/build.md#blas-build) | All |
282282
| [BLIS](docs/backend/BLIS.md) | All |
283-
| [SYCL](docs/backend/SYCL.md) | Intel and Nvidia GPU |
283+
| [SYCL](docs/backend/SYCL.md) | Intel GPU |
284284
| [OpenVINO [In Progress]](docs/backend/OPENVINO.md) | Intel CPUs, GPUs, and NPUs |
285285
| [MUSA](docs/build.md#musa) | Moore Threads GPU |
286286
| [CUDA](docs/build.md#cuda) | Nvidia GPU |

common/arg.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,11 @@ static bool common_params_parse_ex(int argc, char ** argv, common_params_context
536536
throw std::invalid_argument(string_format("error: invalid argument: %s", arg.c_str()));
537537
}
538538
if (!seen_args.insert(arg).second) {
539-
LOG_WRN("DEPRECATED: argument '%s' specified multiple times, use comma-separated values instead (only last value will be used)\n", arg.c_str());
539+
const bool skip = (arg == "--spec-type");
540+
541+
if (!skip) {
542+
LOG_WRN("DEPRECATED: argument '%s' specified multiple times, use comma-separated values instead (only last value will be used)\n", arg.c_str());
543+
}
540544
}
541545
auto & tmp = arg_to_options[arg];
542546
auto opt = *tmp.first;
@@ -893,7 +897,11 @@ bool common_params_to_map(int argc, char ** argv, llama_example ex, std::map<com
893897
throw std::invalid_argument(string_format("error: invalid argument: %s", arg.c_str()));
894898
}
895899
if (!seen_args.insert(arg).second) {
896-
LOG_WRN("DEPRECATED: argument '%s' specified multiple times, use comma-separated values instead (only last value will be used)\n", arg.c_str());
900+
const bool skip = (arg == "--spec-type");
901+
902+
if (!skip) {
903+
LOG_WRN("DEPRECATED: argument '%s' specified multiple times, use comma-separated values instead (only last value will be used)\n", arg.c_str());
904+
}
897905
}
898906
auto opt = *arg_to_options[arg];
899907
std::string val;
@@ -3356,7 +3364,8 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
33563364
" - 1: error\n"
33573365
" - 2: warning\n"
33583366
" - 3: info\n"
3359-
" - 4: debug\n"
3367+
" - 4: trace (more info)\n"
3368+
" - 5: debug\n"
33603369
"(default: %d)\n", params.verbosity),
33613370
[](common_params & params, int value) {
33623371
params.verbosity = value;
@@ -4117,6 +4126,12 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
41174126
params.speculative.ngram_mod.n_match = 24;
41184127
params.speculative.ngram_mod.n_min = 48;
41194128
params.speculative.ngram_mod.n_max = 64;
4129+
4130+
// TODO: not sure if this is a good config - explore more settings and potentially enable it
4131+
//params.speculative.types.push_back(COMMON_SPECULATIVE_TYPE_NGRAM_MAP_K4V);
4132+
//params.speculative.ngram_map_k4v.size_n = 8;
4133+
//params.speculative.ngram_map_k4v.size_m = 24;
4134+
//params.speculative.ngram_map_k4v.min_hits = 2;
41204135
}
41214136
).set_examples({LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_CLI}));
41224137

common/common.cpp

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ struct common_init_result::impl {
11601160
std::vector<llama_sampler_seq_config> samplers_seq_config;
11611161
};
11621162

1163-
common_init_result::common_init_result(common_params & params) :
1163+
common_init_result::common_init_result(common_params & params, bool model_only) :
11641164
pimpl(new impl{}) {
11651165
auto mparams = common_model_params_to_llama(params);
11661166
auto cparams = common_context_params_to_llama(params);
@@ -1173,7 +1173,7 @@ common_init_result::common_init_result(common_params & params) :
11731173
params.tensor_buft_overrides.data(),
11741174
params.fit_params_target.data(),
11751175
params.fit_params_min_ctx,
1176-
params.verbosity >= 4 ? GGML_LOG_LEVEL_DEBUG : GGML_LOG_LEVEL_ERROR);
1176+
params.verbosity >= LOG_LEVEL_DEBUG ? GGML_LOG_LEVEL_DEBUG : GGML_LOG_LEVEL_ERROR);
11771177
}
11781178

11791179
llama_model * model = llama_model_load_from_file(params.model.path.c_str(), mparams);
@@ -1183,6 +1183,10 @@ common_init_result::common_init_result(common_params & params) :
11831183

11841184
pimpl->model.reset(model);
11851185

1186+
if (model_only) {
1187+
return;
1188+
}
1189+
11861190
const llama_vocab * vocab = llama_model_get_vocab(model);
11871191

11881192
// load and optionally apply lora adapters
@@ -1252,29 +1256,6 @@ common_init_result::common_init_result(common_params & params) :
12521256
cparams.n_samplers = pimpl->samplers_seq_config.size();
12531257
}
12541258

1255-
// [TAG_RS_STATE_ROLLBACK_SUPPORT]
1256-
// TODO: ngram speculative methods require checkpointing in addition to partial RS rollback
1257-
// currently this is not supported. so we disable the partial rollback
1258-
if (cparams.n_rs_seq > 0 && (llama_model_is_recurrent(model) || llama_model_is_hybrid(model))) {
1259-
auto & types = params.speculative.types;
1260-
1261-
for (int i = 0; i < (int) types.size(); i++) {
1262-
if (types[i] == COMMON_SPECULATIVE_TYPE_NONE) {
1263-
continue;
1264-
}
1265-
if (types[i] == COMMON_SPECULATIVE_TYPE_DRAFT_MTP) {
1266-
continue;
1267-
}
1268-
1269-
cparams.n_rs_seq = 0;
1270-
1271-
LOG_WRN("%s: recurrent state rollback is not compatible with '%s' - disabling rollback support\n", __func__,
1272-
common_speculative_type_to_str(types[i]).c_str());
1273-
1274-
break;
1275-
}
1276-
}
1277-
12781259
llama_context * lctx = llama_init_from_model(model, cparams);
12791260
if (lctx == NULL) {
12801261
LOG_ERR("%s: failed to create context with model '%s'\n", __func__, params.model.path.c_str());
@@ -1309,15 +1290,19 @@ std::vector<llama_adapter_lora_ptr> & common_init_result::lora() {
13091290
return pimpl->lora;
13101291
}
13111292

1312-
common_init_result_ptr common_init_from_params(common_params & params) {
1313-
common_init_result_ptr res(new common_init_result(params));
1293+
common_init_result_ptr common_init_from_params(common_params & params, bool model_only) {
1294+
common_init_result_ptr res(new common_init_result(params, model_only));
13141295

13151296
llama_model * model = res->model();
13161297
if (model == NULL) {
13171298
LOG_ERR("%s: failed to load model '%s'\n", __func__, params.model.path.c_str());
13181299
return res;
13191300
}
13201301

1302+
if (model_only) {
1303+
return res;
1304+
}
1305+
13211306
llama_context * lctx = res->context();
13221307
if (lctx == NULL) {
13231308
LOG_ERR("%s: failed to create context with model '%s'\n", __func__, params.model.path.c_str());
@@ -1381,7 +1366,7 @@ common_init_result_ptr common_init_from_params(common_params & params) {
13811366
}
13821367

13831368
if (params.warmup) {
1384-
LOG_WRN("%s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n", __func__);
1369+
LOG_INF("%s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n", __func__);
13851370

13861371
llama_set_warmup(lctx, true);
13871372

common/common.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,11 @@ struct common_params_model {
299299

300300
// draft-model-based speculative decoding parameters
301301
struct common_params_speculative_draft {
302-
int32_t n_max = 16; // maximum number of tokens to draft during speculative decoding
303-
int32_t n_min = 0; // minimum number of draft tokens to use for speculative decoding
302+
int32_t n_max = 3; // maximum number of tokens to draft during speculative decoding
303+
int32_t n_min = 0; // minimum number of draft tokens to use for speculative decoding
304304

305-
float p_split = 0.1f; // speculative decoding split probability
306-
float p_min = 0.75f; // minimum speculative decoding probability (greedy) // TODO: change default to 0.0f
305+
float p_split = 0.1f; // speculative decoding split probability
306+
float p_min = 0.0f; // minimum speculative decoding probability (greedy)
307307

308308
common_params_model mparams;
309309

@@ -857,7 +857,7 @@ struct common_sampler;
857857

858858
// note: defines the model, context, samplers, ets. lifetimes
859859
struct common_init_result {
860-
common_init_result(common_params & params);
860+
common_init_result(common_params & params, bool model_only = false);
861861
~common_init_result();
862862

863863
llama_model * model();
@@ -875,7 +875,7 @@ struct common_init_result {
875875

876876
using common_init_result_ptr = std::unique_ptr<common_init_result>;
877877

878-
common_init_result_ptr common_init_from_params(common_params & params);
878+
common_init_result_ptr common_init_from_params(common_params & params, bool model_only = false);
879879

880880
struct llama_model_params common_model_params_to_llama ( common_params & params);
881881
struct llama_context_params common_context_params_to_llama(const common_params & params);

0 commit comments

Comments
 (0)