chewxy / math32

A float32 version of Go's math package
BSD 2-Clause "Simplified" License
60 stars 22 forks source link

Please support the new processor architecture, thank you very much. This architecture is RISC-V #46

Open HougeLangley opened 4 months ago

HougeLangley commented 4 months ago
$ go build .
# github.com/chewxy/math32
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/exp.go:3:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/exp.go:57:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/sqrt.go:3:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/log.go:76:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/remainder.go:33:6: missing function body
HougeLangley commented 4 months ago

Full log

 sipeed @ lpi4a in ~/ollama on git:main o [3:10:57] 
$ go generate ./...        
go: downloading go1.22.0 (linux/riscv64)
go: downloading github.com/google/uuid v1.0.0
go: downloading golang.org/x/crypto v0.14.0
go: downloading google.golang.org/protobuf v1.30.0
go: downloading github.com/d4l3k/go-bfloat16 v0.0.0-20211005043715-690c3bdd05f1
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/nlpodyssey/gopickle v0.3.0
go: downloading github.com/pdevine/tensor v0.0.0-20240228013915-64ccaa8d9ca9
go: downloading github.com/x448/float16 v0.8.4
go: downloading golang.org/x/sys v0.13.0
go: downloading golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
go: downloading golang.org/x/sync v0.3.0
go: downloading github.com/gin-gonic/gin v1.9.1
go: downloading golang.org/x/term v0.13.0
go: downloading github.com/emirpasic/gods v1.18.1
go: downloading github.com/gin-contrib/cors v1.4.0
go: downloading github.com/containerd/console v1.0.3
go: downloading github.com/olekukonko/tablewriter v0.0.5
go: downloading github.com/spf13/cobra v1.7.0
go: downloading golang.org/x/text v0.14.0
go: downloading github.com/apache/arrow/go/arrow v0.0.0-20201229220542-30ce2eb5d4dc
go: downloading github.com/chewxy/hm v1.0.0
go: downloading github.com/chewxy/math32 v1.0.8
go: downloading github.com/google/flatbuffers v1.12.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6
go: downloading gonum.org/v1/gonum v0.8.2
go: downloading gorgonia.org/vecf32 v0.9.0
go: downloading gorgonia.org/vecf64 v0.9.0
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/mattn/go-isatty v0.0.19
go: downloading golang.org/x/net v0.17.0
go: downloading github.com/mattn/go-runewidth v0.0.14
go: downloading github.com/spf13/pflag v1.0.5
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/xtgo/set v1.0.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading github.com/golang/protobuf v1.5.0
go: downloading github.com/go-playground/validator/v10 v10.14.0
go: downloading github.com/pelletier/go-toml/v2 v2.0.8
go: downloading github.com/ugorji/go/codec v1.2.11
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading github.com/gabriel-vasile/mimetype v1.4.2
go: downloading github.com/go-playground/universal-translator v0.18.1
go: downloading github.com/leodido/go-urn v1.2.4
go: downloading github.com/go-playground/locales v0.14.1
+ set -o pipefail
+ echo 'Starting linux generate script'
Starting linux generate script
+ '[' -z '' ']'
+ '[' -x /usr/local/cuda/bin/nvcc ']'
++ command -v nvcc
+ export CUDACXX=
+ CUDACXX=
+ COMMON_CMAKE_DEFS='-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
++ dirname ./gen_linux.sh
+ source ./gen_common.sh
+ init_vars
+ case "${GOARCH}" in
++ uname -m
++ sed -e s/aarch64/arm64/g
+ ARCH=riscv64
+ LLAMACPP_DIR=../llama.cpp
+ CMAKE_DEFS=
+ CMAKE_TARGETS='--target ollama_llama_server'
+ echo ''
+ grep -- -g
+ CMAKE_DEFS='-DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off '
+ case $(uname -s) in
++ uname -s
+ LIB_EXT=so
+ WHOLE_ARCHIVE=-Wl,--whole-archive
+ NO_WHOLE_ARCHIVE=-Wl,--no-whole-archive
+ GCC_ARCH=
+ '[' -z '' ']'
+ CMAKE_CUDA_ARCHITECTURES='50;52;61;70;75;80'
+ git_module_setup
+ '[' -n '' ']'
+ '[' -d ../llama.cpp/gguf ']'
+ git submodule init
+ git submodule update --force ../llama.cpp
子模组路径 '../llama.cpp':检出 '952d03dbead16e4dbdd1d3458486340673cc2465'
+ apply_patches
+ grep ollama ../llama.cpp/CMakeLists.txt
+ echo 'add_subdirectory(../ext_server ext_server) # ollama'
++ ls -A ../patches/02-clip-log.diff ../patches/03-load_exception.diff ../patches/04-metal.diff ../patches/05-clip-fix.diff
+ '[' -n '../patches/02-clip-log.diff
../patches/03-load_exception.diff
../patches/04-metal.diff
../patches/05-clip-fix.diff' ']'
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/02-clip-log.diff
++ cut -f2 '-d '
++ cut -f2- -d/
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout examples/llava/clip.cpp
从索引区更新了 0 个路径
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/03-load_exception.diff
++ cut -f2- -d/
++ cut -f2 '-d '
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout llama.cpp
从索引区更新了 0 个路径
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/04-metal.diff
++ cut -f2 '-d '
++ cut -f2- -d/
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout ggml-metal.m
从索引区更新了 0 个路径
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/05-clip-fix.diff
++ cut -f2 '-d '
++ cut -f2- -d/
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout examples/llava/clip.cpp
从索引区更新了 0 个路径
+ for patch in ../patches/*.diff
+ cd ../llama.cpp
+ git apply ../patches/02-clip-log.diff
+ for patch in ../patches/*.diff
+ cd ../llama.cpp
+ git apply ../patches/03-load_exception.diff
+ for patch in ../patches/*.diff
+ cd ../llama.cpp
+ git apply ../patches/04-metal.diff
+ for patch in ../patches/*.diff
+ cd ../llama.cpp
+ git apply ../patches/05-clip-fix.diff
+ init_vars
+ case "${GOARCH}" in
++ uname -m
++ sed -e s/aarch64/arm64/g
+ ARCH=riscv64
+ LLAMACPP_DIR=../llama.cpp
+ CMAKE_DEFS=
+ CMAKE_TARGETS='--target ollama_llama_server'
+ echo ''
+ grep -- -g
+ CMAKE_DEFS='-DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off '
+ case $(uname -s) in
++ uname -s
+ LIB_EXT=so
+ WHOLE_ARCHIVE=-Wl,--whole-archive
+ NO_WHOLE_ARCHIVE=-Wl,--no-whole-archive
+ GCC_ARCH=
+ '[' -z '50;52;61;70;75;80' ']'
+ '[' -z '' -o '' = static ']'
+ init_vars
+ case "${GOARCH}" in
++ uname -m
++ sed -e s/aarch64/arm64/g
+ ARCH=riscv64
+ LLAMACPP_DIR=../llama.cpp
+ CMAKE_DEFS=
+ CMAKE_TARGETS='--target ollama_llama_server'
+ echo ''
+ grep -- -g
+ CMAKE_DEFS='-DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off '
+ case $(uname -s) in
++ uname -s
+ LIB_EXT=so
+ WHOLE_ARCHIVE=-Wl,--whole-archive
+ NO_WHOLE_ARCHIVE=-Wl,--no-whole-archive
+ GCC_ARCH=
+ '[' -z '50;52;61;70;75;80' ']'
+ CMAKE_TARGETS='--target llama --target ggml'
+ CMAKE_DEFS='-DBUILD_SHARED_LIBS=off -DLLAMA_NATIVE=off -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off '
+ BUILD_DIR=../build/linux/riscv64_static
+ echo 'Building static library'
Building static library
+ build
+ cmake -S ../llama.cpp -B ../build/linux/riscv64_static -DBUILD_SHARED_LIBS=off -DLLAMA_NATIVE=off -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.40.1") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with LLAMA_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: riscv64
-- Unknown architecture
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sipeed/ollama/llm/build/linux/riscv64_static
+ cmake --build ../build/linux/riscv64_static --target llama --target ggml -j8
[ 33%] Building C object CMakeFiles/ggml.dir/ggml-alloc.c.o
[ 33%] Building C object CMakeFiles/ggml.dir/ggml-backend.c.o
[ 50%] Building CXX object CMakeFiles/ggml.dir/sgemm.cpp.o
[ 50%] Building C object CMakeFiles/ggml.dir/ggml.c.o
[ 50%] Building C object CMakeFiles/ggml.dir/ggml-quants.c.o
[ 50%] Built target ggml
[ 83%] Building CXX object CMakeFiles/llama.dir/llama.cpp.o
[ 83%] Building CXX object CMakeFiles/llama.dir/unicode.cpp.o
[ 83%] Building CXX object CMakeFiles/llama.dir/unicode-data.cpp.o
[100%] Linking CXX static library libllama.a
[100%] Built target llama
[100%] Built target ggml
+ init_vars
+ case "${GOARCH}" in
++ uname -m
++ sed -e s/aarch64/arm64/g
+ ARCH=riscv64
+ LLAMACPP_DIR=../llama.cpp
+ CMAKE_DEFS=
+ CMAKE_TARGETS='--target ollama_llama_server'
+ echo ''
+ grep -- -g
+ CMAKE_DEFS='-DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off '
+ case $(uname -s) in
++ uname -s
+ LIB_EXT=so
+ WHOLE_ARCHIVE=-Wl,--whole-archive
+ NO_WHOLE_ARCHIVE=-Wl,--no-whole-archive
+ GCC_ARCH=
+ '[' -z '50;52;61;70;75;80' ']'
+ '[' -z '' ']'
+ '[' -n '' ']'
+ COMMON_CPU_DEFS='-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off'
+ '[' -z '' -o '' = cpu ']'
+ init_vars
+ case "${GOARCH}" in
++ uname -m
++ sed -e s/aarch64/arm64/g
+ ARCH=riscv64
+ LLAMACPP_DIR=../llama.cpp
+ CMAKE_DEFS=
+ CMAKE_TARGETS='--target ollama_llama_server'
+ echo ''
+ grep -- -g
+ CMAKE_DEFS='-DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off '
+ case $(uname -s) in
++ uname -s
+ LIB_EXT=so
+ WHOLE_ARCHIVE=-Wl,--whole-archive
+ NO_WHOLE_ARCHIVE=-Wl,--no-whole-archive
+ GCC_ARCH=
+ '[' -z '50;52;61;70;75;80' ']'
+ CMAKE_DEFS='-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off '
+ BUILD_DIR=../build/linux/riscv64/cpu
+ echo 'Building LCD CPU'
Building LCD CPU
+ build
+ cmake -S ../llama.cpp -B ../build/linux/riscv64/cpu -DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.40.1") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with LLAMA_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: riscv64
-- Unknown architecture
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sipeed/ollama/llm/build/linux/riscv64/cpu
+ cmake --build ../build/linux/riscv64/cpu --target ollama_llama_server -j8
[  6%] Generating build details from Git
[  6%] Building C object CMakeFiles/ggml.dir/ggml.c.o
[ 12%] Building C object CMakeFiles/ggml.dir/ggml-alloc.c.o
[ 18%] Building C object CMakeFiles/ggml.dir/ggml-backend.c.o
[ 18%] Building C object CMakeFiles/ggml.dir/ggml-quants.c.o
-- Found Git: /usr/bin/git (found version "2.40.1") 
[ 25%] Building CXX object CMakeFiles/ggml.dir/sgemm.cpp.o
[ 31%] Building CXX object common/CMakeFiles/build_info.dir/build-info.cpp.o
[ 31%] Built target build_info
[ 31%] Built target ggml
[ 37%] Building CXX object CMakeFiles/llama.dir/llama.cpp.o
[ 43%] Building CXX object CMakeFiles/llama.dir/unicode.cpp.o
[ 43%] Building CXX object CMakeFiles/llama.dir/unicode-data.cpp.o
[ 50%] Linking CXX static library libllama.a
[ 50%] Built target llama
[ 56%] Building CXX object examples/llava/CMakeFiles/llava.dir/clip.cpp.o
[ 62%] Building CXX object examples/llava/CMakeFiles/llava.dir/llava.cpp.o
[ 56%] Building CXX object common/CMakeFiles/common.dir/common.cpp.o
[ 68%] Building CXX object common/CMakeFiles/common.dir/console.cpp.o
[ 75%] Building CXX object common/CMakeFiles/common.dir/sampling.cpp.o
[ 81%] Building CXX object common/CMakeFiles/common.dir/json-schema-to-grammar.cpp.o
[ 81%] Building CXX object common/CMakeFiles/common.dir/grammar-parser.cpp.o
[ 87%] Building CXX object common/CMakeFiles/common.dir/train.cpp.o
[ 87%] Building CXX object common/CMakeFiles/common.dir/ngram-cache.cpp.o
[ 93%] Linking CXX static library libcommon.a
[ 93%] Built target llava
[ 93%] Built target common
[ 93%] Building CXX object ext_server/CMakeFiles/ollama_llama_server.dir/server.cpp.o
[100%] Linking CXX executable ../bin/ollama_llama_server
[100%] Built target ollama_llama_server
+ compress
+ echo 'Compressing payloads to reduce overall binary size...'
Compressing payloads to reduce overall binary size...
+ pids=
+ rm -rf '../build/linux/riscv64/cpu/bin/*.gz'
+ for f in ${BUILD_DIR}/bin/*
+ pids+=' 2078'
+ '[' -d ../build/linux/riscv64/cpu/lib ']'
+ gzip -n --best -f ../build/linux/riscv64/cpu/bin/ollama_llama_server
+ echo

+ for pid in ${pids}
+ wait 2078
+ echo 'Finished compression'
Finished compression
+ '[' riscv64 == x86_64 ']'
+ '[' -z '' ']'
+ '[' -d /usr/local/cuda/lib64 ']'
+ '[' -z '' ']'
+ '[' -d /opt/cuda/targets/x86_64-linux/lib ']'
+ '[' -z '' ']'
+ CUDART_LIB_DIR=
+ '[' -d '' ']'
+ '[' -z '' ']'
+ ROCM_PATH=/opt/rocm
+ '[' -z '' ']'
+ '[' -d /usr/lib/cmake/CLBlast ']'
+ '[' -d /opt/rocm ']'
+ cleanup
+ cd ../llama.cpp/
+ git checkout CMakeLists.txt
从索引区更新了 1 个路径
++ ls -A ../patches/02-clip-log.diff ../patches/03-load_exception.diff ../patches/04-metal.diff ../patches/05-clip-fix.diff
+ '[' -n '../patches/02-clip-log.diff
../patches/03-load_exception.diff
../patches/04-metal.diff
../patches/05-clip-fix.diff' ']'
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/02-clip-log.diff
++ cut -f2 '-d '
++ cut -f2- -d/
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout examples/llava/clip.cpp
从索引区更新了 1 个路径
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/03-load_exception.diff
++ cut -f2 '-d '
++ cut -f2- -d/
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout llama.cpp
从索引区更新了 1 个路径
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/04-metal.diff
++ cut -f2 '-d '
++ cut -f2- -d/
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout ggml-metal.m
从索引区更新了 1 个路径
+ for patch in ../patches/*.diff
++ grep '^+++ ' ../patches/05-clip-fix.diff
++ cut -f2 '-d '
++ cut -f2- -d/
+ for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/)
+ cd ../llama.cpp
+ git checkout examples/llava/clip.cpp
从索引区更新了 0 个路径
++ cd ../build/linux/riscv64/cpu/..
++ echo cpu
+ echo 'go generate completed.  LLM runners: cpu'
go generate completed.  LLM runners: cpu

# sipeed @ lpi4a in ~/ollama on git:main o [3:27:53] 
$ go build .
# github.com/chewxy/math32
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/exp.go:3:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/exp.go:57:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/sqrt.go:3:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/log.go:76:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.0.8/remainder.go:33:6: missing function body
soypat commented 4 months ago

What's the result of running go env on this machine?

HougeLangley commented 4 months ago

What's the result of running go env on this machine?

 sipeed @ lpi4a in ~/ollama on git:main o [3:31:07] 
$ go env    
GO111MODULE=''
GOARCH='riscv64'
GOBIN=''
GOCACHE='/home/sipeed/.cache/go-build'
GOENV='/home/sipeed/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='riscv64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/sipeed/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/sipeed/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/sipeed/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.0.linux-riscv64'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/sipeed/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.0.linux-riscv64/pkg/tool/linux_riscv64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/sipeed/ollama/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1711292759=/tmp/go-build -gno-record-gcc-switches'
soypat commented 4 months ago

I've noticed you are on v1.0.8 of this repo. This has been fixed in the latest version v1.10. If you are using this module directly it should be enough to run go get -u github.com/chewxy/math32@latest. If one of your dependencies is using this module you must ask them to update.

HougeLangley commented 4 months ago

Thanks, Ollama have been noticed and issued.

HougeLangley commented 4 months ago

I have been update last one, the problem still.

# sipeed @ lpi4a in ~/ollama on git:main o [3:48:53] 
$ go get -u github.com/chewxy/math32@latest
go: downloading github.com/chewxy/math32 v1.10.1
go: upgraded github.com/chewxy/math32 v1.0.8 => v1.10.1

# sipeed @ lpi4a in ~/ollama on git:main x [4:20:18] 
$ go build .                               
# github.com/chewxy/math32
../go/pkg/mod/github.com/chewxy/math32@v1.10.1/sqrt.go:3:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.10.1/log.go:76:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.10.1/exp.go:3:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.10.1/exp.go:57:6: missing function body
../go/pkg/mod/github.com/chewxy/math32@v1.10.1/remainder.go:33:6: missing function body

# sipeed @ lpi4a in ~/ollama on git:main x [4:20:25] C:1
$ 
soypat commented 4 months ago

OK thank you for notifying. I am not able to replicate this on my machine but I have noticed that v1.10.1 is quite behind master branch. Will issue a new tag as soon as #48 is solved.

HougeLangley commented 4 months ago

Thanks, you are very kind.

soypat commented 4 months ago

Please try updating to v1.11: go get -u github.com/chewxy/math32@v1.11 and let me know what happens

HougeLangley commented 4 months ago

Screenshot_20240510_073730

HougeLangley commented 4 months ago

https://github.com/felixonmars/archriscv-packages/blob/master/ollama/riscv64.patch

I found Archlinux using this patch could build success.

HougeLangley commented 4 months ago

https://github.com/ollama/ollama/issues/4297

@mxyng @felixonmars could u give a hand ; )

felixonmars commented 4 months ago

ollama/ollama#4297

@mxyng @felixonmars could u give a hand ; )

~Ideally math32 should make a new release here so that we could then update ollama's dependency, instead of pointing to unreleased code.~

EDIT: I noticed that v1.11 is already released. We should ask ollama (and all along its dependency tree) for a bump :)

EDIT again: proxy.golang.org still doesn't have the new version :( It seems we need to wait for it first.

soypat commented 3 months ago

Hmm, I might have botched the tagging. You can try: GOPROXY=direct go get -u github.com/chewxy/math32@7caa3bb to directly download the latest commit at the time of writing this.

HougeLangley commented 3 months ago

I have tested and updated Ollama to the latest Git version. Currently, at the 'go build' stage, I am encountering the following error.

# sipeed @ lpi4a in ~/ollama on git:main o [1:07:32] C:1
$ go get -u github.com/chewxy/math32@7caa3bb
go: downloading github.com/chewxy/math32 v1.10.2-0.20240509203351-7caa3bba2ee1
go: upgraded github.com/chewxy/math32 v1.10.1 => v1.10.2-0.20240509203351-7caa3bba2ee1

# sipeed @ lpi4a in ~/ollama on git:main x [1:07:50] 
$ go build .                                
# github.com/ollama/ollama
/home/sipeed/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.0.linux-riscv64/pkg/tool/linux_riscv64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-2984308571/000019.o: in function `_cgo_d85a20fb2d9c_Cfunc_llama_model_quantize':
/tmp/go-build/llm.cgo2.c:69: undefined reference to `llama_model_quantize'
/usr/bin/ld: /tmp/go-link-2984308571/000019.o: in function `_cgo_d85a20fb2d9c_Cfunc_llama_model_quantize_default_params':
/tmp/go-build/llm.cgo2.c:86: undefined reference to `llama_model_quantize_default_params'
/usr/bin/ld: /tmp/go-link-2984308571/000019.o: in function `_cgo_d85a20fb2d9c_Cfunc_llama_print_system_info':
/tmp/go-build/llm.cgo2.c:103: undefined reference to `llama_print_system_info'
collect2: 错误:ld 返回 1
soypat commented 3 months ago

Hm- this does not seem like an error on math32's side- these look like CGo link errors.

I strongly suggest sharing this error with ollama and asking about it in the cgo channel on the gophers slack. They'll be sure to help much more than myself.