mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-01 00:39:00 +01:00
llama : fix comments for llama_kv_cache API
This commit is contained in:
parent
337120cc0d
commit
5418932b71
16
llama.h
16
llama.h
@ -330,16 +330,16 @@ extern "C" {
|
|||||||
"avoid using this, it will be removed in the future, instead - count the tokens in user code");
|
"avoid using this, it will be removed in the future, instead - count the tokens in user code");
|
||||||
|
|
||||||
// Remove all tokens data of cells in [c0, c1)
|
// Remove all tokens data of cells in [c0, c1)
|
||||||
// c0 < -1 : [0, c1]
|
// c0 < 0 : [0, c1]
|
||||||
// c1 < -1 : [c0, inf)
|
// c1 < 0 : [c0, inf)
|
||||||
LLAMA_API void llama_kv_cache_tokens_rm(
|
LLAMA_API void llama_kv_cache_tokens_rm(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
int32_t c0,
|
int32_t c0,
|
||||||
int32_t c1);
|
int32_t c1);
|
||||||
|
|
||||||
// Removes all tokens that belong to the specified sequence and have positions in [p0, p1)
|
// Removes all tokens that belong to the specified sequence and have positions in [p0, p1)
|
||||||
// p0 < -1 : [0, p1]
|
// p0 < 0 : [0, p1]
|
||||||
// p1 < -1 : [p0, inf)
|
// p1 < 0 : [p0, inf)
|
||||||
LLAMA_API void llama_kv_cache_seq_rm(
|
LLAMA_API void llama_kv_cache_seq_rm(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
llama_seq_id seq_id,
|
llama_seq_id seq_id,
|
||||||
@ -348,8 +348,8 @@ extern "C" {
|
|||||||
|
|
||||||
// Copy all tokens that belong to the specified sequence to another sequence
|
// Copy all tokens that belong to the specified sequence to another sequence
|
||||||
// Note that this does not allocate extra KV cache memory - it simply assigns the tokens to the new sequence
|
// Note that this does not allocate extra KV cache memory - it simply assigns the tokens to the new sequence
|
||||||
// p0 < -1 : [0, p1]
|
// p0 < 0 : [0, p1]
|
||||||
// p1 < -1 : [p0, inf)
|
// p1 < 0 : [p0, inf)
|
||||||
LLAMA_API void llama_kv_cache_seq_cp(
|
LLAMA_API void llama_kv_cache_seq_cp(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
llama_seq_id seq_id_src,
|
llama_seq_id seq_id_src,
|
||||||
@ -364,8 +364,8 @@ extern "C" {
|
|||||||
|
|
||||||
// Adds relative position "delta" to all tokens that belong to the specified sequence and have positions in [p0, p1)
|
// Adds relative position "delta" to all tokens that belong to the specified sequence and have positions in [p0, p1)
|
||||||
// If the KV cache is RoPEd, the KV data is updated accordingly
|
// If the KV cache is RoPEd, the KV data is updated accordingly
|
||||||
// p0 < -1 : [0, p1]
|
// p0 < 0 : [0, p1]
|
||||||
// p1 < -1 : [p0, inf)
|
// p1 < 0 : [p0, inf)
|
||||||
LLAMA_API void llama_kv_cache_seq_shift(
|
LLAMA_API void llama_kv_cache_seq_shift(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
llama_seq_id seq_id,
|
llama_seq_id seq_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user