Skip to content

Commit f500e3b

Browse files
committed
Merge branch 'master' of github.com:ggml-org/llama.cpp into op-dsocr
2 parents 6575c14 + 07b0e7a commit f500e3b

File tree

197 files changed

+112203
-35509
lines changed

Some content is hidden

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

197 files changed

+112203
-35509
lines changed

.devops/cann.Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
# ==============================================================================
44

55
# Define the CANN base image for easier version updates later
6-
ARG CANN_BASE_IMAGE=quay.io/ascend/cann:8.1.rc1-910b-openeuler22.03-py3.10
6+
ARG CHIP_TYPE=910b
7+
ARG CANN_BASE_IMAGE=quay.io/ascend/cann:8.3.rc1.alpha001-${CHIP_TYPE}-openeuler22.03-py3.11
78

89
# ==============================================================================
910
# BUILD STAGE
1011
# Compile all binary files and libraries
1112
# ==============================================================================
1213
FROM ${CANN_BASE_IMAGE} AS build
1314

14-
# Define the Ascend chip model for compilation. Default is Ascend910B3
15-
ARG ASCEND_SOC_TYPE=Ascend910B3
16-
1715
# -- Install build dependencies --
1816
RUN yum install -y gcc g++ cmake make git libcurl-devel python3 python3-pip && \
1917
yum clean all && \
@@ -36,20 +34,21 @@ ENV LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/runtime/lib64/stub:$LD_LIBRARY_PATH
3634
# For brevity, only core variables are listed here. You can paste the original ENV list here.
3735

3836
# -- Build llama.cpp --
39-
# Use the passed ASCEND_SOC_TYPE argument and add general build options
37+
# Use the passed CHIP_TYPE argument and add general build options
38+
ARG CHIP_TYPE
4039
RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh --force \
4140
&& \
4241
cmake -B build \
4342
-DGGML_CANN=ON \
4443
-DCMAKE_BUILD_TYPE=Release \
45-
-DSOC_TYPE=${ASCEND_SOC_TYPE} \
44+
-DSOC_TYPE=ascend${CHIP_TYPE} \
4645
. && \
4746
cmake --build build --config Release -j$(nproc)
4847

4948
# -- Organize build artifacts for copying in later stages --
5049
# Create a lib directory to store all .so files
5150
RUN mkdir -p /app/lib && \
52-
find build -name "*.so" -exec cp {} /app/lib \;
51+
find build -name "*.so*" -exec cp -P {} /app/lib \;
5352

5453
# Create a full directory to store all executables and Python scripts
5554
RUN mkdir -p /app/full && \

.devops/cpu.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
2020
cmake --build build -j $(nproc)
2121

2222
RUN mkdir -p /app/lib && \
23-
find build -name "*.so" -exec cp {} /app/lib \;
23+
find build -name "*.so*" -exec cp -P {} /app/lib \;
2424

2525
RUN mkdir -p /app/full \
2626
&& cp build/bin/* /app/full \

.devops/cuda.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
2525
cmake --build build --config Release -j$(nproc)
2626

2727
RUN mkdir -p /app/lib && \
28-
find build -name "*.so" -exec cp {} /app/lib \;
28+
find build -name "*.so*" -exec cp -P {} /app/lib \;
2929

3030
RUN mkdir -p /app/full \
3131
&& cp build/bin/* /app/full \

.devops/intel.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
2121
cmake --build build --config Release -j$(nproc)
2222

2323
RUN mkdir -p /app/lib && \
24-
find build -name "*.so" -exec cp {} /app/lib \;
24+
find build -name "*.so*" -exec cp -P {} /app/lib \;
2525

2626
RUN mkdir -p /app/full \
2727
&& cp build/bin/* /app/full \

.devops/musa.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
3232
cmake --build build --config Release -j$(nproc)
3333

3434
RUN mkdir -p /app/lib && \
35-
find build -name "*.so" -exec cp {} /app/lib \;
35+
find build -name "*.so*" -exec cp -P {} /app/lib \;
3636

3737
RUN mkdir -p /app/full \
3838
&& cp build/bin/* /app/full \

.devops/nix/package.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
rocmGpuTargets ? builtins.concatStringsSep ";" rocmPackages.clr.gpuTargets,
3535
enableCurl ? true,
3636
useVulkan ? false,
37+
useRpc ? false,
3738
llamaVersion ? "0.0.0", # Arbitrary version, substituted by the flake
3839

3940
# It's necessary to consistently use backendStdenv when building with CUDA support,
@@ -175,6 +176,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
175176
(cmakeBool "GGML_METAL" useMetalKit)
176177
(cmakeBool "GGML_VULKAN" useVulkan)
177178
(cmakeBool "GGML_STATIC" enableStatic)
179+
(cmakeBool "GGML_RPC" useRpc)
178180
]
179181
++ optionals useCuda [
180182
(

.devops/rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
4545
&& cmake --build build --config Release -j$(nproc)
4646

4747
RUN mkdir -p /app/lib \
48-
&& find build -name "*.so" -exec cp {} /app/lib \;
48+
&& find build -name "*.so*" -exec cp -P {} /app/lib \;
4949

5050
RUN mkdir -p /app/full \
5151
&& cp build/bin/* /app/full \

.devops/vulkan.Dockerfile

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG UBUNTU_VERSION=24.04
1+
ARG UBUNTU_VERSION=25.10
22

33
FROM ubuntu:$UBUNTU_VERSION AS build
44

@@ -7,36 +7,20 @@ FROM ubuntu:$UBUNTU_VERSION AS build
77
# Install build tools
88
RUN apt update && apt install -y git build-essential cmake wget xz-utils
99

10-
# Install Vulkan SDK
11-
ARG VULKAN_VERSION=1.4.321.1
12-
RUN ARCH=$(uname -m) && \
13-
wget -qO /tmp/vulkan-sdk.tar.xz https://sdk.lunarg.com/sdk/download/${VULKAN_VERSION}/linux/vulkan-sdk-linux-${ARCH}-${VULKAN_VERSION}.tar.xz && \
14-
mkdir -p /opt/vulkan && \
15-
tar -xf /tmp/vulkan-sdk.tar.xz -C /tmp --strip-components=1 && \
16-
mv /tmp/${ARCH}/* /opt/vulkan/ && \
17-
rm -rf /tmp/*
18-
1910
# Install cURL and Vulkan SDK dependencies
2011
RUN apt install -y libcurl4-openssl-dev curl \
21-
libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev
22-
23-
# Set environment variables
24-
ENV VULKAN_SDK=/opt/vulkan
25-
ENV PATH=$VULKAN_SDK/bin:$PATH
26-
ENV LD_LIBRARY_PATH=$VULKAN_SDK/lib:$LD_LIBRARY_PATH
27-
ENV CMAKE_PREFIX_PATH=$VULKAN_SDK:$CMAKE_PREFIX_PATH
28-
ENV PKG_CONFIG_PATH=$VULKAN_SDK/lib/pkgconfig:$PKG_CONFIG_PATH
12+
libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan-dev glslc
2913

3014
# Build it
3115
WORKDIR /app
3216

3317
COPY . .
3418

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

3822
RUN mkdir -p /app/lib && \
39-
find build -name "*.so" -exec cp {} /app/lib \;
23+
find build -name "*.so*" -exec cp -P {} /app/lib \;
4024

4125
RUN mkdir -p /app/full \
4226
&& cp build/bin/* /app/full \
@@ -50,7 +34,7 @@ RUN mkdir -p /app/full \
5034
FROM ubuntu:$UBUNTU_VERSION AS base
5135

5236
RUN apt-get update \
53-
&& apt-get install -y libgomp1 curl libvulkan-dev \
37+
&& apt-get install -y libgomp1 curl libvulkan1 mesa-vulkan-drivers \
5438
&& apt autoremove -y \
5539
&& apt clean -y \
5640
&& rm -rf /tmp/* /var/tmp/* \

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,11 @@ end_of_line = unset
6060
charset = unset
6161
trim_trailing_whitespace = unset
6262
insert_final_newline = unset
63+
64+
[benches/**]
65+
indent_style = unset
66+
indent_size = unset
67+
end_of_line = unset
68+
charset = unset
69+
trim_trailing_whitespace = unset
70+
insert_final_newline = unset

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ llama.cpp is a large-scale C/C++ project for efficient LLM (Large Language Model
99
- **Size**: ~200k+ lines of code across 1000+ files
1010
- **Architecture**: Modular design with main library (`libllama`) and 40+ executable tools/examples
1111
- **Core dependency**: ggml tensor library (vendored in `ggml/` directory)
12-
- **Backends supported**: CPU (AVX/NEON optimized), CUDA, Metal, Vulkan, SYCL, ROCm, MUSA
12+
- **Backends supported**: CPU (AVX/NEON/RVV optimized), CUDA, Metal, Vulkan, SYCL, ROCm, MUSA
1313
- **License**: MIT
1414

1515
## Build Instructions

0 commit comments

Comments
 (0)