|
11 місяців тому | |
---|---|---|
.. | ||
ggml-cuda | 8 місяців тому | |
patches | 8 місяців тому | |
.gitignore | 8 місяців тому | |
README.md | 8 місяців тому | |
build_cuda.sh | 8 місяців тому | |
build_hipblas.sh | 8 місяців тому | |
ggml-alloc.c | 8 місяців тому | |
ggml-alloc.h | 8 місяців тому | |
ggml-backend-impl.h | 8 місяців тому | |
ggml-backend.c | 8 місяців тому | |
ggml-backend.h | 8 місяців тому | |
ggml-common.h | 8 місяців тому | |
ggml-cuda.cu | 8 місяців тому | |
ggml-cuda.h | 8 місяців тому | |
ggml-impl.h | 8 місяців тому | |
ggml-metal-darwin_arm64.m | 8 місяців тому | |
ggml-metal.h | 8 місяців тому | |
ggml-metal.metal | 8 місяців тому | |
ggml-metal.o | 8 місяців тому | |
ggml-quants.c | 8 місяців тому | |
ggml-quants.h | 8 місяців тому | |
ggml.c | 8 місяців тому | |
ggml.h | 8 місяців тому | |
llama.cpp | 8 місяців тому | |
llama.go | 8 місяців тому | |
llama.h | 8 місяців тому | |
sgemm.cpp | 8 місяців тому | |
sgemm.h | 8 місяців тому | |
unicode-data.cpp | 8 місяців тому | |
unicode-data.h | 8 місяців тому | |
unicode.cpp | 8 місяців тому | |
unicode.h | 8 місяців тому |
llama
This package integrates llama.cpp as a Go package that's easy to build with tags for different CPU and GPU processors.
Extra build steps are required for CUDA and ROCm on Windows since nvcc
and hipcc
both require using msvc as the host compiler. For these small dlls are created:
ggml-cuda.dll
ggml-hipblas.dll
Note: it's important that memory is allocated and freed by the same compiler (e.g. entirely by code compiled with msvc or mingw). Issues from this should be rare, but there are some places where pointers are returned by the CUDA or HIP runtimes and freed elsewhere, causing a a crash. In a future change the same runtime should be used in both cases to avoid crashes.
go build .
go build -tags avx .
# go doesn't recognize `-mfma` as a valid compiler flag
# see https://github.com/golang/go/issues/17895
go env -w "CGO_CFLAGS_ALLOW=-mfma"
go env -w "CGO_CXXFLAGS_ALLOW=-mfma"
go build -tags=avx2 .
Install the CUDA toolkit v11.3.1 then build ggml-cuda:
Build ggml-cuda.dll
:
./build_cuda.sh
Then build the package with the cuda
tag:
go build -tags=cuda .
Install ROCm 5.7.1 and Strawberry Perl.
Then, build ggml-hipblas.dll
:
./build_hipblas.sh
Then build the package with the rocm
tag:
go build -tags=rocm .
To update this package to the latest llama.cpp code, use the sync.sh
script.
./sync.sh ../../llama.cpp