Skip to content

Commit 95f8fbe

Browse files
Revert "Merged the latest changes from ggml-org/llama.cpp into our fork(master)"
1 parent 0e6f8a7 commit 95f8fbe

File tree

809 files changed

+60634
-298484
lines changed

Some content is hidden

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

809 files changed

+60634
-298484
lines changed

.clang-format

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AllowShortLambdasOnASingleLine: Inline
2323
AllowShortLoopsOnASingleLine: false
2424
AlwaysBreakBeforeMultilineStrings: true
2525
BinPackArguments: true
26-
BinPackParameters: false # OnePerLine
26+
BinPackParameters: true # OnePerLine
2727
BitFieldColonSpacing: Both
2828
BreakBeforeBraces: Custom # Attach
2929
BraceWrapping:
@@ -70,17 +70,14 @@ ExperimentalAutoDetectBinPacking: false
7070
FixNamespaceComments: true
7171
IncludeBlocks: Regroup
7272
IncludeCategories:
73-
- Regex: '".*"'
74-
Priority: 1
75-
SortPriority: 0
7673
- Regex: '^<.*\.h>'
77-
Priority: 2
74+
Priority: 1
7875
SortPriority: 0
7976
- Regex: '^<.*'
80-
Priority: 3
77+
Priority: 2
8178
SortPriority: 0
8279
- Regex: '.*'
83-
Priority: 4
80+
Priority: 3
8481
SortPriority: 0
8582
IncludeIsMainRegex: '([-_](test|unittest))?$'
8683
IncludeIsMainSourceRegex: ''

.devops/cann.Dockerfile

Lines changed: 0 additions & 130 deletions
This file was deleted.

.devops/cloud-v-pipeline

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
node('x86_runner1'){ // Running on x86 runner containing latest vector qemu, latest vector gcc and all the necessary libraries
2+
stage('Cleanup'){
3+
cleanWs() // Cleaning previous CI build in workspace
4+
}
5+
stage('checkout repo'){
6+
retry(5){ // Retry if the cloning fails due to some reason
7+
checkout scm // Clone the repo on Runner
8+
}
9+
}
10+
stage('Compiling llama.cpp'){
11+
sh'''#!/bin/bash
12+
make RISCV=1 RISCV_CROSS_COMPILE=1 # Compiling llama for RISC-V
13+
'''
14+
}
15+
stage('Running llama.cpp'){
16+
sh'''#!/bin/bash
17+
module load gnu-bin2/0.1 # loading latest versions of vector qemu and vector gcc
18+
qemu-riscv64 -L /softwares/gnu-bin2/sysroot -cpu rv64,v=true,vlen=256,elen=64,vext_spec=v1.0 ./llama-cli -m /home/alitariq/codellama-7b.Q4_K_M.gguf -p "Anything" -n 9 > llama_log.txt # Running llama.cpp on vector qemu-riscv64
19+
cat llama_log.txt # Printing results
20+
'''
21+
}
22+
}

.devops/cpu.Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ FROM ubuntu:$UBUNTU_VERSION AS build
44

55
ARG TARGETARCH
66

7+
ARG GGML_CPU_ARM_ARCH=armv8-a
8+
79
RUN apt-get update && \
810
apt-get install -y build-essential git cmake libcurl4-openssl-dev
911

1012
WORKDIR /app
1113

1214
COPY . .
1315

14-
RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
16+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
1517
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
18+
elif [ "$TARGETARCH" = "arm64" ]; then \
19+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_CPU_ARM_ARCH=${GGML_CPU_ARM_ARCH}; \
1620
else \
1721
echo "Unsupported architecture"; \
1822
exit 1; \

.devops/cuda.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RUN apt-get update \
6161
python3 \
6262
python3-pip \
6363
&& pip install --upgrade pip setuptools wheel \
64-
&& pip install --break-system-packages -r requirements.txt \
64+
&& pip install -r requirements.txt \
6565
&& apt autoremove -y \
6666
&& apt clean -y \
6767
&& rm -rf /tmp/* /var/tmp/* \

.devops/intel.Dockerfile

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,19 @@ COPY --from=build /app/full /app
4949

5050
WORKDIR /app
5151

52-
RUN apt-get update && \
53-
apt-get install -y \
54-
git \
55-
python3 \
56-
python3-pip \
57-
python3-venv && \
58-
python3 -m venv /opt/venv && \
59-
. /opt/venv/bin/activate && \
60-
pip install --upgrade pip setuptools wheel && \
61-
pip install -r requirements.txt && \
62-
apt autoremove -y && \
63-
apt clean -y && \
64-
rm -rf /tmp/* /var/tmp/* && \
65-
find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete && \
66-
find /var/cache -type f -delete
67-
68-
ENV PATH="/opt/venv/bin:$PATH"
52+
RUN apt-get update \
53+
&& apt-get install -y \
54+
git \
55+
python3 \
56+
python3-pip \
57+
&& pip install --upgrade pip setuptools wheel \
58+
&& pip install -r requirements.txt \
59+
&& apt autoremove -y \
60+
&& apt clean -y \
61+
&& rm -rf /tmp/* /var/tmp/* \
62+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
63+
&& find /var/cache -type f -delete
64+
6965

7066
ENTRYPOINT ["/app/tools.sh"]
7167

.devops/musa.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ARG UBUNTU_VERSION=22.04
22
# This needs to generally match the container host's environment.
3-
ARG MUSA_VERSION=rc4.2.0
3+
ARG MUSA_VERSION=rc4.0.1
44
# Target the MUSA build image
5-
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
5+
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-mudnn-devel-ubuntu${UBUNTU_VERSION}
66

7-
ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64
7+
ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-mudnn-runtime-ubuntu${UBUNTU_VERSION}
88

99
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
1010

.devops/nix/package.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ let
4747
inherit (lib)
4848
cmakeBool
4949
cmakeFeature
50-
optionalAttrs
5150
optionals
5251
strings
5352
;
@@ -198,7 +197,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
198197
];
199198

200199
# Environment variables needed for ROCm
201-
env = optionalAttrs useRocm {
200+
env = optionals useRocm {
202201
ROCM_PATH = "${rocmPackages.clr}";
203202
HIP_DEVICE_LIB_PATH = "${rocmPackages.rocm-device-libs}/amdgcn/bitcode";
204203
};

.devops/rocm.Dockerfile

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ARG UBUNTU_VERSION=24.04
22

33
# This needs to generally match the container host's environment.
4-
ARG ROCM_VERSION=6.4
5-
ARG AMDGPU_VERSION=6.4
4+
ARG ROCM_VERSION=6.3
5+
ARG AMDGPU_VERSION=6.3
66

7-
# Target the ROCm build image
7+
# Target the CUDA build image
88
ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete
99

1010
### Build image
@@ -15,13 +15,16 @@ FROM ${BASE_ROCM_DEV_CONTAINER} AS build
1515
# This is mostly tied to rocBLAS supported archs.
1616
# gfx803, gfx900, gfx1032, gfx1101, gfx1102,not officialy supported
1717
# gfx906 is deprecated
18-
#check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.4.1/reference/system-requirements.html
18+
#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;gfx1200;gfx1201;gfx1151'
21-
#ARG ROCM_DOCKER_ARCH='gfx1151'
20+
ARG ROCM_DOCKER_ARCH='gfx803,gfx900,gfx906,gfx908,gfx90a,gfx942,gfx1010,gfx1030,gfx1032,gfx1100,gfx1101,gfx1102'
21+
#ARG ROCM_DOCKER_ARCH=gfx1100
2222

23-
# Set ROCm architectures
23+
# Set nvcc architectured
2424
ENV AMDGPU_TARGETS=${ROCM_DOCKER_ARCH}
25+
# Enable ROCm
26+
# ENV CC=/opt/rocm/llvm/bin/clang
27+
# ENV CXX=/opt/rocm/llvm/bin/clang++
2528

2629
RUN apt-get update \
2730
&& apt-get install -y \
@@ -36,16 +39,8 @@ WORKDIR /app
3639

3740
COPY . .
3841

39-
RUN git clone https://github.com/rocm/rocwmma --branch develop --depth 1
40-
4142
RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
42-
cmake -S . -B build \
43-
-DGGML_HIP=ON \
44-
-DGGML_HIP_ROCWMMA_FATTN=ON \
45-
-DCMAKE_HIP_FLAGS="-I$(pwd)/rocwmma/library/include/" \
46-
-DAMDGPU_TARGETS="$ROCM_DOCKER_ARCH" \
47-
-DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \
48-
-DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_TESTS=OFF \
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 \
4944
&& cmake --build build --config Release -j$(nproc)
5045

5146
RUN mkdir -p /app/lib \

.devops/tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
set -e
33

44
# Read the first argument into a variable

0 commit comments

Comments
 (0)