|
88 | 88 | #define CC_OFFSET_AMD 1000000
|
89 | 89 | #define CC_RDNA2 (CC_OFFSET_AMD + 1030)
|
90 | 90 |
|
| 91 | +#define GGML_CUDA_MAX_NODES 8192 |
| 92 | + |
91 | 93 | // define this if you want to always fallback to MMQ kernels and not use cuBLAS for matrix multiplication
|
92 | 94 | // on modern hardware, using cuBLAS is recommended as it utilizes F16 tensor cores which are very performant
|
93 | 95 | // for large computational tasks. the drawback is that this requires some extra amount of VRAM:
|
@@ -7727,7 +7729,7 @@ static void ggml_cuda_alibi(const ggml_tensor * src0, const ggml_tensor * src1,
|
7727 | 7729 | ggml_cuda_op_flatten(src0, src1, dst, ggml_cuda_op_alibi);
|
7728 | 7730 | }
|
7729 | 7731 |
|
7730 |
| -void ggml_cuda_im2col(const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst) { |
| 7732 | +static void ggml_cuda_im2col(const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst) { |
7731 | 7733 | ggml_cuda_op_flatten(src0, src1, dst, ggml_cuda_op_im2col);
|
7732 | 7734 | }
|
7733 | 7735 |
|
@@ -7842,11 +7844,11 @@ static size_t g_temp_tensor_extra_index = 0;
|
7842 | 7844 |
|
7843 | 7845 | static ggml_tensor_extra_gpu * ggml_cuda_alloc_temp_tensor_extra() {
|
7844 | 7846 | if (g_temp_tensor_extras == nullptr) {
|
7845 |
| - g_temp_tensor_extras = new ggml_tensor_extra_gpu[GGML_DEFAULT_GRAPH_SIZE]; |
| 7847 | + g_temp_tensor_extras = new ggml_tensor_extra_gpu[GGML_CUDA_MAX_NODES]; |
7846 | 7848 | }
|
7847 | 7849 |
|
7848 | 7850 | size_t alloc_index = g_temp_tensor_extra_index;
|
7849 |
| - g_temp_tensor_extra_index = (g_temp_tensor_extra_index + 1) % GGML_DEFAULT_GRAPH_SIZE; |
| 7851 | + g_temp_tensor_extra_index = (g_temp_tensor_extra_index + 1) % GGML_CUDA_MAX_NODES; |
7850 | 7852 | ggml_tensor_extra_gpu * extra = &g_temp_tensor_extras[alloc_index];
|
7851 | 7853 | memset(extra, 0, sizeof(*extra));
|
7852 | 7854 |
|
@@ -8173,11 +8175,11 @@ struct ggml_backend_buffer_context_cuda {
|
8173 | 8175 |
|
8174 | 8176 | ggml_tensor_extra_gpu * ggml_cuda_alloc_temp_tensor_extra() {
|
8175 | 8177 | if (temp_tensor_extras == nullptr) {
|
8176 |
| - temp_tensor_extras = new ggml_tensor_extra_gpu[GGML_DEFAULT_GRAPH_SIZE]; |
| 8178 | + temp_tensor_extras = new ggml_tensor_extra_gpu[GGML_CUDA_MAX_NODES]; |
8177 | 8179 | }
|
8178 | 8180 |
|
8179 | 8181 | size_t alloc_index = temp_tensor_extra_index;
|
8180 |
| - temp_tensor_extra_index = (temp_tensor_extra_index + 1) % GGML_DEFAULT_GRAPH_SIZE; |
| 8182 | + temp_tensor_extra_index = (temp_tensor_extra_index + 1) % GGML_CUDA_MAX_NODES; |
8181 | 8183 | ggml_tensor_extra_gpu * extra = &temp_tensor_extras[alloc_index];
|
8182 | 8184 | memset(extra, 0, sizeof(*extra));
|
8183 | 8185 |
|
|
0 commit comments