diff options
author | Erik Scholz <Green-Sky@users.noreply.github.com> | 2023-03-19 18:57:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-19 19:57:00 +0200 |
commit | 0b366e735729327476ec31da02de3c9c9771ddfb (patch) | |
tree | 84022e2ae4d512f44e430a0fb8b49acf3c4a6f72 /utils.cpp | |
parent | 160bfb217da5038ccbd74438f9f16a16012d7866 (diff) |
Command line switch to use F16 for memory_k and memory_v (refactor of #154) (#294)
* Use F16 for memory_k and memory_v
* add command line switch to use f16 instead of f32 for memory k+v
---------
Co-authored-by: Ty Everett <ty@tyweb.us>
Diffstat (limited to 'utils.cpp')
-rw-r--r-- | utils.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -49,6 +49,8 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) { params.top_k = std::stoi(argv[++i]); } else if (arg == "-c" || arg == "--ctx_size") { params.n_ctx = std::stoi(argv[++i]); + } else if (arg == "--memory_f16") { + params.memory_f16 = true; } else if (arg == "--top_p") { params.top_p = std::stof(argv[++i]); } else if (arg == "--temp") { @@ -104,6 +106,7 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) { fprintf(stderr, " --repeat_last_n N last n tokens to consider for penalize (default: %d)\n", params.repeat_last_n); fprintf(stderr, " --repeat_penalty N penalize repeat sequence of tokens (default: %.1f)\n", params.repeat_penalty); fprintf(stderr, " -c N, --ctx_size N size of the prompt context (default: %d)\n", params.n_ctx); + fprintf(stderr, " --memory_f16 use f16 instead of f32 for memory key+value\n"); fprintf(stderr, " --temp N temperature (default: %.1f)\n", params.temp); fprintf(stderr, " -b N, --batch_size N batch size for prompt processing (default: %d)\n", params.n_batch); fprintf(stderr, " -m FNAME, --model FNAME\n"); |