Skip to content

Commit 33bf8e6

Browse files
author
prima
committed
Merge remote-tracking branch 'origin/concedo_experimental' into remoteManagement
2 parents d2f8bc4 + 26bf5b4 commit 33bf8e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3961
-1323
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Koboldcpp Linux ROCm
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
commit_hash:
7+
description: 'Optional commit hash to build from'
8+
required: false
9+
default: ''
10+
11+
env:
12+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
13+
KCPP_CUDA: rocm
14+
ARCHES_CU12: 1
15+
16+
jobs:
17+
linux:
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Free Disk Space (Ubuntu)
21+
uses: jlumbroso/free-disk-space@main
22+
with:
23+
# this might remove tools that are actually needed,
24+
# if set to "true" but frees about 6 GB
25+
tool-cache: true
26+
27+
# all of these default to true, but feel free to set to
28+
# "false" if necessary for your workflow
29+
android: true
30+
dotnet: true
31+
haskell: true
32+
large-packages: true
33+
docker-images: true
34+
swap-storage: true
35+
36+
- name: Clone
37+
id: checkout
38+
uses: actions/checkout@v3
39+
with:
40+
ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}
41+
42+
- name: Show Commit Used
43+
run: |
44+
echo "Building from ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}"
45+
46+
- name: Dependencies
47+
id: depends
48+
run: |
49+
sudo apt update
50+
export DEBIAN_FRONTEND=noninteractive
51+
sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
52+
echo "tzdata tzdata/Areas select Etc" | sudo debconf-set-selections
53+
echo "tzdata tzdata/Zones/Etc select UTC" | sudo debconf-set-selections
54+
sudo apt-get -y install git curl bzip2 python3-tk tcl tk
55+
curl -fLO https://repo.radeon.com/rocm/installer/rocm-runfile-installer/rocm-rel-6.4.1/ubuntu/22.04/rocm-installer_1.1.1.60401-30-83~22.04.run && sudo bash rocm-installer_1.1.1.60401-30-83~22.04.run deps=install rocm postrocm target="/opt"
56+
sudo rm -rf rocm-install*
57+
58+
- name: Set Tcl/Tk Paths
59+
run: |
60+
echo "TCL_LIBRARY=$(find /usr/lib/ -name 'tcl8*' | head -n 1)" >> $GITHUB_ENV
61+
echo "TK_LIBRARY=$(find /usr/lib/ -name 'tk8*' | head -n 1)" >> $GITHUB_ENV
62+
63+
- name: Build
64+
id: make_build
65+
run: |
66+
./koboldcpp.sh dist
67+
68+
- name: Save artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: kcpp_linux_binary
72+
path: dist/

.github/workflows/kcpp-build-release-linux.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
1313
NOAVX2: 1
1414
ARCHES_CU11: 1
15+
KCPP_CUDA: 11.5.0
1516

1617
jobs:
1718
linux:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*.o
22
*.a
33
*.bin
4+
*.tmp.yaml
5+
46
.DS_Store
57
.build/
68
.cache/

CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ endif()
152152

153153
if (LLAMA_HIPBLAS)
154154
if (MSVC)
155-
list(APPEND CMAKE_PREFIX_PATH "C:/Program Files/AMD/ROCm/5.5")
155+
execute_process(COMMAND powershell.exe -Command "Get-ChildItem 'C:/Program Files/AMD/ROCm/' | Sort-Object {$_.Version} | Select-Object -Last 1 | ForEach-Object { Write-Output $_.FullName }"
156+
OUTPUT_VARIABLE ROCM_PATH
157+
OUTPUT_STRIP_TRAILING_WHITESPACE
158+
)
159+
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
160+
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-xhip>")
161+
message(STATUS "ROCM_PATH: ${ROCM_PATH}")
156162
else()
157163
list(APPEND CMAKE_PREFIX_PATH /opt/rocm)
158164
endif()
@@ -177,7 +183,7 @@ if (LLAMA_HIPBLAS)
177183
list(APPEND GGML_SOURCES_ROCM ${SRCS})
178184
file(GLOB SRCS "ggml/src/ggml-cuda/template-instances/mmq*.cu")
179185
list(APPEND GGML_SOURCES_ROCM ${SRCS})
180-
add_compile_definitions(GGML_USE_HIP GGML_USE_CUDA SD_USE_CUDA)
186+
add_compile_definitions(GGML_USE_HIP GGML_USE_CUDA SD_USE_CUDA GGML_HIP_NO_VMM)
181187
add_library(ggml-rocm ${GGML_SOURCES_CUDA})
182188

183189
file(GLOB SRCS "ggml/src/ggml-cuda/template-instances/fattn-vec*q4_0-q4_0.cu")
@@ -206,7 +212,7 @@ if (LLAMA_HIPBLAS)
206212
if (LLAMA_STATIC)
207213
message(FATAL_ERROR "Static linking not supported for HIP/ROCm")
208214
endif()
209-
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ggml-rocm ggml-v2-rocm ggml-v2-legacy-rocm)
215+
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ggml-rocm ggml-v2-rocm ggml-v3-rocm ggml-v2-legacy-rocm)
210216
else()
211217
message(WARNING "hipBLAS or HIP not found. Try setting CMAKE_PREFIX_PATH=/opt/rocm")
212218
endif()

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,16 @@ endif # LLAMA_CUBLAS
242242
ifdef LLAMA_HIPBLAS
243243
ifeq ($(wildcard /opt/rocm),)
244244
ROCM_PATH ?= /usr
245+
ifdef LLAMA_PORTABLE
246+
GPU_TARGETS ?= gfx803 gfx900 gfx906 gfx908 gfx90a gfx942 gfx1010 gfx1030 gfx1031 gfx1032 gfx1100 gfx1101 gfx1102 $(shell $(shell which amdgpu-arch))
247+
else
245248
GPU_TARGETS ?= $(shell $(shell which amdgpu-arch))
249+
endif
246250
HCC := $(ROCM_PATH)/bin/hipcc
247251
HCXX := $(ROCM_PATH)/bin/hipcc
248252
else
249253
ROCM_PATH ?= /opt/rocm
250-
GPU_TARGETS ?= gfx803 gfx900 gfx906 gfx908 gfx90a gfx1030 gfx1100 $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch)
254+
GPU_TARGETS ?= gfx803 gfx900 gfx906 gfx908 gfx90a gfx942 gfx1010 gfx1030 gfx1031 gfx1032 gfx1100 gfx1101 gfx1102 $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch)
251255
HCC := $(ROCM_PATH)/llvm/bin/clang
252256
HCXX := $(ROCM_PATH)/llvm/bin/clang++
253257
endif
@@ -855,4 +859,4 @@ build-info.h:
855859
#phony for printing messages
856860
finishedmsg:
857861
$(NOTIFY_MSG)
858-
$(DONOTHING)
862+
$(DONOTHING)

0 commit comments

Comments
 (0)