RASMUS commited on
Commit
ca45431
·
verified ·
1 Parent(s): 350477a

Document layout, chunks, prompt-id convention

Browse files
Files changed (1) hide show
  1. README.md +82 -11
README.md CHANGED
@@ -1,16 +1,87 @@
1
- # commitmoe-qwen35-fp8-layers-v2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- Per-layer columnar streams for Qwen3.5-35B-A3B-FP8 expert-routing prediction.
4
 
5
- Rebuilt from the raw collector shards so that **all 40 layers** are available in
6
- the columnar form, not only the L6 lead-2 slice.
 
7
 
8
- - `layers_v1/chunk_10k/` corpus prompts 0-9,999, rebuilt from `raw` shards
9
- (source list taken from `index_10k.pt`, 3,126 shards; note the collector's
10
- `manifest.jsonl` is stale at 938 shards and must not be used as the source list)
11
 
12
- Layout per stream: `{hidden,logits}/layer=NN/part_*.safetensors`, plus `labels/`.
13
- Columns carry their own `prompt_idx` / `tok`, so joins key on values, never on
14
- row position.
15
 
16
- Existing repos are untouched; this is an additive republish.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - other
5
+ tags:
6
+ - mixture-of-experts
7
+ - expert-routing
8
+ - qwen3
9
+ - inference-optimization
10
+ size_categories:
11
+ - 100M<n<1B
12
+ configs:
13
+ - config_name: default
14
+ data_files: layers_v1/*/labels/*.safetensors
15
+ ---
16
 
17
+ # CommitMoE Qwen3.5-35B-A3B-FP8 expert-routing traces, columnar by layer
18
 
19
+ Per-token MoE routing decisions from `Qwen/Qwen3.5-35B-A3B-FP8`, laid out
20
+ **one directory per layer** so a predictor for a single layer reads only what it
21
+ needs instead of scanning interleaved shards.
22
 
23
+ The model has **40 MoE layers, 256 experts each, top-8 routing**, hidden size
24
+ 2048. Every row is one `(prompt, decode token, layer)` triple.
 
25
 
26
+ ## What this is for
 
 
27
 
28
+ Predicting *which experts a layer will route to* a couple of layers ahead, so
29
+ their weights can be prefetched over PCIe into a small GPU-resident cache
30
+ before the layer runs. A prediction that misses costs a stall; the metric that
31
+ matters is recall at the cache size `C`, and under a `W = C` admission policy
32
+ the stall count per token per layer is exactly `8 · (1 − recall@C)`.
33
+
34
+ ## Layout
35
+
36
+ ```
37
+ layers_v1/<chunk>/
38
+ prompts.jsonl # id + prompt_idx, one row per prompt
39
+ labels/part_*.safetensors # top_indices[8], prompt_idx, tok, layer, gen_token_id
40
+ hidden/layer=NN/part_*.safetensors # h[2048] (pre-MoE hidden), prompt_idx, tok
41
+ logits/layer=NN/part_*.safetensors # logits[256] (router), prompt_idx, tok
42
+ ```
43
+
44
+ `labels` covers all 40 layers in one table — it is small (~2.6 GB per 10k
45
+ prompts) and window features read every layer of it. `hidden` is the expensive
46
+ part at about **10.0 GB per layer per 10k prompts**; `logits` is **1.27 GB**.
47
+
48
+ ## Chunks and prompt ids
49
+
50
+ `prompt_idx` is **globally unique across chunks**, so they can be pooled
51
+ without collision:
52
+
53
+ | chunk | prompts | `prompt_idx` range |
54
+ |---|---|---|
55
+ | `chunk_10k` | 10,000 | 0 – 9,999 |
56
+ | `chunk00` | 4,000 | 10,000 – 13,999 |
57
+ | `chunk01` | 6,000 | 14,000 – 19,999 |
58
+
59
+ `chunk00` lives in the companion repo
60
+ [`commitmoe-qwen35-fp8-layers`](https://huggingface.co/datasets/RASMUS/commitmoe-qwen35-fp8-layers).
61
+ Each chunk's `prompts.jsonl` starts at its own base, and readers derive that
62
+ base from the file's first row rather than assuming zero.
63
+
64
+ **A note on the ids, because it is easy to get wrong.** The raw shards store
65
+ `prompt_idx` as a *shard-local slot* (0–31, an index into that shard's own
66
+ 32-entry prompt list), not a global id. Writing it through unchanged collapses
67
+ every shard's prompts onto the same 32 ids — silently, since the output still
68
+ looks well-formed. The files here are built by resolving each shard's prompt-id
69
+ *strings* through the chunk's index, and every upload is checked by comparing
70
+ the written `prompt_idx` set against the set resolved from the shards.
71
+
72
+ ## How the shards were laid out upstream
73
+
74
+ Each raw shard is a **decode-step slice** of a 32-prompt batch — 32 prompts ×
75
+ ~26 decode steps × 40 layers ≈ 32,768 rows — so roughly **ten consecutive raw
76
+ shards share the same 32 prompts**. That is invisible in this columnar form but
77
+ matters if you rebuild from the raw traces.
78
+
79
+ ## Splits
80
+
81
+ Not stored. The split is derived from the prompt-id string, so it stays
82
+ consistent across chunks and rebuilds.
83
+
84
+ ## Related
85
+
86
+ - Raw interleaved traces: [`commitmoe-qwen35-fp8-expert-routing-traces`](https://huggingface.co/datasets/RASMUS/commitmoe-qwen35-fp8-expert-routing-traces)
87
+ - `chunk00` + raw for `chunk00`/`chunk01`: [`commitmoe-qwen35-fp8-layers`](https://huggingface.co/datasets/RASMUS/commitmoe-qwen35-fp8-layers)