diff --git a/common/jinja/README.md b/common/jinja/README.md index 7059105ee..829124076 100644 --- a/common/jinja/README.md +++ b/common/jinja/README.md @@ -63,7 +63,7 @@ The llama.cpp Jinja engine introduces `jinja::string` (see `jinja/string.h`), wh - **One-to-many** (e.g., split): result is marked `is_input` **only if ALL** input parts are marked `is_input` - **Many-to-one** (e.g., join): same as one-to-many -For string concatenation, string parts will be appended to the new string as-is, while perserving the `is_input` flag. +For string concatenation, string parts will be appended to the new string as-is, while preserving the `is_input` flag. **Enabling Input Marking:** diff --git a/examples/deprecation-warning/deprecation-warning.cpp b/examples/deprecation-warning/deprecation-warning.cpp index 11b35d2c2..50e295994 100644 --- a/examples/deprecation-warning/deprecation-warning.cpp +++ b/examples/deprecation-warning/deprecation-warning.cpp @@ -17,7 +17,7 @@ int main(int argc, char** argv) { filename = filename.substr(pos+1); } - // Append "llama-" to the beginning of filename to get the replacemnt filename + // Append "llama-" to the beginning of filename to get the replacement filename auto replacement_filename = "llama-" + filename; // The exception is if the filename is "main", then our replacement filename is "llama-cli" diff --git a/examples/embedding/README.md b/examples/embedding/README.md index 12b372bf1..3dd279d9f 100644 --- a/examples/embedding/README.md +++ b/examples/embedding/README.md @@ -43,8 +43,8 @@ The above command will output space-separated float values. | $"string"$ | | |--------------|-| | "\n" | (default) -| "<#embSep#>" | for exemple -| "<#sep#>" | other exemple +| "<#embSep#>" | for example +| "<#sep#>" | other example ## examples ### Unix-based systems (Linux, macOS, etc.): diff --git a/examples/imatrix/README.md b/examples/imatrix/README.md index bb5faec94..74d11300d 100644 --- a/examples/imatrix/README.md +++ b/examples/imatrix/README.md @@ -1,6 +1,6 @@ # llama.cpp/examples/imatrix -Compute an importance matrix for a model and given text dataset. Can be used during quantization to enchance the quality of the quantized models. +Compute an importance matrix for a model and given text dataset. Can be used during quantization to enhance the quality of the quantized models. More information is available here: https://github.com/ggerganov/llama.cpp/pull/4861 ## Usage diff --git a/examples/imatrix/imatrix.cpp b/examples/imatrix/imatrix.cpp index 9f269e91a..b6dacfb0d 100644 --- a/examples/imatrix/imatrix.cpp +++ b/examples/imatrix/imatrix.cpp @@ -562,7 +562,7 @@ bool IMatrixCollector::collect_imatrix(struct ggml_tensor * t, bool ask, void * exit(1); } // If we have a 3D tensor as it is the case for the attn_k_b and attn_v_b for DeepSeek MLA models, - // than we need to compute the imatrix for each head, and not just one imatrx for all heads. + // than we need to compute the imatrix for each head, and not just one imatrix for all heads. // Hence, the storage we need is src0->ne[0]*src0->ne[2]. e.values.resize(src0->ne[0]*src0->ne[2], 0); e.counts.resize(src0->ne[0]*src0->ne[2], 0); @@ -775,7 +775,7 @@ bool IMatrixCollector::load_imatrix(const char * fname) { return false; } - // Recreate the state as expected by save_imatrix(), and corerct for weighted sum. + // Recreate the state as expected by save_imatrix(), and correct for weighted sum. for (int i = 0; i < nval; i++) { e.values[i] += tmp[i]; e.counts[i] += ncall; diff --git a/examples/main/README.md b/examples/main/README.md index 417432b3e..63a293eaa 100644 --- a/examples/main/README.md +++ b/examples/main/README.md @@ -251,7 +251,7 @@ The sampler is turned off for `threshold > 0.5`, and `--xtc-probability <=0`. Sets all logits $L_i$ to $-\infty$ where $L_i < L_{\rm max} - n \sigma$. Here $L_{\rm max}$ is the maximum logit, $\sigma$ is the logit standard deviation, and $n$ (a floating point number) is the top-n-sigma parameter. Increasing $n$ increases the fraction of tokens considered for sampling. In the limit of $n$ close to zero, one effectively gets greedy sampling (only top probability token considered). -- --top-n-sigma t top-n-sigma parmeter (default: 0.0 => disabled) +- --top-n-sigma t top-n-sigma parameter (default: 0.0 => disabled) ### Logit Bias @@ -290,7 +290,7 @@ These options help improve the performance and memory usage of the LLaMA models. ### NUMA support -- `--numa distribute`: Pin an equal proportion of the threads to the cores on each NUMA node. This will spread the load amongst all cores on the system, utilitizing all memory channels at the expense of potentially requiring memory to travel over the slow links between nodes. +- `--numa distribute`: Pin an equal proportion of the threads to the cores on each NUMA node. This will spread the load amongst all cores on the system, utilizing all memory channels at the expense of potentially requiring memory to travel over the slow links between nodes. - `--numa isolate`: Pin all threads to the NUMA node that the program starts on. This limits the number of cores and amount of memory that can be used, but guarantees all memory access remains local to the NUMA node. - `--numa numactl`: Pin threads to the CPUMAP that is passed to the program by starting it with the numactl utility. This is the most flexible mode, and allow arbitrary core usage patterns, for example a map that uses all the cores on one NUMA nodes, and just enough cores on a second node to saturate the inter-node memory bus. diff --git a/examples/mtmd/clip-impl.h b/examples/mtmd/clip-impl.h index d02c0bc20..b86d12df3 100644 --- a/examples/mtmd/clip-impl.h +++ b/examples/mtmd/clip-impl.h @@ -63,7 +63,7 @@ #define TN_POS_EMBD "%s.position_embd.weight" #define TN_CLASS_EMBD "v.class_embd" -#define TN_PATCH_EMBD "v.patch_embd.weight" // not rename tensor with ".0" postfix for backwrad compat +#define TN_PATCH_EMBD "v.patch_embd.weight" // not rename tensor with ".0" postfix for backward compat #define TN_PATCH_EMBD_1 "v.patch_embd.weight.1" #define TN_PATCH_BIAS "v.patch_embd.bias" #define TN_ATTN_QKV "%s.blk.%d.attn_qkv.%s" diff --git a/examples/mtmd/clip.cpp b/examples/mtmd/clip.cpp index 3a86f1fce..fb0f442f3 100644 --- a/examples/mtmd/clip.cpp +++ b/examples/mtmd/clip.cpp @@ -198,7 +198,7 @@ struct clip_hparams { float image_std[3]; // for models using dynamic image size, we need to have a smaller image size to warmup - // otherwise, user will get OOM everytime they load the model + // otherwise, user will get OOM every time they load the model int32_t warmup_image_size = 0; int32_t warmup_audio_size = 3000; @@ -4251,7 +4251,7 @@ static void normalize_image_u8_to_f32(const clip_image_u8 & src, clip_image_f32 } } -// set of tools to manupulate images +// set of tools to manipulate images // in the future, we can have HW acceleration by allowing this struct to access 3rd party lib like imagick or opencv struct img_tool { enum resize_algo { @@ -5469,7 +5469,7 @@ bool clip_image_batch_encode(clip_ctx * ctx, const int n_threads, const clip_ima const int win_h = std::min(grid_window, ph - y); const int win_w = std::min(grid_window, pw - x); const int dst_0 = dst; - // group all tokens belong to the same window togather (to a continue range) + // group all tokens belong to the same window together (to a continue range) for (int dy = 0; dy < win_h; dy++) { for (int dx = 0; dx < win_w; dx++) { const int src = (y + dy) * pw + (x + dx); diff --git a/examples/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py b/examples/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py index bb2cc4e4e..e5605d6ef 100644 --- a/examples/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py +++ b/examples/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py @@ -186,7 +186,7 @@ def trunc_normal_tf_( best when :math:`a \\leq \text{mean} \\leq b`. NOTE: this 'tf' variant behaves closer to Tensorflow / JAX impl where the bounds [a, b] are applied when sampling the normal distribution with mean=0, std=1.0 - and the result is subsquently scaled and shifted by the mean and std args. + and the result is subsequently scaled and shifted by the mean and std args. Args: tensor: an n-dimensional `torch.Tensor` mean: the mean of the normal distribution diff --git a/examples/mtmd/mtmd-audio.cpp b/examples/mtmd/mtmd-audio.cpp index 4d053895c..1e8243473 100644 --- a/examples/mtmd/mtmd-audio.cpp +++ b/examples/mtmd/mtmd-audio.cpp @@ -313,7 +313,7 @@ bool preprocess_audio( for (size_t off = 0; off < (size_t)out_full.n_len; off += frames_per_chunk) { int n_len = std::min(frames_per_chunk, (size_t)out_full.n_len - off); if ((size_t)n_len < frames_per_chunk) { - break; // last uncomplete chunk will always be a padded chunk, safe to ignore + break; // last incomplete chunk will always be a padded chunk, safe to ignore } whisper_mel out_chunk; diff --git a/examples/parallel/parallel.cpp b/examples/parallel/parallel.cpp index 7059cafd6..2c34b15de 100644 --- a/examples/parallel/parallel.cpp +++ b/examples/parallel/parallel.cpp @@ -137,7 +137,7 @@ int main(int argc, char ** argv) { // load the prompts from an external file if there are any if (params.prompt.empty()) { - printf("\n\033[32mNo new questions so proceed with build-in defaults.\033[0m\n"); + printf("\n\033[32mNo new questions so proceed with built-in defaults.\033[0m\n"); } else { // Output each line of the input params.prompts vector and copy to k_prompts int index = 0; diff --git a/examples/perplexity/README.md b/examples/perplexity/README.md index 33a46d1a2..fa44e7f09 100644 --- a/examples/perplexity/README.md +++ b/examples/perplexity/README.md @@ -27,10 +27,10 @@ In addition to the KL divergence the following statistics are calculated with `- * Ratio of mean FP16 PPL and quantized PPL. Uncertainty is estimated on logits, then propagated. The logarithm of this metric is also calculated and printed, it is 0 if the logit distributions are the same. * Difference of mean FP16 PPL and quantized PPL. Uncertainty is estimated on logits, then propagated. * Mean change in "correct" token probability. Positive values mean the model gets better at prediction, negative values mean it gets worse. -* Pearson correlation coefficient of the "correct" token probabilites between models. +* Pearson correlation coefficient of the "correct" token probabilities between models. * Percentiles of change in "correct" token probability. Positive values mean the model gets better at prediction, negative values mean it gets worse. Can be used to judge noise vs. quality loss from quantization. If the percentiles are symmetric then the quantization is essentially just adding noise. If the negative values are significantly larger than the positive values then this indicates that the model is actually becoming worse from the quantization. * The root mean square of the change in token probabilities. If you were to assume that the quantization simply causes Gaussian noise on the token probabilities then this would be the standard deviation of said noise. The uncertainty on the value is calculated that the change in token probabilities follows a Gaussian distribution. Related discussion: https://github.com/ggerganov/llama.cpp/discussions/2875 . -* Same top p: Percentage of how often the token was assigned the highest probabilites by both models. The uncertainty is calculated from the Gaussian approximation of the binomial distribution. +* Same top p: Percentage of how often the token was assigned the highest probabilities by both models. The uncertainty is calculated from the Gaussian approximation of the binomial distribution. ## LLaMA 3 8b Scoreboard diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp index 6bc47a12e..e9bd883c3 100644 --- a/examples/perplexity/perplexity.cpp +++ b/examples/perplexity/perplexity.cpp @@ -1198,7 +1198,7 @@ static std::vector load_winogrande_from_csv(const std::string /* * Evaluates the Winogrande score. - * Uses a CSV containing task index, dentence, choice 1, choice 2, answer (1 or 2) + * Uses a CSV containing task index, sentence, choice 1, choice 2, answer (1 or 2) * You can get one such dataset from e.g. https://huggingface.co/datasets/ikawrakow/winogrande-eval-for-llama.cpp * As an example, the 1st row in the above dataset is * diff --git a/examples/retrieval/README.md b/examples/retrieval/README.md index bc5f22e2f..5ff0e2b72 100644 --- a/examples/retrieval/README.md +++ b/examples/retrieval/README.md @@ -7,7 +7,7 @@ https://github.com/ggerganov/llama.cpp/pull/6193 ### How to use -`retieval.cpp` has parameters of its own: +`retrieval.cpp` has parameters of its own: - `--context-file`: file to be embedded - state this option multiple times to embed multiple files - `--chunk-size`: minimum size of each text chunk to be embedded - `--chunk-separator`: STRING to divide chunks by. newline by default diff --git a/examples/server/README.md b/examples/server/README.md index 1ecd5ca95..614e72fec 100644 --- a/examples/server/README.md +++ b/examples/server/README.md @@ -105,7 +105,7 @@ sampling: --mirostat-ent N Mirostat target entropy, parameter tau (default: 5.0) --xtc-probability p xtc probability (default: 0.0 => disabled) --xtc-threshold t xtc threshold (default: 1.0 => disabled) - --top-n-sigma t top-n-sigma parmeter (default: 0.0 => disabled) + --top-n-sigma t top-n-sigma parameter (default: 0.0 => disabled) -l TOKEN_ID(+/-)BIAS modifies the likelihood of token appearing in the completion, i.e. `--logit-bias 15043+1` to increase likelihood of token ' Hello', or `--logit-bias 15043-1` to decrease likelihood of token ' Hello' diff --git a/examples/server/public_legacy/index-new.html b/examples/server/public_legacy/index-new.html index cbfbbdf28..d0c887d6b 100644 --- a/examples/server/public_legacy/index-new.html +++ b/examples/server/public_legacy/index-new.html @@ -36,7 +36,7 @@ const params = signal({ n_predict: 358, // 358 is a nice number - temperature: 0.8, // adapt all following parameters to optimized min-p requierements. If for non-english, set to 0.6 or lower + temperature: 0.8, // adapt all following parameters to optimized min-p requirements. If for non-english, set to 0.6 or lower repeat_last_n: 0, // 0 = disable penalty, -1 = context size repeat_penalty: 1.0, // 1.0 = disabled dry_multiplier: 0.0, // 0.0 = disabled, 0.8 works well @@ -108,7 +108,7 @@ let importedTemplates = local_storage_getDataAsObject('user_templates') if (importedTemplates) { - // saved templates were successfuly imported. + // saved templates were successfully imported. console.log('Processing saved templates and updating default template') params.value = { ...params.value, image_data: [] }; @@ -129,7 +129,7 @@ } function userTemplateResetToDefault() { - console.log('Reseting themplate to default') + console.log('Reseting template to default') selectedUserTemplate.value.name = 'default'; selectedUserTemplate.value.data = savedUserTemplates.value['default']; } @@ -731,7 +731,7 @@ return html` - + diff --git a/examples/server/public_simplechat/datautils.mjs b/examples/server/public_simplechat/datautils.mjs index 75159d6b1..863d129ae 100644 --- a/examples/server/public_simplechat/datautils.mjs +++ b/examples/server/public_simplechat/datautils.mjs @@ -6,8 +6,8 @@ /** * Given the limited context size of local LLMs and , many a times when context gets filled * between the prompt and the response, it can lead to repeating text garbage generation. - * And many a times setting penalty wrt repeatation leads to over-intelligent garbage - * repeatation with slight variations. These garbage inturn can lead to overloading of the + * And many a times setting penalty wrt repetition leads to over-intelligent garbage + * repetition with slight variations. These garbage in turn can lead to overloading of the * available model context, leading to less valuable response for subsequent prompts/queries, * if chat history is sent to ai model. * @@ -21,10 +21,10 @@ /** * Simple minded logic to help remove repeating garbage at end of the string. - * The repeatation needs to be perfectly matching. + * The repetition needs to be perfectly matching. * * The logic progressively goes on probing for longer and longer substring based - * repeatation, till there is no longer repeatation. Inturn picks the one with + * repetition, till there is no longer repetition. In turn picks the one with * the longest chain. * * @param {string} sIn @@ -97,10 +97,10 @@ export function trim_repeat_garbage_at_end_loop(sIn, maxSubL, maxMatchLenThresho /** * A simple minded try trim garbage at end using histogram driven characteristics. - * There can be variation in the repeatations, as long as no new char props up. + * There can be variation in the repetitions, as long as no new char props up. * * This tracks the chars and their frequency in a specified length of substring at the end - * and inturn checks if moving further into the generated text from the end remains within + * and in turn checks if moving further into the generated text from the end remains within * the same char subset or goes beyond it and based on that either trims the string at the * end or not. This allows to filter garbage at the end, including even if there are certain * kind of small variations in the repeated text wrt position of seen chars. @@ -214,7 +214,7 @@ export class NewLines { } /** - * Extracts lines from the passed string and inturn either + * Extracts lines from the passed string and in turn either * append to a previous partial line or add a new line. * @param {string} sLines */ diff --git a/examples/server/public_simplechat/readme.md b/examples/server/public_simplechat/readme.md index 21410199f..e8fd74e0f 100644 --- a/examples/server/public_simplechat/readme.md +++ b/examples/server/public_simplechat/readme.md @@ -14,7 +14,7 @@ Continue reading for the details. ## overview This simple web frontend, allows triggering/testing the server's /completions or /chat/completions endpoints -in a simple way with minimal code from a common code base. Inturn additionally it tries to allow single or +in a simple way with minimal code from a common code base. In turn additionally it tries to allow single or multiple independent back and forth chatting to an extent, with the ai llm model at a basic level, with their own system prompts. @@ -23,7 +23,7 @@ or potentially as it is being generated, in a streamed manner from the server/ai ![Chat and Settings screens](./simplechat_screens.webp "Chat and Settings screens") -Auto saves the chat session locally as and when the chat is progressing and inturn at a later time when you +Auto saves the chat session locally as and when the chat is progressing and in turn at a later time when you open SimpleChat, option is provided to restore the old chat session, if a matching one exists. The UI follows a responsive web design so that the layout can adapt to available display space in a usable @@ -88,7 +88,7 @@ Once inside then the end user needs to enter the same. This keeps the logic simple, while still giving flexibility to the end user to manage any templating/tagging requirement wrt their messages to the model. - * the logic doesnt insert newline at the begining and end wrt the prompt message generated. + * the logic doesnt insert newline at the beginning and end wrt the prompt message generated. However if the chat being sent to /completions end point has more than one role's message, then insert newline when moving from one role's message to the next role's message, so that it can be clearly identified/distinguished. @@ -105,7 +105,7 @@ Once inside * you cant set a system prompt, after you have submitted any user query * if chat.add_system_anytime is used * one can change the system prompt any time during chat, by changing the contents of system prompt. - * inturn the updated/changed system prompt will be inserted into the chat session. + * in turn the updated/changed system prompt will be inserted into the chat session. * this allows for the subsequent user chatting to be driven by the new system prompt set above. * Enter your query and either press enter or click on the submit button. @@ -130,7 +130,7 @@ Once inside ### Reason behind this The idea is to be easy enough to use for basic purposes, while also being simple and easily discernable -by developers who may not be from web frontend background (so inturn may not be familiar with template / +by developers who may not be from web frontend background (so in turn may not be familiar with template / end-use-specific-language-extensions driven flows) so that they can use it to explore/experiment things. And given that the idea is also to help explore/experiment for developers, some flexibility is provided @@ -144,7 +144,7 @@ Me/gMe consolidates the settings which control the behaviour into one object. One can see the current settings, as well as change/update them using browsers devel-tool/console. It is attached to the document object. Some of these can also be updated using the Settings UI. - baseURL - the domain-name/ip-address and inturn the port to send the request. + baseURL - the domain-name/ip-address and in turn the port to send the request. bStream - control between oneshot-at-end and live-stream-as-its-generated collating and showing of the generated response. @@ -155,7 +155,7 @@ It is attached to the document object. Some of these can also be updated using t that text generated till then is not lost. if a very long text is being generated, which leads to no user interaction for sometime and - inturn the machine goes into power saving mode or so, the platform may stop network connection, + in turn the machine goes into power saving mode or so, the platform may stop network connection, leading to exception. apiEP - select between /completions and /chat/completions endpoint provided by the server/ai-model. @@ -166,7 +166,7 @@ It is attached to the document object. Some of these can also be updated using t bCompletionInsertStandardRolePrefix - whether Completion mode inserts role related prefix wrt the messages that get inserted into prompt field wrt /Completion endpoint. - bTrimGarbage - whether garbage repeatation at the end of the generated ai response, should be + bTrimGarbage - whether garbage repetition at the end of the generated ai response, should be trimmed or left as is. If enabled, it will be trimmed so that it wont be sent back as part of subsequent chat history. At the same time the actual trimmed text is shown to the user, once when it was generated, so user can check if any useful info/data was there in the response. @@ -240,11 +240,11 @@ However a developer when testing the server of ai-model may want to change these Using iRecentUserMsgCnt reduce chat history context sent to the server/ai-model to be just the system-prompt, prev-user-request-and-ai-response and cur-user-request, instead of -full chat history. This way if there is any response with garbage/repeatation, it doesnt +full chat history. This way if there is any response with garbage/repetition, it doesnt mess with things beyond the next question/request/query, in some ways. The trim garbage option also tries to help avoid issues with garbage in the context to an extent. -Set max_tokens to 1024, so that a relatively large previous reponse doesnt eat up the space +Set max_tokens to 1024, so that a relatively large previous response doesnt eat up the space available wrt next query-response. However dont forget that the server when started should also be started with a model context size of 1k or more, to be on safe side. @@ -254,7 +254,7 @@ also be started with a model context size of 1k or more, to be on safe side. NOTE: One may want to experiment with frequency/presence penalty fields in apiRequestOptions wrt the set of fields sent to server along with the user query, to check how the model behaves -wrt repeatations in general in the generated text response. +wrt repetitions in general in the generated text response. A end-user can change these behaviour by editing gMe from browser's devel-tool/console or by using the provided settings ui (for settings exposed through the ui). diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index 2fcd24a86..035c0572b 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -318,7 +318,7 @@ class SimpleChat { } /** - * Allow setting of system prompt, but only at begining. + * Allow setting of system prompt, but only at beginning. * @param {string} sysPrompt * @param {string} msgTag */ diff --git a/examples/sweep-bench/README.md b/examples/sweep-bench/README.md index d92740de2..e48c57cae 100644 --- a/examples/sweep-bench/README.md +++ b/examples/sweep-bench/README.md @@ -12,7 +12,7 @@ for each ubatch-sized window in context: 2. measure generation performance 3. remove generated tokens from KV cache 4. prepare a ubatch-sized batch of random tokens - 4. process prepated batch + 4. process prepared batch 5. measure prompt processing performance The purpose of the benchmark is to visualize how the performance changes with diff --git a/ggml/src/ggml-cann/acl_tensor.cpp b/ggml/src/ggml-cann/acl_tensor.cpp index d120ce6ac..8e9ae3159 100644 --- a/ggml/src/ggml-cann/acl_tensor.cpp +++ b/ggml/src/ggml-cann/acl_tensor.cpp @@ -126,7 +126,7 @@ int64_t ggml_cann_get_mulmat_bcast_shape( const size_t* input_nb, const size_t* weight_nb, const size_t* dst_nb, int64_t* bcast_input_ne, int64_t* bcast_weight_ne, int64_t* bcast_dst_ne, size_t* bcast_input_nb, size_t* bcast_weight_nb, size_t* bcast_dst_nb) { - // input and dst shoule in same shape, except first two dims. + // input and dst should be in same shape, except first two dims. GGML_ASSERT(input_ne[2] == dst_ne[2]); GGML_ASSERT(input_ne[3] == dst_ne[3]); diff --git a/ggml/src/ggml-cann/aclnn_ops.cpp b/ggml/src/ggml-cann/aclnn_ops.cpp index 8c4132f5b..34ea272e8 100644 --- a/ggml/src/ggml-cann/aclnn_ops.cpp +++ b/ggml/src/ggml-cann/aclnn_ops.cpp @@ -83,7 +83,7 @@ static void aclnn_repeat(ggml_backend_cann_context& ctx, aclTensor* acl_src, if (workspaceSize > 0) { // Memory from allocator will "free" immediately, and this memory - // will be alloced to other pointers, but it won't access before + // will be allocated to other pointers, but it won't access before // this async task end because all tasks in same stream will execute // in queue. ggml_cann_pool_alloc workspace_allocator(ctx.pool(), workspaceSize); @@ -929,7 +929,7 @@ void ggml_cann_dup(ggml_backend_cann_context& ctx, ggml_tensor* dst) { if (ggml_is_contiguous(dst)) { const size_t src_type_size = ggml_type_size(src->type); if (src->nb[0] == src_type_size) { - // src0 is contigous on first dimension, copy by rows + // src0 is contiguous on first dimension, copy by rows int64_t rows_num = ggml_nrows(src); aclrtlaunch_ascendc_dup_by_rows_fp16( @@ -954,7 +954,7 @@ void ggml_cann_dup(ggml_backend_cann_context& ctx, ggml_tensor* dst) { if (ggml_is_contiguous(dst)) { const size_t src_type_size = ggml_type_size(src->type); if (src->nb[0] == src_type_size) { - // src0 is contigous on first dimension, copy by rows + // src0 is contiguous on first dimension, copy by rows int64_t rows_num = ggml_nrows(src); aclrtlaunch_ascendc_dup_by_rows_fp16_to_fp32( rows_num, ctx.stream(), src->data, dst->data, @@ -997,7 +997,7 @@ void ggml_cann_dup(ggml_backend_cann_context& ctx, ggml_tensor* dst) { if (ggml_is_contiguous(dst)) { const size_t src_type_size = ggml_type_size(src->type); if (src->nb[0] == src_type_size) { - // src0 is contigous on first dimension, copy by rows + // src0 is contiguous on first dimension, copy by rows int64_t rows_num = ggml_nrows(src); aclrtlaunch_ascendc_dup_by_rows_fp32( rows_num, ctx.stream(), src->data, dst->data, @@ -1023,7 +1023,7 @@ void ggml_cann_dup(ggml_backend_cann_context& ctx, ggml_tensor* dst) { if (ggml_is_contiguous(dst)) { const size_t src_type_size = ggml_type_size(src->type); if (src->nb[0] == src_type_size) { - // src0 is contigous on first dimension, copy by rows + // src0 is contiguous on first dimension, copy by rows int64_t rows_num = ggml_nrows(src); aclrtlaunch_ascendc_dup_by_rows_fp32_to_fp16( rows_num, ctx.stream(), src->data, dst->data, @@ -1187,7 +1187,7 @@ void ggml_cann_rms_norm(ggml_backend_cann_context& ctx, ggml_tensor* dst) { ACL_CHECK(aclDestroyTensor(acl_rstd)); } -// TODO: performace is low. +// TODO: performance is low. void ggml_cann_diag_mask(ggml_backend_cann_context& ctx, ggml_tensor* dst, float value) { ggml_tensor* src = dst->src[0]; diff --git a/ggml/src/ggml-cann/common.h b/ggml/src/ggml-cann/common.h index e6a570107..903493f09 100644 --- a/ggml/src/ggml-cann/common.h +++ b/ggml/src/ggml-cann/common.h @@ -120,8 +120,8 @@ struct ggml_cann_pool { * * @param ptr Pointer to the memory block to free. * @param size Size of the memory block to free. - * @note Note that all CANN opertors are running async. Make sure memory is - * still avaiable before this operator finished. + * @note Note that all CANN operators are running async. Make sure memory is + * still available before this operator finished. */ virtual void free(void* ptr, size_t size) = 0; }; diff --git a/ggml/src/ggml-cann/kernels/dup.cpp b/ggml/src/ggml-cann/kernels/dup.cpp index e2c651152..e77c15616 100644 --- a/ggml/src/ggml-cann/kernels/dup.cpp +++ b/ggml/src/ggml-cann/kernels/dup.cpp @@ -12,7 +12,7 @@ class DupByRows { __aicore__ inline DupByRows() {} __aicore__ inline void init(GM_ADDR src, GM_ADDR dst, int64_t *input_ne_ub, size_t *input_nb_ub) { - /* Dup by rows when src is contigous on first dimension and dst is + /* Dup by rows when src is contiguous on first dimension and dst is contiguous, each kernel process one row. */ diff --git a/ggml/src/ggml-cuda.cu b/ggml/src/ggml-cuda.cu index ad0db58e2..e66f3de3a 100644 --- a/ggml/src/ggml-cuda.cu +++ b/ggml/src/ggml-cuda.cu @@ -2516,7 +2516,7 @@ static int ggml_cuda_mul_mat_q(ggml_backend_cuda_context & ctx, const ggml_tenso src0->type, stream); CUDA_CHECK(cudaGetLastError()); - // The code below handles the case when Q, K, V have a bias applied after the resepctive matrix multiplication. + // The code below handles the case when Q, K, V have a bias applied after the respective matrix multiplication. // In that case the graph contains mul_mat(Q) -> mul_mat(K) -> mul_mat(V) -> add(Q) -> add(K) -> add(V) if (fusion && cgraph && node_n + 5 < cgraph->n_nodes && cgraph->nodes[node_n+1]->op == GGML_OP_MUL_MAT && @@ -5124,7 +5124,7 @@ GGML_CALL static bool ggml_backend_cuda_offload_op(ggml_backend_t backend, const // // batch_size * active_experts >= min_batch_size * total_experts // - // as the condition for offloading model weights resinding in RAM to the GPU. + // as the condition for offloading model weights residing in RAM to the GPU. // In this case, the number of tokens is not as usual in op->ne[1] but rather in op->ne[2]. if (op->op == GGML_OP_MUL_MAT_ID || op->op == GGML_OP_MOE_FUSED_UP_GATE) { if (ctx->offload_batch_size_per_byte >= 0) { diff --git a/ggml/src/ggml-cuda/conv2d.cu b/ggml/src/ggml-cuda/conv2d.cu index 142dd6690..e3922d535 100644 --- a/ggml/src/ggml-cuda/conv2d.cu +++ b/ggml/src/ggml-cuda/conv2d.cu @@ -152,7 +152,7 @@ void ggml_cuda_op_conv2d(ggml_backend_cuda_context & ctx, ggml_tensor * dst) { const int KW = kernel->ne[0]; // kernel_w const int KH = kernel->ne[1]; // kernel_h const int IC = input->ne[2]; // input_channels - const int OC = kernel->ne[3]; // ouptut_chanles + const int OC = kernel->ne[3]; // output_channels const int B = input->ne[3]; // n_batches const int64_t total = B * OC * OH * OW; diff --git a/ggml/src/ggml-cuda/fattn-mma-f16.cuh b/ggml/src/ggml-cuda/fattn-mma-f16.cuh index b7b55588a..e6d7d2550 100644 --- a/ggml/src/ggml-cuda/fattn-mma-f16.cuh +++ b/ggml/src/ggml-cuda/fattn-mma-f16.cuh @@ -612,7 +612,7 @@ static __device__ __forceinline__ void flash_attn_ext_f16_process_tile( } // If attention sinks are used, potentially re-scale if KQ_max is small. - // Also add the sink as a value to KQ_rowsum, this is done after synchonization of KQ_rowsum + // Also add the sink as a value to KQ_rowsum, this is done after synchronization of KQ_rowsum // so it's being done unconditionally for every thread. if (!is_fixup && (np == 1 || threadIdx.y % np == 0) && sinks_f) { float KQ_max_scale[cols_per_thread]; diff --git a/ggml/src/ggml-cuda/fattn-new-mma.cu b/ggml/src/ggml-cuda/fattn-new-mma.cu index 46bd8674c..681d4fa4a 100644 --- a/ggml/src/ggml-cuda/fattn-new-mma.cu +++ b/ggml/src/ggml-cuda/fattn-new-mma.cu @@ -1194,7 +1194,7 @@ static __device__ __forceinline__ void flash_attn_ext_f16_process_tile( } // If attention sinks are used, potentially re-scale if KQ_max is small. - // Also add the sink as a value to KQ_rowsum, this is done after synchonization of KQ_rowsum + // Also add the sink as a value to KQ_rowsum, this is done after synchronization of KQ_rowsum // so it's being done unconditionally for every thread. if (!is_fixup && (np == 1 || threadIdx.y % np == 0) && sinks_f) { float KQ_max_scale[cols_per_thread]; @@ -1953,7 +1953,7 @@ static void launch_fattn_new_mma( const int ntiles_total = ntiles_x * ntiles_z * K->ne[2] * Q->ne[3]; // Optional optimization where the mask is scanned to determine whether part of the calculation can be skipped. - // Only worth the overhead if there is at lease one FATTN_KQ_STRIDE x FATTN_KQ_STRIDE square to be skipped or + // Only worth the overhead if there is at least one FATTN_KQ_STRIDE x FATTN_KQ_STRIDE square to be skipped or // multiple sequences of possibly different lengths. if (mask && K->ne[1] % FATTN_KQ_STRIDE == 0 && (Q->ne[1] >= 1024 || Q->ne[3] > 1)) { const int s31 = mask->nb[1] / sizeof(half2); diff --git a/ggml/src/ggml-cuda/fattn-vec-common.cuh b/ggml/src/ggml-cuda/fattn-vec-common.cuh index 3cc52ce28..cc8f85847 100644 --- a/ggml/src/ggml-cuda/fattn-vec-common.cuh +++ b/ggml/src/ggml-cuda/fattn-vec-common.cuh @@ -970,7 +970,7 @@ void launch_fattn( const int ntiles_total = ntiles_x * (Q->ne[2] / ncols2) * Q->ne[3]; // Optional optimization where the mask is scanned to determine whether part of the calculation can be skipped. - // Only worth the overhead if there is at lease one FATTN_KQ_STRIDE x FATTN_KQ_STRIDE square to be skipped or + // Only worth the overhead if there is at least one FATTN_KQ_STRIDE x FATTN_KQ_STRIDE square to be skipped or // multiple sequences of possibly different lengths. if (mask && (Q->ne[1] >= 1024 || Q->ne[3] > 1 || (n_swa > 0 && K->ne[1] >= FATTN_KQ_STRIDE + n_swa))) { const int s31 = mask->nb[1] / sizeof(half2); diff --git a/ggml/src/ggml-cuda/fattn-vec-f32.cuh b/ggml/src/ggml-cuda/fattn-vec-f32.cuh index d07ba359d..6ed1e6600 100644 --- a/ggml/src/ggml-cuda/fattn-vec-f32.cuh +++ b/ggml/src/ggml-cuda/fattn-vec-f32.cuh @@ -8,7 +8,7 @@ #include "common.cuh" #include "fattn-vec-common.cuh" -// Currenlty llvm with the amdgcn target dose not support unrolling loops +// Currently llvm with the amdgcn target does not support unrolling loops // that contain a break that can not be resolved at compile time. #ifdef __clang__ #pragma clang diagnostic push diff --git a/ggml/src/ggml-cuda/mmq_id_common.cuh b/ggml/src/ggml-cuda/mmq_id_common.cuh index 01806a107..74bb301f8 100644 --- a/ggml/src/ggml-cuda/mmq_id_common.cuh +++ b/ggml/src/ggml-cuda/mmq_id_common.cuh @@ -132,7 +132,7 @@ struct tile_x_sizes { #define GGML_CUDA_CC_VEGA (GGML_CUDA_CC_OFFSET_AMD + 0x900) // Vega56/64, minimum for fp16 dual issue #define GGML_CUDA_CC_VEGA20 (GGML_CUDA_CC_OFFSET_AMD + 0x906) // MI50/Radeon VII, minimum for dp4a #define GGML_CUDA_CC_CDNA1 (GGML_CUDA_CC_OFFSET_AMD + 0x908) // MI100, minimum for MFMA, acc registers -#define GGML_CUDA_CC_CDNA2 (GGML_CUDA_CC_OFFSET_AMD + 0x910) // MI210, minimum acc register renameing +#define GGML_CUDA_CC_CDNA2 (GGML_CUDA_CC_OFFSET_AMD + 0x910) // MI210, minimum acc register renaming #define GGML_CUDA_CC_CDNA3 (GGML_CUDA_CC_OFFSET_AMD + 0x942) // MI300 // RDNA removes MFMA, dp4a, xnack, acc registers, wave size is 32 @@ -3281,7 +3281,7 @@ static __device__ __forceinline__ void mmq_write_back_mma_id( // // Strictly speaking, we should bite the bullet and change WARP_SIZE to warp_size or MMQ_TILE_NE_K. -// But as we basically don't support anything but Nvidia in the CUDA backend, we alays have +// But as we basically don't support anything but Nvidia in the CUDA backend, we always have // WARP_SIZE = MMQ_TILE_NE_K = 32 // diff --git a/ggml/src/ggml-cuda/quantize.cu b/ggml/src/ggml-cuda/quantize.cu index 762110f79..dfb828fc5 100644 --- a/ggml/src/ggml-cuda/quantize.cu +++ b/ggml/src/ggml-cuda/quantize.cu @@ -122,7 +122,7 @@ static __global__ void quantize_mmq_q8_1( if (ds_layout != MMQ_Q8_1_DS_LAYOUT_D4) { sum = xi.x + xi.y + xi.z + xi.w; - // Exchange calculate sum across vals_per_sum/4 threads. + // Calculate sum across vals_per_sum/4 threads. #pragma unroll for (int mask = vals_per_sum/8; mask > 0; mask >>= 1) { sum += __shfl_xor_sync(0xFFFFFFFF, sum, mask, WARP_SIZE); @@ -137,7 +137,7 @@ static __global__ void quantize_mmq_q8_1( q.z = roundf(xi.z*d_inv); q.w = roundf(xi.w*d_inv); - // Write back 4 int8 values as a single 32 bit value for better memroy bandwidth: + // Write back 4 int8 values as a single 32 bit value for better memory bandwidth: char4 * yqs4 = (char4 *) y[ib].qs; yqs4[iqs/4] = q; @@ -216,7 +216,7 @@ static __global__ void quantize_mmq_q8_1_id( if (ds_layout != MMQ_Q8_1_DS_LAYOUT_D4) { sum = xi.x + xi.y + xi.z + xi.w; - // Exchange calculate sum across vals_per_sum/4 threads. + // Calculate sum across vals_per_sum/4 threads. #pragma unroll for (int mask = vals_per_sum/8; mask > 0; mask >>= 1) { sum += __shfl_xor_sync(0xFFFFFFFF, sum, mask, WARP_SIZE); @@ -231,7 +231,7 @@ static __global__ void quantize_mmq_q8_1_id( q.z = roundf(xi.z*d_inv); q.w = roundf(xi.w*d_inv); - // Write back 4 int8 values as a single 32 bit value for better memroy bandwidth: + // Write back 4 int8 values as a single 32 bit value for better memory bandwidth: char4 * yqs4 = (char4 *) y[ib].qs; yqs4[iqs/4] = q; diff --git a/ggml/src/ggml-cuda/quantize_id.cu b/ggml/src/ggml-cuda/quantize_id.cu index 9324c2c3e..92774f49e 100644 --- a/ggml/src/ggml-cuda/quantize_id.cu +++ b/ggml/src/ggml-cuda/quantize_id.cu @@ -65,7 +65,7 @@ static __global__ void quantize_mmq_q8_1( q.z = roundf(xi.z*d_inv); q.w = roundf(xi.w*d_inv); - // Write back 4 int8 values as a single 32 bit value for better memroy bandwidth: + // Write back 4 int8 values as a single 32 bit value for better memory bandwidth: char4 * yqs4 = (char4 *) y[ib].qs; yqs4[iqs/4] = q; diff --git a/ggml/src/ggml-cuda/scale.cu b/ggml/src/ggml-cuda/scale.cu index ac1384699..914668c5a 100644 --- a/ggml/src/ggml-cuda/scale.cu +++ b/ggml/src/ggml-cuda/scale.cu @@ -13,7 +13,7 @@ static __global__ void scale_f32(const float * x, float * dst, const float scale static void scale_f32_cuda(const float * x, float * dst, const float scale, const float bias, const int64_t nelements, cudaStream_t stream) { const int64_t num_blocks = (nelements + CUDA_SCALE_BLOCK_SIZE - 1) / CUDA_SCALE_BLOCK_SIZE; - // Whehn will we be scaling tensors with more than 2^39 elements? + // When will we be scaling tensors with more than 2^39 elements? //scale_f32<<>>(x, dst, scale, bias, nelements); scale_f32<<>>(x, dst, scale, bias, nelements); } diff --git a/ggml/src/ggml-cuda/softmax.cu b/ggml/src/ggml-cuda/softmax.cu index 4c9aa7edf..611d480c6 100644 --- a/ggml/src/ggml-cuda/softmax.cu +++ b/ggml/src/ggml-cuda/softmax.cu @@ -289,7 +289,7 @@ static __global__ void soft_max_f32( const int64_t i02 = blockIdx.y; const int64_t i01 = blockIdx.x; - //TODO: noncontigous inputs/outputs + //TODO: noncontiguous inputs/outputs const int rowx = blockIdx.x + blockIdx.y * gridDim.x + blockIdx.z * gridDim.x * gridDim.y; const int64_t i11 = i01; diff --git a/ggml/src/ggml-cuda/solve_tri.cu b/ggml/src/ggml-cuda/solve_tri.cu index a955d535c..60cefa08d 100644 --- a/ggml/src/ggml-cuda/solve_tri.cu +++ b/ggml/src/ggml-cuda/solve_tri.cu @@ -544,7 +544,7 @@ static __global__ void solve_tri_f32_256x256_tiled(const float * __restrict__ A, // When ncols_template == 0 the bounds for the loops in this function are not // known and can't be unrolled. As we want to keep pragma unroll for all other -// cases we supress the clang transformation warning here. +// cases we suppress the clang transformation warning here. #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wpass-failed" diff --git a/ggml/src/ggml-quants.c b/ggml/src/ggml-quants.c index 7d7acbe1e..71bc9fd39 100644 --- a/ggml/src/ggml-quants.c +++ b/ggml/src/ggml-quants.c @@ -4011,7 +4011,7 @@ void quantize_row_q8_K(const float * restrict x, void * restrict y, int64_t k) { #endif } -//===================================== Dot ptoducts ================================= +//===================================== Dot products ================================= // // Helper functions @@ -4385,7 +4385,7 @@ void ggml_vec_dot_q4_0_q8_0(int n, float * restrict s, size_t bs, const void * r __m128 p2_d = _mm_mul_ps( d_2_3, p2 ); __m128 p3_d = _mm_mul_ps( d_2_3, p3 ); - // Acummulate + // Accumulate acc_0 = _mm_add_ps(p0_d, acc_0); acc_1 = _mm_add_ps(p1_d, acc_1); acc_2 = _mm_add_ps(p2_d, acc_2); @@ -4552,7 +4552,7 @@ void ggml_vec_dot_q4_0_q8_0(int n, float * restrict s, size_t bs, const void * r __m128 p2_d = __lsx_vfmul_s( d_2_3, p2 ); __m128 p3_d = __lsx_vfmul_s( d_2_3, p3 ); - // Acummulate + // Accumulate acc_0 = __lsx_vfadd_s(p0_d, acc_0); acc_1 = __lsx_vfadd_s(p1_d, acc_1); acc_2 = __lsx_vfadd_s(p2_d, acc_2); @@ -10976,7 +10976,7 @@ void ggml_vec_dot_iq3_s_q8_K (int n, float * restrict s, size_t bs, const void * idx.vec[0] = _mm256_or_si256(idx.vec[0], _mm256_cvtepi16_epi32(_mm256_castsi256_si128(idx_l))); idx.vec[1] = _mm256_or_si256(idx.vec[1], _mm256_cvtepi16_epi32(_mm256_extractf128_si256(idx_l, 1))); - // At leat on my CPU (Ryzen 7950X), using _mm256_i32gather_epi32 is slower than _mm256_set_epi32. Strange. + // At least on my CPU (Ryzen 7950X), using _mm256_i32gather_epi32 is slower than _mm256_set_epi32. Strange. //const __m256i q2_1 = _mm256_i32gather_epi32((const int *)iq3s_grid, idx.vec[0], 4); //const __m256i q2_2 = _mm256_i32gather_epi32((const int *)iq3s_grid, idx.vec[1], 4); const __m256i q2_1 = _mm256_set_epi32( @@ -11273,7 +11273,7 @@ void ggml_vec_dot_iq3_s_q8_K (int n, float * restrict s, size_t bs, const void * idx.vec[0] = __lasx_xvor_v(idx.vec[0], lasx_ext16_32(lasx_extracti128(idx_l, 0))); idx.vec[1] = __lasx_xvor_v(idx.vec[1], lasx_ext16_32(lasx_extracti128(idx_l, 1))); - // At leat on my CPU (Ryzen 7950X), using _mm256_i32gather_epi32 is slower than _mm256_set_epi32. Strange. + // At least on my CPU (Ryzen 7950X), using _mm256_i32gather_epi32 is slower than _mm256_set_epi32. Strange. //const __m256i q2_1 = _mm256_i32gather_epi32((const int *)iq3s_grid, idx.vec[0], 4); //const __m256i q2_2 = _mm256_i32gather_epi32((const int *)iq3s_grid, idx.vec[1], 4); const __m256i q2_1 = lasx_set_w( @@ -14269,7 +14269,7 @@ void iq1s_process_1block(int block_size, const float * xb, const float * weight, // With just 3 allowed quant values (-1, 0, 1), we can search exhaustively for the two // boundaries that split the weights xb[i] into 3 groups. To do so, we sort the weights // in ascending order, compute Si = sum[weight[j] xb[j], j = 0...i] and - // Wi = sum[weight[j], j = 0...i], and use these to quckly get get the optimum scale + // Wi = sum[weight[j], j = 0...i], and use these to quickly get the optimum scale // for each possible and score for each split. int * idx = (int *)(pairs + 1); for (int j = 0; j < block_size; ++j) { @@ -14485,7 +14485,7 @@ void iq1m_process_1block(const float * xb, const float * weight, int8_t * L, flo // With just 3 allowed quant values (-1, 0, 1), we can search exhaustively for the two // boundaries that split the weights xb[i] into 3 groups. To do so, we sort the weights // in ascending order, compute Si = sum[weight[j] xb[j], j = 0...i] and - // Wi = sum[weight[j], j = 0...i], and use these to quckly get get the optimum scale + // Wi = sum[weight[j], j = 0...i], and use these to quickly get the optimum scale // for each possible and score for each split. int * idx = (int *)(pairs + 1); for (int j = 0; j < block_size; ++j) { diff --git a/ggml/src/ggml-sycl.cpp b/ggml/src/ggml-sycl.cpp index e0f8536af..52f73ace5 100644 --- a/ggml/src/ggml-sycl.cpp +++ b/ggml/src/ggml-sycl.cpp @@ -4409,7 +4409,7 @@ ggml_backend_sycl_buffer_cpy_tensor(ggml_backend_buffer_t buffer, queue_ptr stream_src = src_ctx->stream; size_t size = ggml_nbytes(src); - //todo. it's dirty solutino to walkaroud known issue:device2device cross GPUs. + //todo. it's a dirty solution to workaround known issue:device2device cross GPUs. dev2dev_memcpy(*stream_dst, *stream_src, dst->data, src->data, size); //todo, it's known issue:error in device2device cross GPUs. reused when the issue is fixed. DON"T remove diff --git a/ggml/src/ggml-vulkan.cpp b/ggml/src/ggml-vulkan.cpp index c880898cc..3569f7e0c 100644 --- a/ggml/src/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan.cpp @@ -3903,7 +3903,7 @@ static void ggml_vk_instance_init() { vk_instance.device_indices.push_back(i); } else { // There can be two physical devices corresponding to the same GPU if there are 2 different drivers - // This can cause error when splitting layers aross the devices, need to keep only 1 + // This can cause error when splitting layers across the devices, need to keep only 1 VK_LOG_DEBUG("Device " << i << " and device " << *old_device << " have the same deviceUUID"); vk::PhysicalDeviceProperties2 old_props; @@ -7101,7 +7101,7 @@ static void ggml_vk_op_f32(ggml_backend_vk_context * ctx, vk_context& subctx, co z_buf_offset = vk_tensor_offset(src2) + src2->view_offs; GGML_ASSERT(d_Z != nullptr); } - // Compute misalignment offset for descriptors and store it in in push constants, then align the descriptor offsets. + // Compute misalignment offset for descriptors and store it in push constants, then align the descriptor offsets. init_pushconst_tensor_offsets(ctx, pc, src0, src1, src2, dst); x_buf_offset &= ~(ctx->device->properties.limits.minStorageBufferOffsetAlignment - 1); y_buf_offset &= ~(ctx->device->properties.limits.minStorageBufferOffsetAlignment - 1); diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 0cba53103..0e1b85275 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -5114,7 +5114,7 @@ bool ggml_are_same_stride(const struct ggml_tensor * t0, const struct ggml_tenso (t0->nb[3] == t1->nb[3]); } -// check if t1 can be represented as a repeatition of t0 +// check if t1 can be represented as a repetition of t0 bool ggml_can_repeat(const struct ggml_tensor * t0, const struct ggml_tensor * t1) { static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function"); diff --git a/ggml/src/iqk/fa/iqk_fa_templates.h b/ggml/src/iqk/fa/iqk_fa_templates.h index 68dbbec3b..9b7f8b05e 100644 --- a/ggml/src/iqk/fa/iqk_fa_templates.h +++ b/ggml/src/iqk/fa/iqk_fa_templates.h @@ -1534,7 +1534,7 @@ char * get_q_storage(size_t size) { // Some of the methods in FlashAttn have two identical implementations that only differ by // one version using a loop over the template parameter q_step, while the other using a loop // over an input parameter nq (these are loops over the rows of q^T). I dislike this a lot, -// but performance drops signficantly if I remove the version with fixed q_step iterations. +// but performance drops significantly if I remove the version with fixed q_step iterations. // We only instantiate FlashAttn with q_step = 1 and q_step = 4 or 8 (depending on head size D), // so when we have to process Nq rows, we process q_step*(Nq/q_step) using fixed q_step loops, // and use the variable nq version (with lower performance) only for the remaining i1...q_step-1 diff --git a/ggml/src/iqk/iqk_gemm_1bit.cpp b/ggml/src/iqk/iqk_gemm_1bit.cpp index 8e59c12ff..5c0b9e3b4 100644 --- a/ggml/src/iqk/iqk_gemm_1bit.cpp +++ b/ggml/src/iqk/iqk_gemm_1bit.cpp @@ -2625,7 +2625,7 @@ void mul_mat_iq1_s_q8_K(int n, const void * vx, size_t bx, const DataInfo& info, auto scales128 = vandq_u16(vshrq_n_u16(qhb, 12), vdupq_n_u16(7)); scales128 = vaddq_u16(vshlq_n_u16(scales128, 1), vdupq_n_u16(1)); auto mask = vceqq_u16(vandq_u16(qhb, delta_mask), delta_mask); - // Note: we explicitely assume IQ1S_DELTA = 0.125 + // Note: we explicitly assume IQ1S_DELTA = 0.125 auto deltas128 = vsubq_s16(vbicq_s16(scales128, mask), vandq_s16(scales128, mask)); //auto deltas128 = vorrq_s16(vandq_s16(vdupq_n_s16(-1), mask), vbicq_s16(vdupq_n_s16(1), mask)); //deltas128 = vmulq_s16(scales128, deltas128); diff --git a/ggml/src/iqk/iqk_gemm_ktquants.cpp b/ggml/src/iqk/iqk_gemm_ktquants.cpp index 581b3cb20..70a29e507 100644 --- a/ggml/src/iqk/iqk_gemm_ktquants.cpp +++ b/ggml/src/iqk/iqk_gemm_ktquants.cpp @@ -171,7 +171,7 @@ struct Trellis3 { } } IQK_ALWAYS_INLINE inline void next_128(const uint32_t * val, __m256i * result) const { - // Even though we only have 16 vector registers nn AVX2, this is still faster + // Even though we only have 16 vector registers in AVX2, this is still faster __m256i aux[16]; auto perm = _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7); for (int k = 0; k < 4; ++k) { @@ -213,7 +213,7 @@ struct Trellis3 { } } IQK_ALWAYS_INLINE inline void next_128(__m256i val, __m256i * result) const { - // Even though we only have 16 vector registers nn AVX2, this is still faster + // Even though we only have 16 vector registers in AVX2, this is still faster __m256i aux[16]; __m256i tmp[2]; tmp[0] = _mm256_cvtepu16_epi32(_mm256_castsi256_si128(val)); @@ -263,7 +263,7 @@ struct Trellis3 { } } IQK_ALWAYS_INLINE inline void next_128(const uint16_t * val, uint32_t v0, __m256i * result) const { - // Even though we only have 16 vector registers nn AVX2, this is still faster + // Even though we only have 16 vector registers in AVX2, this is still faster __m256i aux[16]; for (int k = 0; k < 4; ++k) { auto v128 = _mm_add_epi32(_mm_cvtepu16_epi32(_mm_loadl_epi64((const __m128i *)(val + 4*k))), _mm_set1_epi32(v0)); diff --git a/include/llama.h b/include/llama.h index 95750a90f..24e2eb9ec 100644 --- a/include/llama.h +++ b/include/llama.h @@ -1565,7 +1565,7 @@ LLAMA_API struct llama_grammar* llama_sampler_init_grammar_lazy_patterns( struct llama_context * ctx, llama_token_data_array * candidates); - /// @details Randonly selects a token from the candidates following adaptive p sampler. + /// @details Randomly selects a token from the candidates following adaptive p sampler. llama_token llama_sample_token_adaptive_p( struct llama_context * ctx, llama_token_data_array * candidates, diff --git a/tests/test-chat.cpp b/tests/test-chat.cpp index 900fa87d0..ae1e306e7 100644 --- a/tests/test-chat.cpp +++ b/tests/test-chat.cpp @@ -355,7 +355,7 @@ static std::string renormalize_json(const std::string & json_str) { auto json_obj = json::parse(json_str); return json_obj.dump(); } catch (const std::exception & e) { - return ""; // ignore parial JSON contents for comparison purposes + return ""; // ignore partial JSON contents for comparison purposes } }