aday777 commited on
Commit
da634e8
·
verified ·
1 Parent(s): 3a30fd4

Add tiny deterministic glm5_next (GLM-5.3-Flash) random-init text fixture for loader/CI tests

Browse files
LICENSE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 usefulHuggingface
4
+
5
+ Permission is hereby granted, to anyone obtaining a copy of this fixture and its
6
+ associated documentation files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use, copy, modify, merge,
8
+ publish, distribute, sublicense, and/or sell copies of the Software, and to permit
9
+ persons to whom the Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ The Software is provided "as is", without warranty of any kind, express or implied,
16
+ including but not limited to warranty of merchantability, fitness for a particular
17
+ purpose and noninfringement. In no event shall the authors or copyright holders be
18
+ liable for any claim, or damages or other liability, whether in an action of
19
+ contract, tort or otherwise, arising from or in connection with the Software or its
20
+ use or other dealings in it.
README.md ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - zai-org/GLM-5.3-Flash
4
+ tags:
5
+ - glm5_next
6
+ - fixture
7
+ - testing
8
+ pipeline_tag: text-generation
9
+ ---
10
+
11
+ # GLM-5.3-Flash tiny architecture fixture (glm5_next)
12
+
13
+ A ~0.27M-parameter random-init TEXT checkpoint plus a reduced, nested config that
14
+ reproduces the **GLM-5.3-Flash** `glm5_next` schema, so loaders, quant planners,
15
+ and CI jobs can exercise the new multimodal-MoE config parsing, expert-table
16
+ sizing, and safetensors load path without the real weights.
17
+
18
+ > **Support this work** — if this saved you time, donate BTC:
19
+ > `bc1q5ayht3fxhj0v95fk0z8l2f6900g3awdsw5842p`
20
+
21
+ ## What this is
22
+ - Base architecture: `zai-org/GLM-5.3-Flash` (released 2026-08-25),
23
+ `model_type: glm5_next`, `architectures: ["Glm5NextForConditionalGeneration"]`.
24
+ The base is a large multimodal MoE that cannot be instantiated in a unit test,
25
+ in CI, or on a laptop.
26
+ - What this fixture is: a byte-reproducible **random-init** text checkpoint plus a
27
+ reduced config that keeps the real top-level wrapper fields (`model_type`,
28
+ `architectures`, `image_token_id`, `language_model_only`, `text_config`,
29
+ `vision_config`) and the GLM MoE field names inside `text_config`, including the
30
+ dense-to-MoE layer schedule (`first_k_dense_replace`, routed + shared experts).
31
+ - What it is **not**: not trained, not distilled, not a quality or benchmark claim,
32
+ and not a quantization of anything.
33
+ - Why it is useful: it lets you test config parsing, weight-name mapping,
34
+ expert-table sizing, router/top-k bookkeeping, and safetensors load paths in
35
+ milliseconds, and it exercises the `glm5_next` wrapper shape that the plain
36
+ `glm_moe_dsa` text fixture does not.
37
+
38
+ ## Fixture geometry (what this checkpoint actually contains)
39
+ | Field | Value |
40
+ |---|---|
41
+ | num_hidden_layers | 4 |
42
+ | hidden_size | 64 |
43
+ | num_attention_heads / num_key_value_heads | 4 / 4 |
44
+ | head_dim | 16 |
45
+ | n_routed_experts | 8 |
46
+ | num_experts_per_tok | 2 |
47
+ | n_shared_experts | 1 |
48
+ | n_group | 1 |
49
+ | first_k_dense_replace | 1 |
50
+ | moe_intermediate_size | 32 |
51
+ | intermediate_size (dense) | 128 |
52
+ | num_nextn_predict_layers | 0 |
53
+ | dtype | float32 |
54
+ | vocab_size | 256 |
55
+
56
+ Total: 113 tensors, 1,097,984 data bytes = 274,496 float32 parameters.
57
+
58
+ ## Intentional omissions (documented, not silent)
59
+ - **Text-only.** No vision encoder or projector tensors; `vision_config` is a
60
+ placeholder. A full multimodal loader must supply vision/projector tensors and
61
+ remap names.
62
+ - No MTP / next-n-predictor head (`num_nextn_predict_layers: 0`).
63
+ - No `lm_head` tensor; a loader must tie to `model.embed_tokens.weight` or supply
64
+ its own head.
65
+ - Tokenizer metadata files are placeholders (no vocab file); use your own tokenizer.
66
+ - Weight names are a reduced text-only convention; they are not guaranteed to match
67
+ every tensor a full `Glm5NextForConditionalGeneration` loader expects.
68
+
69
+ ## Verification actually performed (stdlib only, no torch in this environment)
70
+ - safetensors header parses: 113 tensors, contiguous `data_offsets`, header padded
71
+ to 8-byte alignment; `__metadata__` records the generator string.
72
+ - `checksums.txt` records the SHA-256 of every tensor blob.
73
+ - Deterministic regeneration: SplitMix64 seed 20260902, Box-Muller normals, scale
74
+ 0.02, float32 row-major, consumed in sorted-name order.
75
+ - Generator script is included as `build_fixture.py` so the folder can be rebuilt
76
+ and diffed.
77
+
78
+ **Not yet verified:** loading under a specific `transformers` version (no
79
+ torch/transformers in the build environment), and whether
80
+ `Glm5NextForConditionalGeneration` accepts this reduced text-only geometry without
81
+ extra fields. Treat those as open until run against a real install.
82
+
83
+ ## How to use
84
+ Read the tensors with the standard library (no torch needed, matching how this was
85
+ built):
86
+
87
+ ```python
88
+ import json, struct
89
+ with open("model.safetensors", "rb") as f:
90
+ n = struct.unpack("<Q", f.read(8))[0]
91
+ header = json.loads(f.read(n))
92
+ # header[name] = {"dtype", "shape", "data_offsets"}; data starts at byte 8+n
93
+ ```
94
+
95
+ Or with the `safetensors` package:
96
+
97
+ ```python
98
+ from safetensors.torch import load_file
99
+ tensors = load_file("model.safetensors") # {name: tensor}
100
+ ```
101
+
102
+ To exercise a real loader, build a config from `config.json` (the `glm5_next`
103
+ model type; use `AutoConfig.from_pretrained(..., trust_remote_code=True)` where
104
+ needed) and feed these weights in. There is no `lm_head` tensor, no vision stack,
105
+ and the tokenizer files are placeholders, so supply your own head/tokenizer/vision.
106
+
107
+ ## License
108
+ The generated fixture content (random weights, config, scripts) is released under
109
+ MIT (see `LICENSE`). The `glm5_next` architecture and config schema belong to the
110
+ base model `zai-org/GLM-5.3-Flash` under its own terms, which were **not**
111
+ independently re-verified this cycle — check the base repository before
112
+ redistribution.
113
+
114
+ ## Citation
115
+ Zhipu AI / Z.ai, GLM-5.3-Flash, 2026.
116
+
117
+ ## Support this work
118
+ If this saved you time or money, consider a donation:
119
+ **Bitcoin:** `bc1q5ayht3fxhj0v95fk0z8l2f6900g3awdsw5842p`
build_fixture.py ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build a tiny, deterministic random-init glm5_next TEXT-stack fixture (stdlib only).
3
+
4
+ Purpose: zai-org/GLM-5.3-Flash (released 2026-08-25) is a large multimodal
5
+ Glm5NextForConditionalGeneration MoE, so nobody can instantiate it in CI or on a
6
+ laptop. This fixture ships a ~0.3 MB random-init TEXT checkpoint plus a reduced,
7
+ nested config (model_type glm5_next, text_config with the GLM MoE schema) so
8
+ loaders, quant planners, and CI jobs can exercise the new architecture's config
9
+ parsing, expert-table sizing, and safetensors load path without the real weights.
10
+
11
+ Random-init: NOT trained and NOT a quality claim. Weight names are a reduced
12
+ text-only convention (see README omissions); a full multimodal loader must supply
13
+ vision/projector tensors and remap names. Geometry is documented in the README.
14
+ """
15
+ import hashlib
16
+ import json
17
+ import math
18
+ import os
19
+ import struct
20
+
21
+ M64 = (1 << 64) - 1
22
+ SEED = 20260902
23
+ SCALE = 0.02
24
+
25
+ # ---- tiny geometry (reduced from the real text_config, documented in README) ----
26
+ VOCAB = 256
27
+ HIDDEN = 64
28
+ LAYERS = 4
29
+ HEADS = 4
30
+ KV_HEADS = 4
31
+ HEAD_DIM = 16
32
+ DENSE_INTER = 128
33
+ MOE_INTER = 32
34
+ N_ROUTED = 8
35
+ TOPK = 2
36
+ N_SHARED = 1
37
+ FIRST_DENSE = 1
38
+ N_GROUP = 1
39
+
40
+
41
+ class SplitMix64:
42
+ """SplitMix64 + Box-Muller, identical to the llama/t5/glm_moe_dsa fixtures."""
43
+
44
+ def __init__(self, seed):
45
+ self.state = seed & M64
46
+ self._spare = None
47
+
48
+ def next_u64(self):
49
+ self.state = (self.state + 0x9E3779B97F4A7C15) & M64
50
+ z = self.state
51
+ z = ((z ^ (z >> 30)) * 0xBF584A7F17C119E3) & M64
52
+ z = ((z ^ (z >> 27)) * 0x94D049BB133111EB) & M64
53
+ return z ^ (z >> 31)
54
+
55
+ def uniform(self):
56
+ return (self.next_u64() >> 11) / float(1 << 53)
57
+
58
+ def gauss(self):
59
+ if self._spare is not None:
60
+ value, self._spare = self._spare, None
61
+ return value
62
+ u1 = 1.0 - self.uniform()
63
+ u2 = self.uniform()
64
+ radius = math.sqrt(-2.0 * math.log(u1))
65
+ theta = 2.0 * math.pi * u2
66
+ self._spare = radius * math.sin(theta)
67
+ return radius * math.cos(theta)
68
+
69
+
70
+ def build_tensors():
71
+ shapes = {
72
+ "model.embed_tokens.weight": (VOCAB, HIDDEN),
73
+ "model.norm.weight": (HIDDEN,),
74
+ }
75
+ ones = {"model.norm.weight"}
76
+ for layer in range(LAYERS):
77
+ p = "model.layers.%d." % layer
78
+ shapes[p + "input_layernorm.weight"] = (HIDDEN,)
79
+ shapes[p + "post_attention_layernorm.weight"] = (HIDDEN,)
80
+ ones.add(p + "input_layernorm.weight")
81
+ ones.add(p + "post_attention_layernorm.weight")
82
+ shapes[p + "self_attn.q_proj.weight"] = (HEADS * HEAD_DIM, HIDDEN)
83
+ shapes[p + "self_attn.k_proj.weight"] = (KV_HEADS * HEAD_DIM, HIDDEN)
84
+ shapes[p + "self_attn.v_proj.weight"] = (KV_HEADS * HEAD_DIM, HIDDEN)
85
+ shapes[p + "self_attn.o_proj.weight"] = (HIDDEN, HEADS * HEAD_DIM)
86
+ if layer < FIRST_DENSE:
87
+ shapes[p + "mlp.gate_proj.weight"] = (DENSE_INTER, HIDDEN)
88
+ shapes[p + "mlp.up_proj.weight"] = (DENSE_INTER, HIDDEN)
89
+ shapes[p + "mlp.down_proj.weight"] = (HIDDEN, DENSE_INTER)
90
+ else:
91
+ shapes[p + "mlp.gate.weight"] = (N_ROUTED, HIDDEN)
92
+ for expert in range(N_ROUTED):
93
+ e = p + "mlp.experts.%d." % expert
94
+ shapes[e + "gate_proj.weight"] = (MOE_INTER, HIDDEN)
95
+ shapes[e + "up_proj.weight"] = (MOE_INTER, HIDDEN)
96
+ shapes[e + "down_proj.weight"] = (HIDDEN, MOE_INTER)
97
+ shapes[p + "mlp.shared_experts.gate_proj.weight"] = (MOE_INTER, HIDDEN)
98
+ shapes[p + "mlp.shared_experts.up_proj.weight"] = (MOE_INTER, HIDDEN)
99
+ shapes[p + "mlp.shared_experts.down_proj.weight"] = (HIDDEN, MOE_INTER)
100
+
101
+ rng = SplitMix64(SEED)
102
+ out = {}
103
+ for name in sorted(shapes):
104
+ shape = shapes[name]
105
+ count = 1
106
+ for dim in shape:
107
+ count *= dim
108
+ if name in ones:
109
+ values = [1.0] * count
110
+ else:
111
+ values = [rng.gauss() * SCALE for _ in range(count)]
112
+ blob = b"".join(
113
+ struct.pack("<f", struct.unpack("<f", struct.pack("<f", v))[0]) for v in values
114
+ )
115
+ out[name] = (list(shape), "F32", blob)
116
+ return out
117
+
118
+
119
+ def write_safetensors(path, tensors, metadata):
120
+ header = {"__metadata__": metadata}
121
+ offset = 0
122
+ blobs = []
123
+ for name in sorted(tensors):
124
+ shape, dtype, blob = tensors[name]
125
+ header[name] = {"dtype": dtype, "shape": shape,
126
+ "data_offsets": [offset, offset + len(blob)]}
127
+ offset += len(blob)
128
+ blobs.append(blob)
129
+ raw = json.dumps(header, separators=(",", ":")).encode("utf-8")
130
+ raw += b" " * ((-len(raw)) % 8)
131
+ with open(path, "wb") as handle:
132
+ handle.write(struct.pack("<Q", len(raw)))
133
+ handle.write(raw)
134
+ for blob in blobs:
135
+ handle.write(blob)
136
+ return len(raw), offset
137
+
138
+
139
+ def main():
140
+ out_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
141
+ "glm5_next_tiny_fixture")
142
+ os.makedirs(out_dir, exist_ok=True)
143
+
144
+ tensors = build_tensors()
145
+ metadata = {
146
+ "format": "pt",
147
+ "source": "usefulHuggingface",
148
+ "generator": "SplitMix64 seed=%d Box-Muller scale=%s float32 row-major" % (SEED, SCALE),
149
+ }
150
+ header_len, data_len = write_safetensors(
151
+ os.path.join(out_dir, "model.safetensors"), tensors, metadata)
152
+
153
+ text_config = {
154
+ "attention_bias": False,
155
+ "attention_dropout": 0.0,
156
+ "dtype": "float32",
157
+ "first_k_dense_replace": FIRST_DENSE,
158
+ "head_dim": HEAD_DIM,
159
+ "hidden_act": "silu",
160
+ "hidden_size": HIDDEN,
161
+ "intermediate_size": DENSE_INTER,
162
+ "max_position_embeddings": 256,
163
+ "model_type": "glm_moe_dsa",
164
+ "moe_intermediate_size": MOE_INTER,
165
+ "moe_layer_freq": 1,
166
+ "moe_router_dtype": "float32",
167
+ "n_group": N_GROUP,
168
+ "n_routed_experts": N_ROUTED,
169
+ "n_shared_experts": N_SHARED,
170
+ "norm_topk_prob": True,
171
+ "num_attention_heads": HEADS,
172
+ "num_experts_per_tok": TOPK,
173
+ "num_hidden_layers": LAYERS,
174
+ "num_key_value_heads": KV_HEADS,
175
+ "num_nextn_predict_layers": 0,
176
+ "pad_token_id": 0,
177
+ "rms_norm_eps": 1e-5,
178
+ "rope_theta": 10000.0,
179
+ "tie_word_embeddings": False,
180
+ "vocab_size": VOCAB,
181
+ }
182
+ config = {
183
+ "architectures": ["Glm5NextForConditionalGeneration"],
184
+ "image_token_id": 248056,
185
+ "language_model_only": True,
186
+ "model_type": "glm5_next",
187
+ "text_config": text_config,
188
+ "vision_config": {
189
+ "model_type": "glm5_next_vision",
190
+ "_note": "placeholder; this fixture ships NO vision/projector tensors",
191
+ },
192
+ }
193
+ with open(os.path.join(out_dir, "config.json"), "w") as handle:
194
+ json.dump(config, handle, indent=2, sort_keys=True)
195
+ handle.write("\n")
196
+
197
+ with open(os.path.join(out_dir, "generation_config.json"), "w") as handle:
198
+ json.dump({"bos_token_id": 1, "eos_token_id": 2, "pad_token_id": 0,
199
+ "no_repeat_ngram_size": 4, "seed": SEED},
200
+ handle, indent=2, sort_keys=True)
201
+ handle.write("\n")
202
+
203
+ with open(os.path.join(out_dir, "tokenizer_config.json"), "w") as handle:
204
+ json.dump({"model_max_length": 256, "bos_token": "<s>", "eos_token": "</s>",
205
+ "unk_token": "<unk>", "pad_token": "<pad>",
206
+ "model_input_names": ["input_ids"]},
207
+ handle, indent=2, sort_keys=True)
208
+ handle.write("\n")
209
+
210
+ with open(os.path.join(out_dir, "special_tokens_map.json"), "w") as handle:
211
+ json.dump({"additional_special_tokens": ["<pad>", "<unk>"],
212
+ "bos_token": "<s>", "eos_token": "</s>",
213
+ "pad_token": "<pad>", "unk_token": "<unk>"},
214
+ handle, indent=2, sort_keys=True)
215
+ handle.write("\n")
216
+
217
+ lines = []
218
+ for name in sorted(tensors):
219
+ shape, dtype, blob = tensors[name]
220
+ lines.append("%s %s %s %d %s" % (name, dtype, "x".join(map(str, shape)),
221
+ len(blob), hashlib.sha256(blob).hexdigest()))
222
+ with open(os.path.join(out_dir, "checksums.txt"), "w") as handle:
223
+ handle.write("\n".join(lines) + "\n")
224
+
225
+ print("header_len=%d data_len=%d tensors=%d" % (header_len, data_len, len(tensors)))
226
+ print("total_params=%d" % (data_len // 4))
227
+
228
+
229
+ if __name__ == "__main__":
230
+ main()
checksums.txt ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model.embed_tokens.weight F32 256x64 65536 3f08fae9d37de444222eb24ce889219d33194a0926d3608567123d6ea830d34a
2
+ model.layers.0.input_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
3
+ model.layers.0.mlp.down_proj.weight F32 64x128 32768 0375aae08165668b25ee3a7004cdfeb5bbc57ed3fd6d4a33f9ef890e55f70963
4
+ model.layers.0.mlp.gate_proj.weight F32 128x64 32768 03cd8858bcd40438059313cae0caf6187d63ec305f8add9c13ad2e83c20f38cb
5
+ model.layers.0.mlp.up_proj.weight F32 128x64 32768 96296b1cbb174cc87c94c16384c08f9c510fec91cb4d397dc8e25fdfaf13f5c0
6
+ model.layers.0.post_attention_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
7
+ model.layers.0.self_attn.k_proj.weight F32 64x64 16384 0cae826683e4036d31f4ca0a028d5a87f5391597721cb201ad2fd732d0afb699
8
+ model.layers.0.self_attn.o_proj.weight F32 64x64 16384 4901df19dc9ca637ab7c08e24492cb392e50d3aa139a805ab5650c347b910fc2
9
+ model.layers.0.self_attn.q_proj.weight F32 64x64 16384 4e765d6088d268738e292837486ad9fb742f8dff7cb0fb72224a8d50387974df
10
+ model.layers.0.self_attn.v_proj.weight F32 64x64 16384 a5e346bd2b98e2c25092ddf73c53d1a479509e37fffc7b977e2937aa73a7595a
11
+ model.layers.1.input_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
12
+ model.layers.1.mlp.experts.0.down_proj.weight F32 64x32 8192 279711947ecbc3ac3dd8dc17439f3b1c0082a08ed24f47e24a10c33ea0fbd6d3
13
+ model.layers.1.mlp.experts.0.gate_proj.weight F32 32x64 8192 e74fd4d2830af3c41e66f0c8eecfd5399becd376e61babd56533533b54bff885
14
+ model.layers.1.mlp.experts.0.up_proj.weight F32 32x64 8192 6ed90b406b4413fe730ee8cdb2209657f7dba109b250ff0199f7626005c2538a
15
+ model.layers.1.mlp.experts.1.down_proj.weight F32 64x32 8192 ad118a14bc6b69cb4c0fc29814210c19084a5f515182d865ff219aaf51bc7491
16
+ model.layers.1.mlp.experts.1.gate_proj.weight F32 32x64 8192 42e75af8e6683f338112392057b6e8d5ec801b8d43fed64c50422f4224c51996
17
+ model.layers.1.mlp.experts.1.up_proj.weight F32 32x64 8192 8ef0d38661b7989dbd3786a2383714f73e5ee2388d40e1933dcb917321a4949e
18
+ model.layers.1.mlp.experts.2.down_proj.weight F32 64x32 8192 de1196042c6b1cbc269df9e37919e2dfa4eed0cb7612b61f967d1234b27ebb27
19
+ model.layers.1.mlp.experts.2.gate_proj.weight F32 32x64 8192 fd9b100fb7677bc8df41661d85423059d8fdfca77da78af37ced208f6e874e67
20
+ model.layers.1.mlp.experts.2.up_proj.weight F32 32x64 8192 70988275a0e98f0e52d547f287b8bd8954dbe7c2a7701112af907187617b3b6e
21
+ model.layers.1.mlp.experts.3.down_proj.weight F32 64x32 8192 fc8d1bf7bc01d7b684128f9c13348f7942fa016acea8f3a82dd004f655b242be
22
+ model.layers.1.mlp.experts.3.gate_proj.weight F32 32x64 8192 fc421d4c1c8fe03327b24550e37a3eed5a51ae65c4739b31070d45b16f73d595
23
+ model.layers.1.mlp.experts.3.up_proj.weight F32 32x64 8192 32c31a5cf5a4e6c02deddac8ab95e090aee724c750aa4c0bd9ea87734d53c4e5
24
+ model.layers.1.mlp.experts.4.down_proj.weight F32 64x32 8192 7577cac4c580dd0da393e60c1f34ee8645a7ae4865be00322cac09652a35ea4e
25
+ model.layers.1.mlp.experts.4.gate_proj.weight F32 32x64 8192 713a0e9a60f971dd60e68a6d949dadd515efe6d18f641bddaf504d3bec91f1c6
26
+ model.layers.1.mlp.experts.4.up_proj.weight F32 32x64 8192 85ce40ba76af6888160affc5e01951a526e51a95bd639605c969ca2d6ef4ee92
27
+ model.layers.1.mlp.experts.5.down_proj.weight F32 64x32 8192 d20c0d35be7b3323d92636cb7e39a39a948bd52dc153e95d026a11803aa7f673
28
+ model.layers.1.mlp.experts.5.gate_proj.weight F32 32x64 8192 62014ab5052b892c179b08468ea01d1ad40ed3c5264409d11d0e1f8a7b2c2de2
29
+ model.layers.1.mlp.experts.5.up_proj.weight F32 32x64 8192 ad6eeb1fe64a1a640baafbd095b79b192ffa6eb878229234359ce2072bb8a4d2
30
+ model.layers.1.mlp.experts.6.down_proj.weight F32 64x32 8192 975376b67f5e8a541d89103cbfad7cd94d35ab556fe45e559938c58c33b347c5
31
+ model.layers.1.mlp.experts.6.gate_proj.weight F32 32x64 8192 ee242f8c3ed900bcbc3ccf83a5e9e59a4214fc971c886ad0cc8aa733346aaecd
32
+ model.layers.1.mlp.experts.6.up_proj.weight F32 32x64 8192 ef558feb9cbf058bf3b39593aba1f19f39087541dec7a70ba6d7e3cd5d1ec750
33
+ model.layers.1.mlp.experts.7.down_proj.weight F32 64x32 8192 698d3b421a9d4d95b97be99964a34c4417db7d83184026aaf9bdf8c6a8676922
34
+ model.layers.1.mlp.experts.7.gate_proj.weight F32 32x64 8192 a510f391c49b7ad1df9b9c1c3f7912d9396e4df6fd7f1a2b9f0715865b1e11d7
35
+ model.layers.1.mlp.experts.7.up_proj.weight F32 32x64 8192 444de5d44f902cce43803b48b6dd0bbc2d9c24ced1cedaa428a26625a53c404a
36
+ model.layers.1.mlp.gate.weight F32 8x64 2048 f6364a5c9d11bd85dd9b4ab90f81694ac96636dd2333184834d930e2d642217a
37
+ model.layers.1.mlp.shared_experts.down_proj.weight F32 64x32 8192 b19a13624210fdd6666b94b0a0a0fcc20f22fd42f99a0b60f21a894fb0d298c9
38
+ model.layers.1.mlp.shared_experts.gate_proj.weight F32 32x64 8192 b53b49ee42efa9c95c0b30f738a1b65781e66ebbb83b077c63f397843c325fe5
39
+ model.layers.1.mlp.shared_experts.up_proj.weight F32 32x64 8192 012fae14bd9ab21630e85e7b47c91d19f8754934996aec6c07cdfe423a809142
40
+ model.layers.1.post_attention_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
41
+ model.layers.1.self_attn.k_proj.weight F32 64x64 16384 b0e3470d1e576cdf5a267ffaf29e1ca54266c4d6152e1a7784485df9d64f73db
42
+ model.layers.1.self_attn.o_proj.weight F32 64x64 16384 05067177b82c856c4ae68742d90298af63f4799c563353837243a6bfafc3da62
43
+ model.layers.1.self_attn.q_proj.weight F32 64x64 16384 8c739a94345ab456d4a6cfbca2efd0e1a2a1d676797a32c196578232b43ebed6
44
+ model.layers.1.self_attn.v_proj.weight F32 64x64 16384 a099ddbd295110f6ec19970c068bd6b411e6fd3765f24ecc451b1a9955b87ed6
45
+ model.layers.2.input_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
46
+ model.layers.2.mlp.experts.0.down_proj.weight F32 64x32 8192 9f1d89cea2ae185646841bdf0ceb46fc6574f98deb0b8a9e416cdf8b427a3948
47
+ model.layers.2.mlp.experts.0.gate_proj.weight F32 32x64 8192 2c1503dc4e2c43ddce988ecf0ee6a6b3f5a9d2f979ebd44de633951c11ef4bd0
48
+ model.layers.2.mlp.experts.0.up_proj.weight F32 32x64 8192 2708d5871de59d45d129e56cf9a0680e89dc5a5339f91c13e3c80ce67fa87e14
49
+ model.layers.2.mlp.experts.1.down_proj.weight F32 64x32 8192 ef3aca4457e483063ecdaba93e87ff50db41b711df4ca5ef93d35bf5e02c7c40
50
+ model.layers.2.mlp.experts.1.gate_proj.weight F32 32x64 8192 9a305ecbd39da549e29bd024ee72399cc0529e8de8ea6c33df013e9456925b6d
51
+ model.layers.2.mlp.experts.1.up_proj.weight F32 32x64 8192 8d1925485b9d1b65de4060b156d4456674298fcbe937bc1004cfde989b24f2c9
52
+ model.layers.2.mlp.experts.2.down_proj.weight F32 64x32 8192 853b5dd4312dc4117d3cd323a68e795cd901e9d4f2a513b94bff6e7d48ab5a4c
53
+ model.layers.2.mlp.experts.2.gate_proj.weight F32 32x64 8192 72baa025d6174868eba63cf4d165223b05f939ebb7e555c4256ef926a6102480
54
+ model.layers.2.mlp.experts.2.up_proj.weight F32 32x64 8192 b752ef65a28abfa9056d1a80ca39a7fc7a68d56e886973b9d8053d4fd352b273
55
+ model.layers.2.mlp.experts.3.down_proj.weight F32 64x32 8192 2b07315229cbe61b4abf258b68aab75da333f4f76ed6d99ca22a072aa4c5f58d
56
+ model.layers.2.mlp.experts.3.gate_proj.weight F32 32x64 8192 0a9f828ebe2b57f858cdce38d02ddfda815aa9f868a52c8db108a39d0c855dd0
57
+ model.layers.2.mlp.experts.3.up_proj.weight F32 32x64 8192 3d1da709ac2da0d1df06c0f3d7b63571cea4a3b0163ce993a87cd133cacfb151
58
+ model.layers.2.mlp.experts.4.down_proj.weight F32 64x32 8192 08f56f31d1dc412bb54c6f89849faf2566cf01fe7b661009dd37d034917033cb
59
+ model.layers.2.mlp.experts.4.gate_proj.weight F32 32x64 8192 87e12d43d67543e9882543ff7634e1bfe14696f6a5d023fc644e76d605004237
60
+ model.layers.2.mlp.experts.4.up_proj.weight F32 32x64 8192 9d491fcc5fc70d86d8f80c5191ebba30845a60279c249368a4e78505f7f8132b
61
+ model.layers.2.mlp.experts.5.down_proj.weight F32 64x32 8192 794a6b9e9b4a349bb3aac8cecbf454fe60aeab6c8eda1caeb7cb0c22970e9432
62
+ model.layers.2.mlp.experts.5.gate_proj.weight F32 32x64 8192 4804bb82fc18cf733679286c9e08b7cb7e5a5e35dc63ed1fc065a122d360323b
63
+ model.layers.2.mlp.experts.5.up_proj.weight F32 32x64 8192 8cf63f5dde125a86ea38052f703d7c7f420a3666fbd9d6bd8fb2d0ef30da6a51
64
+ model.layers.2.mlp.experts.6.down_proj.weight F32 64x32 8192 7200662e2806f639d8c1c38162b7dea4ec28aea921e15f0b76c77c32dd666cf5
65
+ model.layers.2.mlp.experts.6.gate_proj.weight F32 32x64 8192 3f9abfc8dcd9bba73a2452e9c94dd37030a4181549ebcc939182fd012b0dbc92
66
+ model.layers.2.mlp.experts.6.up_proj.weight F32 32x64 8192 7500b5a557e79d4e035b89b0b38ef2b6511f77e235c4f6cb2b90fb0a608d3b7a
67
+ model.layers.2.mlp.experts.7.down_proj.weight F32 64x32 8192 8edc1711b87c798b86d282fa9cb70a459fc908f1d62629a847bd65d829b7b94e
68
+ model.layers.2.mlp.experts.7.gate_proj.weight F32 32x64 8192 f6c50c9e073350032b5e462e3069f8f4b6c1fd7974ac011322719068389372f2
69
+ model.layers.2.mlp.experts.7.up_proj.weight F32 32x64 8192 129caf8fdfd881d86b30362ad0f12b4544a033abf798f6e21a96b09447af95f0
70
+ model.layers.2.mlp.gate.weight F32 8x64 2048 10c3ea820b9bd6596af20a9aab93fc4f34ec9c8d0eaf60afd17a6bc97524eaad
71
+ model.layers.2.mlp.shared_experts.down_proj.weight F32 64x32 8192 93ae17e7d19f6f70d52bc9fb2be92842790c84332ee74e2389300600ebed8d04
72
+ model.layers.2.mlp.shared_experts.gate_proj.weight F32 32x64 8192 a86b2d02968d99380f05bcf57c99891b1533b4b9f04f46953bd43708f0654a8d
73
+ model.layers.2.mlp.shared_experts.up_proj.weight F32 32x64 8192 e7de220a79b81f5211aaee0d3f2d60179248afe39fceb836702e1c630e9f5925
74
+ model.layers.2.post_attention_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
75
+ model.layers.2.self_attn.k_proj.weight F32 64x64 16384 bdc9ce90d83d6acfc9295f59772e1c9e5fac87b9df52d974d3d5619ffce6d907
76
+ model.layers.2.self_attn.o_proj.weight F32 64x64 16384 99f751258a7987f5b7f0939a2a44d51d86e237a494ae99a9b007060ec4273d63
77
+ model.layers.2.self_attn.q_proj.weight F32 64x64 16384 4d5110787d99e86aac90e54ce466a61f07e65dcb4d042052e3b04e0e74688970
78
+ model.layers.2.self_attn.v_proj.weight F32 64x64 16384 4b1be70f2360b6b75c425be7df5b13cbae64b90478cef78020b84c6386bcc3cc
79
+ model.layers.3.input_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
80
+ model.layers.3.mlp.experts.0.down_proj.weight F32 64x32 8192 6e285b7e0b613856ced790951470e53d5e2f6c7d6b3fa689590ddfcdefdd7f42
81
+ model.layers.3.mlp.experts.0.gate_proj.weight F32 32x64 8192 96a37fc9b3e873737d101ed12c20e7b5bbaf4fa60f1ff1bcce68b10e8d85d499
82
+ model.layers.3.mlp.experts.0.up_proj.weight F32 32x64 8192 eae5eb6ac116a547f781a0c69e0a8e2cecb25b2e7f852d1b5f9aa823bc0d5d86
83
+ model.layers.3.mlp.experts.1.down_proj.weight F32 64x32 8192 f5d0c2bdce073007a947c06c9b42f4b5f5218de244b665e921479fd5c4d56843
84
+ model.layers.3.mlp.experts.1.gate_proj.weight F32 32x64 8192 092ac4de020d5c7f8536925080b640e737dde8b14143e2beff3c96912dc0f3f8
85
+ model.layers.3.mlp.experts.1.up_proj.weight F32 32x64 8192 71167a59c3179812717e4c082787531c97cc51a9caa653744f483de71239fd7d
86
+ model.layers.3.mlp.experts.2.down_proj.weight F32 64x32 8192 c710768f3e2db9e0f79e6e137accd29ec4ee925331bf042579b647df77901e55
87
+ model.layers.3.mlp.experts.2.gate_proj.weight F32 32x64 8192 633b9554148234278854f910aa35293addb0f0f3ae732e11c76d7682883a3727
88
+ model.layers.3.mlp.experts.2.up_proj.weight F32 32x64 8192 bec696b4f2275a8e658d59af23f35872025de2390dad551376b83e9e7c0f52d0
89
+ model.layers.3.mlp.experts.3.down_proj.weight F32 64x32 8192 eac1b83e92b8101e11451326c129ee941dd4c2fee43a4a8ce3c17856647663be
90
+ model.layers.3.mlp.experts.3.gate_proj.weight F32 32x64 8192 48aca16db000918028fe1dd758d626136276983ec51dcee9fd15f7887390afbd
91
+ model.layers.3.mlp.experts.3.up_proj.weight F32 32x64 8192 e53028a41fcb255447bfb3830c462d350bf5bb40ddb39cb225208c1142cf491b
92
+ model.layers.3.mlp.experts.4.down_proj.weight F32 64x32 8192 08c1129fc827d3d5837c99cfed4ce24d525bdf7f1cd17b7211872ed0c4c31381
93
+ model.layers.3.mlp.experts.4.gate_proj.weight F32 32x64 8192 cb76d9d1520c668787f3a7c9927588eba3aa66dd0e25e7454b1884bb12264cf9
94
+ model.layers.3.mlp.experts.4.up_proj.weight F32 32x64 8192 43cef4feaa357870bf91aa44dec24e4b5130f1b2e72278a4f75119c0e925883a
95
+ model.layers.3.mlp.experts.5.down_proj.weight F32 64x32 8192 0f13971f2e6af19453aa6fa89e13d370bee9af3f1fafa010363ccc86a9dcb5be
96
+ model.layers.3.mlp.experts.5.gate_proj.weight F32 32x64 8192 7c9af385e178a31887c86c518caa8eee16f83328487eef9ace90da79904631c5
97
+ model.layers.3.mlp.experts.5.up_proj.weight F32 32x64 8192 57ac7cadcbba12192dd1a305c0c6cedaf4d6d8430c75b41aeaa7f0d12b947a85
98
+ model.layers.3.mlp.experts.6.down_proj.weight F32 64x32 8192 025fa38e2a83858fb6a773fa31c815b190eccb23067a7ca5252f12fef6ed590d
99
+ model.layers.3.mlp.experts.6.gate_proj.weight F32 32x64 8192 5decc46a3e50c727385bb2a4d10515e81688a78a00bf5419446f5dc17c2b3251
100
+ model.layers.3.mlp.experts.6.up_proj.weight F32 32x64 8192 1f9f71be526c6ab22c44a656fd779f96c079fd879538c5b21bb810fed793d73a
101
+ model.layers.3.mlp.experts.7.down_proj.weight F32 64x32 8192 c19a9569252a9817df59e165c01586f47800b5cf53600a3d743869c2b1d574fd
102
+ model.layers.3.mlp.experts.7.gate_proj.weight F32 32x64 8192 dfab012213170d796e85152f6631aa4d7ec325b05c5d8611cd7b69df47a3c3f0
103
+ model.layers.3.mlp.experts.7.up_proj.weight F32 32x64 8192 7c48a951e8d38fcbc40dfb02f0d8c2cd37721f0be3c5a992721f90cc61b6218e
104
+ model.layers.3.mlp.gate.weight F32 8x64 2048 ccf44c400b617f4d6bc59b5e1e032534bcc1081ce96bb186abbb8a31ed0bd62c
105
+ model.layers.3.mlp.shared_experts.down_proj.weight F32 64x32 8192 cb1a5e2aabf56a5a8e4bee82492cb027e69225ed84224fac16b2bc9b10aab391
106
+ model.layers.3.mlp.shared_experts.gate_proj.weight F32 32x64 8192 53839eea954751d6deed896c14d06f71d0f7308e6b2372077c0b7b8cc3fa6990
107
+ model.layers.3.mlp.shared_experts.up_proj.weight F32 32x64 8192 5cc83d527ebee4c2a9e4786509dbb552009b4808eac26be211a7d84b4f692ef4
108
+ model.layers.3.post_attention_layernorm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
109
+ model.layers.3.self_attn.k_proj.weight F32 64x64 16384 2d2d41e589aedeeac841b026c5bd5844ef84c0e9cf08dc813ae09a6e95e19afd
110
+ model.layers.3.self_attn.o_proj.weight F32 64x64 16384 1e9b05c129fa641d2a3573e62aa585ed7f0e963037e98656351a367f384bbfd8
111
+ model.layers.3.self_attn.q_proj.weight F32 64x64 16384 772d7157770a6fa92ccaf7b4d6bf4a5405e383937a9a48cd31f5ee73eb7090a2
112
+ model.layers.3.self_attn.v_proj.weight F32 64x64 16384 25c75cf665881a002f84f1f20eb3f31086c1a071976b14feb0dcaaa7cb4d3510
113
+ model.norm.weight F32 64 256 2f20cd03c9cd392a406c56232b0ff93a15f6d6d7da79086bfa14f55d4a4031b0
config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Glm5NextForConditionalGeneration"
4
+ ],
5
+ "image_token_id": 248056,
6
+ "language_model_only": true,
7
+ "model_type": "glm5_next",
8
+ "text_config": {
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "dtype": "float32",
12
+ "first_k_dense_replace": 1,
13
+ "head_dim": 16,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 64,
16
+ "intermediate_size": 128,
17
+ "max_position_embeddings": 256,
18
+ "model_type": "glm_moe_dsa",
19
+ "moe_intermediate_size": 32,
20
+ "moe_layer_freq": 1,
21
+ "moe_router_dtype": "float32",
22
+ "n_group": 1,
23
+ "n_routed_experts": 8,
24
+ "n_shared_experts": 1,
25
+ "norm_topk_prob": true,
26
+ "num_attention_heads": 4,
27
+ "num_experts_per_tok": 2,
28
+ "num_hidden_layers": 4,
29
+ "num_key_value_heads": 4,
30
+ "num_nextn_predict_layers": 0,
31
+ "pad_token_id": 0,
32
+ "rms_norm_eps": 1e-05,
33
+ "rope_theta": 10000.0,
34
+ "tie_word_embeddings": false,
35
+ "vocab_size": 256
36
+ },
37
+ "vision_config": {
38
+ "_note": "placeholder; this fixture ships NO vision/projector tensors",
39
+ "model_type": "glm5_next_vision"
40
+ }
41
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "eos_token_id": 2,
4
+ "no_repeat_ngram_size": 4,
5
+ "pad_token_id": 0,
6
+ "seed": 20260902
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2386d8d284fed9451773500772576d7973351290126e64e173fc8b0567181055
3
+ size 1110392
special_tokens_map.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<pad>",
4
+ "<unk>"
5
+ ],
6
+ "bos_token": "<s>",
7
+ "eos_token": "</s>",
8
+ "pad_token": "<pad>",
9
+ "unk_token": "<unk>"
10
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "eos_token": "</s>",
4
+ "model_input_names": [
5
+ "input_ids"
6
+ ],
7
+ "model_max_length": 256,
8
+ "pad_token": "<pad>",
9
+ "unk_token": "<unk>"
10
+ }