llama : remove redundant fields from llm_graph_params (#32596)

llm_graph_params no longer carries hparams, prec_policy and hdmd, since the model reference already provides them. llm_graph_context sources them from the model and keeps prec_policy as a reference.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)
This commit is contained in:
Georgi Gerganov authored and GitHub committed 2026-11-19 13:31:50 +02:00
1 parent 8bf2132c3f
commit 01592dc58b
3 files changed
+7 -19

No files matched your search

+5 -9
View File
@@ -1594,9 +1594,10 @@ void llm_graph_result::set_params(const llm_graph_params & params) {
llm_graph_context::llm_graph_context(const llm_graph_params & params) :
model (*params.model),
hparams (params.hparams),
hparams (model.hparams),
cparams (params.cparams),
ubatch (params.ubatch),
prec_policy (model.prec_policy),
n_embd (hparams.n_embd),
n_layer (hparams.n_layer()),
n_layer_nextn (hparams.n_layer_nextn),
@@ -1630,8 +1631,7 @@ llm_graph_context::llm_graph_context(const llm_graph_params & params) :
mctx (params.mctx),
cross (params.cross),
moe_cache (params.moe_cache),
prec_policy (params.prec_policy),
hdmd (params.hdmd),
hdmd (model.hdmd.rot.empty() ? nullptr : &model.hdmd),
layer_inp_dev (params.layer_inp_dev),
layer_inp_src (params.layer_inp_src),
h_nextn_dev (params.h_nextn_dev),
@@ -1728,9 +1728,7 @@ ggml_tensor * llm_graph_context::build_lora_mm(
ggml_tensor * cur_mm = build_hadamard_input(w, cur);
ggml_tensor * res = ggml_mul_mat(ctx0, w, cur_mm);
if (prec_policy) {
prec_policy->apply(res);
}
prec_policy.apply(res);
if (w->type == GGML_TYPE_NVFP4) {
ggml_prec_set_acc(res, GGML_PREC_BF16);
@@ -1812,9 +1810,7 @@ ggml_tensor * llm_graph_context::build_lora_mm_id(
ggml_mul_mat_id(ctx0, w, cur_mm, ids) :
ggml_mul_mat_id(ctx0, cached ? moe_cache->get_experts(w) : w, cur_mm, slots);
if (prec_policy) {
prec_policy->apply(res);
}
prec_policy.apply(res);
if (w->type == GGML_TYPE_NVFP4) {
ggml_prec_set_acc(res, GGML_PREC_BF16);