From e57047827581af6cf09f1bca6e40c53937ebda62 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 28 Nov 2025 13:05:11 +0800 Subject: [PATCH] limit cuda arches + scale tweaks --- CMakeLists.txt | 2 ++ Makefile | 6 ++++-- ggml/src/ggml-cuda/fattn.cu | 4 ++++ koboldcpp.py | 6 ++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ae9e1640..1a9847f79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,9 +134,11 @@ if (LLAMA_CUBLAS) message("CUDA Toolkit Version: ${CUDAToolkit_VERSION}") if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 13) add_compile_definitions(GGML_CUDA_USE_GRAPHS) #try enable cuda graphs on cu12 build + add_compile_definitions(KCPP_LIMIT_CUDA_MAX_ARCH=860) set(CMAKE_CUDA_ARCHITECTURES "75-virtual;80-virtual;86-virtual") # lowest CUDA 13 standard elseif(CUDAToolkit_VERSION VERSION_GREATER 12) add_compile_definitions(GGML_CUDA_USE_GRAPHS) #try enable cuda graphs on cu12 build + add_compile_definitions(KCPP_LIMIT_CUDA_MAX_ARCH=800) set(CMAKE_CUDA_ARCHITECTURES "50-virtual;61-virtual;70-virtual;75-virtual;80-virtual") # lowest CUDA 12 standard + lowest for integer intrinsics else() add_compile_definitions(KCPP_LIMIT_CUDA_MAX_ARCH=750) #will cause issues with ggml_cuda_highest_compiled_arch if removed diff --git a/Makefile b/Makefile index 5fad3d148..f083bea29 100644 --- a/Makefile +++ b/Makefile @@ -236,13 +236,15 @@ NVCCFLAGS += -Wno-deprecated-gpu-targets \ -gencode arch=compute_61,code=compute_61 \ -gencode arch=compute_70,code=compute_70 \ -gencode arch=compute_75,code=compute_75 \ - -gencode arch=compute_80,code=compute_80 + -gencode arch=compute_80,code=compute_80 \ + -DKCPP_LIMIT_CUDA_MAX_ARCH=800 else ifdef LLAMA_ARCHES_CU13 NVCCFLAGS += -Wno-deprecated-gpu-targets \ -gencode arch=compute_75,code=compute_75 \ -gencode arch=compute_80,code=compute_80 \ - -gencode arch=compute_86,code=compute_86 + -gencode arch=compute_86,code=compute_86 \ + -DKCPP_LIMIT_CUDA_MAX_ARCH=860 else NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=all diff --git a/ggml/src/ggml-cuda/fattn.cu b/ggml/src/ggml-cuda/fattn.cu index 7e61ffa17..e0e4c91df 100644 --- a/ggml/src/ggml-cuda/fattn.cu +++ b/ggml/src/ggml-cuda/fattn.cu @@ -310,6 +310,10 @@ static best_fattn_kernel ggml_cuda_get_best_fattn_kernel(const int device, const { return BEST_FATTN_KERNEL_WMMA_F16; } + else + { + return BEST_FATTN_KERNEL_NONE; + } } return BEST_FATTN_KERNEL_MMA_F16; diff --git a/koboldcpp.py b/koboldcpp.py index 4b7c830cd..98c526195 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -5001,13 +5001,15 @@ def show_gui(): lastpos = ("+"+str(lparr[1])) if (len(lparr)==2) else "" previous_event_width = new_width previous_event_height = new_height - windowwidth = math.floor(original_windowwidth*max(smallratio,min(incr_w,smallratio*1.2))) #allow slight extension past legal width + windowwidth = math.floor(original_windowwidth*smallratio) windowwidth = max(256, min(1024, windowwidth)) windowheight = math.floor(original_windowheight*smallratio) windowheight = max(256, min(1024, windowheight)) root.geometry(str(windowwidth) + "x" + str(windowheight) + str(lastpos)) + if corrupt_scaler: + smallratio = min(smallratio, 1)*0.98 #don't allow scaling beyond normal ctk.set_widget_scaling(smallratio) - root.after(20, clearesizing) + root.after(5, clearesizing) changerunmode(1,1,1) togglerope(1,1,1) toggleflashattn(1,1,1)