LocalAI: unexpectedly reached end of fileSIGILL: illegal instruction

I’m trying to use many models, but none of them are working when I use the /chat/completions page. Here’s what I’m getting with gpt4all:

I’m using Postman with this query:

{ "model": "gpt", "messages": [ { "role": "user", "content": "How are you?" } ], "temperature": 0.9 }

Starting LocalAI using 4 threads, with models path: /models ┌───────────────────────────────────────────────────┐ │ Fiber v2.45.0 │ │ http://127.0.0.1:8080 │ │ (bound on host 0.0.0.0 and port 8080) │ │ │ │ Handlers … 17 Processes … 1 │ │ Prefork … Disabled PID … 164 │ └───────────────────────────────────────────────────┘ llama.cpp: loading model from /models/gpt failed unexpectedly reached end of fileSIGILL: illegal instruction PC=0xa893c4 m=5 sigcode=2 signal arrived during cgo execution instruction bytes: 0xc4 0xc3 0x7d 0x39 0x86 0xd8 0x13 0x0 0x0 0x1 0x49 0x89 0x86 0xb8 0x14 0x0 goroutine 18 [syscall]: runtime.cgocall(0x97b760, 0xc0001ae920) /usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc0001ae8f8 sp=0xc0001ae8c0 pc=0x44a4fc github.com/nomic-ai/gpt4all/gpt4all-bindings/golang._Cfunc_load_gptjllama_model(0x7fa4e8002550, 0x4) cgo_gotypes.go:137 +0x4d fp=0xc0001ae920 sp=0xc0001ae8f8 pc=0x584f0d github.com/nomic-ai/gpt4all/gpt4all-bindings/golang.New({0xc000236650, 0xb}, {0xc000209080, 0x2, 0x1?}) /build/gpt4all/gpt4all-bindings/golang/gpt4all.go:35 +0x145 fp=0xc0001ae978 sp=0xc0001ae920 pc=0x585225 github.com/go-skynet/LocalAI/pkg/model.gpt4allLM.func1({0xc000236650?, 0xbca30f?}) /build/pkg/model/initializers.go:110 +0x2a fp=0xc0001ae9b0 sp=0xc0001ae978 pc=0x607d4a github.com/go-skynet/LocalAI/pkg/model.(*ModelLoader).LoadModel(0xc0001a66c0, {0xc000236568, 0x3}, 0xc000024ca0) /build/pkg/model/loader.go:127 +0x1fe fp=0xc0001aeaa8 sp=0xc0001ae9b0 pc=0x609c9e github.com/go-skynet/LocalAI/pkg/model.(*ModelLoader).BackendLoader(0xc0001a66c0, {0xbba207, 0xd}, {0xc000236568, 0x3}, {0xc000014590, 0x1, 0x1}, 0x4) /build/pkg/model/initializers.go:150 +0x7d2 fp=0xc0001aeb70 sp=0xc0001aeaa8 pc=0x608752 github.com/go-skynet/LocalAI/pkg/model.(*ModelLoader).GreedyLoader(0xc0001a66c0, {0xc000236568, 0x3}, {0xc000014590, 0x1, 0x1}, 0x0?) /build/pkg/model/initializers.go:183 +0x2e5 fp=0xc0001aeca8 sp=0xc0001aeb70 pc=0x608ca5 github.com/go-skynet/LocalAI/api.ModelInference({, _}, _, {{{0xc000236568, 0x3}, {0x0, 0x0}, {0x0, 0x0}, {0x0, …}, …}, …}, …) /build/api/prediction.go:218 +0x145 fp=0xc0001aef58 sp=0xc0001aeca8 pc=0x8d8325 github.com/go-skynet/LocalAI/api.ComputeChoices({0xc0002400c0, 0xba}, 0xc00014ab40, 0xc000115b80, 0xc000208f50?, 0xbf46b8, 0x4?) /build/api/prediction.go:517 +0x138 fp=0xc0001af708 sp=0xc0001aef58 pc=0x8db9f8 github.com/go-skynet/LocalAI/api.chatEndpoint.func2(0xc000132840) /build/api/openai.go:361 +0x8ec fp=0xc0001af8c8 sp=0xc0001af708 pc=0x8d35cc github.com/gofiber/fiber/v2.(*App).next(0xc000138d80, 0xc000132840) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/router.go:144 +0x1bf fp=0xc0001af970 sp=0xc0001af8c8 pc=0x88993f github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0000a0330?) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/ctx.go:913 +0x53 fp=0xc0001af990 sp=0xc0001af970 pc=0x874f13 github.com/gofiber/fiber/v2/middleware/cors.New.func1(0xc000132840) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/middleware/cors/cors.go:162 +0x3da fp=0xc0001afa98 sp=0xc0001af990 pc=0x88f75a github.com/gofiber/fiber/v2.(*Ctx).Next(0x14?) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/ctx.go:910 +0x43 fp=0xc0001afab8 sp=0xc0001afa98 pc=0x874f03 github.com/gofiber/fiber/v2/middleware/recover.New.func1(0xb3c360?) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/middleware/recover/recover.go:43 +0xcb fp=0xc0001afb30 sp=0xc0001afab8 pc=0x89638b github.com/gofiber/fiber/v2.(*App).next(0xc000138d80, 0xc000132840) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/router.go:144 +0x1bf fp=0xc0001afbd8 sp=0xc0001afb30 pc=0x88993f github.com/gofiber/fiber/v2.(*App).handler(0xc000138d80, 0x50ce57?) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/router.go:171 +0x87 fp=0xc0001afc38 sp=0xc0001afbd8 pc=0x889b87 github.com/gofiber/fiber/v2.(*App).handler-fm(0xc0000a0000?) <autogenerated>:1 +0x2c fp=0xc0001afc58 sp=0xc0001afc38 pc=0x88edac github.com/valyala/fasthttp.(*Server).serveConn(0xc0001fc400, {0xc79c80?, 0xc00008e008}) /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/server.go:2365 +0x11d3 fp=0xc0001afec8 sp=0xc0001afc58 pc=0x80fb33 github.com/valyala/fasthttp.(*Server).serveConn-fm({0xc79c80?, 0xc00008e008?}) <autogenerated>:1 +0x39 fp=0xc0001afef0 sp=0xc0001afec8 pc=0x81f3f9 github.com/valyala/fasthttp.(*workerPool).workerFunc(0xc000117680, 0xc00009e000) /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/workerpool.go:224 +0xa9 fp=0xc0001affa0 sp=0xc0001afef0 pc=0x81b629 github.com/valyala/fasthttp.(*workerPool).getCh.func1() /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/workerpool.go:196 +0x38 fp=0xc0001affe0 sp=0xc0001affa0 pc=0x81b398 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0001affe8 sp=0xc0001affe0 pc=0x4ac9c1 created by github.com/valyala/fasthttp.(*workerPool).getCh /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/workerpool.go:195 +0x1b0 goroutine 1 [IO wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc0001cd418 sp=0xc0001cd3f8 pc=0x47e016 runtime.netpollblock(0x7fa500316548?, 0x449b8f?, 0x0?) /usr/local/go/src/runtime/netpoll.go:527 +0xf7 fp=0xc0001cd450 sp=0xc0001cd418 pc=0x476977 internal/poll.runtime_pollWait(0x7fa5002ea418, 0x72) /usr/local/go/src/runtime/netpoll.go:306 +0x89 fp=0xc0001cd470 sp=0xc0001cd450 pc=0x4a76c9 internal/poll.(*pollDesc).wait(0xc000166b00?, 0x4?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32 fp=0xc0001cd498 sp=0xc0001cd470 pc=0x51ae92 internal/poll.(*pollDesc).waitRead(…) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Accept(0xc000166b00) /usr/local/go/src/internal/poll/fd_unix.go:614 +0x2bd fp=0xc0001cd540 sp=0xc0001cd498 pc=0x52079d net.(*netFD).accept(0xc000166b00) /usr/local/go/src/net/fd_unix.go:172 +0x35 fp=0xc0001cd5f8 sp=0xc0001cd540 pc=0x5a8c15 net.(*TCPListener).accept(0xc000012828) /usr/local/go/src/net/tcpsock_posix.go:148 +0x25 fp=0xc0001cd620 sp=0xc0001cd5f8 pc=0x5beea5 net.(*TCPListener).Accept(0xc000012828) /usr/local/go/src/net/tcpsock.go:297 +0x3d fp=0xc0001cd650 sp=0xc0001cd620 pc=0x5bdf9d github.com/valyala/fasthttp.acceptConn(0xc0001fc400, {0xc773e0, 0xc000012828}, 0xc0001cd848) /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/server.go:1930 +0x62 fp=0xc0001cd730 sp=0xc0001cd650 pc=0x80e002 github.com/valyala/fasthttp.(*Server).Serve(0xc0001fc400, {0xc773e0?, 0xc000012828}) /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/server.go:1823 +0x4f4 fp=0xc0001cd878 sp=0xc0001cd730 pc=0x80d614 github.com/gofiber/fiber/v2.(*App).Listen(0xc000138d80, {0xbb0b88?, 0x7?}) /go/pkg/mod/github.com/gofiber/fiber/v2@v2.45.0/listen.go:82 +0x110 fp=0xc0001cd8d8 sp=0xc0001cd878 pc=0x880a30 main.main.func1(0xc0001cdbc8?) /build/main.go:96 +0x2f9 fp=0xc0001cd9b8 sp=0xc0001cd8d8 pc=0x909919 github.com/urfave/cli/v2.(*Command).Run(0xc0001ba160, 0xc00006a800, {0xc000024060, 0x2, 0x2}) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/command.go:274 +0x9eb fp=0xc0001cdc58 sp=0xc0001cd9b8 pc=0x8f786b github.com/urfave/cli/v2.(*App).RunContext(0xc0001b6000, {0xc776b8?, 0xc000028078}, {0xc000024060, 0x2, 0x2}) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/app.go:332 +0x616 fp=0xc0001cdcc8 sp=0xc0001cdc58 pc=0x8f4676 github.com/urfave/cli/v2.(*App).Run(…) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/app.go:309 main.main() /build/main.go:100 +0xbae fp=0xc0001cdf80 sp=0xc0001cdcc8 pc=0x90954e runtime.main() /usr/local/go/src/runtime/proc.go:250 +0x207 fp=0xc0001cdfe0 sp=0xc0001cdf80 pc=0x47dbe7 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0001cdfe8 sp=0xc0001cdfe0 pc=0x4ac9c1 goroutine 2 [force gc (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000040fb0 sp=0xc000040f90 pc=0x47e016 runtime.goparkunlock(…) /usr/local/go/src/runtime/proc.go:387 runtime.forcegchelper() /usr/local/go/src/runtime/proc.go:305 +0xb0 fp=0xc000040fe0 sp=0xc000040fb0 pc=0x47de50 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000040fe8 sp=0xc000040fe0 pc=0x4ac9c1 created by runtime.init.6 /usr/local/go/src/runtime/proc.go:293 +0x25 goroutine 3 [GC sweep wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000041780 sp=0xc000041760 pc=0x47e016 runtime.goparkunlock(…) /usr/local/go/src/runtime/proc.go:387 runtime.bgsweep(0x0?) /usr/local/go/src/runtime/mgcsweep.go:278 +0x8e fp=0xc0000417c8 sp=0xc000041780 pc=0x46a22e runtime.gcenable.func1() /usr/local/go/src/runtime/mgc.go:178 +0x26 fp=0xc0000417e0 sp=0xc0000417c8 pc=0x45f4e6 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000417e8 sp=0xc0000417e0 pc=0x4ac9c1 created by runtime.gcenable /usr/local/go/src/runtime/mgc.go:178 +0x6b goroutine 4 [GC scavenge wait]: runtime.gopark(0xc000068000?, 0xc701e8?, 0x1?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000041f70 sp=0xc000041f50 pc=0x47e016 runtime.goparkunlock(…) /usr/local/go/src/runtime/proc.go:387 runtime.(*scavengerState).park(0x1060e60) /usr/local/go/src/runtime/mgcscavenge.go:400 +0x53 fp=0xc000041fa0 sp=0xc000041f70 pc=0x468153 runtime.bgscavenge(0x0?) /usr/local/go/src/runtime/mgcscavenge.go:628 +0x45 fp=0xc000041fc8 sp=0xc000041fa0 pc=0x468725 runtime.gcenable.func2() /usr/local/go/src/runtime/mgc.go:179 +0x26 fp=0xc000041fe0 sp=0xc000041fc8 pc=0x45f486 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000041fe8 sp=0xc000041fe0 pc=0x4ac9c1 created by runtime.gcenable /usr/local/go/src/runtime/mgc.go:179 +0xaa goroutine 5 [finalizer wait]: runtime.gopark(0x1a0?, 0x1061b40?, 0x60?, 0x78?, 0xc000040770?) /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000040628 sp=0xc000040608 pc=0x47e016 runtime.runfinq() /usr/local/go/src/runtime/mfinal.go:193 +0x107 fp=0xc0000407e0 sp=0xc000040628 pc=0x45e527 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000407e8 sp=0xc0000407e0 pc=0x4ac9c1 created by runtime.createfing /usr/local/go/src/runtime/mfinal.go:163 +0x45 goroutine 6 [sleep]: runtime.gopark(0xf34e8098faa?, 0xc000042788?, 0x5?, 0xd8?, 0xc0001176b0?) /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000042758 sp=0xc000042738 pc=0x47e016 time.Sleep(0x2540be400) /usr/local/go/src/runtime/time.go:195 +0x135 fp=0xc000042798 sp=0xc000042758 pc=0x4a9835 github.com/valyala/fasthttp.(*workerPool).Start.func2() /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/workerpool.go:67 +0x56 fp=0xc0000427e0 sp=0xc000042798 pc=0x81aaf6 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000427e8 sp=0xc0000427e0 pc=0x4ac9c1 created by github.com/valyala/fasthttp.(*workerPool).Start /go/pkg/mod/github.com/valyala/fasthttp@v1.47.0/workerpool.go:59 +0xdd rax 0x7fa4e8005398 rbx 0xffffffff rcx 0x20 rdx 0x4c46d8c rdi 0x7fa4e8005408 rsi 0x16e0 rbp 0x7fa4fbffebf0 rsp 0x7fa4fbffd730 r8 0x7fa4e8003eb0 r9 0x7fa4e8000080 r10 0x4 r11 0x0 r12 0x7fa4fbffec70 r13 0x7fa4fbffedb0 r14 0x7fa4e8003eb0 r15 0xc000080000 rip 0xa893c4 rflags 0x10246 cs 0x33 fs 0x0 gs 0x0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 27 (3 by maintainers)

Most upvoted comments

I have the same problem. I googled a bit and there are a few things that point to the cpu not having the avx2 instruction (https://github.com/flashlight/wav2letter/issues/604). I don’t know enough about cpus or the interals of the code to be sure, but it makes sense to me. Probably a cflag in the build would fix it, or to buy a new computer (pre 2013 cpus seem to have the problem). Obviously I would like it much more to have the software-solution, but… well… EDIT: My cpu doesnt have AVX at all (Xeon X5650) - maybe thats the problem and not avx2, which is “only” faster avx, as far as i understand.

Just in case, GitHub supports spoilers for huge pages of wonderful content.

confirming that issue occurs when there is no avx2 support. i have tried to run vicuna based model on different server configurations:

* cpu with avx2 support — OK

* cpu with avx only — FAILED, but llama.cpp runs well

I think there is a problem while go-llama linkings building process.

Can you try building LocalAI from source with:

CMAKE_ARGS="-DLLAMA_AVX2=OFF" make build

That should build LocalAI without avx2 on llama.cpp

That didn’t work. Still getting the same error. Does it mean that problem is not in AVX2 bindings?