Ludovico commited on
Commit
ad8a46d
·
verified ·
1 Parent(s): fc462c2

Document WEX format evolution and verified size ratios

Browse files
Files changed (1) hide show
  1. README.md +59 -25
README.md CHANGED
@@ -1,49 +1,83 @@
1
  ---
2
- license: other
3
- library_name: colibri
4
  pipeline_tag: text-generation
 
 
 
 
 
5
  ---
6
- # WEX4 expert containers
7
 
8
- Binary expert-weight assets. These are **not standalone Transformers checkpoints** and cannot be loaded with `from_pretrained()`.
9
 
10
- ## Contents
11
 
12
- | File | Model/build | Bytes |
13
- |---|---|---:|
14
- | `qwen38-mxfp4/q38_experts.wex` | Qwen 3.8 MXFP4 expert container | 64,251,047,936 |
15
- | `v41-reap/v4_flash_experts.nr3.wex` | DeepSeek V4.1 Flash REAP-192, NR3 container | 123,312,910,336 |
16
- | `provenance/*.verified.pre-wex4` | Supplied source/build verification notes | — |
17
 
18
- ## Format and compatibility
 
 
 
 
 
19
 
20
- WEX4 is a self-describing container with a hashed header/index, SHA-256 digests for blobs and records, and 4 KiB aligned data. It stores raw records or WNR3 encoded expert records. The Qwen file stores RAW MXFP4 records; the V4.1 file stores WNR3-CZ records.
21
 
22
- WNR2 is a different, older codec used inside WEX3 containers. Neither file in this repository uses WNR2. Use a runtime build that explicitly supports WEX4 for the corresponding model family. A generic Transformers runtime or an older WEX/WNR2-only build cannot load these files.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  ## Download
25
 
26
- Install the Hugging Face CLI and download the repository:
27
 
28
  ```powershell
29
  hf download Kaira666/Kaira-WEX4-Experts --repo-type model --local-dir .\WEX4-Experts
30
  ```
31
 
32
- The containers total about 187.6 GB decimal. Ensure sufficient free disk space before downloading.
 
 
 
 
 
 
 
 
 
33
 
34
- ## Integrity and runtime configuration
35
 
36
- The WEX4 whole-file verifier checks the header, index, blobs, records, padding, and indexed SHA-256 values, then prints the 64-digit container root. Run it on each downloaded file before use. In a compatible runtime, `COLI_WEX_ROOT` pins the expected root; `COLI_WEX_VERIFY=1` enables first-read record hashing where supported.
37
 
38
- | Container | Verified WEX4 root | Content digest |
39
- |---|---|---|
40
- | `q38_experts.wex` | `db5389f699abb49a164a9e73d925b5b629b0ce6de430a553388ba3e1cae5c0df` | `0d752bbf2d169b611ac79b005f07d0b9152c0591b23b65cbd12e06ea8300ec77` |
41
- | `v4_flash_experts.nr3.wex` | `f0f78a84d040a3b336f3abef3cf8b0a36c649deb38586c813e94d35dea3beeb1` | `fb085e127ba980214f106313e9af578b18e5ebac4cde7ecb9730b1a0f78ae512` |
42
 
43
- The supplied `.verified.pre-wex4` files record provenance before/alongside WEX4 conversion. The Qwen file passed whole-file verification: all 24,576 records decoded and all indexed hashes matched. The V4.1 file passed whole-file verification: all 7,680 records decoded and all indexed hashes matched.
44
 
45
  ## License
46
 
47
- No license has been specified for these model assets. Public availability does not grant permission to use, modify, or redistribute them. Add the applicable license before reuse.
48
-
49
-
 
1
  ---
 
 
2
  pipeline_tag: text-generation
3
+ tags:
4
+ - wex4
5
+ - mixture-of-experts
6
+ - mxfp4
7
+ - expert-weights
8
  ---
9
+ # WEX4 Expert Containers
10
 
11
+ These are expert-weight containers for compatible Mixture-of-Experts (MoE) runtimes, not complete model checkpoints. They do not include the full model, tokenizer, chat template, or inference runtime, and are not loadable with `transformers.from_pretrained()`.
12
 
13
+ The container format and the per-record codec are separate layers: WEX4 provides indexed access and integrity checking; WNR3 is an optional custom codec for MXFP4 expert records.
14
 
15
+ ## Files
 
 
 
 
16
 
17
+ | Path | Model and layout | Expert count | Size |
18
+ |---|---|---:|---:|
19
+ | `qwen38-mxfp4/q38_experts.wex` | Qwen3.8-Flash-Next, routed MXFP4, WEX4 with RAW records | 24,576 (48 × 512) | 64,251,047,936 bytes (64.25 GB) |
20
+ | `v41-reap/v4_flash_experts.nr3.wex` | DeepSeek V4.1 Flash REAP-192, WEX4 with WNR3-CZ records | 7,680 (40 × 192) | 123,312,910,336 bytes (123.31 GB) |
21
+ | `provenance/q38_experts.wex.verified.pre-wex4` | Supplied Qwen source-copy SHA-256 note | — | 123 bytes |
22
+ | `provenance/v4_flash_experts.nr3.wex.verified.pre-wex4` | Supplied V4.1 build/read-back note | — | 177 bytes |
23
 
24
+ The two containers total about 187.6 GB decimal (174.7 GiB). Allow additional disk space for the runtime, cache, and any local mirrors.
25
 
26
+ ## Container evolution
27
+
28
+ | Format | What it adds |
29
+ |---|---|
30
+ | **WEX1** | Original layout: raw expert records aligned to 4 KiB for direct per-expert reads. |
31
+ | **WEX2** | Lossless tiled coding for MXFP4 scale values; FP4 weight bytes stay raw. |
32
+ | **WEX3** | Per-record codec support, including WNR2 and WNR3, with the metadata those codecs require. |
33
+ | **WEX4** | Self-describing tensor index, a SHA-256 container root, and hashes for records and blobs. It can hold either raw or encoded records; WEX4 is not itself a compression codec. |
34
+
35
+ WNR2 and WNR3 are different codecs. WNR2 is the earlier codec 4 used in WEX3; these published containers do not use WNR2. The Qwen file contains RAW records. The V4.1 file contains WNR3-CZ records (codec 5) inside WEX4.
36
+
37
+ ## WNR3 codec and size results
38
+
39
+ WNR3 is a custom entropy codec designed for MXFP4 expert weights and scales. It uses context-based rANS coding and has a purpose-built GPU decoder. It is not a general-purpose archive format. The WNR3-CZ production variant maps negative zero to positive zero: represented numeric values are preserved, but those zero sign bits are not byte-identical to the source.
40
+
41
+ Compression figures below compare expert containers for the same DeepSeek V4.1 REAP-192 experts:
42
+
43
+ | Encoding | Result relative to raw | Evidence and qualification |
44
+ |---|---:|---|
45
+ | WNR2, bit-exact | 0.8997×, about 10.03% smaller | Measured full container: 129,905,360,896 B vs 144,389,472,256 B raw. This is historical and is not used by the files in this repository. |
46
+ | WNR3, strict bit-lossless | About 0.8819×, about 11.81% smaller | Estimate from held-out experts; not a full-model non-CZ container measurement. |
47
+ | WNR3-CZ, value-exact | 0.8540×, about 14.60% smaller | Production container: 123,306,192,896 B before the WEX4 index; the published WEX4 file is 123,312,910,336 B. CZ normalizes the FP4 sign of zero. |
48
+
49
+ The Qwen3.8 file is intentionally RAW MXFP4, so it claims no codec compression benefit. Its WEX4 index adds about 26 MB over the prior WEX1 file and supplies integrity metadata and indexed expert records.
50
 
51
  ## Download
52
 
53
+ Install the Hugging Face CLI and download the full repository:
54
 
55
  ```powershell
56
  hf download Kaira666/Kaira-WEX4-Experts --repo-type model --local-dir .\WEX4-Experts
57
  ```
58
 
59
+ You can download either container separately:
60
+
61
+ ```powershell
62
+ hf download Kaira666/Kaira-WEX4-Experts qwen38-mxfp4/q38_experts.wex --repo-type model --local-dir .\WEX4-Experts
63
+ hf download Kaira666/Kaira-WEX4-Experts v41-reap/v4_flash_experts.nr3.wex --repo-type model --local-dir .\WEX4-Experts
64
+ ```
65
+
66
+ ## Runtime compatibility and integrity
67
+
68
+ Use a runtime that explicitly supports WEX4 version 4.0 and the codec/model family in the selected file. An older WEX/WNR2-only build or a generic Transformers loader cannot read these assets. The Qwen3.8 file needs a WEX4 loader for RAW MXFP4 experts. The DeepSeek V4.1 file also needs WNR3-CZ decoding support and its matching GPU helper.
69
 
70
+ In compatible runtimes that expose these settings, set `COLI_WEX_PATH` to the selected file and `COLI_WEX_ROOT` to its verified root. `COLI_WEX_VERIFY=1` enables first-read record hashing where supported. These settings do not add WEX4 support to an incompatible runtime.
71
 
72
+ A WEX4 whole-file verification checks the header, index, exact file layout, padding, every blob, and every record; encoded records are decoded as part of the check. The root is the SHA-256 of the first 4,064 bytes of the header page. The content digest below is SHA-256 over decoded tensor content and tensor metadata in table order.
73
 
74
+ | File | Verified WEX4 root | Content digest | Verification result |
75
+ |---|---|---|---|
76
+ | `q38_experts.wex` | `db5389f699abb49a164a9e73d925b5b629b0ce6de430a553388ba3e1cae5c0df` | `0d752bbf2d169b611ac79b005f07d0b9152c0591b23b65cbd12e06ea8300ec77` | 24,576 records decoded; all indexed hashes matched |
77
+ | `v4_flash_experts.nr3.wex` | `f0f78a84d040a3b336f3abef3cf8b0a36c649deb38586c813e94d35dea3beeb1` | `fb085e127ba980214f106313e9af578b18e5ebac4cde7ecb9730b1a0f78ae512` | 7,680 records decoded; all indexed hashes matched |
78
 
79
+ The `.verified.pre-wex4` files are included as supplied provenance notes. The roots and results above apply to the final published WEX4 files.
80
 
81
  ## License
82
 
83
+ No license has been specified for these model assets. Public availability does not grant permission to use, modify, or redistribute the weights. Confirm the applicable rights before reuse.