-
Notifications
You must be signed in to change notification settings - Fork 6
/
booster.go
20 lines (17 loc) · 8.1 KB
/
booster.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main
/*
#cgo linux CFLAGS: -O3 -g -std=c17 -I. -fPIC -pthread -march=native -mtune=native -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -DNDEBUG -D_XOPEN_SOURCE=600 -DGGML_USE_LLAMAFILE -D_GNU_SOURCE -DGGML_USE_CUDA -DGGML_CUDA_USE_GRAPHS -DLOG_DISABLE_LOGS -I/usr/local/cuda/include -I/opt/cuda/include -I/usr/local/cuda/targets/x86_64-linux/include
#cgo darwin CFLAGS: -O3 -g -std=c17 -I. -fPIC -pthread -mcpu=native -DGGML_USE_LLAMAFILE -DNDEBUG -D_XOPEN_SOURCE=600 -DGGML_USE_LLAMAFILE -D_DARWIN_C_SOURCE -DGGML_USE_METAL -DGGML_LLAMA_METAL_EMBED_LIBRARY -DGGML_METAL_NDEBUG -DGGML_USE_ACCELERATE -DGGML_USE_BLAS -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64 -DGGML_USE_LLAMAFILE
#cgo linux CXXFLAGS: -std=c++11 -fPIC -O3 -g -pthread -fopenmp -march=native -mtune=native -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG -DGGML_USE_OPENMP -DGGML_USE_LLAMAFILE -DGGML_USE_CUDA -I/usr/local/cuda/include -I/usr/local/cuda/targets/x86_64-linux/include -DGGML_CUDA_USE_GRAPHS
#cgo darwin CXXFLAGS: -O3 -g -std=c++17 -I. -fPIC -pthread -mcpu=native -Icpp/ggml/include -Icpp/ggml/src -Icpp/include -Icpp/src -Icpp/common -DGGML_USE_LLAMAFILE -DNDEBUG -D_XOPEN_SOURCE=600 -DGGML_USE_LLAMAFILE -D_DARWIN_C_SOURCE -DGGML_USE_METAL -DGGML_LLAMA_METAL_EMBED_LIBRARY -DGGML_METAL_NDEBUG -DGGML_USE_ACCELERATE -DGGML_USE_BLAS -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64 -DGGML_USE_LLAMAFILE
#cgo linux LDFLAGS: cpp/bridge.o cpp/janus.o cpp/src/llama.o cpp/common/common.o cpp/common/sampling.o cpp/src/llama-sampling.o cpp/common/build-info.o cpp/common/json-schema-to-grammar.o cpp/common/grammar-parser.o cpp/src/llama-vocab.o cpp/src/llama-grammar.o cpp/src/unicode.o cpp/src/unicode-data.o cpp/ggml/src/ggml.o cpp/ggml/src/llamafile/sgemm.o cpp/ggml/src/ggml-cuda.o cpp/ggml/src/ggml-cuda/acc.o cpp/ggml/src/ggml-cuda/arange.o cpp/ggml/src/ggml-cuda/argsort.o cpp/ggml/src/ggml-cuda/binbcast.o cpp/ggml/src/ggml-cuda/clamp.o cpp/ggml/src/ggml-cuda/concat.o cpp/ggml/src/ggml-cuda/conv-transpose-1d.o cpp/ggml/src/ggml-cuda/convert.o cpp/ggml/src/ggml-cuda/cpy.o cpp/ggml/src/ggml-cuda/diagmask.o cpp/ggml/src/ggml-cuda/dmmv.o cpp/ggml/src/ggml-cuda/fattn-tile-f16.o cpp/ggml/src/ggml-cuda/fattn-tile-f32.o cpp/ggml/src/ggml-cuda/fattn.o cpp/ggml/src/ggml-cuda/getrows.o cpp/ggml/src/ggml-cuda/im2col.o cpp/ggml/src/ggml-cuda/mmq.o cpp/ggml/src/ggml-cuda/mmvq.o cpp/ggml/src/ggml-cuda/norm.o cpp/ggml/src/ggml-cuda/pad.o cpp/ggml/src/ggml-cuda/pool2d.o cpp/ggml/src/ggml-cuda/quantize.o cpp/ggml/src/ggml-cuda/rope.o cpp/ggml/src/ggml-cuda/scale.o cpp/ggml/src/ggml-cuda/softmax.o cpp/ggml/src/ggml-cuda/sumrows.o cpp/ggml/src/ggml-cuda/tsembd.o cpp/ggml/src/ggml-cuda/unary.o cpp/ggml/src/ggml-cuda/upscale.o cpp/ggml/src/ggml-cuda/template-instances/fattn-wmma-f16-instance-kqfloat-cpb16.o cpp/ggml/src/ggml-cuda/template-instances/fattn-wmma-f16-instance-kqfloat-cpb32.o cpp/ggml/src/ggml-cuda/template-instances/fattn-wmma-f16-instance-kqhalf-cpb16.o cpp/ggml/src/ggml-cuda/template-instances/fattn-wmma-f16-instance-kqhalf-cpb32.o cpp/ggml/src/ggml-cuda/template-instances/fattn-wmma-f16-instance-kqhalf-cpb8.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq1_s.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_s.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xs.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xxs.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_s.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_xxs.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_nl.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_xs.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q2_k.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q3_k.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_0.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_1.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_k.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_0.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_1.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_k.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q6_k.o cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q8_0.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q4_0.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q4_0.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q8_0.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q8_0.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-f16.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs256-f16-f16.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-f16.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-f16.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs256-f16-f16.o cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-f16.o cpp/ggml/src/ggml-alloc.o cpp/ggml/src/ggml-backend.o cpp/ggml/src/ggml-quants.o cpp/ggml/src/ggml-aarch64.o -lstdc++ -lm -lcuda -lcublas -lculibos -lcudart -lcublasLt -lpthread -ldl -lrt -fopenmp -L/usr/local/cuda/lib64 -L/usr/lib64 -L/usr/local/cuda/targets/x86_64-linux/lib -L/usr/local/cuda/lib64/stubs -L/usr/lib/wsl/lib
#cgo darwin LDFLAGS: cpp/bridge.o cpp/janus.o cpp/src/llama.o cpp/common/common.o cpp/common/sampling.o cpp/src/llama-sampling.o cpp/common/build-info.o cpp/common/json-schema-to-grammar.o cpp/common/grammar-parser.o cpp/src/llama-vocab.o cpp/src/llama-grammar.o cpp/src/unicode.o cpp/src/unicode-data.o cpp/ggml/src/ggml.o cpp/ggml/src/ggml-alloc.o cpp/ggml/src/ggml-backend.o cpp/ggml/src/ggml-quants.o cpp/ggml/src/ggml-aarch64.o cpp/ggml/src/llamafile/sgemm.o cpp/ggml/src/ggml-metal.o cpp/ggml/src/ggml-metal-embed.o cpp/ggml/src/ggml-blas.o -lstdc++ -framework Foundation -framework Metal -framework MetalKit -framework Accelerate
*/
import "C"
import "github.com/gotzmann/booster/pkg/booster"
// WAS
// #cgo linux CXXFLAGS: -O3 -g -std=c++17 -I. -fPIC -pthread -march=native -mtune=native -Icpp/ggml/include -Icpp/ggml/src -Icpp/include -Icpp/src -Icpp/common -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -DNDEBUG -D_XOPEN_SOURCE=600 -DGGML_USE_LLAMAFILE -D_GNU_SOURCE -DGGML_USE_CUDA -DGGML_CUDA_USE_GRAPHS -DLOG_DISABLE_LOGS -I/usr/local/cuda/include -I/opt/cuda/include -I/usr/local/cuda/targets/x86_64-linux/include
// #cgo linux LDFLAGS: cpp/bridge.o cpp/janus.o cpp/src/llama.o cpp/common/common.o cpp/common/sampling.o cpp/src/llama-sampling.o cpp/common/build-info.o cpp/common/json-schema-to-grammar.o cpp/common/grammar-parser.o cpp/src/llama-vocab.o cpp/src/llama-grammar.o cpp/src/unicode.o cpp/src/unicode-data.o cpp/ggml/src/ggml.o cpp/ggml/src/ggml-alloc.o cpp/ggml/src/ggml-backend.o cpp/ggml/src/ggml-quants.o cpp/ggml/src/ggml-aarch64.o cpp/ggml/src/llamafile/sgemm.o cpp/ggml/src/ggml-cuda.o -lstdc++ -lm -lcuda -lcublas -lculibos -lcudart -lcublasLt -lpthread -ldl -lrt -fopenmp -L/usr/local/cuda/lib64 -L/opt/cuda/lib64 -L/usr/local/cuda/targets/x86_64-linux/lib -L/usr/lib/wsl/lib cpp/ggml/src/ggml-cuda/binbcast.o cpp/ggml/src/ggml-cuda/cpy.o cpp/ggml/src/ggml-cuda/dmmv.o cpp/ggml/src/ggml-cuda/mmq.o cpp/ggml/src/ggml-cuda/mmvq.o cpp/ggml/src/ggml-cuda/quantize.o cpp/ggml/src/ggml-cuda/convert.o cpp/ggml/src/ggml-cuda/argsort.o cpp/ggml/src/ggml-cuda/unary.o cpp/ggml/src/ggml-cuda/fattn.o cpp/ggml/src/ggml-cuda/conv-transpose-1d.o cpp/ggml/src/ggml-cuda/im2col.o cpp/ggml/src/ggml-cuda/sumrows.o cpp/ggml/src/ggml-cuda/pool2d.o cpp/ggml/src/ggml-cuda/norm.o cpp/ggml/src/ggml-cuda/getrows.o cpp/ggml/src/ggml-cuda/tsembd.o cpp/ggml/src/ggml-cuda/upscale.o cpp/ggml/src/ggml-cuda/arange.o cpp/ggml/src/ggml-cuda/scale.o cpp/ggml/src/ggml-cuda/clamp.o cpp/ggml/src/ggml-cuda/pad.o cpp/ggml/src/ggml-cuda/diagmask.o cpp/ggml/src/ggml-cuda/softmax.o cpp/ggml/src/ggml-cuda/rope.o cpp/ggml/src/ggml-cuda/concat.o cpp/ggml/src/ggml-cuda/acc.o
func main() {
booster.Run()
}