add n_threads_batch to system info, refactor to get_system_info()
This commit is contained in:
parent
92fb8ab5a7
commit
a6084cc719
7 changed files with 21 additions and 9 deletions
|
@ -611,7 +611,7 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
|
||||||
printf(" -s SEED, --seed SEED RNG seed (default: -1, use random seed for < 0)\n");
|
printf(" -s SEED, --seed SEED RNG seed (default: -1, use random seed for < 0)\n");
|
||||||
printf(" -t N, --threads N number of threads to use during generation (default: %d)\n", params.n_threads);
|
printf(" -t N, --threads N number of threads to use during generation (default: %d)\n", params.n_threads);
|
||||||
printf(" -tb N, --threads-batch N\n");
|
printf(" -tb N, --threads-batch N\n");
|
||||||
printf(" number of threads to use during batch evaluation and prompt processing (default: same as --threads)\n");
|
printf(" number of threads to use during batch and prompt processing (default: same as --threads)\n");
|
||||||
printf(" -p PROMPT, --prompt PROMPT\n");
|
printf(" -p PROMPT, --prompt PROMPT\n");
|
||||||
printf(" prompt to start generation with (default: empty)\n");
|
printf(" prompt to start generation with (default: empty)\n");
|
||||||
printf(" -e, --escape process prompt escapes sequences (\\n, \\r, \\t, \\', \\\", \\\\)\n");
|
printf(" -e, --escape process prompt escapes sequences (\\n, \\r, \\t, \\', \\\", \\\\)\n");
|
||||||
|
@ -703,6 +703,19 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string get_system_info(const gpt_params & params) {
|
||||||
|
std::ostringstream os;
|
||||||
|
|
||||||
|
os << "system_info: n_threads = " << params.n_threads;
|
||||||
|
if (params.n_threads_batch != -1) {
|
||||||
|
os << " (n_threads_batch = " << params.n_threads_batch << ")";
|
||||||
|
}
|
||||||
|
os << " / " << std::thread::hardware_concurrency() << " | " << llama_print_system_info();
|
||||||
|
|
||||||
|
return os.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string gpt_random_prompt(std::mt19937 & rng) {
|
std::string gpt_random_prompt(std::mt19937 & rng) {
|
||||||
const int r = rng() % 10;
|
const int r = rng() % 10;
|
||||||
switch (r) {
|
switch (r) {
|
||||||
|
|
|
@ -124,6 +124,8 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params);
|
||||||
|
|
||||||
void gpt_print_usage(int argc, char ** argv, const gpt_params & params);
|
void gpt_print_usage(int argc, char ** argv, const gpt_params & params);
|
||||||
|
|
||||||
|
std::string get_system_info(const gpt_params & params);
|
||||||
|
|
||||||
std::string gpt_random_prompt(std::mt19937 & rng);
|
std::string gpt_random_prompt(std::mt19937 & rng);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -48,8 +48,7 @@ struct MyModel* create_mymodel(int argc, char ** argv) {
|
||||||
// print system information
|
// print system information
|
||||||
{
|
{
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
fprintf(stderr, "system_info: n_threads = %d / %d | %s\n",
|
fprintf(stderr, "%s\n", get_system_info(params).c_str());
|
||||||
params.n_threads, std::thread::hardware_concurrency(), llama_print_system_info());
|
|
||||||
}
|
}
|
||||||
struct MyModel * ret = new MyModel();
|
struct MyModel * ret = new MyModel();
|
||||||
ret->ctx = ctx;
|
ret->ctx = ctx;
|
||||||
|
|
|
@ -53,8 +53,7 @@ int main(int argc, char ** argv) {
|
||||||
// print system information
|
// print system information
|
||||||
{
|
{
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
fprintf(stderr, "system_info: n_threads = %d / %d | %s\n",
|
fprintf(stderr, "%s\n", get_system_info(params).c_str());
|
||||||
params.n_threads, std::thread::hardware_concurrency(), llama_print_system_info());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int n_past = 0;
|
int n_past = 0;
|
||||||
|
|
|
@ -201,8 +201,7 @@ int main(int argc, char ** argv) {
|
||||||
// print system information
|
// print system information
|
||||||
{
|
{
|
||||||
LOG_TEE("\n");
|
LOG_TEE("\n");
|
||||||
LOG_TEE("system_info: n_threads = %d / %d | %s\n",
|
LOG_TEE("%s\n", get_system_info(params).c_str());
|
||||||
params.n_threads, std::thread::hardware_concurrency(), llama_print_system_info());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// export the cgraph and exit
|
// export the cgraph and exit
|
||||||
|
|
|
@ -708,8 +708,7 @@ int main(int argc, char ** argv) {
|
||||||
// print system information
|
// print system information
|
||||||
{
|
{
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
fprintf(stderr, "system_info: n_threads = %d / %d | %s\n",
|
fprintf(stderr, "%s\n", get_system_info(params).c_str());
|
||||||
params.n_threads, std::thread::hardware_concurrency(), llama_print_system_info());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct results_perplexity results;
|
struct results_perplexity results;
|
||||||
|
|
|
@ -1286,6 +1286,7 @@ int main(int argc, char **argv)
|
||||||
{"commit", BUILD_COMMIT}});
|
{"commit", BUILD_COMMIT}});
|
||||||
LOG_INFO("system info", {
|
LOG_INFO("system info", {
|
||||||
{"n_threads", params.n_threads},
|
{"n_threads", params.n_threads},
|
||||||
|
{"n_threads_batch", params.n_threads_batch},
|
||||||
{"total_threads", std::thread::hardware_concurrency()},
|
{"total_threads", std::thread::hardware_concurrency()},
|
||||||
{"system_info", llama_print_system_info()},
|
{"system_info", llama_print_system_info()},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue