Skip to content

Commit 6eaea63

Browse files
committed
minor
1 parent de014bc commit 6eaea63

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

include/llama.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ extern "C" {
543543
// to an n_embd x n_layers buffer starting from layer 1.
544544
// il_start and il_end are the layer range the vector should apply to (both inclusive)
545545
// See llama_control_vector_load in common to load a control vector.
546-
// TODO: rename to llama_adapter_vec_apply
546+
// TODO: rename to llama_adapter_cvec_apply
547547
LLAMA_API int32_t llama_control_vector_apply(
548548
struct llama_context * lctx,
549549
const float * data,

src/llama-adapter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#include <vector>
1010

1111
//
12-
// llama_adapter_vec
12+
// llama_adapter_cvec
1313
//
1414

15-
// TODO: rename to llama_adapter_vec
15+
// TODO: rename to llama_adapter_cvec
1616
struct llama_control_vector {
1717
std::vector<ggml_context_ptr> ctxs;
1818
std::vector<ggml_backend_buffer_ptr> bufs;

src/llama-model.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static bool buft_supported(ggml_backend_buffer_type_t buft, ggml_backend_dev_t d
134134
/*.mem_buffer =*/ NULL,
135135
/*.no_alloc =*/ true,
136136
};
137+
137138
ggml_context_ptr ctx { ggml_init(params) };
138139
if (!ctx) {
139140
throw std::runtime_error(format("failed to create ggml context"));
@@ -147,6 +148,7 @@ static bool buft_supported(ggml_backend_buffer_type_t buft, ggml_backend_dev_t d
147148
op_tensor->src[i]->buffer = buf.get();
148149
}
149150
}
151+
150152
bool op_supported = ggml_backend_dev_supports_op(dev, op_tensor);
151153

152154
return op_supported;
@@ -161,6 +163,7 @@ static ggml_backend_buffer_type_t select_buft(const llama_model::buft_list_t & b
161163
return cur_buft;
162164
}
163165
}
166+
164167
throw std::runtime_error(format("no suitable buffer type found"));
165168
}
166169

src/llama-model.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ struct llama_model {
334334
ggml_backend_dev_t dev;
335335
buft_list_t * buft_list;
336336
};
337+
337338
layer_dev dev_input = {};
338339
layer_dev dev_output = {};
339340
std::vector<layer_dev> dev_layer;
@@ -348,7 +349,6 @@ struct llama_model {
348349
llama_mmaps mappings;
349350

350351
// objects representing data potentially being locked in memory
351-
// TODO: should these be part of llama_context instead?
352352
llama_mlocks mlock_bufs;
353353
llama_mlocks mlock_mmaps;
354354

@@ -371,7 +371,7 @@ std::string llama_model_arch_name (const llama_model & model);
371371
std::string llama_model_type_name (const llama_model & model);
372372
std::string llama_model_ftype_name(const llama_model & model);
373373

374-
// used by llama_adapter_vec
374+
// used by llama_adapter_cvec
375375
ggml_backend_buffer_type_t llama_model_select_buft(const llama_model & model, int il);
376376

377377
// used by llama_adapter_lora

0 commit comments

Comments
 (0)