File tree Expand file tree Collapse file tree 6 files changed +58
-1
lines changed Expand file tree Collapse file tree 6 files changed +58
-1
lines changed Original file line number Diff line number Diff line change 75
75
ffmpeg : ' true'
76
76
image-type : ' core'
77
77
runs-on : ' ubuntu-latest'
78
+ - build-type : ' sycl_f16'
79
+ platforms : ' linux/amd64'
80
+ tag-latest : ' false'
81
+ tag-suffix : ' sycl-f16-ffmpeg-core'
82
+ ffmpeg : ' true'
83
+ image-type : ' core'
84
+ runs-on : ' ubuntu-latest'
78
85
- build-type : ' cublas'
79
86
cuda-major-version : " 12"
80
87
cuda-minor-version : " 1"
Original file line number Diff line number Diff line change @@ -122,6 +122,34 @@ jobs:
122
122
ffmpeg : ' true'
123
123
image-type : ' core'
124
124
runs-on : ' ubuntu-latest'
125
+ - build-type : ' sycl_f16'
126
+ platforms : ' linux/amd64'
127
+ tag-latest : ' false'
128
+ tag-suffix : ' sycl-f16-core'
129
+ ffmpeg : ' false'
130
+ image-type : ' core'
131
+ runs-on : ' ubuntu-latest'
132
+ - build-type : ' sycl_f32'
133
+ platforms : ' linux/amd64'
134
+ tag-latest : ' false'
135
+ tag-suffix : ' sycl-f32-core'
136
+ ffmpeg : ' false'
137
+ image-type : ' core'
138
+ runs-on : ' ubuntu-latest'
139
+ - build-type : ' sycl_f16'
140
+ platforms : ' linux/amd64'
141
+ tag-latest : ' false'
142
+ tag-suffix : ' sycl-f16-ffmpeg-core'
143
+ ffmpeg : ' true'
144
+ image-type : ' core'
145
+ runs-on : ' ubuntu-latest'
146
+ - build-type : ' sycl_f32'
147
+ platforms : ' linux/amd64'
148
+ tag-latest : ' false'
149
+ tag-suffix : ' sycl-f32-ffmpeg-core'
150
+ ffmpeg : ' true'
151
+ image-type : ' core'
152
+ runs-on : ' ubuntu-latest'
125
153
- build-type : ' cublas'
126
154
cuda-major-version : " 11"
127
155
cuda-minor-version : " 7"
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ ARG GO_VERSION=1.21-bullseye
2
2
ARG IMAGE_TYPE=extras
3
3
# extras or core
4
4
5
-
6
5
FROM golang:$GO_VERSION as requirements-core
7
6
8
7
ARG BUILD_TYPE
@@ -38,6 +37,11 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \
38
37
apt-get update && \
39
38
apt-get install -y cuda-nvcc-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} libcublas-dev-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} libcusparse-dev-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} libcusolver-dev-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} && apt-get clean \
40
39
; fi
40
+ # oneapi requirements
41
+ RUN if [ "${BUILD_TYPE}" = "sycl_f16" ] || [ "${BUILD_TYPE}" = "sycl_f32" ]; then \
42
+ wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/163da6e4-56eb-4948-aba3-debcec61c064/l_BaseKit_p_2024.0.1.46_offline.sh && \
43
+ sh ./l_BaseKit_p_2024.0.1.46_offline.sh \
44
+ ; fi
41
45
ENV PATH /usr/local/cuda/bin:${PATH}
42
46
43
47
# OpenBLAS requirements and stable diffusion
Original file line number Diff line number Diff line change @@ -111,6 +111,14 @@ ifeq ($(BUILD_TYPE),hipblas)
111
111
CGO_LDFLAGS += -O3 --rtlib=compiler-rt -unwindlib=libgcc -lhipblas -lrocblas --hip-link
112
112
endif
113
113
114
+ ifeq ($(BUILD_TYPE ) ,sycl_f16)
115
+ CMAKE_ARGS+=-DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_SYCL_F16=ON
116
+ endif
117
+
118
+ ifeq ($(BUILD_TYPE ) ,sycl_f32)
119
+ CMAKE_ARGS+=-DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
120
+ endif
121
+
114
122
ifeq ($(BUILD_TYPE ) ,metal)
115
123
CGO_LDFLAGS+=-framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders
116
124
export LLAMA_METAL=1
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ LLAMA_VERSION?=
3
3
4
4
CMAKE_ARGS? =
5
5
BUILD_TYPE? =
6
+ ONEAPI_VARS? =/opt/intel/oneapi/setvars.sh
6
7
7
8
# If build type is cublas, then we set -DLLAMA_CUBLAS=ON to CMAKE_ARGS automatically
8
9
ifeq ($(BUILD_TYPE ) ,cublas)
@@ -49,5 +50,10 @@ clean:
49
50
rm -rf grpc-server
50
51
51
52
grpc-server : llama.cpp llama.cpp/examples/grpc-server
53
+ ifneq (,$(findstring sycl,$(BUILD_TYPE ) ) )
54
+ source $(ONEAPI_VARS) && \
55
+ cd llama.cpp && mkdir -p build && cd build && cmake .. $(CMAKE_ARGS) && cmake --build . --config Release
56
+ else
52
57
cd llama.cpp && mkdir -p build && cd build && cmake .. $(CMAKE_ARGS) && cmake --build . --config Release
58
+ endif
53
59
cp llama.cpp/build/bin/grpc-server .
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ if [ -n "$EXTRA_BACKENDS" ]; then
13
13
done
14
14
fi
15
15
16
+ if [ -e " /opt/intel/oneapi/setvars.sh" ]; then
17
+ source /opt/intel/oneapi/setvars.sh
18
+ fi
19
+
16
20
if [ " $REBUILD " != " false" ]; then
17
21
rm -rf ./local-ai
18
22
make build -j${BUILD_PARALLELISM:- 1}
You can’t perform that action at this time.
0 commit comments