We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19fbfd8 commit 1ce1c1aCopy full SHA for 1ce1c1a
1 file changed
lora.hpp
@@ -3,7 +3,7 @@
3
4
#include "ggml_extend.hpp"
5
6
-#define LORA_GRAPH_SIZE 15360
+#define LORA_GRAPH_BASE_SIZE 10240
7
8
struct LoraModel : public GGMLRunner {
9
enum lora_t {
@@ -238,7 +238,8 @@ struct LoraModel : public GGMLRunner {
238
}
239
240
struct ggml_cgraph* build_lora_graph(std::map<std::string, struct ggml_tensor*> model_tensors, SDVersion version) {
241
- struct ggml_cgraph* gf = ggml_new_graph_custom(compute_ctx, LORA_GRAPH_SIZE, false);
+ size_t lora_graph_size = LORA_GRAPH_BASE_SIZE + lora_tensors.size() * 10;
242
+ struct ggml_cgraph* gf = ggml_new_graph_custom(compute_ctx, lora_graph_size, false);
243
244
zero_index = ggml_new_tensor_1d(compute_ctx, GGML_TYPE_I32, 1);
245
set_backend_tensor_data(zero_index, zero_index_vec.data());
0 commit comments