[GH-ISSUE #9820] model create fails in AIX #52941

Closed
opened 2026-04-29 01:25:45 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @ayappanec on GitHub (Mar 17, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9820

What is the issue?

I am running ollama-0.5.1 in AIX. While trying to create a model , it failed with the below error.

$ cat Modelfile
FROM /gguf_model/Llama-3.2-3B-Instruct-uncensored-f16.gguf

$ /ollama-0.5.1/ollama create my_model
transferring model data 100%
Error: Post "http://127.0.0.1:11434/api/create": EOF

From the Ollama server.,

[GIN] 2025/03/17 - 08:08:10 | 200 | 19µs | 127.0.0.1 | HEAD "/"
[GIN] 2025/03/17 - 08:09:20 | 201 | 44.290868s | 127.0.0.1 | POST "/api/blobs/sha256:5e9d2be67300511a12ea4d10348c23f6c630f02bbaf5242d42f446cdabbbcd7c"
panic: runtime error: makeslice: len out of range

goroutine 16 [running]:
github.com/ollama/ollama/llm.readGGUFString(0xa00010000452808, {0xa00000046c5f9c0, 0xa000100008fa258})
/ollama-0.5.1/llm/gguf.go:333 +0x118
github.com/ollama/ollama/llm.(*gguf).Decode(0xa00010000452808, {0x1101dbe60, 0xa000100008fa258})
/ollama-0.5.1/llm/gguf.go:145 +0xf0
github.com/ollama/ollama/llm.(*containerGGUF).Decode(0xa000100008b2140, {0x1101dbe60, 0xa000100008fa258})
/ollama-0.5.1/llm/gguf.go:67 +0x21c
github.com/ollama/ollama/llm.DecodeGGML({0x1101db1d8, 0xa0001000011a2a8}, 0x10?)
/ollama-0.5.1/llm/ggml.go:346 +0x458
github.com/ollama/ollama/server.parseFromFile({0x1101dfc88, 0xa000100008b20a0}, {0x100e953d8, 0x5}, {0x0, 0x0, 0x0}, 0xa0001000011a2a8, {0xa00010000644321, 0x47}, ...)
/ollama-0.5.1/server/model.go:187 +0x334
github.com/ollama/ollama/server.CreateModel({0x1101dfc88, 0xa000100008b20a0}, {{0x100eaa5c3, 0x12}, {0x100e9e0a1, 0x7}, {0xa00010000412510, 0x8}, {0x100e9a5cc, 0x6}}, ...)
/ollama-0.5.1/server/images.go:412 +0x714
github.com/ollama/ollama/server.(*Server).CreateHandler.func1()
/ollama-0.5.1/server/routes.go:695 +0x224
created by github.com/ollama/ollama/server.(*Server).CreateHandler in goroutine 72
/ollama-0.5.1/server/routes.go:685 +0x964

The model "Llama-3.2-3B-Instruct-uncensored-f16.gguf" is already converted to Big Endian (AIX is Big Endian) by making use of the script "gguf_convert_endian.py" from llama.cpp.

OS

AIX

GPU

No GPU

CPU

Power9

Ollama version

0.5.1

Originally created by @ayappanec on GitHub (Mar 17, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9820 ### What is the issue? I am running ollama-0.5.1 in AIX. While trying to create a model , it failed with the below error. $ cat Modelfile FROM /gguf_model/Llama-3.2-3B-Instruct-uncensored-f16.gguf $ /ollama-0.5.1/ollama create my_model transferring model data 100% Error: Post "http://127.0.0.1:11434/api/create": EOF From the Ollama server., [GIN] 2025/03/17 - 08:08:10 | 200 | 19µs | 127.0.0.1 | HEAD "/" [GIN] 2025/03/17 - 08:09:20 | 201 | 44.290868s | 127.0.0.1 | POST "/api/blobs/sha256:5e9d2be67300511a12ea4d10348c23f6c630f02bbaf5242d42f446cdabbbcd7c" panic: runtime error: makeslice: len out of range goroutine 16 [running]: github.com/ollama/ollama/llm.readGGUFString(0xa00010000452808, {0xa00000046c5f9c0, 0xa000100008fa258}) /ollama-0.5.1/llm/gguf.go:333 +0x118 github.com/ollama/ollama/llm.(*gguf).Decode(0xa00010000452808, {0x1101dbe60, 0xa000100008fa258}) /ollama-0.5.1/llm/gguf.go:145 +0xf0 github.com/ollama/ollama/llm.(*containerGGUF).Decode(0xa000100008b2140, {0x1101dbe60, 0xa000100008fa258}) /ollama-0.5.1/llm/gguf.go:67 +0x21c github.com/ollama/ollama/llm.DecodeGGML({0x1101db1d8, 0xa0001000011a2a8}, 0x10?) /ollama-0.5.1/llm/ggml.go:346 +0x458 github.com/ollama/ollama/server.parseFromFile({0x1101dfc88, 0xa000100008b20a0}, {0x100e953d8, 0x5}, {0x0, 0x0, 0x0}, 0xa0001000011a2a8, {0xa00010000644321, 0x47}, ...) /ollama-0.5.1/server/model.go:187 +0x334 github.com/ollama/ollama/server.CreateModel({0x1101dfc88, 0xa000100008b20a0}, {{0x100eaa5c3, 0x12}, {0x100e9e0a1, 0x7}, {0xa00010000412510, 0x8}, {0x100e9a5cc, 0x6}}, ...) /ollama-0.5.1/server/images.go:412 +0x714 github.com/ollama/ollama/server.(*Server).CreateHandler.func1() /ollama-0.5.1/server/routes.go:695 +0x224 created by github.com/ollama/ollama/server.(*Server).CreateHandler in goroutine 72 /ollama-0.5.1/server/routes.go:685 +0x964 The model "Llama-3.2-3B-Instruct-uncensored-f16.gguf" is already converted to Big Endian (AIX is Big Endian) by making use of the script "gguf_convert_endian.py" from llama.cpp. ### OS AIX ### GPU No GPU ### CPU Power9 ### Ollama version 0.5.1
GiteaMirror added the bug label 2026-04-29 01:25:45 -05:00
Author
Owner

@pdevine commented on GitHub (Mar 17, 2025):

Hey @ayappanec , thanks for the issue.

Unfortunately Ollama only supports little endian right now which is almost certainly why it blew up. There currently aren't plans to support big endian unless we had a lot of demand for it. It's a pretty major architectural change.

I'm going to close the issue as not planned, but we can revisit in the future.

<!-- gh-comment-id:2730386142 --> @pdevine commented on GitHub (Mar 17, 2025): Hey @ayappanec , thanks for the issue. Unfortunately Ollama *only* supports little endian right now which is almost certainly why it blew up. There currently aren't plans to support big endian unless we had a lot of demand for it. It's a pretty major architectural change. I'm going to close the issue as not planned, but we can revisit in the future.
Author
Owner

@ayappanec commented on GitHub (Apr 2, 2025):

Debugging this, I see in DecodeGGML there are switch statements to handle BigEndian as well. The magic constant for the Big Endian converted model is still coming as 0x46554747 (FILE_MAGIC_GGUF_LE). So when I changed the binary.Read to use BigEndian, then things start to working in AIX.

var magic uint32
if err := binary.Read(rs, binary.BigEndian, &magic); err != nil {
         return nil, 0, err
 }
<!-- gh-comment-id:2772565157 --> @ayappanec commented on GitHub (Apr 2, 2025): Debugging this, I see in DecodeGGML there are switch statements to handle BigEndian as well. The magic constant for the Big Endian converted model is still coming as 0x46554747 (FILE_MAGIC_GGUF_LE). So when I changed the `binary.Read` to use BigEndian, then things start to working in AIX. ``` var magic uint32 if err := binary.Read(rs, binary.BigEndian, &magic); err != nil { return nil, 0, err } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#52941