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 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 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 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; }