Skip to content

Commit 484f6e9

Browse files
committed
llama: initialize f16 tables in quantize c api.
1 parent 5ea4339 commit 484f6e9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

examples/quantize/quantize.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ int main(int argc, char ** argv) {
5252
return 1;
5353
}
5454

55-
// needed to initialize f16 tables
56-
{
57-
struct ggml_init_params params = { 0, NULL, false };
58-
struct ggml_context * ctx = ggml_init(params);
59-
ggml_free(ctx);
60-
}
61-
6255
// parse command line arguments
6356
const std::string fname_inp = argv[1];
6457
std::string fname_out;

llama.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,12 @@ int llama_model_quantize(
21982198
enum llama_ftype ftype,
21992199
int nthread) {
22002200
try {
2201+
// needed to initialize f16 tables
2202+
{
2203+
struct ggml_init_params params = { 0, NULL, false };
2204+
struct ggml_context * ctx = ggml_init(params);
2205+
ggml_free(ctx);
2206+
}
22012207
llama_model_quantize_internal(fname_inp, fname_out, ftype, nthread);
22022208
return 0;
22032209
} catch (const std::string & err) {

0 commit comments

Comments
 (0)