/src/llama.cpp/src/llama-cparams.h
Line | Count | Source |
1 | | #pragma once |
2 | | |
3 | | #include "llama.h" |
4 | | |
5 | | #include <cstdint> |
6 | | #include <vector> |
7 | | |
8 | 0 | #define LLAMA_MAX_SEQ 256 |
9 | | |
10 | | struct llama_cparams { |
11 | | uint32_t n_ctx; // context size used during inference |
12 | | uint32_t n_ctx_seq; // context for a single sequence |
13 | | uint32_t n_batch; |
14 | | uint32_t n_ubatch; |
15 | | uint32_t n_seq_max; |
16 | | uint32_t n_rs_seq; // number of recurrent-state snapshots per seq for rollback |
17 | | uint32_t n_outputs_max; // max outputs supported by the context |
18 | | int32_t n_threads; // number of threads to use for generation |
19 | | int32_t n_threads_batch; // number of threads to use for batch processing |
20 | | |
21 | | int32_t nextn_layer_offset = 0; |
22 | | |
23 | | float rope_freq_base; |
24 | | float rope_freq_scale; |
25 | | |
26 | | uint32_t n_ctx_orig_yarn; |
27 | | // These hyperparameters are not exposed in GGUF, because all |
28 | | // existing YaRN models use the same values for them. |
29 | | float yarn_ext_factor; |
30 | | float yarn_attn_factor; |
31 | | float yarn_beta_fast; |
32 | | float yarn_beta_slow; |
33 | | |
34 | | bool embeddings; |
35 | | bool embeddings_nextn; // also extract the hidden state before the final output norm |
36 | | bool embeddings_nextn_masked; // extract for only rows where batch.logits != 0 |
37 | | bool causal_attn; |
38 | | bool offload_kqv; |
39 | | bool flash_attn; |
40 | | bool auto_fa; |
41 | | bool fused_gdn_ar; // use fused gated delta net (autoregressive) |
42 | | bool fused_gdn_ch; // use fused gated delta net (chunked) |
43 | | bool auto_fgdn; |
44 | | bool fused_lid; // use fused lightning indexer |
45 | | bool auto_flid; |
46 | | bool no_perf; |
47 | | bool warmup; // TODO: remove [TAG_LLAMA_GRAPH_NO_WARMUP] |
48 | | bool op_offload; |
49 | | bool kv_unified; |
50 | | bool pipeline_parallel; |
51 | | |
52 | | std::vector<bool> embeddings_layer_inp; // [n_layer()] extract input embeddings for layer |
53 | | |
54 | | enum llama_context_type ctx_type; |
55 | | enum llama_pooling_type pooling_type; |
56 | | |
57 | | ggml_backend_sched_eval_callback cb_eval; |
58 | | void * cb_eval_user_data; |
59 | | |
60 | | llama_context * ctx_other; |
61 | | }; |