Skip to content

Commit 35d06fa

Browse files
committed
Merge branch 'master' into compilade/mamba2
2 parents c9ecf62 + b1dd4d0 commit 35d06fa

File tree

462 files changed

+76226
-48775
lines changed

Some content is hidden

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

462 files changed

+76226
-48775
lines changed

.clang-tidy

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Checks: >
1313
-readability-magic-numbers,
1414
-readability-uppercase-literal-suffix,
1515
-readability-simplify-boolean-expr,
16+
-readability-math-missing-parentheses,
1617
clang-analyzer-*,
1718
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
1819
performance-*,

.devops/cpu.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ WORKDIR /app
1414
COPY . .
1515

1616
RUN if [ "$TARGETARCH" = "amd64" ]; then \
17-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
17+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
1818
elif [ "$TARGETARCH" = "arm64" ]; then \
19-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=${GGML_CPU_ARM_ARCH}; \
19+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_CPU_ARM_ARCH=${GGML_CPU_ARM_ARCH}; \
2020
else \
2121
echo "Unsupported architecture"; \
2222
exit 1; \

.devops/cuda.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ COPY . .
2121
RUN if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
2222
export CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_DOCKER_ARCH}"; \
2323
fi && \
24-
cmake -B build -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
24+
cmake -B build -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_BUILD_TESTS=OFF ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
2525
cmake --build build --config Release -j$(nproc)
2626

2727
RUN mkdir -p /app/lib && \

.devops/intel.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
1717
&& export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
1818
fi && \
1919
echo "Building with dynamic libs" && \
20-
cmake -B build -DGGML_NATIVE=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
20+
cmake -B build -DGGML_NATIVE=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_BUILD_TESTS=OFF ${OPT_SYCL_F16} && \
2121
cmake --build build --config Release -j$(nproc)
2222

2323
RUN mkdir -p /app/lib && \

.devops/llama-cli-cann.Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
ARG ASCEND_VERSION=8.0.rc2.alpha003-910b-openeuler22.03-py3.8
1+
ARG ASCEND_VERSION=8.1.RC1.alpha001-910b-openeuler22.03-py3.10
22

33
FROM ascendai/cann:$ASCEND_VERSION AS build
44

55
WORKDIR /app
66

77
COPY . .
88

9-
RUN yum install -y gcc g++ cmake make
9+
RUN yum install -y gcc g++ cmake make libcurl-devel
1010
ENV ASCEND_TOOLKIT_HOME=/usr/local/Ascend/ascend-toolkit/latest
1111
ENV LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:$LIBRARY_PATH
1212
ENV LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/lib64/plugin/opskernel:${ASCEND_TOOLKIT_HOME}/lib64/plugin/nnengine:${ASCEND_TOOLKIT_HOME}/opp/built-in/op_impl/ai_core/tbe/op_tiling:${LD_LIBRARY_PATH}
@@ -22,7 +22,7 @@ ENV LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/runtime/lib64/stub:$LD_LIBRARY_PATH
2222

2323
RUN echo "Building with static libs" && \
2424
source /usr/local/Ascend/ascend-toolkit/set_env.sh --force && \
25-
cmake -B build -DGGML_NATIVE=OFF -DGGML_CANN=ON -DBUILD_SHARED_LIBS=OFF && \
25+
cmake -B build -DGGML_NATIVE=OFF -DGGML_CANN=ON -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_TESTS=OFF && \
2626
cmake --build build --config Release --target llama-cli
2727

2828
# TODO: use image with NNRT

.devops/musa.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ COPY . .
3535
RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
3636
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
3737
fi && \
38-
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
38+
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
3939
cmake --build build --config Release -j$(nproc)
4040

4141
RUN mkdir -p /app/lib && \

.devops/rocm.Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ FROM ${BASE_ROCM_DEV_CONTAINER} AS build
1717
# gfx906 is deprecated
1818
#check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.2.4/reference/system-requirements.html
1919

20-
#ARG ROCM_DOCKER_ARCH='gfx803,gfx900,gfx906,gfx908,gfx90a,gfx942,gfx1010,gfx1030,gfx1032,gfx1100,gfx1101,gfx1102'
21-
ARG ROCM_DOCKER_ARCH=gfx1100
20+
ARG ROCM_DOCKER_ARCH='gfx803,gfx900,gfx906,gfx908,gfx90a,gfx942,gfx1010,gfx1030,gfx1032,gfx1100,gfx1101,gfx1102'
21+
#ARG ROCM_DOCKER_ARCH=gfx1100
2222

2323
# Set nvcc architectured
2424
ENV AMDGPU_TARGETS=${ROCM_DOCKER_ARCH}
@@ -40,7 +40,7 @@ WORKDIR /app
4040
COPY . .
4141

4242
RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
43-
cmake -S . -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=$ROCM_DOCKER_ARCH -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON \
43+
cmake -S . -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=$ROCM_DOCKER_ARCH -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_TESTS=OFF \
4444
&& cmake --build build --config Release -j$(nproc)
4545

4646
RUN mkdir -p /app/lib \

.devops/vulkan.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ WORKDIR /app
1616

1717
COPY . .
1818

19-
RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_VULKAN=1 -DLLAMA_CURL=1 && \
19+
RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_VULKAN=1 -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON && \
2020
cmake --build build --config Release -j$(nproc)
2121

2222
RUN mkdir -p /app/lib && \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Windows - Setup CURL'
2+
description: 'Composite action, to be reused in other workflow'
3+
inputs:
4+
curl_version:
5+
description: 'CURL version'
6+
required: false
7+
default: '8.6.0_6'
8+
outputs:
9+
curl_path:
10+
description: "Path to the downloaded libcurl"
11+
value: ${{ steps.get_libcurl.outputs.curl_path }}
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: libCURL
17+
id: get_libcurl
18+
shell: powershell
19+
env:
20+
CURL_VERSION: ${{ inputs.curl_version }}
21+
run: |
22+
curl.exe -o $env:RUNNER_TEMP/curl.zip -L "https://curl.se/windows/dl-${env:CURL_VERSION}/curl-${env:CURL_VERSION}-win64-mingw.zip"
23+
mkdir $env:RUNNER_TEMP/libcurl
24+
tar.exe -xvf $env:RUNNER_TEMP/curl.zip --strip-components=1 -C $env:RUNNER_TEMP/libcurl
25+
echo "curl_path=$env:RUNNER_TEMP/libcurl" >> $env:GITHUB_OUTPUT

.github/workflows/bench.yml.disabled

-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ jobs:
104104
cmake -B build \
105105
-DGGML_NATIVE=OFF \
106106
-DLLAMA_BUILD_SERVER=ON \
107-
-DLLAMA_CURL=ON \
108107
-DLLAMA_CUBLAS=ON \
109108
-DCUDAToolkit_ROOT=/usr/local/cuda \
110109
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Build on Linux using cross-compiler
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
6+
jobs:
7+
ubuntu-latest-riscv64-cpu-cross:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Setup Riscv
13+
run: |
14+
sudo dpkg --add-architecture riscv64
15+
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' \
16+
/etc/apt/sources.list /etc/apt/apt-mirrors.txt
17+
sudo apt-get clean
18+
sudo apt-get update
19+
sudo apt-get install -y --no-install-recommends \
20+
build-essential \
21+
gcc-14-riscv64-linux-gnu \
22+
g++-14-riscv64-linux-gnu \
23+
libcurl4-openssl-dev:riscv64
24+
25+
- name: Build
26+
run: |
27+
cmake -B build -DCMAKE_BUILD_TYPE=Release \
28+
-DGGML_OPENMP=OFF \
29+
-DLLAMA_BUILD_EXAMPLES=ON \
30+
-DLLAMA_BUILD_TESTS=OFF \
31+
-DCMAKE_SYSTEM_NAME=Linux \
32+
-DCMAKE_SYSTEM_PROCESSOR=riscv64 \
33+
-DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
34+
-DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
35+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
36+
-DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
37+
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
38+
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
39+
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
40+
41+
cmake --build build --config Release -j $(nproc)
42+
43+
ubuntu-latest-riscv64-vulkan-cross:
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Setup Riscv
52+
run: |
53+
sudo dpkg --add-architecture riscv64
54+
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' \
55+
/etc/apt/sources.list /etc/apt/apt-mirrors.txt
56+
sudo apt-get clean
57+
sudo apt-get update
58+
sudo apt-get install -y --no-install-recommends \
59+
build-essential \
60+
glslc \
61+
gcc-14-riscv64-linux-gnu \
62+
g++-14-riscv64-linux-gnu \
63+
libvulkan-dev:riscv64 \
64+
libcurl4-openssl-dev:riscv64
65+
66+
- name: Build
67+
run: |
68+
cmake -B build -DCMAKE_BUILD_TYPE=Release \
69+
-DGGML_VULKAN=ON \
70+
-DGGML_OPENMP=OFF \
71+
-DLLAMA_BUILD_EXAMPLES=ON \
72+
-DLLAMA_BUILD_TESTS=OFF \
73+
-DCMAKE_SYSTEM_NAME=Linux \
74+
-DCMAKE_SYSTEM_PROCESSOR=riscv64 \
75+
-DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
76+
-DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
77+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
78+
-DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
79+
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
80+
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
81+
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
82+
83+
cmake --build build --config Release -j $(nproc)
84+
85+
ubuntu-latest-arm64-vulkan-cross:
86+
runs-on: ubuntu-latest
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
with:
91+
fetch-depth: 0
92+
93+
- name: Setup Arm64
94+
run: |
95+
sudo dpkg --add-architecture arm64
96+
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' \
97+
/etc/apt/sources.list /etc/apt/apt-mirrors.txt
98+
sudo apt-get clean
99+
sudo apt-get update
100+
sudo apt-get install -y --no-install-recommends \
101+
build-essential \
102+
glslc \
103+
crossbuild-essential-arm64 \
104+
libvulkan-dev:arm64 \
105+
libcurl4-openssl-dev:arm64
106+
107+
- name: Build
108+
run: |
109+
cmake -B build -DCMAKE_BUILD_TYPE=Release \
110+
-DGGML_VULKAN=ON \
111+
-DGGML_OPENMP=OFF \
112+
-DLLAMA_BUILD_EXAMPLES=ON \
113+
-DLLAMA_BUILD_TESTS=OFF \
114+
-DCMAKE_SYSTEM_NAME=Linux \
115+
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
116+
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
117+
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
118+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
119+
-DCMAKE_FIND_ROOT_PATH=/usr/lib/aarch64-linux-gnu \
120+
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
121+
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
122+
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
123+
124+
cmake --build build --config Release -j $(nproc)

0 commit comments

Comments
 (0)