forked from ggml-org/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_
More file actions
executable file
·47 lines (40 loc) · 1.27 KB
/
Copy path_
File metadata and controls
executable file
·47 lines (40 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -e
# Pass --clean to force full rebuild from scratch
if [[ "$1" == "--clean" ]]; then
rm -rf build
fi
mkdir -p build
cd build
export ROCM_PATH=/opt/rocm
export HIP_PATH=/opt/rocm
# ccache: needed for HIP files
export CCACHE_CPP2=yes
export CCACHE_NODIRECT=1
# Only run cmake configure if cache missing or --clean was used
if [[ ! -f CMakeCache.txt ]]; then
cmake .. \
-G Ninja \
-DGGML_HIP=ON \
-DAMDGPU_TARGETS=gfx1100 \
-DGGML_HIP_ROCWMMA_FATTN=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLAMA_BUILD_SERVER=ON \
-DLLAMA_CURL=ON \
-DGGML_CCACHE=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_HIP_COMPILER_LAUNCHER=ccache \
-DCMAKE_PREFIX_PATH="/opt/rocm;/opt/rocm/hip;/opt/rocm/lib/cmake" \
-DHIP_ROOT_DIR=/opt/rocm \
-DROCM_PATH=/opt/rocm \
-DHIP_PATH=/opt/rocm \
-DCMAKE_HIP_ARCHITECTURES="gfx1100" \
-DCMAKE_HIP_FLAGS="-mllvm --amdgpu-unroll-threshold-local=600"
fi
cmake --build . --config Release -j$(nproc)
# Archive binaries for quick rollback
ARCHIVE_DIR=~/src/llama.cpp/bin/GPU/ROCm-turboquant/$(date +%Y%m%d%H%M%S)
mkdir -p "$ARCHIVE_DIR"
cp bin/llama-server bin/lib*.so* "$ARCHIVE_DIR/"
echo "Archived to $ARCHIVE_DIR"