Skip to content

Commit 01f45e1

Browse files
committed
manual merge with llama.cpp master
2 parents 49f0bfd + 916a9ac commit 01f45e1

File tree

6 files changed

+867
-497
lines changed

6 files changed

+867
-497
lines changed

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,6 @@ ifdef LLAMA_CUDA_KQUANTS_ITER
253253
else
254254
NVCCFLAGS += -DK_QUANTS_PER_ITERATION=2
255255
endif
256-
ifdef LLAMA_CUDA_MMQ_Y
257-
NVCCFLAGS += -DGGML_CUDA_MMQ_Y=$(LLAMA_CUDA_MMQ_Y)
258-
else
259-
NVCCFLAGS += -DGGML_CUDA_MMQ_Y=64
260-
endif # LLAMA_CUDA_MMQ_Y
261256
#ifdef LLAMA_CUDA_CUBLAS
262257
# NVCCFLAGS += -DGGML_CUDA_CUBLAS
263258
#endif # LLAMA_CUDA_CUBLAS

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ Building the program with BLAS support may lead to some performance improvements
406406
--->
407407
| Option | Legal values | Default | Description |
408408
|-------------------------|------------------------|---------|-------------|
409-
| LLAMA_CUDA_MMQ_Y | Positive integer >= 32 | 64 | Tile size in y direction when using the custom CUDA kernels for prompt processing. Higher values can be faster depending on the amount of shared memory available. Power of 2 heavily recommended. |
410409
| LLAMA_CUDA_FORCE_DMMV | Boolean | false | Force the use of dequantization + matrix vector multiplication kernels instead of using kernels that do matrix vector multiplication on quantized data. By default the decision is made based on compute capability (MMVQ for 6.1/Pascal/GTX 1000 or higher). Does not affect k-quants. |
411410
| LLAMA_CUDA_DMMV_X | Positive integer >= 32 | 32 | Number of values in x direction processed by the CUDA dequantization + matrix vector multiplication kernel per iteration. Increasing this value can improve performance on fast GPUs. Power of 2 heavily recommended. Does not affect k-quants. |
412411
| LLAMA_CUDA_MMV_Y | Positive integer | 1 | Block size in y direction for the CUDA mul mat vec kernels. Increasing this value can improve performance on fast GPUs. Power of 2 recommended. Does not affect k-quants. |

ggml-alloc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@ static void allocate_node(struct ggml_allocr * alloc, struct ggml_tensor * node)
394394
if (parent == NULL) {
395395
break;
396396
}
397+
398+
// if the node's data is external, then we cannot re-use it
399+
if ((char *) parent->data < (char *) alloc->data ||
400+
(char *) parent->data >= ((char *) alloc->data + alloc->size)) {
401+
AT_PRINTF("not reusing parent %s for %s as %p is external\n", parent->name, node->name, parent->data);
402+
continue;
403+
}
404+
397405
struct hash_node * p_hn = hash_get(ht, parent);
398406
if (parent->data != NULL && p_hn->n_children == 1 && p_hn->n_views == 0 && ggml_are_same_layout(node, parent)) {
399407
if (ggml_is_view(parent)) {

0 commit comments

Comments
 (0)