]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
gpt : initialize f16 tables during quantization (#77)
authorLostRuins <redacted>
Mon, 10 Apr 2023 07:47:47 +0000 (15:47 +0800)
committerGitHub <redacted>
Mon, 10 Apr 2023 07:47:47 +0000 (10:47 +0300)
examples/gpt-2/quantize.cpp
examples/gpt-j/quantize.cpp

index 693b0787cb6701118c02911e1bce146dc331f21b..2ef21ad3b683da728a6b10fa833caa8b5751a4ce 100644 (file)
@@ -289,6 +289,13 @@ int main(int argc, char ** argv) {
         return 1;
     }
 
+    // needed to initialize f16 tables
+    {
+        struct ggml_init_params params = { 0, NULL };
+        struct ggml_context * ctx = ggml_init(params);
+        ggml_free(ctx);
+    }
+
     const std::string fname_inp = argv[1];
     const std::string fname_out = argv[2];
 
index 29b92cfe48d1f2d49a897a544c0cecbbf86e721b..170b39421b01d58d3f294a2908220ba01d0c41c8 100644 (file)
@@ -290,6 +290,13 @@ int main(int argc, char ** argv) {
         return 1;
     }
 
+    // needed to initialize f16 tables
+    {
+        struct ggml_init_params params = { 0, NULL };
+        struct ggml_context * ctx = ggml_init(params);
+        ggml_free(ctx);
+    }
+
     const std::string fname_inp = argv[1];
     const std::string fname_out = argv[2];