cherrypicked the Hipblas fixed from PR #571
This commit is contained in:
parent
77463e0e9c
commit
852ca780c9
1 changed files with 11 additions and 5 deletions
16
koboldcpp.py
16
koboldcpp.py
|
@ -408,6 +408,7 @@ totalgens = 0
|
||||||
currentusergenkey = "" #store a special key so polled streaming works even in multiuser
|
currentusergenkey = "" #store a special key so polled streaming works even in multiuser
|
||||||
args = None #global args
|
args = None #global args
|
||||||
gui_layers_untouched = True
|
gui_layers_untouched = True
|
||||||
|
runmode_untouched = True
|
||||||
preloaded_story = None
|
preloaded_story = None
|
||||||
sslvalid = False
|
sslvalid = False
|
||||||
|
|
||||||
|
@ -1288,12 +1289,13 @@ def show_new_gui():
|
||||||
MaxMemory[0] = max(int(FetchedCUdeviceMem[idx])*1024*1024,MaxMemory[0])
|
MaxMemory[0] = max(int(FetchedCUdeviceMem[idx])*1024*1024,MaxMemory[0])
|
||||||
|
|
||||||
#autopick cublas if suitable, requires at least 3.5GB VRAM to auto pick
|
#autopick cublas if suitable, requires at least 3.5GB VRAM to auto pick
|
||||||
global exitcounter
|
global exitcounter, runmode_untouched
|
||||||
if exitcounter < 100 and MaxMemory[0]>3500000000 and CUDevicesNames[0]!="" and ("Use CuBLAS" in runopts or "Use hipBLAS (ROCM)" in runopts) and runopts_var.get()=="Use OpenBLAS":
|
#we do not want to autoselect hip/cublas if the user has already changed their desired backend!
|
||||||
|
if exitcounter < 100 and MaxMemory[0]>3500000000 and (("Use CuBLAS" in runopts and CUDevicesNames[0]!="") or "Use hipBLAS (ROCm)" in runopts) and (any(CUDevicesNames) or any(CLDevicesNames)) and runmode_untouched:
|
||||||
if "Use CuBLAS" in runopts:
|
if "Use CuBLAS" in runopts:
|
||||||
runopts_var.set("Use CuBLAS")
|
runopts_var.set("Use CuBLAS")
|
||||||
elif "Use hipBLAS (ROCM)" in runopts:
|
elif "Use hipBLAS (ROCm)" in runopts:
|
||||||
runopts_var.set("Use hipBLAS (ROCM)")
|
runopts_var.set("Use hipBLAS (ROCm)")
|
||||||
|
|
||||||
changed_gpu_choice_var()
|
changed_gpu_choice_var()
|
||||||
return
|
return
|
||||||
|
@ -1394,6 +1396,8 @@ def show_new_gui():
|
||||||
gpulayers_var.trace("w", changed_gpulayers)
|
gpulayers_var.trace("w", changed_gpulayers)
|
||||||
|
|
||||||
def changerunmode(a,b,c):
|
def changerunmode(a,b,c):
|
||||||
|
global runmode_untouched
|
||||||
|
runmode_untouched = False
|
||||||
index = runopts_var.get()
|
index = runopts_var.get()
|
||||||
if index == "Use CLBlast" or index == "CLBlast NoAVX2 (Old CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)":
|
if index == "Use CLBlast" or index == "CLBlast NoAVX2 (Old CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)":
|
||||||
quick_gpuname_label.grid(row=3, column=1, padx=75, sticky="W")
|
quick_gpuname_label.grid(row=3, column=1, padx=75, sticky="W")
|
||||||
|
@ -1525,6 +1529,8 @@ def show_new_gui():
|
||||||
|
|
||||||
runopts_var.trace('w', changerunmode)
|
runopts_var.trace('w', changerunmode)
|
||||||
changerunmode(1,1,1)
|
changerunmode(1,1,1)
|
||||||
|
global runmode_untouched
|
||||||
|
runmode_untouched = True
|
||||||
|
|
||||||
# Tokens Tab
|
# Tokens Tab
|
||||||
tokens_tab = tabcontent["Tokens"]
|
tokens_tab = tabcontent["Tokens"]
|
||||||
|
@ -1704,7 +1710,7 @@ def show_new_gui():
|
||||||
if cublas_option:
|
if cublas_option:
|
||||||
runopts_var.set(cublas_option)
|
runopts_var.set(cublas_option)
|
||||||
elif hipblas_option:
|
elif hipblas_option:
|
||||||
runopts_var.set(cublas_option)
|
runopts_var.set(hipblas_option)
|
||||||
lowvram_var.set(1 if "lowvram" in dict["usecublas"] else 0)
|
lowvram_var.set(1 if "lowvram" in dict["usecublas"] else 0)
|
||||||
mmq_var.set(1 if "mmq" in dict["usecublas"] else 0)
|
mmq_var.set(1 if "mmq" in dict["usecublas"] else 0)
|
||||||
gpu_choice_var.set("All")
|
gpu_choice_var.set("All")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue