@@ -366,15 +366,29 @@ void common_init() {
366366 SetConsoleCP (CP_UTF8);
367367#endif
368368
369+ common_log_set_prefix (common_log_main (), true );
370+ common_log_set_timestamps (common_log_main (), true );
371+
369372 llama_log_set (common_log_default_callback, NULL );
373+ }
370374
375+ void common_params_print_info (const common_params & params) {
371376#ifdef NDEBUG
372377 const char * build_type = " " ;
373378#else
374379 const char * build_type = " (debug)" ;
375380#endif
381+ LOG_TRC (" %s: build %d (%s) with %s for %s%s\n " , __func__, llama_build_number (), llama_commit (), llama_compiler (), llama_build_target (), build_type);
376382
377- LOG_DBG (" build: %d (%s) with %s for %s%s\n " , llama_build_number (), llama_commit (), llama_compiler (), llama_build_target (), build_type);
383+ LOG_INF (" log_info: verbosity = %d (adjust with the `-lv N` CLI arg)\n " , common_log_get_verbosity_thold ());
384+ LOG_INF (" device_info:\n " );
385+ for (size_t i = 0 ; i < ggml_backend_dev_count (); ++i) {
386+ auto * dev = ggml_backend_dev_get (i);
387+ size_t free, total;
388+ ggml_backend_dev_memory (dev, &free, &total);
389+ LOG_INF (" - %-8s: %s (%zu MiB, %zu MiB free)\n " , ggml_backend_dev_name (dev), ggml_backend_dev_description (dev), total / 1024 / 1024 , free / 1024 / 1024 );
390+ }
391+ LOG_INF (" %s\n " , common_params_get_system_info (params).c_str ());
378392}
379393
380394std::string common_params_get_system_info (const common_params & params) {
@@ -1147,7 +1161,8 @@ common_init_result::common_init_result(common_params & params) :
11471161 auto cparams = common_context_params_to_llama (params);
11481162
11491163 if (params.fit_params ) {
1150- LOG_INF (" %s: fitting params to device memory, for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on\n " , __func__);
1164+ LOG_INF (" %s: fitting params to device memory ...\n " , __func__);
1165+ LOG_INF (" %s: (for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on)\n " , __func__);
11511166 common_fit_params (params.model .path .c_str (), &mparams, &cparams,
11521167 params.tensor_split ,
11531168 params.tensor_buft_overrides .data (),
@@ -1196,7 +1211,7 @@ common_init_result::common_init_result(common_params & params) :
11961211 // initialize once
11971212 for (llama_token i = 0 ; i < llama_vocab_n_tokens (vocab); i++) {
11981213 if (llama_vocab_is_eog (vocab, i)) {
1199- LOG_INF (" %s: added %s logit bias = %f\n " , __func__, common_token_to_piece (vocab, i).c_str (), -INFINITY);
1214+ LOG_TRC (" %s: added %s logit bias = %f\n " , __func__, common_token_to_piece (vocab, i).c_str (), -INFINITY);
12001215 params.sampling .logit_bias_eog .push_back ({i, -INFINITY});
12011216 }
12021217 }
@@ -1209,12 +1224,12 @@ common_init_result::common_init_result(common_params & params) :
12091224 }
12101225
12111226 // if (params.sampling.penalty_last_n == -1) {
1212- // LOG_INF ("%s: setting penalty_last_n to ctx_size = %d\n", __func__, llama_n_ctx(lctx));
1227+ // LOG_TRC ("%s: setting penalty_last_n to ctx_size = %d\n", __func__, llama_n_ctx(lctx));
12131228 // params.sampling.penalty_last_n = llama_n_ctx(lctx);
12141229 // }
12151230
12161231 // if (params.sampling.dry_penalty_last_n == -1) {
1217- // LOG_INF ("%s: setting dry_penalty_last_n to ctx_size = %d\n", __func__, llama_n_ctx(lctx));
1232+ // LOG_TRC ("%s: setting dry_penalty_last_n to ctx_size = %d\n", __func__, llama_n_ctx(lctx));
12181233 // params.sampling.dry_penalty_last_n = llama_n_ctx(lctx);
12191234 // }
12201235
@@ -1422,7 +1437,7 @@ common_context_seq_rm_type common_context_can_seq_rm(llama_context * ctx) {
14221437
14231438 // try to remove the last tokens
14241439 if (!llama_memory_seq_rm (mem, 0 , 1 , -1 )) {
1425- LOG_WRN (" %s: the context does not support partial sequence removal\n " , __func__);
1440+ LOG_TRC (" %s: the context does not support partial sequence removal\n " , __func__);
14261441 res = COMMON_CONTEXT_SEQ_RM_TYPE_FULL;
14271442 goto done;
14281443 }
0 commit comments