|
23 | 23 | #include <string> |
24 | 24 | #include <vector> |
25 | 25 |
|
26 | | - |
27 | 26 | //////////////////////////////////////////////////////////////////////////////// |
28 | 27 | // |
29 | 28 | // ROLLUP acc.cu |
@@ -3608,6 +3607,8 @@ void ggml_cuda_op_dequantize_mul_mat_vec( |
3608 | 3607 | GGML_UNUSED(src1_padded_row_size); |
3609 | 3608 | } |
3610 | 3609 |
|
| 3610 | +#ifndef GGML_MINIMIZE_CODE_SIZE |
| 3611 | + |
3611 | 3612 | //////////////////////////////////////////////////////////////////////////////// |
3612 | 3613 | // |
3613 | 3614 | // ROLLUP fattn.cu |
@@ -5098,7 +5099,6 @@ void ggml_cuda_flash_attn_ext_tile_f32(ggml_backend_cuda_context & ctx, ggml_ten |
5098 | 5099 | // |
5099 | 5100 | //////////////////////////////////////////////////////////////////////////////// |
5100 | 5101 |
|
5101 | | - |
5102 | 5102 | template<int D, int ncols, int parallel_blocks> // D == head size |
5103 | 5103 | #if !(defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)) |
5104 | 5104 | __launch_bounds__(D, 1) |
@@ -5432,7 +5432,6 @@ void ggml_cuda_flash_attn_ext_vec_f16_no_mma(ggml_backend_cuda_context & ctx, gg |
5432 | 5432 | // |
5433 | 5433 | //////////////////////////////////////////////////////////////////////////////// |
5434 | 5434 |
|
5435 | | - |
5436 | 5435 | template<int D, int ncols, int parallel_blocks> // D == head size |
5437 | 5436 | #if !(defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)) |
5438 | 5437 | __launch_bounds__(D, 1) |
@@ -5709,6 +5708,8 @@ void ggml_cuda_flash_attn_ext_vec_f32(ggml_backend_cuda_context & ctx, ggml_tens |
5709 | 5708 | launch_fattn_vec_f32_64_128<cols_per_block, parallel_blocks>(ctx, dst); |
5710 | 5709 | } |
5711 | 5710 |
|
| 5711 | +#endif // GGML_MINIMIZE_CODE_SIZE |
| 5712 | + |
5712 | 5713 | //////////////////////////////////////////////////////////////////////////////// |
5713 | 5714 | // |
5714 | 5715 | // ROLLUP getrows.cu |
@@ -13096,7 +13097,9 @@ static bool ggml_cuda_compute_forward(ggml_backend_cuda_context & ctx, struct gg |
13096 | 13097 | ggml_cuda_op_argsort(ctx, dst); |
13097 | 13098 | break; |
13098 | 13099 | case GGML_OP_FLASH_ATTN_EXT: |
| 13100 | +#ifndef GGML_MINIMIZE_CODE_SIZE |
13099 | 13101 | ggml_cuda_flash_attn_ext(ctx, dst); |
| 13102 | +#endif |
13100 | 13103 | break; |
13101 | 13104 | default: |
13102 | 13105 | return false; |
@@ -13649,7 +13652,9 @@ GGML_CALL static bool ggml_backend_cuda_supports_op(ggml_backend_t backend, cons |
13649 | 13652 | case GGML_OP_LEAKY_RELU: |
13650 | 13653 | return true; |
13651 | 13654 | case GGML_OP_FLASH_ATTN_EXT: |
13652 | | -#if defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__) |
| 13655 | +#if defined(GGML_MINIMIZE_CODE_SIZE) |
| 13656 | + return false; |
| 13657 | +#elif defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__) |
13653 | 13658 | return op->src[0]->ne[0] == 64 || op->src[0]->ne[0] == 128; |
13654 | 13659 | #else |
13655 | 13660 | if (op->src[0]->ne[0] == 64 || op->src[0]->ne[0] == 128) { |
|
0 commit comments