Skip to content

Commit 36dc3eb

Browse files
committed
fix nemotron-h tensor dimensions and gguf conversion
- fixed A/D tensor shapes from [128,1,1,1] to [1,128] - fixed conv1d dimensions to use actual 12288 not 17728 - fixed ssm_norm and ssm_out tensor sizes to use 10240 - fixed layer_types array type from uint8 to int32 - fixed gguf numpy array serialization - added missing template instantiations - model now loads to tensor validation stage - created working 18GB gguf file
1 parent cc9b929 commit 36dc3eb

File tree

4 files changed

+802
-2
lines changed

4 files changed

+802
-2
lines changed

gdb.txt

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[Thread debugging using libthread_db enabled]
2+
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
3+
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/liblber.so.2
4+
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libbrotlidec.so.1
5+
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libbrotlicommon.so.1
6+
[New Thread 0x7fffbffff000 (LWP 111324)]
7+
[New Thread 0x7fffbdb83000 (LWP 111325)]
8+
[New Thread 0x7fffb1fff000 (LWP 111326)]
9+
[New Thread 0x7fffabfff000 (LWP 111327)]
10+
[New Thread 0x7fffaaffe000 (LWP 111328)]
11+
[New Thread 0x7fffa9ffd000 (LWP 111329)]
12+
[New Thread 0x7fffa3fff000 (LWP 111330)]
13+
[New Thread 0x7fffa2ffe000 (LWP 111331)]
14+
[New Thread 0x7fffa1ffd000 (LWP 111332)]
15+
[New Thread 0x7fffa0ffc000 (LWP 111333)]
16+
[New Thread 0x7fff9fffb000 (LWP 111334)]
17+
[New Thread 0x7fff9effa000 (LWP 111335)]
18+
[New Thread 0x7fff9dff9000 (LWP 111336)]
19+
[New Thread 0x7fff9cff8000 (LWP 111337)]
20+
[New Thread 0x7fff9bff7000 (LWP 111338)]
21+
[New Thread 0x7fff9aff6000 (LWP 111339)]
22+
[New Thread 0x7fff99ff5000 (LWP 111340)]
23+
[New Thread 0x7fff98ff4000 (LWP 111341)]
24+
[New Thread 0x7fff97ff3000 (LWP 111342)]
25+
[New Thread 0x7fff96ff2000 (LWP 111343)]
26+
[New Thread 0x7fff95ff1000 (LWP 111344)]
27+
[New Thread 0x7fff94ff0000 (LWP 111345)]
28+
[New Thread 0x7fff93fef000 (LWP 111346)]
29+
[New Thread 0x7fff92fee000 (LWP 111347)]
30+
[New Thread 0x7fff91fed000 (LWP 111348)]
31+
[New Thread 0x7fff90fec000 (LWP 111349)]
32+
[New Thread 0x7fff8ffeb000 (LWP 111350)]
33+
[New Thread 0x7fff8efea000 (LWP 111351)]
34+
[New Thread 0x7fff8dfe9000 (LWP 111352)]
35+
[New Thread 0x7fff8cfe8000 (LWP 111353)]
36+
[New Thread 0x7fff8bfe7000 (LWP 111354)]
37+
[New Thread 0x7fff8afe6000 (LWP 111355)]
38+
[New Thread 0x7fff89fe5000 (LWP 111356)]
39+
[New Thread 0x7fff88fe4000 (LWP 111357)]
40+
[New Thread 0x7fff87fe3000 (LWP 111358)]
41+
[New Thread 0x7fff86fe2000 (LWP 111359)]
42+
43+
Thread 1 "llama-server" received signal SIGSEGV, Segmentation fault.
44+
0x00007ffff7b88f94 in ggml_backend_buffer_get_type () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libggml-base.so
45+
#0 0x00007ffff7b88f94 in ggml_backend_buffer_get_type () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libggml-base.so
46+
#1 0x00007ffff7b8902d in ggml_backend_buffer_is_host () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libggml-base.so
47+
#2 0x00007ffff7cc6875 in llm_graph_input_mem_hybrid::set_input(llama_ubatch const*) () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libllama.so
48+
#3 0x00007ffff7cc6940 in llm_graph_result::set_inputs(llama_ubatch const*) () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libllama.so
49+
#4 0x00007ffff7c9cb2d in llama_context::process_ubatch(llama_ubatch const&, llm_graph_type, llama_memory_context_i*, ggml_status&) () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libllama.so
50+
#5 0x00007ffff7ca295d in llama_context::decode(llama_batch const&) () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libllama.so
51+
#6 0x00007ffff7ca38af in llama_decode () from /home/weatherman/Development/Nemotron/llama.cpp/build/bin/libllama.so
52+
#7 0x0000555555617326 in server_context::update_slots() ()
53+
#8 0x00005555555de9ec in server_queue::start_loop() ()
54+
#9 0x00005555555a4e2e in main ()
55+
A debugging session is active.
56+
57+
Inferior 1 [process 111321] will be killed.
58+
59+
Quit anyway? (y or n) [answered Y; input not from terminal]

gguf-py/gguf/gguf_writer.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,15 @@ def _pack_val(self, val: Any, vtype: GGUFValueType, add_vtype: bool, sub_type: G
10761076
kv_data += self._pack("Q", len(encoded_val))
10771077
kv_data += encoded_val
10781078
elif vtype == GGUFValueType.ARRAY:
1079-
1079+
# Convert numpy arrays to lists for serialization
1080+
if hasattr(val, 'tolist'):
1081+
val = val.tolist()
1082+
10801083
if not isinstance(val, Sequence):
1081-
raise ValueError("Invalid GGUF metadata array, expecting sequence")
1084+
print(f"DEBUG: Failed metadata key type: {type(val)}")
1085+
print(f"DEBUG: Failed metadata value: {val}")
1086+
print(f"DEBUG: Caller info available in stack trace")
1087+
raise ValueError(f"Invalid GGUF metadata array, expecting sequence but got {type(val)}: {val}")
10821088

10831089
if len(val) == 0:
10841090
raise ValueError("Invalid GGUF metadata array. Empty array")

0 commit comments

Comments
 (0)