From 635e9fadfd516d4604a0fecf4a854bfb25ad17ae Mon Sep 17 00:00:00 2001 From: cebtenzzre Date: Wed, 1 Nov 2023 13:09:21 -0400 Subject: [PATCH] fix includes with help from include-what-you-use --- common/common.cpp | 18 ++++++++----- common/common.h | 11 ++++---- common/console.cpp | 11 ++++---- common/grammar-parser.cpp | 1 - common/grammar-parser.h | 7 +++-- common/sampling.cpp | 6 +++++ common/sampling.h | 8 +++--- common/train.cpp | 14 ++++++++-- common/train.h | 11 ++++---- examples/baby-llama/baby-llama.cpp | 6 +++-- examples/batched-bench/batched-bench.cpp | 5 ++-- examples/batched/batched.cpp | 4 ++- examples/beam-search/beam-search.cpp | 19 ++----------- examples/benchmark/benchmark-matmult.cpp | 15 +++-------- .../convert-llama2c-to-ggml.cpp | 25 +++++++++-------- examples/embedding/embedding.cpp | 5 ++++ examples/export-lora/export-lora.cpp | 9 +++++-- examples/finetune/finetune.cpp | 24 ++++++++--------- examples/infill/infill.cpp | 12 ++++----- examples/llama-bench/llama-bench.cpp | 14 ++++++---- examples/llava/clip.cpp | 16 ++++++----- examples/llava/clip.h | 3 ++- examples/llava/llava.cpp | 7 +++-- examples/main/main.cpp | 11 ++++---- examples/parallel/parallel.cpp | 13 ++++++--- examples/perplexity/perplexity.cpp | 11 ++++++-- examples/quantize-stats/quantize-stats.cpp | 9 ++++--- examples/quantize/quantize.cpp | 6 ++++- examples/save-load-state/save-load-state.cpp | 6 +++-- examples/server/server.cpp | 27 ++++++++++++++++--- examples/simple/simple.cpp | 3 +-- examples/speculative/speculative.cpp | 6 ++++- .../train-text-from-scratch.cpp | 23 ++++++++-------- ggml-alloc.c | 3 ++- ggml-alloc.h | 3 +++ ggml-backend.c | 3 --- ggml-backend.h | 3 +++ ggml-impl.h | 4 +-- ggml-quants.c | 5 ++-- ggml-quants.h | 6 ++--- ggml.c | 10 +++---- ggml.h | 1 - llama.cpp | 9 +++++-- llama.h | 5 +++- pocs/vdot/q8dot.cpp | 21 +++++++-------- pocs/vdot/vdot.cpp | 21 ++++++++------- tests/test-grad0.cpp | 3 ++- tests/test-grammar-parser.cpp | 8 +++++- tests/test-llama-grammar.cpp | 6 +++++ tests/test-quantize-fns.cpp | 7 +++-- tests/test-quantize-perf.cpp | 8 +++--- tests/test-rope.cpp | 3 ++- tests/test-sampling.cpp | 8 +----- tests/test-tokenizer-0-falcon.cpp | 10 ++++--- tests/test-tokenizer-0-llama.cpp | 10 ++++--- tests/test-tokenizer-1-bpe.cpp | 12 ++++----- tests/test-tokenizer-1-llama.cpp | 11 +++----- 57 files changed, 311 insertions(+), 235 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index e938dee16..35b22de0f 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1,20 +1,28 @@ #include "common.h" +#include "ggml.h" #include "llama.h" +#include "log.h" +#include "sampling.h" #include -#include +#include +#include +#include #include -#include +#include #include +#include #include #include -#include #include #include +#include #include +#include +#include #include +#include #include -#include #if defined(__APPLE__) && defined(__MACH__) #include @@ -32,9 +40,7 @@ #include #include #else -#include #include -#include #endif #if defined(_MSC_VER) diff --git a/common/common.h b/common/common.h index 72a49b890..c763be8b0 100644 --- a/common/common.h +++ b/common/common.h @@ -3,19 +3,18 @@ #pragma once #include "llama.h" - #include "sampling.h" #define LOG_NO_FILE_LINE_FUNCTION #include "log.h" #include -#include -#include +#include +#include #include -#include -#include +#include #include +#include #ifdef _WIN32 #define DIRECTORY_SEPARATOR '\\' @@ -68,7 +67,7 @@ struct gpt_params { int32_t yarn_orig_ctx = 0; // YaRN original context length int8_t rope_scaling_type = LLAMA_ROPE_SCALING_UNSPECIFIED; - // // sampling parameters + // sampling parameters struct llama_sampling_params sparams; std::string model = "models/7B/ggml-model-f16.gguf"; // model path diff --git a/common/console.cpp b/common/console.cpp index f65cbc6ed..69f1419f1 100644 --- a/common/console.cpp +++ b/common/console.cpp @@ -14,14 +14,13 @@ #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif #else -#include +#include +#include +#include + #include -#include -#include -#include -#include -#include #include +#include #endif #define ANSI_COLOR_RED "\x1b[31m" diff --git a/common/grammar-parser.cpp b/common/grammar-parser.cpp index ff51cc803..ef56e909d 100644 --- a/common/grammar-parser.cpp +++ b/common/grammar-parser.cpp @@ -1,6 +1,5 @@ #include "grammar-parser.h" #include -#include #include #include #include diff --git a/common/grammar-parser.h b/common/grammar-parser.h index 9037d7272..b603764b3 100644 --- a/common/grammar-parser.h +++ b/common/grammar-parser.h @@ -10,11 +10,14 @@ // space ::= [ \t\n]* #pragma once + #include "llama.h" -#include -#include + #include +#include +#include #include +#include namespace grammar_parser { struct parse_state { diff --git a/common/sampling.cpp b/common/sampling.cpp index 1317024c2..a5b684ee3 100644 --- a/common/sampling.cpp +++ b/common/sampling.cpp @@ -1,5 +1,11 @@ +#include "common.h" #include "sampling.h" +#include +#include +#include +#include + struct llama_sampling_context * llama_sampling_init(const struct llama_sampling_params & params) { struct llama_sampling_context * result = new llama_sampling_context(); diff --git a/common/sampling.h b/common/sampling.h index 7c9b8dcf2..03909efbc 100644 --- a/common/sampling.h +++ b/common/sampling.h @@ -1,12 +1,12 @@ #pragma once +#include "grammar-parser.h" #include "llama.h" -#include "grammar-parser.h" - +#include #include -#include #include +#include // sampling parameters typedef struct llama_sampling_params { @@ -56,8 +56,6 @@ struct llama_sampling_context { std::vector cur; }; -#include "common.h" - // Create a new sampling context instance. struct llama_sampling_context * llama_sampling_init(const struct llama_sampling_params & params); diff --git a/common/train.cpp b/common/train.cpp index bc15b7a03..d1f5505cb 100644 --- a/common/train.cpp +++ b/common/train.cpp @@ -1,9 +1,19 @@ -#include "train.h" #include "common.h" +#include "ggml.h" +#include "llama.h" +#include "train.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include struct random_normal_distribution { std::mt19937 gen; diff --git a/common/train.h b/common/train.h index d86c93cc4..ccac6b7d6 100644 --- a/common/train.h +++ b/common/train.h @@ -2,13 +2,14 @@ #pragma once -#include -#include -#include - -#include "ggml.h" #include "llama.h" +#include +#include +#include +#include +#include + typedef std::string mt19937_state; struct train_state { diff --git a/examples/baby-llama/baby-llama.cpp b/examples/baby-llama/baby-llama.cpp index 8155101d0..35404f9a3 100644 --- a/examples/baby-llama/baby-llama.cpp +++ b/examples/baby-llama/baby-llama.cpp @@ -1,11 +1,13 @@ #include "ggml.h" #include "train.h" -#include +#include #include +#include +#include +#include #include #include -#include #include #if defined(_MSC_VER) diff --git a/examples/batched-bench/batched-bench.cpp b/examples/batched-bench/batched-bench.cpp index 533c55c17..955d815cc 100644 --- a/examples/batched-bench/batched-bench.cpp +++ b/examples/batched-bench/batched-bench.cpp @@ -1,10 +1,11 @@ #include "common.h" +#include "ggml.h" #include "llama.h" #include -#include +#include #include -#include +#include #include // mutates the input string diff --git a/examples/batched/batched.cpp b/examples/batched/batched.cpp index 22a4265df..f91872798 100644 --- a/examples/batched/batched.cpp +++ b/examples/batched/batched.cpp @@ -1,9 +1,11 @@ #include "common.h" +#include "ggml.h" #include "llama.h" #include -#include +#include #include +#include #include #include diff --git a/examples/beam-search/beam-search.cpp b/examples/beam-search/beam-search.cpp index 679b382e1..cce2b9916 100644 --- a/examples/beam-search/beam-search.cpp +++ b/examples/beam-search/beam-search.cpp @@ -1,29 +1,14 @@ #include "common.h" #include "llama.h" +#include #include -#include -#include #include -#include -#include -#include #include #include +#include #include -#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) -#include -#include -#elif defined (_WIN32) -#define WIN32_LEAN_AND_MEAN -#ifndef NOMINMAX -# define NOMINMAX -#endif -#include -#include -#endif - // Used for debugging to print out beam tokens. struct ostream_beam_view { llama_context * ctx; diff --git a/examples/benchmark/benchmark-matmult.cpp b/examples/benchmark/benchmark-matmult.cpp index 76e3f57cc..58bf9a814 100644 --- a/examples/benchmark/benchmark-matmult.cpp +++ b/examples/benchmark/benchmark-matmult.cpp @@ -1,20 +1,11 @@ #include "common.h" #include "ggml.h" -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include +#include #if defined(_MSC_VER) #pragma warning(disable: 4244 4267) // possible loss of data diff --git a/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp b/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp index cae3bf3c3..7ecc15cb5 100644 --- a/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp +++ b/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp @@ -1,19 +1,22 @@ +#include "common.h" #include "ggml.h" #include "llama.h" -#include "common.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include // GGUF keys & tensor names. diff --git a/examples/embedding/embedding.cpp b/examples/embedding/embedding.cpp index 3295cd240..86f874a52 100644 --- a/examples/embedding/embedding.cpp +++ b/examples/embedding/embedding.cpp @@ -1,7 +1,12 @@ #include "common.h" #include "llama.h" +#include +#include #include +#include +#include +#include #if defined(_MSC_VER) #pragma warning(disable: 4244 4267) // possible loss of data diff --git a/examples/export-lora/export-lora.cpp b/examples/export-lora/export-lora.cpp index d803cfd5c..a2406de5a 100644 --- a/examples/export-lora/export-lora.cpp +++ b/examples/export-lora/export-lora.cpp @@ -1,11 +1,16 @@ - #include "common.h" #include "ggml.h" #include "ggml-alloc.h" -#include +#include +#include +#include +#include +#include +#include #include #include +#include static const size_t tensor_alignment = 32; diff --git a/examples/finetune/finetune.cpp b/examples/finetune/finetune.cpp index 649a3b7c1..710ddba96 100644 --- a/examples/finetune/finetune.cpp +++ b/examples/finetune/finetune.cpp @@ -1,19 +1,19 @@ -#include "ggml.h" -#include "ggml-alloc.h" -#include "llama.h" #include "common.h" +#include "ggml-alloc.h" +#include "ggml.h" +#include "llama.h" #include "train.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include +#include +#include +#include +#include +#include +#include +#include #include +#include #if defined(_MSC_VER) #pragma warning(disable: 4244 4267) // possible loss of data diff --git a/examples/infill/infill.cpp b/examples/infill/infill.cpp index 62f5ce3c1..f9caffacb 100644 --- a/examples/infill/infill.cpp +++ b/examples/infill/infill.cpp @@ -1,19 +1,17 @@ #include "common.h" - #include "console.h" #include "llama.h" -#include "grammar-parser.h" +#include "sampling.h" -#include -#include -#include +#include #include -#include +#include #include #include -#include +#include #include #include +#include #include #if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) diff --git a/examples/llama-bench/llama-bench.cpp b/examples/llama-bench/llama-bench.cpp index 9bd82d565..0df6c4c45 100644 --- a/examples/llama-bench/llama-bench.cpp +++ b/examples/llama-bench/llama-bench.cpp @@ -1,26 +1,30 @@ +#include "ggml.h" +#include "llama.h" +#include "common.h" +#include "ggml-cuda.h" + #include #include #include +#include #include #include #include #include #include +#include #include #include #include #include +#include #include #include #include #include +#include #include -#include "ggml.h" -#include "llama.h" -#include "common.h" -#include "ggml-cuda.h" - // utils static uint64_t get_time_ns() { using clock = std::chrono::high_resolution_clock; diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index 61932e659..03a8e9c46 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -2,21 +2,23 @@ // so there might be still unnecessary artifacts hanging around // I'll gradually clean and extend it -#include +#include "clip.h" +#include "ggml-alloc.h" +#include "ggml.h" + +#include +#include #include +#include +#include #include #include #include -#include -#include #include #include +#include #include -#include "clip.h" -#include "ggml.h" -#include "ggml-alloc.h" - #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" diff --git a/examples/llava/clip.h b/examples/llava/clip.h index 3d7261e29..106df0d1a 100644 --- a/examples/llava/clip.h +++ b/examples/llava/clip.h @@ -1,7 +1,8 @@ #ifndef CLIP_H #define CLIP_H -#include "ggml.h" +#include +#include struct clip_ctx; diff --git a/examples/llava/llava.cpp b/examples/llava/llava.cpp index f0974d5bc..2c5a86398 100644 --- a/examples/llava/llava.cpp +++ b/examples/llava/llava.cpp @@ -1,11 +1,14 @@ #include "clip.h" -#include "llava-utils.h" #include "common.h" +#include "ggml.h" #include "llama.h" +#include "llava-utils.h" +#include #include #include -#include +#include +#include static void show_additional_info(int /*argc*/, char ** argv) { printf("\n example usage: %s -m --mmproj --image [--temp 0.1] [-p \"describe the image in detail.\"]\n", argv[0]); diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 8d985c82a..ce68efae4 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -1,18 +1,17 @@ #include "common.h" - #include "console.h" #include "llama.h" +#include "sampling.h" -#include -#include -#include +#include #include -#include +#include #include #include -#include +#include #include #include +#include #include #if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) diff --git a/examples/parallel/parallel.cpp b/examples/parallel/parallel.cpp index a78df305f..9b107e5f1 100644 --- a/examples/parallel/parallel.cpp +++ b/examples/parallel/parallel.cpp @@ -2,13 +2,20 @@ // The clients submite requests to the server and they are processed in parallel. #include "common.h" +#include "ggml.h" #include "llama.h" +#include "sampling.h" -#include +#include +#include +#include #include -#include -#include +#include #include +#include +#include +#include +#include // trim whitespace from the beginning and end of a string static std::string trim(const std::string & str) { diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp index de60c5227..f8e8f8fc5 100644 --- a/examples/perplexity/perplexity.cpp +++ b/examples/perplexity/perplexity.cpp @@ -1,13 +1,20 @@ #include "common.h" #include "llama.h" +#include +#include #include #include #include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include #include #if defined(_MSC_VER) diff --git a/examples/quantize-stats/quantize-stats.cpp b/examples/quantize-stats/quantize-stats.cpp index 271282477..d5c3c3591 100644 --- a/examples/quantize-stats/quantize-stats.cpp +++ b/examples/quantize-stats/quantize-stats.cpp @@ -8,15 +8,16 @@ #include #include #include +#include #include -#include +#include +#include #include #include #include -#include -#include #include -#include +#include +#include #if defined(_MSC_VER) #pragma warning(disable: 4244 4267) // possible loss of data diff --git a/examples/quantize/quantize.cpp b/examples/quantize/quantize.cpp index d27ea5e91..ce6863a2b 100644 --- a/examples/quantize/quantize.cpp +++ b/examples/quantize/quantize.cpp @@ -1,10 +1,14 @@ #include "common.h" #include "llama.h" +#include +#include #include +#include #include -#include +#include #include +#include struct quant_option { std::string name; diff --git a/examples/save-load-state/save-load-state.cpp b/examples/save-load-state/save-load-state.cpp index 48d801110..622101449 100644 --- a/examples/save-load-state/save-load-state.cpp +++ b/examples/save-load-state/save-load-state.cpp @@ -1,9 +1,11 @@ #include "common.h" #include "llama.h" -#include +#include #include -#include +#include +#include +#include int main(int argc, char ** argv) { gpt_params params; diff --git a/examples/server/server.cpp b/examples/server/server.cpp index fd755327a..0da14c9b7 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1,6 +1,7 @@ #include "common.h" +#include "ggml.h" #include "llama.h" -#include "grammar-parser.h" +#include "sampling.h" #include "../llava/clip.h" @@ -20,10 +21,28 @@ #include "completion.js.hpp" #include "json-schema-to-grammar.mjs.hpp" -#include -#include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifndef SERVER_VERBOSE #define SERVER_VERBOSE 1 diff --git a/examples/simple/simple.cpp b/examples/simple/simple.cpp index 374aef6f1..52b0de48f 100644 --- a/examples/simple/simple.cpp +++ b/examples/simple/simple.cpp @@ -1,9 +1,8 @@ #include "common.h" +#include "ggml.h" #include "llama.h" -#include #include -#include #include int main(int argc, char ** argv) { diff --git a/examples/speculative/speculative.cpp b/examples/speculative/speculative.cpp index 798684f66..3e65d7e6e 100644 --- a/examples/speculative/speculative.cpp +++ b/examples/speculative/speculative.cpp @@ -1,9 +1,13 @@ #include "common.h" +#include "ggml.h" #include "llama.h" +#include "sampling.h" -#include +#include #include +#include #include +#include #include #define SPEC_VOCAB_MAX_SIZE_DIFFERENCE 100 diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp index 2a257e632..42e5c6b0f 100644 --- a/examples/train-text-from-scratch/train-text-from-scratch.cpp +++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp @@ -1,19 +1,18 @@ -#include "ggml.h" -#include "ggml-alloc.h" #include "common.h" -#include "train.h" +#include "ggml-alloc.h" +#include "ggml.h" #include "llama.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "train.h" + #include +#include +#include +#include +#include +#include +#include #include +#include #if defined(_MSC_VER) #pragma warning(disable: 4244 4267) // possible loss of data diff --git a/ggml-alloc.c b/ggml-alloc.c index 34eba3f83..c9fd6e54d 100644 --- a/ggml-alloc.c +++ b/ggml-alloc.c @@ -1,8 +1,9 @@ #include "ggml-alloc.h" #include "ggml-backend.h" #include "ggml.h" + #include -#include +#include #include #include #include diff --git a/ggml-alloc.h b/ggml-alloc.h index e38758878..4ebba6a6b 100644 --- a/ggml-alloc.h +++ b/ggml-alloc.h @@ -2,6 +2,9 @@ #include "ggml.h" +#include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/ggml-backend.c b/ggml-backend.c index ca8d83daf..89af304d3 100644 --- a/ggml-backend.c +++ b/ggml-backend.c @@ -1,8 +1,5 @@ #include "ggml-backend.h" -#include "ggml-alloc.h" -#include -#include #include #include #include diff --git a/ggml-backend.h b/ggml-backend.h index da134b0db..12618036b 100644 --- a/ggml-backend.h +++ b/ggml-backend.h @@ -2,6 +2,9 @@ #include "ggml.h" +#include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/ggml-impl.h b/ggml-impl.h index 5ec18a50c..8a9fb7388 100644 --- a/ggml-impl.h +++ b/ggml-impl.h @@ -1,9 +1,9 @@ #pragma once -#include "ggml.h" - // GGML internal header +#include "ggml.h" + #include #include #include diff --git a/ggml-quants.c b/ggml-quants.c index 740be6dc5..39f2c27b3 100644 --- a/ggml-quants.c +++ b/ggml-quants.c @@ -1,10 +1,11 @@ #include "ggml-quants.h" #include "ggml-impl.h" -#include -#include #include #include +#include +#include +#include #ifdef __ARM_NEON diff --git a/ggml-quants.h b/ggml-quants.h index 70c12c274..f782d54c8 100644 --- a/ggml-quants.h +++ b/ggml-quants.h @@ -1,11 +1,11 @@ #pragma once -#include "ggml-impl.h" - // GGML internal header +#include "ggml.h" + +#include #include -#include #define QK4_0 32 typedef struct { diff --git a/ggml.c b/ggml.c index 605a27940..fca45ad14 100644 --- a/ggml.c +++ b/ggml.c @@ -1,6 +1,7 @@ #define _CRT_SECURE_NO_DEPRECATE // Disables ridiculous "unsafe" warnigns on Windows #define _USE_MATH_DEFINES // For M_PI on MSVC +#include "ggml.h" #include "ggml-impl.h" #include "ggml-quants.h" @@ -20,9 +21,7 @@ #include #include #include -#include #include -#include #ifdef GGML_USE_METAL #include @@ -85,15 +84,14 @@ static int sched_yield (void) { return 0; } #else + #include +#include #include +#include typedef void * thread_ret_t; -#include -#include -#include - #endif #ifdef GGML_USE_CPU_HBM diff --git a/ggml.h b/ggml.h index 70eb25a6b..5b27b7ad2 100644 --- a/ggml.h +++ b/ggml.h @@ -300,7 +300,6 @@ extern "C" { GGML_API void ggml_fp16_to_fp32_row(const ggml_fp16_t * x, float * y, int n); GGML_API void ggml_fp32_to_fp16_row(const float * x, ggml_fp16_t * y, int n); - struct ggml_object; struct ggml_context; enum ggml_type { diff --git a/llama.cpp b/llama.cpp index bb60044b4..93cdc9824 100644 --- a/llama.cpp +++ b/llama.cpp @@ -52,29 +52,34 @@ #include #include #include +#include #include #include #include #include -#include #include #include +#include #include #include +#include #include #include #include #include +#include +#include #include #include #include #include #include #include -#include #include #include +#include #include +#include #include #if defined(_MSC_VER) diff --git a/llama.h b/llama.h index 3f1becd76..dd16407c8 100644 --- a/llama.h +++ b/llama.h @@ -2,12 +2,14 @@ #define LLAMA_H #include "ggml.h" + #ifdef GGML_USE_CUBLAS #include "ggml-cuda.h" #define LLAMA_MAX_DEVICES GGML_CUDA_MAX_DEVICES #else #define LLAMA_MAX_DEVICES 1 #endif // GGML_USE_CUBLAS + #include #include #include @@ -759,8 +761,9 @@ extern "C" { // Internal API to be implemented by llama.cpp and used by tests/benchmarks only #ifdef LLAMA_API_INTERNAL -#include #include +#include +#include struct ggml_tensor; diff --git a/pocs/vdot/q8dot.cpp b/pocs/vdot/q8dot.cpp index 111770d55..05e85ee30 100644 --- a/pocs/vdot/q8dot.cpp +++ b/pocs/vdot/q8dot.cpp @@ -1,16 +1,13 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ggml.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include constexpr int kVecSize = 1 << 16; diff --git a/pocs/vdot/vdot.cpp b/pocs/vdot/vdot.cpp index e96372c4b..5b0ebb706 100644 --- a/pocs/vdot/vdot.cpp +++ b/pocs/vdot/vdot.cpp @@ -1,14 +1,15 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ggml.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if defined(_MSC_VER) #pragma warning(disable: 4244 4267) // possible loss of data diff --git a/tests/test-grad0.cpp b/tests/test-grad0.cpp index 0a559b27a..49a92ed23 100644 --- a/tests/test-grad0.cpp +++ b/tests/test-grad0.cpp @@ -1,10 +1,11 @@ #define _CRT_SECURE_NO_DEPRECATE // Disables ridiculous "unsafe" warnigns on Windows #include "ggml.h" +#include #include +#include #include #include -#include #if defined(_MSC_VER) #pragma warning(disable: 4244 4267) // possible loss of data diff --git a/tests/test-grammar-parser.cpp b/tests/test-grammar-parser.cpp index a0b5b043d..b4d825b62 100644 --- a/tests/test-grammar-parser.cpp +++ b/tests/test-grammar-parser.cpp @@ -2,10 +2,16 @@ #undef NDEBUG #endif -#include "llama.h" #include "grammar-parser.h" +#include "llama.h" #include +#include +#include +#include +#include +#include +#include int main() { diff --git a/tests/test-llama-grammar.cpp b/tests/test-llama-grammar.cpp index 73dd33dd2..cbbe95bd3 100644 --- a/tests/test-llama-grammar.cpp +++ b/tests/test-llama-grammar.cpp @@ -6,6 +6,12 @@ #include "grammar-parser.h" #include +#include +#include +#include +#include +#include +#include int main() { diff --git a/tests/test-quantize-fns.cpp b/tests/test-quantize-fns.cpp index a2459a286..3b88b4989 100644 --- a/tests/test-quantize-fns.cpp +++ b/tests/test-quantize-fns.cpp @@ -2,10 +2,9 @@ #include "ggml.h" -#undef NDEBUG -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/test-quantize-perf.cpp b/tests/test-quantize-perf.cpp index 88fac0e23..b4260e548 100644 --- a/tests/test-quantize-perf.cpp +++ b/tests/test-quantize-perf.cpp @@ -2,14 +2,12 @@ #include "ggml.h" -#undef NDEBUG #include -#include +#include +#include +#include #include -#include -#include #include -#include #include #include diff --git a/tests/test-rope.cpp b/tests/test-rope.cpp index 26c1f42dc..2fda30ccb 100644 --- a/tests/test-rope.cpp +++ b/tests/test-rope.cpp @@ -1,9 +1,10 @@ #include "ggml.h" +#include #include +#include #include #include -#include #include #if defined(_MSC_VER) diff --git a/tests/test-sampling.cpp b/tests/test-sampling.cpp index 32e58941c..63ae06d30 100644 --- a/tests/test-sampling.cpp +++ b/tests/test-sampling.cpp @@ -1,15 +1,9 @@ #include "ggml.h" #include "llama.h" -#ifdef NDEBUG -#undef NDEBUG -#endif - #include -#include -#include +#include #include -#include static void dump(const llama_token_data_array * candidates) { for (size_t i = 0; i < candidates->size; i++) { diff --git a/tests/test-tokenizer-0-falcon.cpp b/tests/test-tokenizer-0-falcon.cpp index a4e9d2b91..d2f983baa 100644 --- a/tests/test-tokenizer-0-falcon.cpp +++ b/tests/test-tokenizer-0-falcon.cpp @@ -1,12 +1,14 @@ -#include "llama.h" #include "common.h" #include "console.h" +#include "llama.h" #include -#include -#include -#include #include +#include +#include +#include +#include +#include // generate using test-tokenizer-0-falcon.py static const std::map> & k_tests() { diff --git a/tests/test-tokenizer-0-llama.cpp b/tests/test-tokenizer-0-llama.cpp index 39c8d188c..c00a668de 100644 --- a/tests/test-tokenizer-0-llama.cpp +++ b/tests/test-tokenizer-0-llama.cpp @@ -1,12 +1,14 @@ -#include "llama.h" #include "common.h" #include "console.h" +#include "llama.h" #include -#include -#include -#include #include +#include +#include +#include +#include +#include // generate using test-tokenizer-0-llama.py static const std::map> & k_tests() { diff --git a/tests/test-tokenizer-1-bpe.cpp b/tests/test-tokenizer-1-bpe.cpp index 386530f23..cc924da5c 100644 --- a/tests/test-tokenizer-1-bpe.cpp +++ b/tests/test-tokenizer-1-bpe.cpp @@ -1,16 +1,14 @@ -#include "llama.h" #include "common.h" -#include "unicode.h" #include "console.h" +#include "ggml.h" +#include "llama.h" +#include "unicode.h" -#include +#include #include -#include +#include #include -#include -#include #include -#include int main(int argc, char **argv) { if (argc < 2) { diff --git a/tests/test-tokenizer-1-llama.cpp b/tests/test-tokenizer-1-llama.cpp index 4b58fe495..95832f899 100644 --- a/tests/test-tokenizer-1-llama.cpp +++ b/tests/test-tokenizer-1-llama.cpp @@ -1,16 +1,13 @@ -#include "llama.h" #include "common.h" -#include "unicode.h" #include "console.h" +#include "ggml.h" +#include "llama.h" +#include "unicode.h" -#include +#include #include -#include #include -#include -#include #include -#include int main(int argc, char **argv) { if (argc < 2) {