data: publish complete Calculet NPU research archive

This commit is contained in:
2026-08-02 14:57:11 +08:00
parent b5c4fbffab
commit 98e6cadcb6
12400 changed files with 6166642 additions and 0 deletions
@@ -0,0 +1,21 @@
# llama.cpp unreachable-object recovery
This directory preserves every commit and annotated tag reported as unreachable by
`git fsck --full --unreachable --no-reflogs` in the recovered repository.
The seven commits consist of one ordinary experimental commit and three expired
stash pairs. In each stash pair, the `index on ...` commit stores the staged/index
tree and the two-parent `WIP on ...` commit stores the complete worktree snapshot.
`patches/*-vs-first-parent.patch` reproduces each commit relative to its base.
For two-parent WIP commits, `*-vs-index-parent.patch` additionally isolates the
worktree snapshot relative to the stash index parent. Zero-byte patch files are
intentional: those index commits contain no tree changes from their base.
`llama.cpp-all-refs-plus-recovered-unreachable-20260802.bundle` is the preferred
self-contained recovery asset. It names the recovered objects under
`refs/recovered/unreachable/*` and `refs/recovered/tags/*`; clone it with
`git clone --mirror` to retain those ref names.
The exact original repository archive remains the forensic source of truth because
it also preserves original reflogs, config, worktree state, and object storage.
@@ -0,0 +1,8 @@
commit kind parent_1 parent_2 author_date author subject
1d248d956f6cbcf5fdd4169d5467678ead035fe2 ordinary-experiment 41e6636ea1fb3884e41fb2023f92b0e7262ef09b 2026-03-24T02:17:22+08:00 wangbomeng <wangbomeng@calculet.tech> calrt: add slice
f06f10a592284d02a0e68019abab18f637cb738f expired-stash-index 207ca38c751f7e6c251833eb11e89a2a0bb0fd07 2026-04-09T10:37:03+08:00 Bomeng Wang <wangbomeng@calculet.tech> index on dev: 207ca38c delet extra printf
c44438579a1cc573cbdb2519dda46ccd04ddc817 expired-stash-wip 207ca38c751f7e6c251833eb11e89a2a0bb0fd07 f06f10a592284d02a0e68019abab18f637cb738f 2026-04-09T10:37:03+08:00 Bomeng Wang <wangbomeng@calculet.tech> WIP on dev: 207ca38c delet extra printf
294f5e41db9f2ee14fa7e511b1774c6271c7c7ec expired-stash-index 99dd308adb8488fa869bb669e3335e646a938eff 2026-04-27T11:41:25+08:00 Bomeng Wang <wangbomeng@calculet.tech> index on (no branch): 99dd308a server: fix max_seq_len
2a67be2e31c4b7b28fa3937893ec9e86bf5d9f4d expired-stash-wip 99dd308adb8488fa869bb669e3335e646a938eff 294f5e41db9f2ee14fa7e511b1774c6271c7c7ec 2026-04-27T11:41:25+08:00 Bomeng Wang <wangbomeng@calculet.tech> WIP on (no branch): 99dd308a server: fix max_seq_len
499f6ff441d26b9a720c3d3403bde14695257b9d expired-stash-index efa1876bb8b2a449a55054a8c3745892f2c0f262 2026-04-30T16:18:01+08:00 Bomeng Wang <wangbomeng@calculet.tech> index on (no branch): efa1876b update version print
81d4fd2c584e6df9199181e44b77fc3d939c0a67 expired-stash-wip efa1876bb8b2a449a55054a8c3745892f2c0f262 499f6ff441d26b9a720c3d3403bde14695257b9d 2026-04-30T16:18:01+08:00 Bomeng Wang <wangbomeng@calculet.tech> WIP on (no branch): efa1876b update version print
1 commit kind parent_1 parent_2 author_date author subject
2 1d248d956f6cbcf5fdd4169d5467678ead035fe2 ordinary-experiment 41e6636ea1fb3884e41fb2023f92b0e7262ef09b 2026-03-24T02:17:22+08:00 wangbomeng <wangbomeng@calculet.tech> calrt: add slice
3 f06f10a592284d02a0e68019abab18f637cb738f expired-stash-index 207ca38c751f7e6c251833eb11e89a2a0bb0fd07 2026-04-09T10:37:03+08:00 Bomeng Wang <wangbomeng@calculet.tech> index on dev: 207ca38c delet extra printf
4 c44438579a1cc573cbdb2519dda46ccd04ddc817 expired-stash-wip 207ca38c751f7e6c251833eb11e89a2a0bb0fd07 f06f10a592284d02a0e68019abab18f637cb738f 2026-04-09T10:37:03+08:00 Bomeng Wang <wangbomeng@calculet.tech> WIP on dev: 207ca38c delet extra printf
5 294f5e41db9f2ee14fa7e511b1774c6271c7c7ec expired-stash-index 99dd308adb8488fa869bb669e3335e646a938eff 2026-04-27T11:41:25+08:00 Bomeng Wang <wangbomeng@calculet.tech> index on (no branch): 99dd308a server: fix max_seq_len
6 2a67be2e31c4b7b28fa3937893ec9e86bf5d9f4d expired-stash-wip 99dd308adb8488fa869bb669e3335e646a938eff 294f5e41db9f2ee14fa7e511b1774c6271c7c7ec 2026-04-27T11:41:25+08:00 Bomeng Wang <wangbomeng@calculet.tech> WIP on (no branch): 99dd308a server: fix max_seq_len
7 499f6ff441d26b9a720c3d3403bde14695257b9d expired-stash-index efa1876bb8b2a449a55054a8c3745892f2c0f262 2026-04-30T16:18:01+08:00 Bomeng Wang <wangbomeng@calculet.tech> index on (no branch): efa1876b update version print
8 81d4fd2c584e6df9199181e44b77fc3d939c0a67 expired-stash-wip efa1876bb8b2a449a55054a8c3745892f2c0f262 499f6ff441d26b9a720c3d3403bde14695257b9d 2026-04-30T16:18:01+08:00 Bomeng Wang <wangbomeng@calculet.tech> WIP on (no branch): efa1876b update version print
@@ -0,0 +1,7 @@
commit 1d248d956f6cbcf5fdd4169d5467678ead035fe2
Author: wangbomeng <wangbomeng@calculet.tech>
AuthorDate: Tue Mar 24 02:17:22 2026 +0800
Commit: wangbomeng <wangbomeng@calculet.tech>
CommitDate: Tue Mar 24 02:17:22 2026 +0800
calrt: add slice
@@ -0,0 +1,15 @@
diff --git a/src/llama-calrt.cpp b/src/llama-calrt.cpp
index 5bbdd52e1f7adc96ac72945ed52eabd9e075d990..e038a4c25d5589550680bf5bb556145f1524ae17 100644
--- a/src/llama-calrt.cpp
+++ b/src/llama-calrt.cpp
@@ -564,6 +564,10 @@ void calrt_context::calrt_infer(calrt_seqs_info & seqs) {
// makeup_ubatch(ubatch);
copy_data_to_ibuf(*pIbuf, ubatch, model_name);
+ //only copy promt tokens
+ //pObuf->SliceTensorByName(pObuf->GetTensorByName("outputs[0]")->GetDataPtr(),"outputs[0]", 0, cur_seq_len * sizeof(ggml_bf16_t));
+ pObuf->GetTensorByName("outputs[0]")->SliceTensor(0, cur_seq_len * sizeof(ggml_bf16_t));
+
calrt::infer(vdev, model, pIbuf.get(), pObuf.get());
pObuf->Wait();
@@ -0,0 +1,7 @@
commit 294f5e41db9f2ee14fa7e511b1774c6271c7c7ec
Author: Bomeng Wang <wangbomeng@calculet.tech>
AuthorDate: Mon Apr 27 11:41:25 2026 +0800
Commit: Bomeng Wang <wangbomeng@calculet.tech>
CommitDate: Mon Apr 27 11:41:25 2026 +0800
index on (no branch): 99dd308a server: fix max_seq_len
@@ -0,0 +1,8 @@
commit 2a67be2e31c4b7b28fa3937893ec9e86bf5d9f4d
Merge: 99dd308a 294f5e41
Author: Bomeng Wang <wangbomeng@calculet.tech>
AuthorDate: Mon Apr 27 11:41:25 2026 +0800
Commit: Bomeng Wang <wangbomeng@calculet.tech>
CommitDate: Mon Apr 27 11:41:25 2026 +0800
WIP on (no branch): 99dd308a server: fix max_seq_len
@@ -0,0 +1,140 @@
diff --git a/common/common.cpp b/common/common.cpp
index 625b369b26a5981cc19eda5181226d916acc28ad..898d445293a51a4d1e0037f05bc83b5f773cc430 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -1058,51 +1058,51 @@ struct common_init_result common_init_from_params(common_params & params) {
params.sampling.dry_penalty_last_n = llama_n_ctx(lctx);
}
- if (params.warmup) {
- LOG_WRN("%s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n", __func__);
-
- llama_set_warmup(lctx, true);
-
- std::vector<llama_token> tmp;
- llama_token bos = llama_vocab_bos(vocab);
- llama_token eos = llama_vocab_eos(vocab);
-
- // some models (e.g. T5) don't have a BOS token
- if (bos != LLAMA_TOKEN_NULL) {
- tmp.push_back(bos);
- }
- if (eos != LLAMA_TOKEN_NULL) {
- tmp.push_back(eos);
- }
- if (tmp.empty()) {
- tmp.push_back(0);
- }
-
- if (llama_model_has_encoder(model)) {
- #ifdef USE_CALRT
- //calrt_encode(cal_ctx, llama_batch_get_one(tmp.data(), tmp.size()));
- #else
- llama_encode(lctx, llama_batch_get_one(tmp.data(), tmp.size()));
- #endif
- llama_token decoder_start_token_id = llama_model_decoder_start_token(model);
- if (decoder_start_token_id == LLAMA_TOKEN_NULL) {
- decoder_start_token_id = bos;
- }
- tmp.clear();
- tmp.push_back(decoder_start_token_id);
- }
- if (llama_model_has_decoder(model)) {
- #ifdef USE_CALRT
- calrt_decode(cal_ctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
- #else
- llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
- #endif
- }
- llama_memory_clear(llama_get_memory(lctx), true);
- llama_synchronize(lctx);
- llama_perf_context_reset(lctx);
- llama_set_warmup(lctx, false);
- }
+ // if (params.warmup) {
+ // LOG_WRN("%s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n", __func__);
+
+ // llama_set_warmup(lctx, true);
+
+ // std::vector<llama_token> tmp;
+ // llama_token bos = llama_vocab_bos(vocab);
+ // llama_token eos = llama_vocab_eos(vocab);
+
+ // // some models (e.g. T5) don't have a BOS token
+ // if (bos != LLAMA_TOKEN_NULL) {
+ // tmp.push_back(bos);
+ // }
+ // if (eos != LLAMA_TOKEN_NULL) {
+ // tmp.push_back(eos);
+ // }
+ // if (tmp.empty()) {
+ // tmp.push_back(0);
+ // }
+
+ // if (llama_model_has_encoder(model)) {
+ // #ifdef USE_CALRT
+ // //calrt_encode(cal_ctx, llama_batch_get_one(tmp.data(), tmp.size()));
+ // #else
+ // llama_encode(lctx, llama_batch_get_one(tmp.data(), tmp.size()));
+ // #endif
+ // llama_token decoder_start_token_id = llama_model_decoder_start_token(model);
+ // if (decoder_start_token_id == LLAMA_TOKEN_NULL) {
+ // decoder_start_token_id = bos;
+ // }
+ // tmp.clear();
+ // tmp.push_back(decoder_start_token_id);
+ // }
+ // if (llama_model_has_decoder(model)) {
+ // #ifdef USE_CALRT
+ // calrt_decode(cal_ctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
+ // #else
+ // llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
+ // #endif
+ // }
+ // llama_memory_clear(llama_get_memory(lctx), true);
+ // llama_synchronize(lctx);
+ // llama_perf_context_reset(lctx);
+ // llama_set_warmup(lctx, false);
+ // }
iparams.model.reset(model);
iparams.context.reset(lctx);
diff --git a/src/llama-calrt.cpp b/src/llama-calrt.cpp
index 9f41c955b7bb36cdc4dfc0d50c5fdd76667a2373..e8dc07c6fe6282ff3d7d4e43210b3491982d10f0 100644
--- a/src/llama-calrt.cpp
+++ b/src/llama-calrt.cpp
@@ -43,6 +43,16 @@ std::unique_ptr<calrt::VirtualDevice> init_calrt_vdev() {
throw std::runtime_error("failed to create vdevice");
}
+ uint64_t commitId = 0;
+ uint32_t rdata = 0;
+ vDev->GetDevice()->ReadReg(0x0a238254, rdata);
+ commitId |=(((uint64_t)rdata) << 32);
+ vDev->GetDevice()->ReadReg(0x0a238258, rdata);
+ commitId |=((uint64_t)rdata);
+
+ LLAMA_LOG_INFO("CalcoreRT: =================== CalcoreRT Version: %016llx ====================\n", commitId);
+ LLAMA_LOG_INFO("CalRT: =================== CalRT Version %s ====================\n", calrt::calrt_version());
+
return vDev;
}
@@ -664,7 +674,7 @@ calrt::CalbinModel * calrt_context::get_model_by_name(std::string & name) {
}
if (smodelName.empty()) {
- LLAMA_LOG_ERROR("submodel who's name contains %s not found", name.c_str());
+ //LLAMA_LOG_ERROR("submodel who's name contains %s not found", name.c_str());
return nullptr;
}
@@ -681,7 +691,7 @@ calrt::CalbinModel * calrt_context::get_model_by_names(std::string & name1, std:
}
if (smodelName.empty()) {
- LLAMA_LOG_ERROR("submodel who's name contains %s not found", name1.c_str(), name2.c_str());
+ //LLAMA_LOG_ERROR("submodel who's name contains %s not found", name1.c_str(), name2.c_str());
return nullptr;
}
@@ -0,0 +1,140 @@
diff --git a/common/common.cpp b/common/common.cpp
index 625b369b26a5981cc19eda5181226d916acc28ad..898d445293a51a4d1e0037f05bc83b5f773cc430 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -1058,51 +1058,51 @@ struct common_init_result common_init_from_params(common_params & params) {
params.sampling.dry_penalty_last_n = llama_n_ctx(lctx);
}
- if (params.warmup) {
- LOG_WRN("%s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n", __func__);
-
- llama_set_warmup(lctx, true);
-
- std::vector<llama_token> tmp;
- llama_token bos = llama_vocab_bos(vocab);
- llama_token eos = llama_vocab_eos(vocab);
-
- // some models (e.g. T5) don't have a BOS token
- if (bos != LLAMA_TOKEN_NULL) {
- tmp.push_back(bos);
- }
- if (eos != LLAMA_TOKEN_NULL) {
- tmp.push_back(eos);
- }
- if (tmp.empty()) {
- tmp.push_back(0);
- }
-
- if (llama_model_has_encoder(model)) {
- #ifdef USE_CALRT
- //calrt_encode(cal_ctx, llama_batch_get_one(tmp.data(), tmp.size()));
- #else
- llama_encode(lctx, llama_batch_get_one(tmp.data(), tmp.size()));
- #endif
- llama_token decoder_start_token_id = llama_model_decoder_start_token(model);
- if (decoder_start_token_id == LLAMA_TOKEN_NULL) {
- decoder_start_token_id = bos;
- }
- tmp.clear();
- tmp.push_back(decoder_start_token_id);
- }
- if (llama_model_has_decoder(model)) {
- #ifdef USE_CALRT
- calrt_decode(cal_ctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
- #else
- llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
- #endif
- }
- llama_memory_clear(llama_get_memory(lctx), true);
- llama_synchronize(lctx);
- llama_perf_context_reset(lctx);
- llama_set_warmup(lctx, false);
- }
+ // if (params.warmup) {
+ // LOG_WRN("%s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n", __func__);
+
+ // llama_set_warmup(lctx, true);
+
+ // std::vector<llama_token> tmp;
+ // llama_token bos = llama_vocab_bos(vocab);
+ // llama_token eos = llama_vocab_eos(vocab);
+
+ // // some models (e.g. T5) don't have a BOS token
+ // if (bos != LLAMA_TOKEN_NULL) {
+ // tmp.push_back(bos);
+ // }
+ // if (eos != LLAMA_TOKEN_NULL) {
+ // tmp.push_back(eos);
+ // }
+ // if (tmp.empty()) {
+ // tmp.push_back(0);
+ // }
+
+ // if (llama_model_has_encoder(model)) {
+ // #ifdef USE_CALRT
+ // //calrt_encode(cal_ctx, llama_batch_get_one(tmp.data(), tmp.size()));
+ // #else
+ // llama_encode(lctx, llama_batch_get_one(tmp.data(), tmp.size()));
+ // #endif
+ // llama_token decoder_start_token_id = llama_model_decoder_start_token(model);
+ // if (decoder_start_token_id == LLAMA_TOKEN_NULL) {
+ // decoder_start_token_id = bos;
+ // }
+ // tmp.clear();
+ // tmp.push_back(decoder_start_token_id);
+ // }
+ // if (llama_model_has_decoder(model)) {
+ // #ifdef USE_CALRT
+ // calrt_decode(cal_ctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
+ // #else
+ // llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
+ // #endif
+ // }
+ // llama_memory_clear(llama_get_memory(lctx), true);
+ // llama_synchronize(lctx);
+ // llama_perf_context_reset(lctx);
+ // llama_set_warmup(lctx, false);
+ // }
iparams.model.reset(model);
iparams.context.reset(lctx);
diff --git a/src/llama-calrt.cpp b/src/llama-calrt.cpp
index 9f41c955b7bb36cdc4dfc0d50c5fdd76667a2373..e8dc07c6fe6282ff3d7d4e43210b3491982d10f0 100644
--- a/src/llama-calrt.cpp
+++ b/src/llama-calrt.cpp
@@ -43,6 +43,16 @@ std::unique_ptr<calrt::VirtualDevice> init_calrt_vdev() {
throw std::runtime_error("failed to create vdevice");
}
+ uint64_t commitId = 0;
+ uint32_t rdata = 0;
+ vDev->GetDevice()->ReadReg(0x0a238254, rdata);
+ commitId |=(((uint64_t)rdata) << 32);
+ vDev->GetDevice()->ReadReg(0x0a238258, rdata);
+ commitId |=((uint64_t)rdata);
+
+ LLAMA_LOG_INFO("CalcoreRT: =================== CalcoreRT Version: %016llx ====================\n", commitId);
+ LLAMA_LOG_INFO("CalRT: =================== CalRT Version %s ====================\n", calrt::calrt_version());
+
return vDev;
}
@@ -664,7 +674,7 @@ calrt::CalbinModel * calrt_context::get_model_by_name(std::string & name) {
}
if (smodelName.empty()) {
- LLAMA_LOG_ERROR("submodel who's name contains %s not found", name.c_str());
+ //LLAMA_LOG_ERROR("submodel who's name contains %s not found", name.c_str());
return nullptr;
}
@@ -681,7 +691,7 @@ calrt::CalbinModel * calrt_context::get_model_by_names(std::string & name1, std:
}
if (smodelName.empty()) {
- LLAMA_LOG_ERROR("submodel who's name contains %s not found", name1.c_str(), name2.c_str());
+ //LLAMA_LOG_ERROR("submodel who's name contains %s not found", name1.c_str(), name2.c_str());
return nullptr;
}
@@ -0,0 +1,7 @@
commit 499f6ff441d26b9a720c3d3403bde14695257b9d
Author: Bomeng Wang <wangbomeng@calculet.tech>
AuthorDate: Thu Apr 30 16:18:01 2026 +0800
Commit: Bomeng Wang <wangbomeng@calculet.tech>
CommitDate: Thu Apr 30 16:18:01 2026 +0800
index on (no branch): efa1876b update version print
@@ -0,0 +1,8 @@
commit 81d4fd2c584e6df9199181e44b77fc3d939c0a67
Merge: efa1876b 499f6ff4
Author: Bomeng Wang <wangbomeng@calculet.tech>
AuthorDate: Thu Apr 30 16:18:01 2026 +0800
Commit: Bomeng Wang <wangbomeng@calculet.tech>
CommitDate: Thu Apr 30 16:18:01 2026 +0800
WIP on (no branch): efa1876b update version print
@@ -0,0 +1,13 @@
diff --git a/src/llama-calrt.cpp b/src/llama-calrt.cpp
index 0dd65366a7390fc29423281f515f29406003de51..845d1df3b3e3ac5df45404b08909c5941ea49e54 100644
--- a/src/llama-calrt.cpp
+++ b/src/llama-calrt.cpp
@@ -133,7 +133,7 @@ int calrt_context::decode(const llama_batch & batch_inp) {
// require that all tokens are output
if (n_outputs_all != n_tokens_all) {
LLAMA_LOG_ERROR(
- "%s: pooled embedding requires that all tokens are output (n_outputs_all = %d, n_tokens_all = %d)\n",
+ "%s: pooled embedding requires that all tokens are eoutput (n_outputs_all = %d, n_tokens_all = %d)\n",
__func__, n_outputs_all, n_tokens_all);
return -1;
}
@@ -0,0 +1,13 @@
diff --git a/src/llama-calrt.cpp b/src/llama-calrt.cpp
index 0dd65366a7390fc29423281f515f29406003de51..845d1df3b3e3ac5df45404b08909c5941ea49e54 100644
--- a/src/llama-calrt.cpp
+++ b/src/llama-calrt.cpp
@@ -133,7 +133,7 @@ int calrt_context::decode(const llama_batch & batch_inp) {
// require that all tokens are output
if (n_outputs_all != n_tokens_all) {
LLAMA_LOG_ERROR(
- "%s: pooled embedding requires that all tokens are output (n_outputs_all = %d, n_tokens_all = %d)\n",
+ "%s: pooled embedding requires that all tokens are eoutput (n_outputs_all = %d, n_tokens_all = %d)\n",
__func__, n_outputs_all, n_tokens_all);
return -1;
}
@@ -0,0 +1,8 @@
commit c44438579a1cc573cbdb2519dda46ccd04ddc817
Merge: 207ca38c f06f10a5
Author: Bomeng Wang <wangbomeng@calculet.tech>
AuthorDate: Thu Apr 9 10:37:03 2026 +0800
Commit: Bomeng Wang <wangbomeng@calculet.tech>
CommitDate: Thu Apr 9 10:37:03 2026 +0800
WIP on dev: 207ca38c delet extra printf
@@ -0,0 +1,49 @@
diff --git a/tools/server/server.cpp b/tools/server/server.cpp
index 868d17b418312a2d7898f4b355eef76f509195c5..d2a035baeb46f868c72592d48a64c5ede41efee9 100644
--- a/tools/server/server.cpp
+++ b/tools/server/server.cpp
@@ -1875,7 +1875,7 @@ struct server_slot {
GGML_ASSERT(task);
auto previous_msg = chat_msg;
- SRV_DBG("Parsing chat message: %s\n", generated_text.c_str());
+ //SRV_DBG("Parsing chat message: %s\n", generated_text.c_str());
auto new_msg = common_chat_parse(
generated_text,
/* is_partial= */ stop != STOP_TYPE_EOS,
@@ -1920,13 +1920,17 @@ struct server_slot {
}
void print_timings() const {
- const double t_prompt = t_prompt_processing / n_prompt_tokens_processed;
- const double n_prompt_second = 1e3 / t_prompt_processing * n_prompt_tokens_processed;
+ const double t_copyout_total = t_inference_outcopy / 32 * 31;
+ const double t_copyout_decode = (t_inference_outcopy - t_prefill_inference_outcopy) / 32 * 31;
+ const double t_copyout_prefill = t_prefill_inference_outcopy / 32 * 31;
- const double t_gen = t_token_generation / n_decoded;
- const double n_gen_second = 1e3 / t_token_generation * n_decoded;
+ const double t_prompt = (t_prompt_processing - t_copyout_prefill) / n_prompt_tokens_processed;
+ const double n_prompt_second = 1e3 / (t_prompt_processing - t_copyout_prefill) * n_prompt_tokens_processed;
- const double t_total = t_prompt_processing + t_token_generation;
+ const double t_gen = (t_token_generation - t_copyout_decode) / n_decoded;
+ const double n_gen_second = 1e3 / (t_token_generation - t_copyout_decode) * n_decoded;
+
+ const double t_total = t_prompt_processing + t_token_generation -t_copyout_total ;
const double t_framework_other = t_total - t_inference_accumulated - t_inference_incopy - t_inference_outcopy - t_sampling_accumulated - t_unknown;
const double t_prompt_inference = t_prefill_inference_accumulated / n_prompt_tokens_processed;
@@ -1950,9 +1954,9 @@ struct server_slot {
" [Device] Unknown : %10.2f ms \n"
" [CPU] Sampling: %10.2f ms \n"
" [CPU] Fw Ovhd : %10.2f ms (Batch Prep, Logic, etc.)\n",
- t_prompt_processing, n_prompt_tokens_processed, t_prompt, n_prompt_second,
- t_token_generation, n_decoded, t_gen, n_gen_second,
- t_prompt_processing + t_token_generation, n_prompt_tokens_processed + n_decoded,
+ t_prompt_processing - t_copyout_prefill , n_prompt_tokens_processed, t_prompt, n_prompt_second,
+ t_token_generation - t_copyout_decode , n_decoded, t_gen, n_gen_second,
+ t_prompt_processing + t_token_generation - t_copyout_total, n_prompt_tokens_processed + n_decoded,
t_inference_accumulated, t_prefill_inference_accumulated, t_prompt_inference, t_inference_accumulated - t_prefill_inference_accumulated, t_gen_inference,
t_inference_incopy, t_prefill_inference_incopy, t_prompt_incopy, t_inference_incopy - t_prefill_inference_incopy, t_gen_incopy,
t_inference_outcopy, t_prefill_inference_outcopy, t_prompt_outcopy, t_inference_outcopy - t_prefill_inference_outcopy, t_gen_outcopy,
@@ -0,0 +1,49 @@
diff --git a/tools/server/server.cpp b/tools/server/server.cpp
index 868d17b418312a2d7898f4b355eef76f509195c5..d2a035baeb46f868c72592d48a64c5ede41efee9 100644
--- a/tools/server/server.cpp
+++ b/tools/server/server.cpp
@@ -1875,7 +1875,7 @@ struct server_slot {
GGML_ASSERT(task);
auto previous_msg = chat_msg;
- SRV_DBG("Parsing chat message: %s\n", generated_text.c_str());
+ //SRV_DBG("Parsing chat message: %s\n", generated_text.c_str());
auto new_msg = common_chat_parse(
generated_text,
/* is_partial= */ stop != STOP_TYPE_EOS,
@@ -1920,13 +1920,17 @@ struct server_slot {
}
void print_timings() const {
- const double t_prompt = t_prompt_processing / n_prompt_tokens_processed;
- const double n_prompt_second = 1e3 / t_prompt_processing * n_prompt_tokens_processed;
+ const double t_copyout_total = t_inference_outcopy / 32 * 31;
+ const double t_copyout_decode = (t_inference_outcopy - t_prefill_inference_outcopy) / 32 * 31;
+ const double t_copyout_prefill = t_prefill_inference_outcopy / 32 * 31;
- const double t_gen = t_token_generation / n_decoded;
- const double n_gen_second = 1e3 / t_token_generation * n_decoded;
+ const double t_prompt = (t_prompt_processing - t_copyout_prefill) / n_prompt_tokens_processed;
+ const double n_prompt_second = 1e3 / (t_prompt_processing - t_copyout_prefill) * n_prompt_tokens_processed;
- const double t_total = t_prompt_processing + t_token_generation;
+ const double t_gen = (t_token_generation - t_copyout_decode) / n_decoded;
+ const double n_gen_second = 1e3 / (t_token_generation - t_copyout_decode) * n_decoded;
+
+ const double t_total = t_prompt_processing + t_token_generation -t_copyout_total ;
const double t_framework_other = t_total - t_inference_accumulated - t_inference_incopy - t_inference_outcopy - t_sampling_accumulated - t_unknown;
const double t_prompt_inference = t_prefill_inference_accumulated / n_prompt_tokens_processed;
@@ -1950,9 +1954,9 @@ struct server_slot {
" [Device] Unknown : %10.2f ms \n"
" [CPU] Sampling: %10.2f ms \n"
" [CPU] Fw Ovhd : %10.2f ms (Batch Prep, Logic, etc.)\n",
- t_prompt_processing, n_prompt_tokens_processed, t_prompt, n_prompt_second,
- t_token_generation, n_decoded, t_gen, n_gen_second,
- t_prompt_processing + t_token_generation, n_prompt_tokens_processed + n_decoded,
+ t_prompt_processing - t_copyout_prefill , n_prompt_tokens_processed, t_prompt, n_prompt_second,
+ t_token_generation - t_copyout_decode , n_decoded, t_gen, n_gen_second,
+ t_prompt_processing + t_token_generation - t_copyout_total, n_prompt_tokens_processed + n_decoded,
t_inference_accumulated, t_prefill_inference_accumulated, t_prompt_inference, t_inference_accumulated - t_prefill_inference_accumulated, t_gen_inference,
t_inference_incopy, t_prefill_inference_incopy, t_prompt_incopy, t_inference_incopy - t_prefill_inference_incopy, t_gen_incopy,
t_inference_outcopy, t_prefill_inference_outcopy, t_prompt_outcopy, t_inference_outcopy - t_prefill_inference_outcopy, t_gen_outcopy,
@@ -0,0 +1,7 @@
commit f06f10a592284d02a0e68019abab18f637cb738f
Author: Bomeng Wang <wangbomeng@calculet.tech>
AuthorDate: Thu Apr 9 10:37:03 2026 +0800
Commit: Bomeng Wang <wangbomeng@calculet.tech>
CommitDate: Thu Apr 9 10:37:03 2026 +0800
index on dev: 207ca38c delet extra printf
@@ -0,0 +1,6 @@
object 41e6636ea1fb3884e41fb2023f92b0e7262ef09b
type commit
tag v0.1.0
tagger wangbomeng <wangbomeng@calculet.tech> 1775010837 +0800
add slice and infer/copy time