From f13295b5454b38aa39b70d7b11c15bf2fb1fb842 Mon Sep 17 00:00:00 2001 From: YellowRoseCx <80486540+YellowRoseCx@users.noreply.github.com> Date: Sun, 10 Dec 2023 22:43:02 -0600 Subject: [PATCH] CLBLAST_noavx2 should only be built on Windows --- Makefile | 6 ++---- koboldcpp.py | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 1899b0c64366a..d85459767acca 100644 --- a/Makefile +++ b/Makefile @@ -300,8 +300,6 @@ ifeq ($(OS),Windows_NT) endif else DEFAULT_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o $@.so $(LDFLAGS) - FAILSAFE_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o $@.so $(LDFLAGS) - NOAVX2_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o $@.so $(LDFLAGS) ifdef LLAMA_OPENBLAS OPENBLAS_BUILD = $(CXX) $(CXXFLAGS) $^ $(ARCH_ADD) -lopenblas -shared -o $@.so $(LDFLAGS) @@ -482,8 +480,8 @@ endif ifdef CLBLAST_BUILD koboldcpp_clblast: ggml_clblast.o ggml_v2_clblast.o ggml_v1.o expose.o common.o gpttype_adapter_clblast.o ggml-opencl.o ggml_v2-opencl.o ggml_v2-opencl-legacy.o ggml-quants.o ggml-alloc.o ggml-backend.o grammar-parser.o $(OBJS) $(CLBLAST_BUILD) -koboldcpp_clblast_noavx2: ggml_clblast_noavx2.o ggml_v2_clblast_noavx2.o ggml_v1_failsafe.o expose.o common.o gpttype_adapter_clblast_noavx2.o ggml-opencl.o ggml_v2-opencl.o ggml_v2-opencl-legacy.o ggml-quants_noavx2.o ggml-alloc.o ggml-backend.o grammar-parser.o $(OBJS) - $(CLBLAST_BUILD) +koboldcpp_clblast_noavx2: + $(DONOTHING) else koboldcpp_clblast: $(DONOTHING) diff --git a/koboldcpp.py b/koboldcpp.py index 7757e386152f7..9c050cc879212 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -990,14 +990,18 @@ def show_new_gui(): blasbatchsize_text = ["Don't Batch BLAS","32","64","128","256","512","1024","2048"] contextsize_text = ["256", "512", "1024", "2048", "3072", "4096", "6144", "8192", "12288", "16384", "24576", "32768", "65536"] runopts = [opt for lib, opt in lib_option_pairs if file_exists(lib)] - antirunopts = [opt.replace("Use ", "") for lib, opt in lib_option_pairs if not (opt in runopts) and not (opt == "Use CuBLAS" and "Use hipBLAS (ROCm)" in runopts)] - # if os.name != 'nt': - # if "NoAVX2 Mode (Old CPU)" in antirunopts: - # antirunopts.remove("NoAVX2 Mode (Old CPU)") - # if "Failsafe Mode (Old CPU)" in antirunopts: - # antirunopts.remove("Failsafe Mode (Old CPU)") - # if "CLBlast NoAVX2 (Old CPU)" in antirunopts: - # antirunopts.remove("CLBlast NoAVX2 (Old CPU)") + antirunopts = [opt.replace("Use ", "") for lib, opt in lib_option_pairs if not (opt in runopts)] + if "Use CuBLAS" in runopts: + antirunopts.remove("hipBLAS (ROCm)") + if "Use hipBLAS (ROCm)" in runopts: + antirunopts.remove("CuBLAS") + if os.name != 'nt': + if "NoAVX2 Mode (Old CPU)" in antirunopts: + antirunopts.remove("NoAVX2 Mode (Old CPU)") + if "Failsafe Mode (Old CPU)" in antirunopts: + antirunopts.remove("Failsafe Mode (Old CPU)") + if "CLBlast NoAVX2 (Old CPU)" in antirunopts: + antirunopts.remove("CLBlast NoAVX2 (Old CPU)") if not any(runopts): exitcounter = 999 show_gui_msgbox("No Backends Available!","KoboldCPP couldn't locate any backends to use (i.e Default, OpenBLAS, CLBlast, CuBLAS).\n\nTo use the program, please run the 'make' command from the directory.") @@ -1366,12 +1370,12 @@ def hide_tooltip(event): tooltip.withdraw() def setup_backend_tooltip(parent): - num_backends_built = makelabel(parent, str(len(runopts)) + f"/{7 if os.name == 'nt' else 7}", 5, 2) + num_backends_built = makelabel(parent, str(len(runopts)) + f"/{7 if os.name == 'nt' else 4}", 5, 2) num_backends_built.grid(row=1, column=1, padx=195, pady=0) num_backends_built.configure(text_color="#00ff00") # Bind the backend count label with the tooltip function nl = '\n' - num_backends_built.bind("", lambda event: show_tooltip(event, f"Number of backends you have built and available." + (f"\n\nMissing Backends: \n\n{nl.join(antirunopts)}" if len(runopts) != 7 else ""))) + num_backends_built.bind("", lambda event: show_tooltip(event, f"Number of backends you have built and available." + (f"\n\nMissing Backends: \n\n{nl.join(antirunopts)}" if len(runopts) != 4 else ""))) num_backends_built.bind("", hide_tooltip) # # Vars - should be in scope to be used by multiple widgets