813 B
813 B
llama.cpp
https://github.com/ggml-org/llama.cpp/archive/refs/tags/b10094.tar.gz
HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode
ROCM_PATH=/pkg/gnu
HIP_PATH=/pkg/gnu
GPU_TARGETS=gfx1150
sed -i '/^ggml_add_backend_library(ggml-hip$/,/^[[:space:]]*)$/{ /^[[:space:]]*)$/a\
target_compile_options(ggml-hip PRIVATE $<$<COMPILE_LANGUAGE:HIP>:-include __clang_hip_runtime_wrapper.h>)
}' ggml/src/ggml-hip/CMakeLists.txt
mkdir -p build; cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX="$pkgpath" \
-DGGML_HIP=ON \
-DCMAKE_C_COMPILER=amdclang \
-DCMAKE_CXX_COMPILER=amdclang++ \
-DCMAKE_CXX_FLAGS="-D_GNU_SOURCE -O3 -march=native" \
-DGPU_TARGETS="gfx1150"
cmake --build . -j$(nproc)
cmake --install .