Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: nvidia-open-model-agreement
|
| 4 |
+
license_link: https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-agreement/
|
| 5 |
+
base_model:
|
| 6 |
+
- nvidia/GLM-5.3-Flash-FP4-Local
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- glm
|
| 10 |
+
- glm-5
|
| 11 |
+
- fp4
|
| 12 |
+
- nvfp4
|
| 13 |
+
- mxfp8
|
| 14 |
+
- moe
|
| 15 |
+
- ssd-offloading
|
| 16 |
+
- expert-offloading
|
| 17 |
+
- low-vram
|
| 18 |
+
- inferred-thoughts
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# GLM-5.3-Flash-FP4-Local, laid out for inferredThoughts
|
| 22 |
+
|
| 23 |
+
NVIDIA's [GLM-5.3-Flash-FP4-Local](https://huggingface.co/nvidia/GLM-5.3-Flash-FP4-Local), with each MoE layer's
|
| 24 |
+
routed experts stacked into one block per projection, so the inferredThoughts engine can keep the experts a
|
| 25 |
+
conversation uses on the GPU, the next ones in RAM and the rest on an NVMe SSD.
|
| 26 |
+
|
| 27 |
+
**The weights are NVIDIA's, unchanged.** This is a re-layout, not a new quantization: the same numbers in a
|
| 28 |
+
different order. Every tensor that is not a routed expert is copied byte for byte under its own name.
|
| 29 |
+
|
| 30 |
+
**Text only for now.** The vision tower is included unchanged, but the engine does not run it yet.
|
| 31 |
+
|
| 32 |
+
## Precision (NVIDIA's, kept as it is)
|
| 33 |
+
|
| 34 |
+
| part | stored as (from `hf_quant_config.json`) |
|
| 35 |
+
|---|---|
|
| 36 |
+
| routed experts, 42 MoE layers | NVFP4: E2M1 values, E4M3 scales per 16 weights, FP32 global scale |
|
| 37 |
+
| the MTP layer's routed experts | NVFP4, weights only (BF16 activations) |
|
| 38 |
+
| shared experts; the sparse-attention layers' projections | FP8 E4M3, block-scaled, weights only |
|
| 39 |
+
| the linear-attention layers' projections, the three dense MLPs, `lm_head` | MXFP8: E4M3 values, UE8M0 scales per 32 weights |
|
| 40 |
+
| embeddings, norms, routers | BF16 |
|
| 41 |
+
| vision tower | NVFP4 (weights only) MLPs and merger, MXFP8 attention, the rest BF16 |
|
| 42 |
+
|
| 43 |
+
321.3B parameters by our count of the tensors (NVIDIA's card: 320B in total, 18B active).
|
| 44 |
+
|
| 45 |
+
## What changed from NVIDIA's checkpoint
|
| 46 |
+
|
| 47 |
+
- Each routed expert's three projections (gate, up, down) become one record each of a stacked tensor per layer,
|
| 48 |
+
`model.language_model.layers.{L}.mlp.experts.{proj}.packed` (U8, one row per expert). A record is the expert's
|
| 49 |
+
E2M1 weights followed by its E4M3 group scales.
|
| 50 |
+
- NVIDIA stores those group scales in a compressed format (`csf_32x2_v1`). Here they are decoded once, losslessly,
|
| 51 |
+
into the plain E4M3 bytes the engine's kernel reads. The MTP layer's scales, stored plain in the source, are
|
| 52 |
+
copied as they are.
|
| 53 |
+
- Each layer's experts go in their own file, `experts-{L}.safetensors`, aligned for unbuffered reads; everything else
|
| 54 |
+
is in `dense-0000{1,2,3}.safetensors`.
|
| 55 |
+
- Kept: the MTP layer (layer 45) and the vision tower, unchanged.
|
| 56 |
+
|
| 57 |
+
186,126,353,632 bytes of tensors in 2,658 tensors. `SHA256SUMS` lists every file.
|
| 58 |
+
|
| 59 |
+
## Can I load it?
|
| 60 |
+
|
| 61 |
+
**Only with inferredThoughts.** The stacked layout is the engine's own; vLLM, SGLang and transformers read NVIDIA's
|
| 62 |
+
original instead, so use that one with them. GLM-5.3-Flash support in inferredThoughts is not in a public release
|
| 63 |
+
yet; this card will say which release runs it.
|
| 64 |
+
|
| 65 |
+
## Files
|
| 66 |
+
|
| 67 |
+
| file | what |
|
| 68 |
+
|---|---|
|
| 69 |
+
| `experts-003.safetensors` ... `experts-045.safetensors` | the routed experts, one MoE layer a file |
|
| 70 |
+
| `dense-00001.safetensors` ... `dense-00003.safetensors` | everything else, byte for byte from the source |
|
| 71 |
+
| `model.safetensors.index.json` | the tensor map |
|
| 72 |
+
| `config.json`, `generation_config.json`, `hf_quant_config.json`, `processor_config.json`, `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja` | from the source, unchanged |
|
| 73 |
+
| `NVIDIA-MODEL-CARD.md` | NVIDIA's model card for the source checkpoint, unchanged |
|
| 74 |
+
| `NOTICE`, `LICENSE-NVIDIA-Open-Model-Agreement.pdf`, `LICENSE-MIT-GLM` | the licences and notices |
|
| 75 |
+
| `SHA256SUMS` | SHA-256 of every file |
|
| 76 |
+
|
| 77 |
+
Check a download with `sha256sum --ignore-missing -c SHA256SUMS`.
|
| 78 |
+
|
| 79 |
+
## License
|
| 80 |
+
|
| 81 |
+
Use of this model is governed by the [NVIDIA Open Model Agreement](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-agreement/)
|
| 82 |
+
(`LICENSE-NVIDIA-Open-Model-Agreement.pdf`). The GLM-5.3-Flash base model is governed by the MIT License
|
| 83 |
+
(`LICENSE-MIT-GLM`). See `NOTICE`.
|
| 84 |
+
|
| 85 |
+
This is an independent re-layout. It is not made, reviewed or endorsed by NVIDIA or by Z.ai.
|