Rhett1 commited on
Commit
6aa9bb9
·
verified ·
1 Parent(s): 9077358

tr3 tree: real files, uniform weight names

Browse files
tr3/heal/llama2-13b/README.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama2
3
+ base_model: NousResearch/Llama-2-13b-chat-hf
4
+ tags:
5
+ - tensor-decomposition
6
+ - tensor-ring
7
+ - model-compression
8
+ - llama2
9
+ ---
10
+
11
+ # TR-3: LLaMA-2-13B-chat compressed with a Tensor Ring
12
+
13
+ Every attention and MLP projection replaced by a **3-site Tensor Ring** (cyclic — the ring
14
+ closes with a non-trivial boundary bond, so it is not a train/TT) plus a 5% sparse residual,
15
+ then healed with pure knowledge distillation.
16
+
17
+ - **7.740B parameters**, down from 13.016B — **40.53% reduction**
18
+ - **60M healing tokens**, pure forward-KL from the unmodified 13B teacher (alpha=1, no gold labels)
19
+ - Held-out token-mean KL: **0.3612 → 0.1333**
20
+ - MMLU (5-shot, 40/subtask probe): **39.17% → 49.65%**, teacher **54.43%** — **91.2% retained**
21
+
22
+ The highest retention of any model in this study, consistent with larger models tolerating a
23
+ fixed compression rate better: at ~40% reduction the pre-heal KL is 3.5810 for Qwen2.5-3B,
24
+ 0.6915 for LLaMA-2-7B and 0.3612 for this model.
25
+
26
+ ## ⚠️ Full benchmark table not yet measured
27
+
28
+ The five-task evaluation on the full benchmarks has **not been run on this checkpoint**. The
29
+ numbers above are healing-time probes (held-out KL, MMLU subsampled to 40 questions per
30
+ subtask) — internally consistent and comparable across this study, but **not** full-benchmark
31
+ figures. The dense teacher scores MMLU 53.53 / HellaSwag 82.10 / BoolQ 81.93 / TriviaQA 65.18
32
+ / GSM8K 35.18 (average 63.58) on the full benchmarks under `eval_protocol_13b.json`.
33
+
34
+ ## ⚠️ This is NOT a standard `transformers` checkpoint
35
+
36
+ `state_dict_fp16_healed.pt` holds **ring cores**, not dense `nn.Linear` weights. Rebuild the
37
+ architecture with `TRLinear`/`SparseAugTRLinear` from `tensor_formats.py` using `ranks.json`;
38
+ `AutoModelForCausalLM.from_pretrained()` will not work. LLaMA-2 has no attention biases and
39
+ untied embeddings, so the loader is the plain case — see `../qwen2.5-3b/README.md` for the
40
+ recipe, substituting this directory's base model and files.
41
+
42
+ Healing used `micro=16, grad_accum=1, seq_len=1024` — `tokens_per_step = 16384`, the same
43
+ global batch as the other TR-3 arms.
tr3/heal/llama2-13b/config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": null,
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "bos_token_id": 1,
7
+ "eos_token_id": 2,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 5120,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 13824,
12
+ "max_position_embeddings": 4096,
13
+ "model_type": "llama",
14
+ "num_attention_heads": 40,
15
+ "num_hidden_layers": 40,
16
+ "num_key_value_heads": 40,
17
+ "pad_token_id": 0,
18
+ "pretraining_tp": 1,
19
+ "rms_norm_eps": 1e-05,
20
+ "rope_scaling": null,
21
+ "tie_word_embeddings": false,
22
+ "torch_dtype": "float16",
23
+ "transformers_version": "4.31.0.dev0",
24
+ "use_cache": true,
25
+ "vocab_size": 32000
26
+ }
tr3/heal/llama2-13b/eval_protocol_13b.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_id": "NousResearch/Llama-2-13b-chat-hf",
3
+ "model_revision": "d73f5fa9c4bc135502e04c27b39660747172d76b",
4
+ "lm_eval_revision": "0.4.12",
5
+ "tasks": {
6
+ "mmlu": "mmlu",
7
+ "hellaswag": "hellaswag",
8
+ "boolq": "boolq",
9
+ "triviaqa": "triviaqa",
10
+ "gsm8k": "gsm8k"
11
+ },
12
+ "num_fewshot": {
13
+ "mmlu": 5,
14
+ "hellaswag": 10,
15
+ "boolq": 0,
16
+ "triviaqa": 5,
17
+ "gsm8k": 5
18
+ },
19
+ "apply_chat_template": false,
20
+ "batch_size": "auto",
21
+ "dtype": "float16",
22
+ "seed": 1234,
23
+ "score_scale": "fraction",
24
+ "result_parser": {
25
+ "mmlu": "acc,none",
26
+ "hellaswag": "acc_norm,none",
27
+ "boolq": "acc,none",
28
+ "triviaqa": "exact_match,remove_whitespace",
29
+ "gsm8k": "exact_match,strict-match"
30
+ },
31
+ "hardware": {
32
+ "gpus_max": 4,
33
+ "gpu_model": "NVIDIA GB200 (Grace-Blackwell NVL4, sm_100)",
34
+ "note": "RIKYU compute node, 4x GB200 with 184GiB each. NOT the hardware the 7B results were produced on (that was 4x RTX A6000, sm_86). Numerically irrelevant for fp16 eval but recorded because the software stack differs too -- see torch_deviation below."
35
+ },
36
+ "torch_deviation": {
37
+ "locked": "torch==2.4.1+cu121",
38
+ "actual": "torch==2.7.1+cu128",
39
+ "reason": "requirements.compactifai.lock.txt was exported from an x86_64 box. torch 2.4.1+cu121 ships no aarch64 wheel, and the whole nvidia-*-cu12==12.1.x stack it depends on is x86_64/win_amd64 only. Independently, CUDA 12.1 predates Blackwell: GB200 is sm_100 and needs CUDA 12.8+. Every other package in the lock is installed at the locked version. This deviation is FORCED, not chosen, and applies to the 13B numbers but NOT to the already-recorded 7B numbers.",
40
+ "implication": "13B results in this protocol are not same-stack comparable to the 7B results in eval_protocol.json. To claim a controlled 7B-vs-13B comparison, re-run the 7B under this stack."
41
+ },
42
+ "added_packages": {
43
+ "sentencepiece": "0.2.2",
44
+ "protobuf": "7.36.1",
45
+ "reason": "ADDITIVE, not a version change: neither package appears in requirements.compactifai.lock.txt at any version. The 7B repo ships a prebuilt fast tokenizer (tokenizer.json), so transformers never needed to convert anything; the 13B repo ships only tokenizer.model (the raw sentencepiece model), and converting it requires both libraries. Without them AutoTokenizer.from_pretrained raises ImportError before any compute starts.",
46
+ "equivalence_check": "The converted 13B tokenizer was compared against the 7B's prebuilt tokenizer.json on four probes (English prose, Python source, an MMLU-shaped few-shot prompt, and Japanese text): identical input_ids on all four, identical vocab_size 32000, identical bos/eos/pad ids 1/2/0. Both repos carry the same LLaMA-2 sentencepiece model, so the conversion reproduces the tokenizer rather than approximating it."
47
+ },
48
+ "assumptions": [
49
+ "Model source: mirrors the 7B decision. We use the non-gated NousResearch/Llama-2-13b-chat-hf pinned at commit d73f5fa9c4bc135502e04c27b39660747172d76b, because meta-llama/Llama-2-13b-chat-hf is manually gated. All three safetensors shards match the gated repo's byte-for-byte in SIZE (9,948,693,272 / 9,904,129,368 / 6,178,962,272); shard sizes agreeing is consistent with a straight redistribution but is NOT a content hash, so this is evidence, not proof. Reproduction level for weights: close (unofficial host, contents not independently hashed against Meta's).",
50
+ "Every protocol field except model_id/model_revision/hardware is copied UNCHANGED from eval_protocol.json. Shot counts, metric keys, dtype, seed, batch_size and score_scale are identical, so the 7B and 13B rows differ only in the model -- which is the whole point of the scaling claim. Do not tune any of these per-scale.",
51
+ "Architecture: hidden 5120, intermediate 13824, 40 layers, vocab 32000 -> 13,015,864,320 dense parameters. These are read from the model config at runtime by scripts/whitened_lowrank.py:_arch_dims(), not hardcoded here, so this file cannot drift from the actual weights.",
52
+ "Compression budget is set to match the 7B's ACHIEVED ratio, not its absolute size: 4,023,119,424 / 6,738,415,616 = 0.597042 (40.30% reduction). Applied to 13B that is 7,771,022,084 total, of which 634,388,480 is the 5% sparse residual, giving --target-params-b 7.1366 for the ring cores + embeddings + norms.",
53
+ "TriviaQA remains the least certain task, exactly as documented in the 7B protocol. The same 5-shot exact_match (remove_whitespace) convention is locked here so the 7B-vs-13B delta stays meaningful even where the absolute deviates from the paper."
54
+ ]
55
+ }
tr3/heal/llama2-13b/ranks.json ADDED
@@ -0,0 +1,3362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model.layers.0.self_attn.q_proj": {
3
+ "o1": 16,
4
+ "o2": 16,
5
+ "o3": 20,
6
+ "i1": 16,
7
+ "i2": 16,
8
+ "i3": 20,
9
+ "r0": 124,
10
+ "r1": 124,
11
+ "r2": 124,
12
+ "nnz": 1310720
13
+ },
14
+ "model.layers.0.self_attn.k_proj": {
15
+ "o1": 16,
16
+ "o2": 16,
17
+ "o3": 20,
18
+ "i1": 16,
19
+ "i2": 16,
20
+ "i3": 20,
21
+ "r0": 124,
22
+ "r1": 124,
23
+ "r2": 124,
24
+ "nnz": 1310720
25
+ },
26
+ "model.layers.0.self_attn.v_proj": {
27
+ "o1": 16,
28
+ "o2": 16,
29
+ "o3": 20,
30
+ "i1": 16,
31
+ "i2": 16,
32
+ "i3": 20,
33
+ "r0": 124,
34
+ "r1": 124,
35
+ "r2": 124,
36
+ "nnz": 1310720
37
+ },
38
+ "model.layers.0.self_attn.o_proj": {
39
+ "o1": 16,
40
+ "o2": 16,
41
+ "o3": 20,
42
+ "i1": 16,
43
+ "i2": 16,
44
+ "i3": 20,
45
+ "r0": 124,
46
+ "r1": 124,
47
+ "r2": 124,
48
+ "nnz": 1310720
49
+ },
50
+ "model.layers.0.mlp.gate_proj": {
51
+ "o1": 24,
52
+ "o2": 24,
53
+ "o3": 24,
54
+ "i1": 16,
55
+ "i2": 16,
56
+ "i3": 20,
57
+ "r0": 174,
58
+ "r1": 174,
59
+ "r2": 174,
60
+ "nnz": 3538944
61
+ },
62
+ "model.layers.0.mlp.up_proj": {
63
+ "o1": 24,
64
+ "o2": 24,
65
+ "o3": 24,
66
+ "i1": 16,
67
+ "i2": 16,
68
+ "i3": 20,
69
+ "r0": 174,
70
+ "r1": 174,
71
+ "r2": 174,
72
+ "nnz": 3538944
73
+ },
74
+ "model.layers.0.mlp.down_proj": {
75
+ "o1": 16,
76
+ "o2": 16,
77
+ "o3": 20,
78
+ "i1": 24,
79
+ "i2": 24,
80
+ "i3": 24,
81
+ "r0": 174,
82
+ "r1": 174,
83
+ "r2": 174,
84
+ "nnz": 3538944
85
+ },
86
+ "model.layers.1.self_attn.q_proj": {
87
+ "o1": 16,
88
+ "o2": 16,
89
+ "o3": 20,
90
+ "i1": 16,
91
+ "i2": 16,
92
+ "i3": 20,
93
+ "r0": 124,
94
+ "r1": 124,
95
+ "r2": 124,
96
+ "nnz": 1310720
97
+ },
98
+ "model.layers.1.self_attn.k_proj": {
99
+ "o1": 16,
100
+ "o2": 16,
101
+ "o3": 20,
102
+ "i1": 16,
103
+ "i2": 16,
104
+ "i3": 20,
105
+ "r0": 124,
106
+ "r1": 124,
107
+ "r2": 124,
108
+ "nnz": 1310720
109
+ },
110
+ "model.layers.1.self_attn.v_proj": {
111
+ "o1": 16,
112
+ "o2": 16,
113
+ "o3": 20,
114
+ "i1": 16,
115
+ "i2": 16,
116
+ "i3": 20,
117
+ "r0": 124,
118
+ "r1": 124,
119
+ "r2": 124,
120
+ "nnz": 1310720
121
+ },
122
+ "model.layers.1.self_attn.o_proj": {
123
+ "o1": 16,
124
+ "o2": 16,
125
+ "o3": 20,
126
+ "i1": 16,
127
+ "i2": 16,
128
+ "i3": 20,
129
+ "r0": 124,
130
+ "r1": 124,
131
+ "r2": 124,
132
+ "nnz": 1310720
133
+ },
134
+ "model.layers.1.mlp.gate_proj": {
135
+ "o1": 24,
136
+ "o2": 24,
137
+ "o3": 24,
138
+ "i1": 16,
139
+ "i2": 16,
140
+ "i3": 20,
141
+ "r0": 174,
142
+ "r1": 174,
143
+ "r2": 174,
144
+ "nnz": 3538944
145
+ },
146
+ "model.layers.1.mlp.up_proj": {
147
+ "o1": 24,
148
+ "o2": 24,
149
+ "o3": 24,
150
+ "i1": 16,
151
+ "i2": 16,
152
+ "i3": 20,
153
+ "r0": 174,
154
+ "r1": 174,
155
+ "r2": 174,
156
+ "nnz": 3538944
157
+ },
158
+ "model.layers.1.mlp.down_proj": {
159
+ "o1": 16,
160
+ "o2": 16,
161
+ "o3": 20,
162
+ "i1": 24,
163
+ "i2": 24,
164
+ "i3": 24,
165
+ "r0": 174,
166
+ "r1": 174,
167
+ "r2": 174,
168
+ "nnz": 3538944
169
+ },
170
+ "model.layers.2.self_attn.q_proj": {
171
+ "o1": 16,
172
+ "o2": 16,
173
+ "o3": 20,
174
+ "i1": 16,
175
+ "i2": 16,
176
+ "i3": 20,
177
+ "r0": 124,
178
+ "r1": 124,
179
+ "r2": 124,
180
+ "nnz": 1310720
181
+ },
182
+ "model.layers.2.self_attn.k_proj": {
183
+ "o1": 16,
184
+ "o2": 16,
185
+ "o3": 20,
186
+ "i1": 16,
187
+ "i2": 16,
188
+ "i3": 20,
189
+ "r0": 124,
190
+ "r1": 124,
191
+ "r2": 124,
192
+ "nnz": 1310720
193
+ },
194
+ "model.layers.2.self_attn.v_proj": {
195
+ "o1": 16,
196
+ "o2": 16,
197
+ "o3": 20,
198
+ "i1": 16,
199
+ "i2": 16,
200
+ "i3": 20,
201
+ "r0": 124,
202
+ "r1": 124,
203
+ "r2": 124,
204
+ "nnz": 1310720
205
+ },
206
+ "model.layers.2.self_attn.o_proj": {
207
+ "o1": 16,
208
+ "o2": 16,
209
+ "o3": 20,
210
+ "i1": 16,
211
+ "i2": 16,
212
+ "i3": 20,
213
+ "r0": 124,
214
+ "r1": 124,
215
+ "r2": 124,
216
+ "nnz": 1310720
217
+ },
218
+ "model.layers.2.mlp.gate_proj": {
219
+ "o1": 24,
220
+ "o2": 24,
221
+ "o3": 24,
222
+ "i1": 16,
223
+ "i2": 16,
224
+ "i3": 20,
225
+ "r0": 174,
226
+ "r1": 174,
227
+ "r2": 174,
228
+ "nnz": 3538944
229
+ },
230
+ "model.layers.2.mlp.up_proj": {
231
+ "o1": 24,
232
+ "o2": 24,
233
+ "o3": 24,
234
+ "i1": 16,
235
+ "i2": 16,
236
+ "i3": 20,
237
+ "r0": 174,
238
+ "r1": 174,
239
+ "r2": 174,
240
+ "nnz": 3538944
241
+ },
242
+ "model.layers.2.mlp.down_proj": {
243
+ "o1": 16,
244
+ "o2": 16,
245
+ "o3": 20,
246
+ "i1": 24,
247
+ "i2": 24,
248
+ "i3": 24,
249
+ "r0": 174,
250
+ "r1": 174,
251
+ "r2": 174,
252
+ "nnz": 3538944
253
+ },
254
+ "model.layers.3.self_attn.q_proj": {
255
+ "o1": 16,
256
+ "o2": 16,
257
+ "o3": 20,
258
+ "i1": 16,
259
+ "i2": 16,
260
+ "i3": 20,
261
+ "r0": 124,
262
+ "r1": 124,
263
+ "r2": 124,
264
+ "nnz": 1310720
265
+ },
266
+ "model.layers.3.self_attn.k_proj": {
267
+ "o1": 16,
268
+ "o2": 16,
269
+ "o3": 20,
270
+ "i1": 16,
271
+ "i2": 16,
272
+ "i3": 20,
273
+ "r0": 124,
274
+ "r1": 124,
275
+ "r2": 124,
276
+ "nnz": 1310720
277
+ },
278
+ "model.layers.3.self_attn.v_proj": {
279
+ "o1": 16,
280
+ "o2": 16,
281
+ "o3": 20,
282
+ "i1": 16,
283
+ "i2": 16,
284
+ "i3": 20,
285
+ "r0": 124,
286
+ "r1": 124,
287
+ "r2": 124,
288
+ "nnz": 1310720
289
+ },
290
+ "model.layers.3.self_attn.o_proj": {
291
+ "o1": 16,
292
+ "o2": 16,
293
+ "o3": 20,
294
+ "i1": 16,
295
+ "i2": 16,
296
+ "i3": 20,
297
+ "r0": 124,
298
+ "r1": 124,
299
+ "r2": 124,
300
+ "nnz": 1310720
301
+ },
302
+ "model.layers.3.mlp.gate_proj": {
303
+ "o1": 24,
304
+ "o2": 24,
305
+ "o3": 24,
306
+ "i1": 16,
307
+ "i2": 16,
308
+ "i3": 20,
309
+ "r0": 174,
310
+ "r1": 174,
311
+ "r2": 174,
312
+ "nnz": 3538944
313
+ },
314
+ "model.layers.3.mlp.up_proj": {
315
+ "o1": 24,
316
+ "o2": 24,
317
+ "o3": 24,
318
+ "i1": 16,
319
+ "i2": 16,
320
+ "i3": 20,
321
+ "r0": 174,
322
+ "r1": 174,
323
+ "r2": 174,
324
+ "nnz": 3538944
325
+ },
326
+ "model.layers.3.mlp.down_proj": {
327
+ "o1": 16,
328
+ "o2": 16,
329
+ "o3": 20,
330
+ "i1": 24,
331
+ "i2": 24,
332
+ "i3": 24,
333
+ "r0": 174,
334
+ "r1": 174,
335
+ "r2": 174,
336
+ "nnz": 3538944
337
+ },
338
+ "model.layers.4.self_attn.q_proj": {
339
+ "o1": 16,
340
+ "o2": 16,
341
+ "o3": 20,
342
+ "i1": 16,
343
+ "i2": 16,
344
+ "i3": 20,
345
+ "r0": 124,
346
+ "r1": 124,
347
+ "r2": 124,
348
+ "nnz": 1310720
349
+ },
350
+ "model.layers.4.self_attn.k_proj": {
351
+ "o1": 16,
352
+ "o2": 16,
353
+ "o3": 20,
354
+ "i1": 16,
355
+ "i2": 16,
356
+ "i3": 20,
357
+ "r0": 124,
358
+ "r1": 124,
359
+ "r2": 124,
360
+ "nnz": 1310720
361
+ },
362
+ "model.layers.4.self_attn.v_proj": {
363
+ "o1": 16,
364
+ "o2": 16,
365
+ "o3": 20,
366
+ "i1": 16,
367
+ "i2": 16,
368
+ "i3": 20,
369
+ "r0": 124,
370
+ "r1": 124,
371
+ "r2": 124,
372
+ "nnz": 1310720
373
+ },
374
+ "model.layers.4.self_attn.o_proj": {
375
+ "o1": 16,
376
+ "o2": 16,
377
+ "o3": 20,
378
+ "i1": 16,
379
+ "i2": 16,
380
+ "i3": 20,
381
+ "r0": 124,
382
+ "r1": 124,
383
+ "r2": 124,
384
+ "nnz": 1310720
385
+ },
386
+ "model.layers.4.mlp.gate_proj": {
387
+ "o1": 24,
388
+ "o2": 24,
389
+ "o3": 24,
390
+ "i1": 16,
391
+ "i2": 16,
392
+ "i3": 20,
393
+ "r0": 174,
394
+ "r1": 174,
395
+ "r2": 174,
396
+ "nnz": 3538944
397
+ },
398
+ "model.layers.4.mlp.up_proj": {
399
+ "o1": 24,
400
+ "o2": 24,
401
+ "o3": 24,
402
+ "i1": 16,
403
+ "i2": 16,
404
+ "i3": 20,
405
+ "r0": 174,
406
+ "r1": 174,
407
+ "r2": 174,
408
+ "nnz": 3538944
409
+ },
410
+ "model.layers.4.mlp.down_proj": {
411
+ "o1": 16,
412
+ "o2": 16,
413
+ "o3": 20,
414
+ "i1": 24,
415
+ "i2": 24,
416
+ "i3": 24,
417
+ "r0": 174,
418
+ "r1": 174,
419
+ "r2": 174,
420
+ "nnz": 3538944
421
+ },
422
+ "model.layers.5.self_attn.q_proj": {
423
+ "o1": 16,
424
+ "o2": 16,
425
+ "o3": 20,
426
+ "i1": 16,
427
+ "i2": 16,
428
+ "i3": 20,
429
+ "r0": 124,
430
+ "r1": 124,
431
+ "r2": 124,
432
+ "nnz": 1310720
433
+ },
434
+ "model.layers.5.self_attn.k_proj": {
435
+ "o1": 16,
436
+ "o2": 16,
437
+ "o3": 20,
438
+ "i1": 16,
439
+ "i2": 16,
440
+ "i3": 20,
441
+ "r0": 124,
442
+ "r1": 124,
443
+ "r2": 124,
444
+ "nnz": 1310720
445
+ },
446
+ "model.layers.5.self_attn.v_proj": {
447
+ "o1": 16,
448
+ "o2": 16,
449
+ "o3": 20,
450
+ "i1": 16,
451
+ "i2": 16,
452
+ "i3": 20,
453
+ "r0": 124,
454
+ "r1": 124,
455
+ "r2": 124,
456
+ "nnz": 1310720
457
+ },
458
+ "model.layers.5.self_attn.o_proj": {
459
+ "o1": 16,
460
+ "o2": 16,
461
+ "o3": 20,
462
+ "i1": 16,
463
+ "i2": 16,
464
+ "i3": 20,
465
+ "r0": 124,
466
+ "r1": 124,
467
+ "r2": 124,
468
+ "nnz": 1310720
469
+ },
470
+ "model.layers.5.mlp.gate_proj": {
471
+ "o1": 24,
472
+ "o2": 24,
473
+ "o3": 24,
474
+ "i1": 16,
475
+ "i2": 16,
476
+ "i3": 20,
477
+ "r0": 174,
478
+ "r1": 174,
479
+ "r2": 174,
480
+ "nnz": 3538944
481
+ },
482
+ "model.layers.5.mlp.up_proj": {
483
+ "o1": 24,
484
+ "o2": 24,
485
+ "o3": 24,
486
+ "i1": 16,
487
+ "i2": 16,
488
+ "i3": 20,
489
+ "r0": 174,
490
+ "r1": 174,
491
+ "r2": 174,
492
+ "nnz": 3538944
493
+ },
494
+ "model.layers.5.mlp.down_proj": {
495
+ "o1": 16,
496
+ "o2": 16,
497
+ "o3": 20,
498
+ "i1": 24,
499
+ "i2": 24,
500
+ "i3": 24,
501
+ "r0": 174,
502
+ "r1": 174,
503
+ "r2": 174,
504
+ "nnz": 3538944
505
+ },
506
+ "model.layers.6.self_attn.q_proj": {
507
+ "o1": 16,
508
+ "o2": 16,
509
+ "o3": 20,
510
+ "i1": 16,
511
+ "i2": 16,
512
+ "i3": 20,
513
+ "r0": 124,
514
+ "r1": 124,
515
+ "r2": 124,
516
+ "nnz": 1310720
517
+ },
518
+ "model.layers.6.self_attn.k_proj": {
519
+ "o1": 16,
520
+ "o2": 16,
521
+ "o3": 20,
522
+ "i1": 16,
523
+ "i2": 16,
524
+ "i3": 20,
525
+ "r0": 124,
526
+ "r1": 124,
527
+ "r2": 124,
528
+ "nnz": 1310720
529
+ },
530
+ "model.layers.6.self_attn.v_proj": {
531
+ "o1": 16,
532
+ "o2": 16,
533
+ "o3": 20,
534
+ "i1": 16,
535
+ "i2": 16,
536
+ "i3": 20,
537
+ "r0": 124,
538
+ "r1": 124,
539
+ "r2": 124,
540
+ "nnz": 1310720
541
+ },
542
+ "model.layers.6.self_attn.o_proj": {
543
+ "o1": 16,
544
+ "o2": 16,
545
+ "o3": 20,
546
+ "i1": 16,
547
+ "i2": 16,
548
+ "i3": 20,
549
+ "r0": 124,
550
+ "r1": 124,
551
+ "r2": 124,
552
+ "nnz": 1310720
553
+ },
554
+ "model.layers.6.mlp.gate_proj": {
555
+ "o1": 24,
556
+ "o2": 24,
557
+ "o3": 24,
558
+ "i1": 16,
559
+ "i2": 16,
560
+ "i3": 20,
561
+ "r0": 174,
562
+ "r1": 174,
563
+ "r2": 174,
564
+ "nnz": 3538944
565
+ },
566
+ "model.layers.6.mlp.up_proj": {
567
+ "o1": 24,
568
+ "o2": 24,
569
+ "o3": 24,
570
+ "i1": 16,
571
+ "i2": 16,
572
+ "i3": 20,
573
+ "r0": 174,
574
+ "r1": 174,
575
+ "r2": 174,
576
+ "nnz": 3538944
577
+ },
578
+ "model.layers.6.mlp.down_proj": {
579
+ "o1": 16,
580
+ "o2": 16,
581
+ "o3": 20,
582
+ "i1": 24,
583
+ "i2": 24,
584
+ "i3": 24,
585
+ "r0": 174,
586
+ "r1": 174,
587
+ "r2": 174,
588
+ "nnz": 3538944
589
+ },
590
+ "model.layers.7.self_attn.q_proj": {
591
+ "o1": 16,
592
+ "o2": 16,
593
+ "o3": 20,
594
+ "i1": 16,
595
+ "i2": 16,
596
+ "i3": 20,
597
+ "r0": 124,
598
+ "r1": 124,
599
+ "r2": 124,
600
+ "nnz": 1310720
601
+ },
602
+ "model.layers.7.self_attn.k_proj": {
603
+ "o1": 16,
604
+ "o2": 16,
605
+ "o3": 20,
606
+ "i1": 16,
607
+ "i2": 16,
608
+ "i3": 20,
609
+ "r0": 124,
610
+ "r1": 124,
611
+ "r2": 124,
612
+ "nnz": 1310720
613
+ },
614
+ "model.layers.7.self_attn.v_proj": {
615
+ "o1": 16,
616
+ "o2": 16,
617
+ "o3": 20,
618
+ "i1": 16,
619
+ "i2": 16,
620
+ "i3": 20,
621
+ "r0": 124,
622
+ "r1": 124,
623
+ "r2": 124,
624
+ "nnz": 1310720
625
+ },
626
+ "model.layers.7.self_attn.o_proj": {
627
+ "o1": 16,
628
+ "o2": 16,
629
+ "o3": 20,
630
+ "i1": 16,
631
+ "i2": 16,
632
+ "i3": 20,
633
+ "r0": 124,
634
+ "r1": 124,
635
+ "r2": 124,
636
+ "nnz": 1310720
637
+ },
638
+ "model.layers.7.mlp.gate_proj": {
639
+ "o1": 24,
640
+ "o2": 24,
641
+ "o3": 24,
642
+ "i1": 16,
643
+ "i2": 16,
644
+ "i3": 20,
645
+ "r0": 174,
646
+ "r1": 174,
647
+ "r2": 174,
648
+ "nnz": 3538944
649
+ },
650
+ "model.layers.7.mlp.up_proj": {
651
+ "o1": 24,
652
+ "o2": 24,
653
+ "o3": 24,
654
+ "i1": 16,
655
+ "i2": 16,
656
+ "i3": 20,
657
+ "r0": 174,
658
+ "r1": 174,
659
+ "r2": 174,
660
+ "nnz": 3538944
661
+ },
662
+ "model.layers.7.mlp.down_proj": {
663
+ "o1": 16,
664
+ "o2": 16,
665
+ "o3": 20,
666
+ "i1": 24,
667
+ "i2": 24,
668
+ "i3": 24,
669
+ "r0": 174,
670
+ "r1": 174,
671
+ "r2": 174,
672
+ "nnz": 3538944
673
+ },
674
+ "model.layers.8.self_attn.q_proj": {
675
+ "o1": 16,
676
+ "o2": 16,
677
+ "o3": 20,
678
+ "i1": 16,
679
+ "i2": 16,
680
+ "i3": 20,
681
+ "r0": 124,
682
+ "r1": 124,
683
+ "r2": 124,
684
+ "nnz": 1310720
685
+ },
686
+ "model.layers.8.self_attn.k_proj": {
687
+ "o1": 16,
688
+ "o2": 16,
689
+ "o3": 20,
690
+ "i1": 16,
691
+ "i2": 16,
692
+ "i3": 20,
693
+ "r0": 124,
694
+ "r1": 124,
695
+ "r2": 124,
696
+ "nnz": 1310720
697
+ },
698
+ "model.layers.8.self_attn.v_proj": {
699
+ "o1": 16,
700
+ "o2": 16,
701
+ "o3": 20,
702
+ "i1": 16,
703
+ "i2": 16,
704
+ "i3": 20,
705
+ "r0": 124,
706
+ "r1": 124,
707
+ "r2": 124,
708
+ "nnz": 1310720
709
+ },
710
+ "model.layers.8.self_attn.o_proj": {
711
+ "o1": 16,
712
+ "o2": 16,
713
+ "o3": 20,
714
+ "i1": 16,
715
+ "i2": 16,
716
+ "i3": 20,
717
+ "r0": 124,
718
+ "r1": 124,
719
+ "r2": 124,
720
+ "nnz": 1310720
721
+ },
722
+ "model.layers.8.mlp.gate_proj": {
723
+ "o1": 24,
724
+ "o2": 24,
725
+ "o3": 24,
726
+ "i1": 16,
727
+ "i2": 16,
728
+ "i3": 20,
729
+ "r0": 174,
730
+ "r1": 174,
731
+ "r2": 174,
732
+ "nnz": 3538944
733
+ },
734
+ "model.layers.8.mlp.up_proj": {
735
+ "o1": 24,
736
+ "o2": 24,
737
+ "o3": 24,
738
+ "i1": 16,
739
+ "i2": 16,
740
+ "i3": 20,
741
+ "r0": 174,
742
+ "r1": 174,
743
+ "r2": 174,
744
+ "nnz": 3538944
745
+ },
746
+ "model.layers.8.mlp.down_proj": {
747
+ "o1": 16,
748
+ "o2": 16,
749
+ "o3": 20,
750
+ "i1": 24,
751
+ "i2": 24,
752
+ "i3": 24,
753
+ "r0": 174,
754
+ "r1": 174,
755
+ "r2": 174,
756
+ "nnz": 3538944
757
+ },
758
+ "model.layers.9.self_attn.q_proj": {
759
+ "o1": 16,
760
+ "o2": 16,
761
+ "o3": 20,
762
+ "i1": 16,
763
+ "i2": 16,
764
+ "i3": 20,
765
+ "r0": 124,
766
+ "r1": 124,
767
+ "r2": 124,
768
+ "nnz": 1310720
769
+ },
770
+ "model.layers.9.self_attn.k_proj": {
771
+ "o1": 16,
772
+ "o2": 16,
773
+ "o3": 20,
774
+ "i1": 16,
775
+ "i2": 16,
776
+ "i3": 20,
777
+ "r0": 124,
778
+ "r1": 124,
779
+ "r2": 124,
780
+ "nnz": 1310720
781
+ },
782
+ "model.layers.9.self_attn.v_proj": {
783
+ "o1": 16,
784
+ "o2": 16,
785
+ "o3": 20,
786
+ "i1": 16,
787
+ "i2": 16,
788
+ "i3": 20,
789
+ "r0": 124,
790
+ "r1": 124,
791
+ "r2": 124,
792
+ "nnz": 1310720
793
+ },
794
+ "model.layers.9.self_attn.o_proj": {
795
+ "o1": 16,
796
+ "o2": 16,
797
+ "o3": 20,
798
+ "i1": 16,
799
+ "i2": 16,
800
+ "i3": 20,
801
+ "r0": 124,
802
+ "r1": 124,
803
+ "r2": 124,
804
+ "nnz": 1310720
805
+ },
806
+ "model.layers.9.mlp.gate_proj": {
807
+ "o1": 24,
808
+ "o2": 24,
809
+ "o3": 24,
810
+ "i1": 16,
811
+ "i2": 16,
812
+ "i3": 20,
813
+ "r0": 174,
814
+ "r1": 174,
815
+ "r2": 174,
816
+ "nnz": 3538944
817
+ },
818
+ "model.layers.9.mlp.up_proj": {
819
+ "o1": 24,
820
+ "o2": 24,
821
+ "o3": 24,
822
+ "i1": 16,
823
+ "i2": 16,
824
+ "i3": 20,
825
+ "r0": 174,
826
+ "r1": 174,
827
+ "r2": 174,
828
+ "nnz": 3538944
829
+ },
830
+ "model.layers.9.mlp.down_proj": {
831
+ "o1": 16,
832
+ "o2": 16,
833
+ "o3": 20,
834
+ "i1": 24,
835
+ "i2": 24,
836
+ "i3": 24,
837
+ "r0": 174,
838
+ "r1": 174,
839
+ "r2": 174,
840
+ "nnz": 3538944
841
+ },
842
+ "model.layers.10.self_attn.q_proj": {
843
+ "o1": 16,
844
+ "o2": 16,
845
+ "o3": 20,
846
+ "i1": 16,
847
+ "i2": 16,
848
+ "i3": 20,
849
+ "r0": 124,
850
+ "r1": 124,
851
+ "r2": 124,
852
+ "nnz": 1310720
853
+ },
854
+ "model.layers.10.self_attn.k_proj": {
855
+ "o1": 16,
856
+ "o2": 16,
857
+ "o3": 20,
858
+ "i1": 16,
859
+ "i2": 16,
860
+ "i3": 20,
861
+ "r0": 124,
862
+ "r1": 124,
863
+ "r2": 124,
864
+ "nnz": 1310720
865
+ },
866
+ "model.layers.10.self_attn.v_proj": {
867
+ "o1": 16,
868
+ "o2": 16,
869
+ "o3": 20,
870
+ "i1": 16,
871
+ "i2": 16,
872
+ "i3": 20,
873
+ "r0": 124,
874
+ "r1": 124,
875
+ "r2": 124,
876
+ "nnz": 1310720
877
+ },
878
+ "model.layers.10.self_attn.o_proj": {
879
+ "o1": 16,
880
+ "o2": 16,
881
+ "o3": 20,
882
+ "i1": 16,
883
+ "i2": 16,
884
+ "i3": 20,
885
+ "r0": 124,
886
+ "r1": 124,
887
+ "r2": 124,
888
+ "nnz": 1310720
889
+ },
890
+ "model.layers.10.mlp.gate_proj": {
891
+ "o1": 24,
892
+ "o2": 24,
893
+ "o3": 24,
894
+ "i1": 16,
895
+ "i2": 16,
896
+ "i3": 20,
897
+ "r0": 174,
898
+ "r1": 174,
899
+ "r2": 174,
900
+ "nnz": 3538944
901
+ },
902
+ "model.layers.10.mlp.up_proj": {
903
+ "o1": 24,
904
+ "o2": 24,
905
+ "o3": 24,
906
+ "i1": 16,
907
+ "i2": 16,
908
+ "i3": 20,
909
+ "r0": 174,
910
+ "r1": 174,
911
+ "r2": 174,
912
+ "nnz": 3538944
913
+ },
914
+ "model.layers.10.mlp.down_proj": {
915
+ "o1": 16,
916
+ "o2": 16,
917
+ "o3": 20,
918
+ "i1": 24,
919
+ "i2": 24,
920
+ "i3": 24,
921
+ "r0": 174,
922
+ "r1": 174,
923
+ "r2": 174,
924
+ "nnz": 3538944
925
+ },
926
+ "model.layers.11.self_attn.q_proj": {
927
+ "o1": 16,
928
+ "o2": 16,
929
+ "o3": 20,
930
+ "i1": 16,
931
+ "i2": 16,
932
+ "i3": 20,
933
+ "r0": 124,
934
+ "r1": 124,
935
+ "r2": 124,
936
+ "nnz": 1310720
937
+ },
938
+ "model.layers.11.self_attn.k_proj": {
939
+ "o1": 16,
940
+ "o2": 16,
941
+ "o3": 20,
942
+ "i1": 16,
943
+ "i2": 16,
944
+ "i3": 20,
945
+ "r0": 124,
946
+ "r1": 124,
947
+ "r2": 124,
948
+ "nnz": 1310720
949
+ },
950
+ "model.layers.11.self_attn.v_proj": {
951
+ "o1": 16,
952
+ "o2": 16,
953
+ "o3": 20,
954
+ "i1": 16,
955
+ "i2": 16,
956
+ "i3": 20,
957
+ "r0": 124,
958
+ "r1": 124,
959
+ "r2": 124,
960
+ "nnz": 1310720
961
+ },
962
+ "model.layers.11.self_attn.o_proj": {
963
+ "o1": 16,
964
+ "o2": 16,
965
+ "o3": 20,
966
+ "i1": 16,
967
+ "i2": 16,
968
+ "i3": 20,
969
+ "r0": 124,
970
+ "r1": 124,
971
+ "r2": 124,
972
+ "nnz": 1310720
973
+ },
974
+ "model.layers.11.mlp.gate_proj": {
975
+ "o1": 24,
976
+ "o2": 24,
977
+ "o3": 24,
978
+ "i1": 16,
979
+ "i2": 16,
980
+ "i3": 20,
981
+ "r0": 174,
982
+ "r1": 174,
983
+ "r2": 174,
984
+ "nnz": 3538944
985
+ },
986
+ "model.layers.11.mlp.up_proj": {
987
+ "o1": 24,
988
+ "o2": 24,
989
+ "o3": 24,
990
+ "i1": 16,
991
+ "i2": 16,
992
+ "i3": 20,
993
+ "r0": 174,
994
+ "r1": 174,
995
+ "r2": 174,
996
+ "nnz": 3538944
997
+ },
998
+ "model.layers.11.mlp.down_proj": {
999
+ "o1": 16,
1000
+ "o2": 16,
1001
+ "o3": 20,
1002
+ "i1": 24,
1003
+ "i2": 24,
1004
+ "i3": 24,
1005
+ "r0": 174,
1006
+ "r1": 174,
1007
+ "r2": 174,
1008
+ "nnz": 3538944
1009
+ },
1010
+ "model.layers.12.self_attn.q_proj": {
1011
+ "o1": 16,
1012
+ "o2": 16,
1013
+ "o3": 20,
1014
+ "i1": 16,
1015
+ "i2": 16,
1016
+ "i3": 20,
1017
+ "r0": 124,
1018
+ "r1": 124,
1019
+ "r2": 124,
1020
+ "nnz": 1310720
1021
+ },
1022
+ "model.layers.12.self_attn.k_proj": {
1023
+ "o1": 16,
1024
+ "o2": 16,
1025
+ "o3": 20,
1026
+ "i1": 16,
1027
+ "i2": 16,
1028
+ "i3": 20,
1029
+ "r0": 124,
1030
+ "r1": 124,
1031
+ "r2": 124,
1032
+ "nnz": 1310720
1033
+ },
1034
+ "model.layers.12.self_attn.v_proj": {
1035
+ "o1": 16,
1036
+ "o2": 16,
1037
+ "o3": 20,
1038
+ "i1": 16,
1039
+ "i2": 16,
1040
+ "i3": 20,
1041
+ "r0": 124,
1042
+ "r1": 124,
1043
+ "r2": 124,
1044
+ "nnz": 1310720
1045
+ },
1046
+ "model.layers.12.self_attn.o_proj": {
1047
+ "o1": 16,
1048
+ "o2": 16,
1049
+ "o3": 20,
1050
+ "i1": 16,
1051
+ "i2": 16,
1052
+ "i3": 20,
1053
+ "r0": 124,
1054
+ "r1": 124,
1055
+ "r2": 124,
1056
+ "nnz": 1310720
1057
+ },
1058
+ "model.layers.12.mlp.gate_proj": {
1059
+ "o1": 24,
1060
+ "o2": 24,
1061
+ "o3": 24,
1062
+ "i1": 16,
1063
+ "i2": 16,
1064
+ "i3": 20,
1065
+ "r0": 174,
1066
+ "r1": 174,
1067
+ "r2": 174,
1068
+ "nnz": 3538944
1069
+ },
1070
+ "model.layers.12.mlp.up_proj": {
1071
+ "o1": 24,
1072
+ "o2": 24,
1073
+ "o3": 24,
1074
+ "i1": 16,
1075
+ "i2": 16,
1076
+ "i3": 20,
1077
+ "r0": 174,
1078
+ "r1": 174,
1079
+ "r2": 174,
1080
+ "nnz": 3538944
1081
+ },
1082
+ "model.layers.12.mlp.down_proj": {
1083
+ "o1": 16,
1084
+ "o2": 16,
1085
+ "o3": 20,
1086
+ "i1": 24,
1087
+ "i2": 24,
1088
+ "i3": 24,
1089
+ "r0": 174,
1090
+ "r1": 174,
1091
+ "r2": 174,
1092
+ "nnz": 3538944
1093
+ },
1094
+ "model.layers.13.self_attn.q_proj": {
1095
+ "o1": 16,
1096
+ "o2": 16,
1097
+ "o3": 20,
1098
+ "i1": 16,
1099
+ "i2": 16,
1100
+ "i3": 20,
1101
+ "r0": 124,
1102
+ "r1": 124,
1103
+ "r2": 124,
1104
+ "nnz": 1310720
1105
+ },
1106
+ "model.layers.13.self_attn.k_proj": {
1107
+ "o1": 16,
1108
+ "o2": 16,
1109
+ "o3": 20,
1110
+ "i1": 16,
1111
+ "i2": 16,
1112
+ "i3": 20,
1113
+ "r0": 124,
1114
+ "r1": 124,
1115
+ "r2": 124,
1116
+ "nnz": 1310720
1117
+ },
1118
+ "model.layers.13.self_attn.v_proj": {
1119
+ "o1": 16,
1120
+ "o2": 16,
1121
+ "o3": 20,
1122
+ "i1": 16,
1123
+ "i2": 16,
1124
+ "i3": 20,
1125
+ "r0": 124,
1126
+ "r1": 124,
1127
+ "r2": 124,
1128
+ "nnz": 1310720
1129
+ },
1130
+ "model.layers.13.self_attn.o_proj": {
1131
+ "o1": 16,
1132
+ "o2": 16,
1133
+ "o3": 20,
1134
+ "i1": 16,
1135
+ "i2": 16,
1136
+ "i3": 20,
1137
+ "r0": 124,
1138
+ "r1": 124,
1139
+ "r2": 124,
1140
+ "nnz": 1310720
1141
+ },
1142
+ "model.layers.13.mlp.gate_proj": {
1143
+ "o1": 24,
1144
+ "o2": 24,
1145
+ "o3": 24,
1146
+ "i1": 16,
1147
+ "i2": 16,
1148
+ "i3": 20,
1149
+ "r0": 174,
1150
+ "r1": 174,
1151
+ "r2": 174,
1152
+ "nnz": 3538944
1153
+ },
1154
+ "model.layers.13.mlp.up_proj": {
1155
+ "o1": 24,
1156
+ "o2": 24,
1157
+ "o3": 24,
1158
+ "i1": 16,
1159
+ "i2": 16,
1160
+ "i3": 20,
1161
+ "r0": 174,
1162
+ "r1": 174,
1163
+ "r2": 174,
1164
+ "nnz": 3538944
1165
+ },
1166
+ "model.layers.13.mlp.down_proj": {
1167
+ "o1": 16,
1168
+ "o2": 16,
1169
+ "o3": 20,
1170
+ "i1": 24,
1171
+ "i2": 24,
1172
+ "i3": 24,
1173
+ "r0": 174,
1174
+ "r1": 174,
1175
+ "r2": 174,
1176
+ "nnz": 3538944
1177
+ },
1178
+ "model.layers.14.self_attn.q_proj": {
1179
+ "o1": 16,
1180
+ "o2": 16,
1181
+ "o3": 20,
1182
+ "i1": 16,
1183
+ "i2": 16,
1184
+ "i3": 20,
1185
+ "r0": 124,
1186
+ "r1": 124,
1187
+ "r2": 124,
1188
+ "nnz": 1310720
1189
+ },
1190
+ "model.layers.14.self_attn.k_proj": {
1191
+ "o1": 16,
1192
+ "o2": 16,
1193
+ "o3": 20,
1194
+ "i1": 16,
1195
+ "i2": 16,
1196
+ "i3": 20,
1197
+ "r0": 124,
1198
+ "r1": 124,
1199
+ "r2": 124,
1200
+ "nnz": 1310720
1201
+ },
1202
+ "model.layers.14.self_attn.v_proj": {
1203
+ "o1": 16,
1204
+ "o2": 16,
1205
+ "o3": 20,
1206
+ "i1": 16,
1207
+ "i2": 16,
1208
+ "i3": 20,
1209
+ "r0": 124,
1210
+ "r1": 124,
1211
+ "r2": 124,
1212
+ "nnz": 1310720
1213
+ },
1214
+ "model.layers.14.self_attn.o_proj": {
1215
+ "o1": 16,
1216
+ "o2": 16,
1217
+ "o3": 20,
1218
+ "i1": 16,
1219
+ "i2": 16,
1220
+ "i3": 20,
1221
+ "r0": 124,
1222
+ "r1": 124,
1223
+ "r2": 124,
1224
+ "nnz": 1310720
1225
+ },
1226
+ "model.layers.14.mlp.gate_proj": {
1227
+ "o1": 24,
1228
+ "o2": 24,
1229
+ "o3": 24,
1230
+ "i1": 16,
1231
+ "i2": 16,
1232
+ "i3": 20,
1233
+ "r0": 174,
1234
+ "r1": 174,
1235
+ "r2": 174,
1236
+ "nnz": 3538944
1237
+ },
1238
+ "model.layers.14.mlp.up_proj": {
1239
+ "o1": 24,
1240
+ "o2": 24,
1241
+ "o3": 24,
1242
+ "i1": 16,
1243
+ "i2": 16,
1244
+ "i3": 20,
1245
+ "r0": 174,
1246
+ "r1": 174,
1247
+ "r2": 174,
1248
+ "nnz": 3538944
1249
+ },
1250
+ "model.layers.14.mlp.down_proj": {
1251
+ "o1": 16,
1252
+ "o2": 16,
1253
+ "o3": 20,
1254
+ "i1": 24,
1255
+ "i2": 24,
1256
+ "i3": 24,
1257
+ "r0": 174,
1258
+ "r1": 174,
1259
+ "r2": 174,
1260
+ "nnz": 3538944
1261
+ },
1262
+ "model.layers.15.self_attn.q_proj": {
1263
+ "o1": 16,
1264
+ "o2": 16,
1265
+ "o3": 20,
1266
+ "i1": 16,
1267
+ "i2": 16,
1268
+ "i3": 20,
1269
+ "r0": 124,
1270
+ "r1": 124,
1271
+ "r2": 124,
1272
+ "nnz": 1310720
1273
+ },
1274
+ "model.layers.15.self_attn.k_proj": {
1275
+ "o1": 16,
1276
+ "o2": 16,
1277
+ "o3": 20,
1278
+ "i1": 16,
1279
+ "i2": 16,
1280
+ "i3": 20,
1281
+ "r0": 124,
1282
+ "r1": 124,
1283
+ "r2": 124,
1284
+ "nnz": 1310720
1285
+ },
1286
+ "model.layers.15.self_attn.v_proj": {
1287
+ "o1": 16,
1288
+ "o2": 16,
1289
+ "o3": 20,
1290
+ "i1": 16,
1291
+ "i2": 16,
1292
+ "i3": 20,
1293
+ "r0": 124,
1294
+ "r1": 124,
1295
+ "r2": 124,
1296
+ "nnz": 1310720
1297
+ },
1298
+ "model.layers.15.self_attn.o_proj": {
1299
+ "o1": 16,
1300
+ "o2": 16,
1301
+ "o3": 20,
1302
+ "i1": 16,
1303
+ "i2": 16,
1304
+ "i3": 20,
1305
+ "r0": 124,
1306
+ "r1": 124,
1307
+ "r2": 124,
1308
+ "nnz": 1310720
1309
+ },
1310
+ "model.layers.15.mlp.gate_proj": {
1311
+ "o1": 24,
1312
+ "o2": 24,
1313
+ "o3": 24,
1314
+ "i1": 16,
1315
+ "i2": 16,
1316
+ "i3": 20,
1317
+ "r0": 174,
1318
+ "r1": 174,
1319
+ "r2": 174,
1320
+ "nnz": 3538944
1321
+ },
1322
+ "model.layers.15.mlp.up_proj": {
1323
+ "o1": 24,
1324
+ "o2": 24,
1325
+ "o3": 24,
1326
+ "i1": 16,
1327
+ "i2": 16,
1328
+ "i3": 20,
1329
+ "r0": 174,
1330
+ "r1": 174,
1331
+ "r2": 174,
1332
+ "nnz": 3538944
1333
+ },
1334
+ "model.layers.15.mlp.down_proj": {
1335
+ "o1": 16,
1336
+ "o2": 16,
1337
+ "o3": 20,
1338
+ "i1": 24,
1339
+ "i2": 24,
1340
+ "i3": 24,
1341
+ "r0": 174,
1342
+ "r1": 174,
1343
+ "r2": 174,
1344
+ "nnz": 3538944
1345
+ },
1346
+ "model.layers.16.self_attn.q_proj": {
1347
+ "o1": 16,
1348
+ "o2": 16,
1349
+ "o3": 20,
1350
+ "i1": 16,
1351
+ "i2": 16,
1352
+ "i3": 20,
1353
+ "r0": 124,
1354
+ "r1": 124,
1355
+ "r2": 124,
1356
+ "nnz": 1310720
1357
+ },
1358
+ "model.layers.16.self_attn.k_proj": {
1359
+ "o1": 16,
1360
+ "o2": 16,
1361
+ "o3": 20,
1362
+ "i1": 16,
1363
+ "i2": 16,
1364
+ "i3": 20,
1365
+ "r0": 124,
1366
+ "r1": 124,
1367
+ "r2": 124,
1368
+ "nnz": 1310720
1369
+ },
1370
+ "model.layers.16.self_attn.v_proj": {
1371
+ "o1": 16,
1372
+ "o2": 16,
1373
+ "o3": 20,
1374
+ "i1": 16,
1375
+ "i2": 16,
1376
+ "i3": 20,
1377
+ "r0": 124,
1378
+ "r1": 124,
1379
+ "r2": 124,
1380
+ "nnz": 1310720
1381
+ },
1382
+ "model.layers.16.self_attn.o_proj": {
1383
+ "o1": 16,
1384
+ "o2": 16,
1385
+ "o3": 20,
1386
+ "i1": 16,
1387
+ "i2": 16,
1388
+ "i3": 20,
1389
+ "r0": 124,
1390
+ "r1": 124,
1391
+ "r2": 124,
1392
+ "nnz": 1310720
1393
+ },
1394
+ "model.layers.16.mlp.gate_proj": {
1395
+ "o1": 24,
1396
+ "o2": 24,
1397
+ "o3": 24,
1398
+ "i1": 16,
1399
+ "i2": 16,
1400
+ "i3": 20,
1401
+ "r0": 174,
1402
+ "r1": 174,
1403
+ "r2": 174,
1404
+ "nnz": 3538944
1405
+ },
1406
+ "model.layers.16.mlp.up_proj": {
1407
+ "o1": 24,
1408
+ "o2": 24,
1409
+ "o3": 24,
1410
+ "i1": 16,
1411
+ "i2": 16,
1412
+ "i3": 20,
1413
+ "r0": 174,
1414
+ "r1": 174,
1415
+ "r2": 174,
1416
+ "nnz": 3538944
1417
+ },
1418
+ "model.layers.16.mlp.down_proj": {
1419
+ "o1": 16,
1420
+ "o2": 16,
1421
+ "o3": 20,
1422
+ "i1": 24,
1423
+ "i2": 24,
1424
+ "i3": 24,
1425
+ "r0": 174,
1426
+ "r1": 174,
1427
+ "r2": 174,
1428
+ "nnz": 3538944
1429
+ },
1430
+ "model.layers.17.self_attn.q_proj": {
1431
+ "o1": 16,
1432
+ "o2": 16,
1433
+ "o3": 20,
1434
+ "i1": 16,
1435
+ "i2": 16,
1436
+ "i3": 20,
1437
+ "r0": 124,
1438
+ "r1": 124,
1439
+ "r2": 124,
1440
+ "nnz": 1310720
1441
+ },
1442
+ "model.layers.17.self_attn.k_proj": {
1443
+ "o1": 16,
1444
+ "o2": 16,
1445
+ "o3": 20,
1446
+ "i1": 16,
1447
+ "i2": 16,
1448
+ "i3": 20,
1449
+ "r0": 124,
1450
+ "r1": 124,
1451
+ "r2": 124,
1452
+ "nnz": 1310720
1453
+ },
1454
+ "model.layers.17.self_attn.v_proj": {
1455
+ "o1": 16,
1456
+ "o2": 16,
1457
+ "o3": 20,
1458
+ "i1": 16,
1459
+ "i2": 16,
1460
+ "i3": 20,
1461
+ "r0": 124,
1462
+ "r1": 124,
1463
+ "r2": 124,
1464
+ "nnz": 1310720
1465
+ },
1466
+ "model.layers.17.self_attn.o_proj": {
1467
+ "o1": 16,
1468
+ "o2": 16,
1469
+ "o3": 20,
1470
+ "i1": 16,
1471
+ "i2": 16,
1472
+ "i3": 20,
1473
+ "r0": 124,
1474
+ "r1": 124,
1475
+ "r2": 124,
1476
+ "nnz": 1310720
1477
+ },
1478
+ "model.layers.17.mlp.gate_proj": {
1479
+ "o1": 24,
1480
+ "o2": 24,
1481
+ "o3": 24,
1482
+ "i1": 16,
1483
+ "i2": 16,
1484
+ "i3": 20,
1485
+ "r0": 174,
1486
+ "r1": 174,
1487
+ "r2": 174,
1488
+ "nnz": 3538944
1489
+ },
1490
+ "model.layers.17.mlp.up_proj": {
1491
+ "o1": 24,
1492
+ "o2": 24,
1493
+ "o3": 24,
1494
+ "i1": 16,
1495
+ "i2": 16,
1496
+ "i3": 20,
1497
+ "r0": 174,
1498
+ "r1": 174,
1499
+ "r2": 174,
1500
+ "nnz": 3538944
1501
+ },
1502
+ "model.layers.17.mlp.down_proj": {
1503
+ "o1": 16,
1504
+ "o2": 16,
1505
+ "o3": 20,
1506
+ "i1": 24,
1507
+ "i2": 24,
1508
+ "i3": 24,
1509
+ "r0": 174,
1510
+ "r1": 174,
1511
+ "r2": 174,
1512
+ "nnz": 3538944
1513
+ },
1514
+ "model.layers.18.self_attn.q_proj": {
1515
+ "o1": 16,
1516
+ "o2": 16,
1517
+ "o3": 20,
1518
+ "i1": 16,
1519
+ "i2": 16,
1520
+ "i3": 20,
1521
+ "r0": 124,
1522
+ "r1": 124,
1523
+ "r2": 124,
1524
+ "nnz": 1310720
1525
+ },
1526
+ "model.layers.18.self_attn.k_proj": {
1527
+ "o1": 16,
1528
+ "o2": 16,
1529
+ "o3": 20,
1530
+ "i1": 16,
1531
+ "i2": 16,
1532
+ "i3": 20,
1533
+ "r0": 124,
1534
+ "r1": 124,
1535
+ "r2": 124,
1536
+ "nnz": 1310720
1537
+ },
1538
+ "model.layers.18.self_attn.v_proj": {
1539
+ "o1": 16,
1540
+ "o2": 16,
1541
+ "o3": 20,
1542
+ "i1": 16,
1543
+ "i2": 16,
1544
+ "i3": 20,
1545
+ "r0": 124,
1546
+ "r1": 124,
1547
+ "r2": 124,
1548
+ "nnz": 1310720
1549
+ },
1550
+ "model.layers.18.self_attn.o_proj": {
1551
+ "o1": 16,
1552
+ "o2": 16,
1553
+ "o3": 20,
1554
+ "i1": 16,
1555
+ "i2": 16,
1556
+ "i3": 20,
1557
+ "r0": 124,
1558
+ "r1": 124,
1559
+ "r2": 124,
1560
+ "nnz": 1310720
1561
+ },
1562
+ "model.layers.18.mlp.gate_proj": {
1563
+ "o1": 24,
1564
+ "o2": 24,
1565
+ "o3": 24,
1566
+ "i1": 16,
1567
+ "i2": 16,
1568
+ "i3": 20,
1569
+ "r0": 174,
1570
+ "r1": 174,
1571
+ "r2": 174,
1572
+ "nnz": 3538944
1573
+ },
1574
+ "model.layers.18.mlp.up_proj": {
1575
+ "o1": 24,
1576
+ "o2": 24,
1577
+ "o3": 24,
1578
+ "i1": 16,
1579
+ "i2": 16,
1580
+ "i3": 20,
1581
+ "r0": 174,
1582
+ "r1": 174,
1583
+ "r2": 174,
1584
+ "nnz": 3538944
1585
+ },
1586
+ "model.layers.18.mlp.down_proj": {
1587
+ "o1": 16,
1588
+ "o2": 16,
1589
+ "o3": 20,
1590
+ "i1": 24,
1591
+ "i2": 24,
1592
+ "i3": 24,
1593
+ "r0": 174,
1594
+ "r1": 174,
1595
+ "r2": 174,
1596
+ "nnz": 3538944
1597
+ },
1598
+ "model.layers.19.self_attn.q_proj": {
1599
+ "o1": 16,
1600
+ "o2": 16,
1601
+ "o3": 20,
1602
+ "i1": 16,
1603
+ "i2": 16,
1604
+ "i3": 20,
1605
+ "r0": 124,
1606
+ "r1": 124,
1607
+ "r2": 124,
1608
+ "nnz": 1310720
1609
+ },
1610
+ "model.layers.19.self_attn.k_proj": {
1611
+ "o1": 16,
1612
+ "o2": 16,
1613
+ "o3": 20,
1614
+ "i1": 16,
1615
+ "i2": 16,
1616
+ "i3": 20,
1617
+ "r0": 124,
1618
+ "r1": 124,
1619
+ "r2": 124,
1620
+ "nnz": 1310720
1621
+ },
1622
+ "model.layers.19.self_attn.v_proj": {
1623
+ "o1": 16,
1624
+ "o2": 16,
1625
+ "o3": 20,
1626
+ "i1": 16,
1627
+ "i2": 16,
1628
+ "i3": 20,
1629
+ "r0": 124,
1630
+ "r1": 124,
1631
+ "r2": 124,
1632
+ "nnz": 1310720
1633
+ },
1634
+ "model.layers.19.self_attn.o_proj": {
1635
+ "o1": 16,
1636
+ "o2": 16,
1637
+ "o3": 20,
1638
+ "i1": 16,
1639
+ "i2": 16,
1640
+ "i3": 20,
1641
+ "r0": 124,
1642
+ "r1": 124,
1643
+ "r2": 124,
1644
+ "nnz": 1310720
1645
+ },
1646
+ "model.layers.19.mlp.gate_proj": {
1647
+ "o1": 24,
1648
+ "o2": 24,
1649
+ "o3": 24,
1650
+ "i1": 16,
1651
+ "i2": 16,
1652
+ "i3": 20,
1653
+ "r0": 174,
1654
+ "r1": 174,
1655
+ "r2": 174,
1656
+ "nnz": 3538944
1657
+ },
1658
+ "model.layers.19.mlp.up_proj": {
1659
+ "o1": 24,
1660
+ "o2": 24,
1661
+ "o3": 24,
1662
+ "i1": 16,
1663
+ "i2": 16,
1664
+ "i3": 20,
1665
+ "r0": 174,
1666
+ "r1": 174,
1667
+ "r2": 174,
1668
+ "nnz": 3538944
1669
+ },
1670
+ "model.layers.19.mlp.down_proj": {
1671
+ "o1": 16,
1672
+ "o2": 16,
1673
+ "o3": 20,
1674
+ "i1": 24,
1675
+ "i2": 24,
1676
+ "i3": 24,
1677
+ "r0": 174,
1678
+ "r1": 174,
1679
+ "r2": 174,
1680
+ "nnz": 3538944
1681
+ },
1682
+ "model.layers.20.self_attn.q_proj": {
1683
+ "o1": 16,
1684
+ "o2": 16,
1685
+ "o3": 20,
1686
+ "i1": 16,
1687
+ "i2": 16,
1688
+ "i3": 20,
1689
+ "r0": 124,
1690
+ "r1": 124,
1691
+ "r2": 124,
1692
+ "nnz": 1310720
1693
+ },
1694
+ "model.layers.20.self_attn.k_proj": {
1695
+ "o1": 16,
1696
+ "o2": 16,
1697
+ "o3": 20,
1698
+ "i1": 16,
1699
+ "i2": 16,
1700
+ "i3": 20,
1701
+ "r0": 124,
1702
+ "r1": 124,
1703
+ "r2": 124,
1704
+ "nnz": 1310720
1705
+ },
1706
+ "model.layers.20.self_attn.v_proj": {
1707
+ "o1": 16,
1708
+ "o2": 16,
1709
+ "o3": 20,
1710
+ "i1": 16,
1711
+ "i2": 16,
1712
+ "i3": 20,
1713
+ "r0": 124,
1714
+ "r1": 124,
1715
+ "r2": 124,
1716
+ "nnz": 1310720
1717
+ },
1718
+ "model.layers.20.self_attn.o_proj": {
1719
+ "o1": 16,
1720
+ "o2": 16,
1721
+ "o3": 20,
1722
+ "i1": 16,
1723
+ "i2": 16,
1724
+ "i3": 20,
1725
+ "r0": 124,
1726
+ "r1": 124,
1727
+ "r2": 124,
1728
+ "nnz": 1310720
1729
+ },
1730
+ "model.layers.20.mlp.gate_proj": {
1731
+ "o1": 24,
1732
+ "o2": 24,
1733
+ "o3": 24,
1734
+ "i1": 16,
1735
+ "i2": 16,
1736
+ "i3": 20,
1737
+ "r0": 174,
1738
+ "r1": 174,
1739
+ "r2": 174,
1740
+ "nnz": 3538944
1741
+ },
1742
+ "model.layers.20.mlp.up_proj": {
1743
+ "o1": 24,
1744
+ "o2": 24,
1745
+ "o3": 24,
1746
+ "i1": 16,
1747
+ "i2": 16,
1748
+ "i3": 20,
1749
+ "r0": 174,
1750
+ "r1": 174,
1751
+ "r2": 174,
1752
+ "nnz": 3538944
1753
+ },
1754
+ "model.layers.20.mlp.down_proj": {
1755
+ "o1": 16,
1756
+ "o2": 16,
1757
+ "o3": 20,
1758
+ "i1": 24,
1759
+ "i2": 24,
1760
+ "i3": 24,
1761
+ "r0": 174,
1762
+ "r1": 174,
1763
+ "r2": 174,
1764
+ "nnz": 3538944
1765
+ },
1766
+ "model.layers.21.self_attn.q_proj": {
1767
+ "o1": 16,
1768
+ "o2": 16,
1769
+ "o3": 20,
1770
+ "i1": 16,
1771
+ "i2": 16,
1772
+ "i3": 20,
1773
+ "r0": 124,
1774
+ "r1": 124,
1775
+ "r2": 124,
1776
+ "nnz": 1310720
1777
+ },
1778
+ "model.layers.21.self_attn.k_proj": {
1779
+ "o1": 16,
1780
+ "o2": 16,
1781
+ "o3": 20,
1782
+ "i1": 16,
1783
+ "i2": 16,
1784
+ "i3": 20,
1785
+ "r0": 124,
1786
+ "r1": 124,
1787
+ "r2": 124,
1788
+ "nnz": 1310720
1789
+ },
1790
+ "model.layers.21.self_attn.v_proj": {
1791
+ "o1": 16,
1792
+ "o2": 16,
1793
+ "o3": 20,
1794
+ "i1": 16,
1795
+ "i2": 16,
1796
+ "i3": 20,
1797
+ "r0": 124,
1798
+ "r1": 124,
1799
+ "r2": 124,
1800
+ "nnz": 1310720
1801
+ },
1802
+ "model.layers.21.self_attn.o_proj": {
1803
+ "o1": 16,
1804
+ "o2": 16,
1805
+ "o3": 20,
1806
+ "i1": 16,
1807
+ "i2": 16,
1808
+ "i3": 20,
1809
+ "r0": 124,
1810
+ "r1": 124,
1811
+ "r2": 124,
1812
+ "nnz": 1310720
1813
+ },
1814
+ "model.layers.21.mlp.gate_proj": {
1815
+ "o1": 24,
1816
+ "o2": 24,
1817
+ "o3": 24,
1818
+ "i1": 16,
1819
+ "i2": 16,
1820
+ "i3": 20,
1821
+ "r0": 174,
1822
+ "r1": 174,
1823
+ "r2": 174,
1824
+ "nnz": 3538944
1825
+ },
1826
+ "model.layers.21.mlp.up_proj": {
1827
+ "o1": 24,
1828
+ "o2": 24,
1829
+ "o3": 24,
1830
+ "i1": 16,
1831
+ "i2": 16,
1832
+ "i3": 20,
1833
+ "r0": 174,
1834
+ "r1": 174,
1835
+ "r2": 174,
1836
+ "nnz": 3538944
1837
+ },
1838
+ "model.layers.21.mlp.down_proj": {
1839
+ "o1": 16,
1840
+ "o2": 16,
1841
+ "o3": 20,
1842
+ "i1": 24,
1843
+ "i2": 24,
1844
+ "i3": 24,
1845
+ "r0": 174,
1846
+ "r1": 174,
1847
+ "r2": 174,
1848
+ "nnz": 3538944
1849
+ },
1850
+ "model.layers.22.self_attn.q_proj": {
1851
+ "o1": 16,
1852
+ "o2": 16,
1853
+ "o3": 20,
1854
+ "i1": 16,
1855
+ "i2": 16,
1856
+ "i3": 20,
1857
+ "r0": 124,
1858
+ "r1": 124,
1859
+ "r2": 124,
1860
+ "nnz": 1310720
1861
+ },
1862
+ "model.layers.22.self_attn.k_proj": {
1863
+ "o1": 16,
1864
+ "o2": 16,
1865
+ "o3": 20,
1866
+ "i1": 16,
1867
+ "i2": 16,
1868
+ "i3": 20,
1869
+ "r0": 124,
1870
+ "r1": 124,
1871
+ "r2": 124,
1872
+ "nnz": 1310720
1873
+ },
1874
+ "model.layers.22.self_attn.v_proj": {
1875
+ "o1": 16,
1876
+ "o2": 16,
1877
+ "o3": 20,
1878
+ "i1": 16,
1879
+ "i2": 16,
1880
+ "i3": 20,
1881
+ "r0": 124,
1882
+ "r1": 124,
1883
+ "r2": 124,
1884
+ "nnz": 1310720
1885
+ },
1886
+ "model.layers.22.self_attn.o_proj": {
1887
+ "o1": 16,
1888
+ "o2": 16,
1889
+ "o3": 20,
1890
+ "i1": 16,
1891
+ "i2": 16,
1892
+ "i3": 20,
1893
+ "r0": 124,
1894
+ "r1": 124,
1895
+ "r2": 124,
1896
+ "nnz": 1310720
1897
+ },
1898
+ "model.layers.22.mlp.gate_proj": {
1899
+ "o1": 24,
1900
+ "o2": 24,
1901
+ "o3": 24,
1902
+ "i1": 16,
1903
+ "i2": 16,
1904
+ "i3": 20,
1905
+ "r0": 174,
1906
+ "r1": 174,
1907
+ "r2": 174,
1908
+ "nnz": 3538944
1909
+ },
1910
+ "model.layers.22.mlp.up_proj": {
1911
+ "o1": 24,
1912
+ "o2": 24,
1913
+ "o3": 24,
1914
+ "i1": 16,
1915
+ "i2": 16,
1916
+ "i3": 20,
1917
+ "r0": 174,
1918
+ "r1": 174,
1919
+ "r2": 174,
1920
+ "nnz": 3538944
1921
+ },
1922
+ "model.layers.22.mlp.down_proj": {
1923
+ "o1": 16,
1924
+ "o2": 16,
1925
+ "o3": 20,
1926
+ "i1": 24,
1927
+ "i2": 24,
1928
+ "i3": 24,
1929
+ "r0": 174,
1930
+ "r1": 174,
1931
+ "r2": 174,
1932
+ "nnz": 3538944
1933
+ },
1934
+ "model.layers.23.self_attn.q_proj": {
1935
+ "o1": 16,
1936
+ "o2": 16,
1937
+ "o3": 20,
1938
+ "i1": 16,
1939
+ "i2": 16,
1940
+ "i3": 20,
1941
+ "r0": 124,
1942
+ "r1": 124,
1943
+ "r2": 124,
1944
+ "nnz": 1310720
1945
+ },
1946
+ "model.layers.23.self_attn.k_proj": {
1947
+ "o1": 16,
1948
+ "o2": 16,
1949
+ "o3": 20,
1950
+ "i1": 16,
1951
+ "i2": 16,
1952
+ "i3": 20,
1953
+ "r0": 124,
1954
+ "r1": 124,
1955
+ "r2": 124,
1956
+ "nnz": 1310720
1957
+ },
1958
+ "model.layers.23.self_attn.v_proj": {
1959
+ "o1": 16,
1960
+ "o2": 16,
1961
+ "o3": 20,
1962
+ "i1": 16,
1963
+ "i2": 16,
1964
+ "i3": 20,
1965
+ "r0": 124,
1966
+ "r1": 124,
1967
+ "r2": 124,
1968
+ "nnz": 1310720
1969
+ },
1970
+ "model.layers.23.self_attn.o_proj": {
1971
+ "o1": 16,
1972
+ "o2": 16,
1973
+ "o3": 20,
1974
+ "i1": 16,
1975
+ "i2": 16,
1976
+ "i3": 20,
1977
+ "r0": 124,
1978
+ "r1": 124,
1979
+ "r2": 124,
1980
+ "nnz": 1310720
1981
+ },
1982
+ "model.layers.23.mlp.gate_proj": {
1983
+ "o1": 24,
1984
+ "o2": 24,
1985
+ "o3": 24,
1986
+ "i1": 16,
1987
+ "i2": 16,
1988
+ "i3": 20,
1989
+ "r0": 174,
1990
+ "r1": 174,
1991
+ "r2": 174,
1992
+ "nnz": 3538944
1993
+ },
1994
+ "model.layers.23.mlp.up_proj": {
1995
+ "o1": 24,
1996
+ "o2": 24,
1997
+ "o3": 24,
1998
+ "i1": 16,
1999
+ "i2": 16,
2000
+ "i3": 20,
2001
+ "r0": 174,
2002
+ "r1": 174,
2003
+ "r2": 174,
2004
+ "nnz": 3538944
2005
+ },
2006
+ "model.layers.23.mlp.down_proj": {
2007
+ "o1": 16,
2008
+ "o2": 16,
2009
+ "o3": 20,
2010
+ "i1": 24,
2011
+ "i2": 24,
2012
+ "i3": 24,
2013
+ "r0": 174,
2014
+ "r1": 174,
2015
+ "r2": 174,
2016
+ "nnz": 3538944
2017
+ },
2018
+ "model.layers.24.self_attn.q_proj": {
2019
+ "o1": 16,
2020
+ "o2": 16,
2021
+ "o3": 20,
2022
+ "i1": 16,
2023
+ "i2": 16,
2024
+ "i3": 20,
2025
+ "r0": 124,
2026
+ "r1": 124,
2027
+ "r2": 124,
2028
+ "nnz": 1310720
2029
+ },
2030
+ "model.layers.24.self_attn.k_proj": {
2031
+ "o1": 16,
2032
+ "o2": 16,
2033
+ "o3": 20,
2034
+ "i1": 16,
2035
+ "i2": 16,
2036
+ "i3": 20,
2037
+ "r0": 124,
2038
+ "r1": 124,
2039
+ "r2": 124,
2040
+ "nnz": 1310720
2041
+ },
2042
+ "model.layers.24.self_attn.v_proj": {
2043
+ "o1": 16,
2044
+ "o2": 16,
2045
+ "o3": 20,
2046
+ "i1": 16,
2047
+ "i2": 16,
2048
+ "i3": 20,
2049
+ "r0": 124,
2050
+ "r1": 124,
2051
+ "r2": 124,
2052
+ "nnz": 1310720
2053
+ },
2054
+ "model.layers.24.self_attn.o_proj": {
2055
+ "o1": 16,
2056
+ "o2": 16,
2057
+ "o3": 20,
2058
+ "i1": 16,
2059
+ "i2": 16,
2060
+ "i3": 20,
2061
+ "r0": 124,
2062
+ "r1": 124,
2063
+ "r2": 124,
2064
+ "nnz": 1310720
2065
+ },
2066
+ "model.layers.24.mlp.gate_proj": {
2067
+ "o1": 24,
2068
+ "o2": 24,
2069
+ "o3": 24,
2070
+ "i1": 16,
2071
+ "i2": 16,
2072
+ "i3": 20,
2073
+ "r0": 174,
2074
+ "r1": 174,
2075
+ "r2": 174,
2076
+ "nnz": 3538944
2077
+ },
2078
+ "model.layers.24.mlp.up_proj": {
2079
+ "o1": 24,
2080
+ "o2": 24,
2081
+ "o3": 24,
2082
+ "i1": 16,
2083
+ "i2": 16,
2084
+ "i3": 20,
2085
+ "r0": 174,
2086
+ "r1": 174,
2087
+ "r2": 174,
2088
+ "nnz": 3538944
2089
+ },
2090
+ "model.layers.24.mlp.down_proj": {
2091
+ "o1": 16,
2092
+ "o2": 16,
2093
+ "o3": 20,
2094
+ "i1": 24,
2095
+ "i2": 24,
2096
+ "i3": 24,
2097
+ "r0": 174,
2098
+ "r1": 174,
2099
+ "r2": 174,
2100
+ "nnz": 3538944
2101
+ },
2102
+ "model.layers.25.self_attn.q_proj": {
2103
+ "o1": 16,
2104
+ "o2": 16,
2105
+ "o3": 20,
2106
+ "i1": 16,
2107
+ "i2": 16,
2108
+ "i3": 20,
2109
+ "r0": 124,
2110
+ "r1": 124,
2111
+ "r2": 124,
2112
+ "nnz": 1310720
2113
+ },
2114
+ "model.layers.25.self_attn.k_proj": {
2115
+ "o1": 16,
2116
+ "o2": 16,
2117
+ "o3": 20,
2118
+ "i1": 16,
2119
+ "i2": 16,
2120
+ "i3": 20,
2121
+ "r0": 124,
2122
+ "r1": 124,
2123
+ "r2": 124,
2124
+ "nnz": 1310720
2125
+ },
2126
+ "model.layers.25.self_attn.v_proj": {
2127
+ "o1": 16,
2128
+ "o2": 16,
2129
+ "o3": 20,
2130
+ "i1": 16,
2131
+ "i2": 16,
2132
+ "i3": 20,
2133
+ "r0": 124,
2134
+ "r1": 124,
2135
+ "r2": 124,
2136
+ "nnz": 1310720
2137
+ },
2138
+ "model.layers.25.self_attn.o_proj": {
2139
+ "o1": 16,
2140
+ "o2": 16,
2141
+ "o3": 20,
2142
+ "i1": 16,
2143
+ "i2": 16,
2144
+ "i3": 20,
2145
+ "r0": 124,
2146
+ "r1": 124,
2147
+ "r2": 124,
2148
+ "nnz": 1310720
2149
+ },
2150
+ "model.layers.25.mlp.gate_proj": {
2151
+ "o1": 24,
2152
+ "o2": 24,
2153
+ "o3": 24,
2154
+ "i1": 16,
2155
+ "i2": 16,
2156
+ "i3": 20,
2157
+ "r0": 174,
2158
+ "r1": 174,
2159
+ "r2": 174,
2160
+ "nnz": 3538944
2161
+ },
2162
+ "model.layers.25.mlp.up_proj": {
2163
+ "o1": 24,
2164
+ "o2": 24,
2165
+ "o3": 24,
2166
+ "i1": 16,
2167
+ "i2": 16,
2168
+ "i3": 20,
2169
+ "r0": 174,
2170
+ "r1": 174,
2171
+ "r2": 174,
2172
+ "nnz": 3538944
2173
+ },
2174
+ "model.layers.25.mlp.down_proj": {
2175
+ "o1": 16,
2176
+ "o2": 16,
2177
+ "o3": 20,
2178
+ "i1": 24,
2179
+ "i2": 24,
2180
+ "i3": 24,
2181
+ "r0": 174,
2182
+ "r1": 174,
2183
+ "r2": 174,
2184
+ "nnz": 3538944
2185
+ },
2186
+ "model.layers.26.self_attn.q_proj": {
2187
+ "o1": 16,
2188
+ "o2": 16,
2189
+ "o3": 20,
2190
+ "i1": 16,
2191
+ "i2": 16,
2192
+ "i3": 20,
2193
+ "r0": 124,
2194
+ "r1": 124,
2195
+ "r2": 124,
2196
+ "nnz": 1310720
2197
+ },
2198
+ "model.layers.26.self_attn.k_proj": {
2199
+ "o1": 16,
2200
+ "o2": 16,
2201
+ "o3": 20,
2202
+ "i1": 16,
2203
+ "i2": 16,
2204
+ "i3": 20,
2205
+ "r0": 124,
2206
+ "r1": 124,
2207
+ "r2": 124,
2208
+ "nnz": 1310720
2209
+ },
2210
+ "model.layers.26.self_attn.v_proj": {
2211
+ "o1": 16,
2212
+ "o2": 16,
2213
+ "o3": 20,
2214
+ "i1": 16,
2215
+ "i2": 16,
2216
+ "i3": 20,
2217
+ "r0": 124,
2218
+ "r1": 124,
2219
+ "r2": 124,
2220
+ "nnz": 1310720
2221
+ },
2222
+ "model.layers.26.self_attn.o_proj": {
2223
+ "o1": 16,
2224
+ "o2": 16,
2225
+ "o3": 20,
2226
+ "i1": 16,
2227
+ "i2": 16,
2228
+ "i3": 20,
2229
+ "r0": 124,
2230
+ "r1": 124,
2231
+ "r2": 124,
2232
+ "nnz": 1310720
2233
+ },
2234
+ "model.layers.26.mlp.gate_proj": {
2235
+ "o1": 24,
2236
+ "o2": 24,
2237
+ "o3": 24,
2238
+ "i1": 16,
2239
+ "i2": 16,
2240
+ "i3": 20,
2241
+ "r0": 174,
2242
+ "r1": 174,
2243
+ "r2": 174,
2244
+ "nnz": 3538944
2245
+ },
2246
+ "model.layers.26.mlp.up_proj": {
2247
+ "o1": 24,
2248
+ "o2": 24,
2249
+ "o3": 24,
2250
+ "i1": 16,
2251
+ "i2": 16,
2252
+ "i3": 20,
2253
+ "r0": 174,
2254
+ "r1": 174,
2255
+ "r2": 174,
2256
+ "nnz": 3538944
2257
+ },
2258
+ "model.layers.26.mlp.down_proj": {
2259
+ "o1": 16,
2260
+ "o2": 16,
2261
+ "o3": 20,
2262
+ "i1": 24,
2263
+ "i2": 24,
2264
+ "i3": 24,
2265
+ "r0": 174,
2266
+ "r1": 174,
2267
+ "r2": 174,
2268
+ "nnz": 3538944
2269
+ },
2270
+ "model.layers.27.self_attn.q_proj": {
2271
+ "o1": 16,
2272
+ "o2": 16,
2273
+ "o3": 20,
2274
+ "i1": 16,
2275
+ "i2": 16,
2276
+ "i3": 20,
2277
+ "r0": 124,
2278
+ "r1": 124,
2279
+ "r2": 124,
2280
+ "nnz": 1310720
2281
+ },
2282
+ "model.layers.27.self_attn.k_proj": {
2283
+ "o1": 16,
2284
+ "o2": 16,
2285
+ "o3": 20,
2286
+ "i1": 16,
2287
+ "i2": 16,
2288
+ "i3": 20,
2289
+ "r0": 124,
2290
+ "r1": 124,
2291
+ "r2": 124,
2292
+ "nnz": 1310720
2293
+ },
2294
+ "model.layers.27.self_attn.v_proj": {
2295
+ "o1": 16,
2296
+ "o2": 16,
2297
+ "o3": 20,
2298
+ "i1": 16,
2299
+ "i2": 16,
2300
+ "i3": 20,
2301
+ "r0": 124,
2302
+ "r1": 124,
2303
+ "r2": 124,
2304
+ "nnz": 1310720
2305
+ },
2306
+ "model.layers.27.self_attn.o_proj": {
2307
+ "o1": 16,
2308
+ "o2": 16,
2309
+ "o3": 20,
2310
+ "i1": 16,
2311
+ "i2": 16,
2312
+ "i3": 20,
2313
+ "r0": 124,
2314
+ "r1": 124,
2315
+ "r2": 124,
2316
+ "nnz": 1310720
2317
+ },
2318
+ "model.layers.27.mlp.gate_proj": {
2319
+ "o1": 24,
2320
+ "o2": 24,
2321
+ "o3": 24,
2322
+ "i1": 16,
2323
+ "i2": 16,
2324
+ "i3": 20,
2325
+ "r0": 174,
2326
+ "r1": 174,
2327
+ "r2": 174,
2328
+ "nnz": 3538944
2329
+ },
2330
+ "model.layers.27.mlp.up_proj": {
2331
+ "o1": 24,
2332
+ "o2": 24,
2333
+ "o3": 24,
2334
+ "i1": 16,
2335
+ "i2": 16,
2336
+ "i3": 20,
2337
+ "r0": 174,
2338
+ "r1": 174,
2339
+ "r2": 174,
2340
+ "nnz": 3538944
2341
+ },
2342
+ "model.layers.27.mlp.down_proj": {
2343
+ "o1": 16,
2344
+ "o2": 16,
2345
+ "o3": 20,
2346
+ "i1": 24,
2347
+ "i2": 24,
2348
+ "i3": 24,
2349
+ "r0": 174,
2350
+ "r1": 174,
2351
+ "r2": 174,
2352
+ "nnz": 3538944
2353
+ },
2354
+ "model.layers.28.self_attn.q_proj": {
2355
+ "o1": 16,
2356
+ "o2": 16,
2357
+ "o3": 20,
2358
+ "i1": 16,
2359
+ "i2": 16,
2360
+ "i3": 20,
2361
+ "r0": 124,
2362
+ "r1": 124,
2363
+ "r2": 124,
2364
+ "nnz": 1310720
2365
+ },
2366
+ "model.layers.28.self_attn.k_proj": {
2367
+ "o1": 16,
2368
+ "o2": 16,
2369
+ "o3": 20,
2370
+ "i1": 16,
2371
+ "i2": 16,
2372
+ "i3": 20,
2373
+ "r0": 124,
2374
+ "r1": 124,
2375
+ "r2": 124,
2376
+ "nnz": 1310720
2377
+ },
2378
+ "model.layers.28.self_attn.v_proj": {
2379
+ "o1": 16,
2380
+ "o2": 16,
2381
+ "o3": 20,
2382
+ "i1": 16,
2383
+ "i2": 16,
2384
+ "i3": 20,
2385
+ "r0": 124,
2386
+ "r1": 124,
2387
+ "r2": 124,
2388
+ "nnz": 1310720
2389
+ },
2390
+ "model.layers.28.self_attn.o_proj": {
2391
+ "o1": 16,
2392
+ "o2": 16,
2393
+ "o3": 20,
2394
+ "i1": 16,
2395
+ "i2": 16,
2396
+ "i3": 20,
2397
+ "r0": 124,
2398
+ "r1": 124,
2399
+ "r2": 124,
2400
+ "nnz": 1310720
2401
+ },
2402
+ "model.layers.28.mlp.gate_proj": {
2403
+ "o1": 24,
2404
+ "o2": 24,
2405
+ "o3": 24,
2406
+ "i1": 16,
2407
+ "i2": 16,
2408
+ "i3": 20,
2409
+ "r0": 174,
2410
+ "r1": 174,
2411
+ "r2": 174,
2412
+ "nnz": 3538944
2413
+ },
2414
+ "model.layers.28.mlp.up_proj": {
2415
+ "o1": 24,
2416
+ "o2": 24,
2417
+ "o3": 24,
2418
+ "i1": 16,
2419
+ "i2": 16,
2420
+ "i3": 20,
2421
+ "r0": 174,
2422
+ "r1": 174,
2423
+ "r2": 174,
2424
+ "nnz": 3538944
2425
+ },
2426
+ "model.layers.28.mlp.down_proj": {
2427
+ "o1": 16,
2428
+ "o2": 16,
2429
+ "o3": 20,
2430
+ "i1": 24,
2431
+ "i2": 24,
2432
+ "i3": 24,
2433
+ "r0": 174,
2434
+ "r1": 174,
2435
+ "r2": 174,
2436
+ "nnz": 3538944
2437
+ },
2438
+ "model.layers.29.self_attn.q_proj": {
2439
+ "o1": 16,
2440
+ "o2": 16,
2441
+ "o3": 20,
2442
+ "i1": 16,
2443
+ "i2": 16,
2444
+ "i3": 20,
2445
+ "r0": 124,
2446
+ "r1": 124,
2447
+ "r2": 124,
2448
+ "nnz": 1310720
2449
+ },
2450
+ "model.layers.29.self_attn.k_proj": {
2451
+ "o1": 16,
2452
+ "o2": 16,
2453
+ "o3": 20,
2454
+ "i1": 16,
2455
+ "i2": 16,
2456
+ "i3": 20,
2457
+ "r0": 124,
2458
+ "r1": 124,
2459
+ "r2": 124,
2460
+ "nnz": 1310720
2461
+ },
2462
+ "model.layers.29.self_attn.v_proj": {
2463
+ "o1": 16,
2464
+ "o2": 16,
2465
+ "o3": 20,
2466
+ "i1": 16,
2467
+ "i2": 16,
2468
+ "i3": 20,
2469
+ "r0": 124,
2470
+ "r1": 124,
2471
+ "r2": 124,
2472
+ "nnz": 1310720
2473
+ },
2474
+ "model.layers.29.self_attn.o_proj": {
2475
+ "o1": 16,
2476
+ "o2": 16,
2477
+ "o3": 20,
2478
+ "i1": 16,
2479
+ "i2": 16,
2480
+ "i3": 20,
2481
+ "r0": 124,
2482
+ "r1": 124,
2483
+ "r2": 124,
2484
+ "nnz": 1310720
2485
+ },
2486
+ "model.layers.29.mlp.gate_proj": {
2487
+ "o1": 24,
2488
+ "o2": 24,
2489
+ "o3": 24,
2490
+ "i1": 16,
2491
+ "i2": 16,
2492
+ "i3": 20,
2493
+ "r0": 174,
2494
+ "r1": 174,
2495
+ "r2": 174,
2496
+ "nnz": 3538944
2497
+ },
2498
+ "model.layers.29.mlp.up_proj": {
2499
+ "o1": 24,
2500
+ "o2": 24,
2501
+ "o3": 24,
2502
+ "i1": 16,
2503
+ "i2": 16,
2504
+ "i3": 20,
2505
+ "r0": 174,
2506
+ "r1": 174,
2507
+ "r2": 174,
2508
+ "nnz": 3538944
2509
+ },
2510
+ "model.layers.29.mlp.down_proj": {
2511
+ "o1": 16,
2512
+ "o2": 16,
2513
+ "o3": 20,
2514
+ "i1": 24,
2515
+ "i2": 24,
2516
+ "i3": 24,
2517
+ "r0": 174,
2518
+ "r1": 174,
2519
+ "r2": 174,
2520
+ "nnz": 3538944
2521
+ },
2522
+ "model.layers.30.self_attn.q_proj": {
2523
+ "o1": 16,
2524
+ "o2": 16,
2525
+ "o3": 20,
2526
+ "i1": 16,
2527
+ "i2": 16,
2528
+ "i3": 20,
2529
+ "r0": 124,
2530
+ "r1": 124,
2531
+ "r2": 124,
2532
+ "nnz": 1310720
2533
+ },
2534
+ "model.layers.30.self_attn.k_proj": {
2535
+ "o1": 16,
2536
+ "o2": 16,
2537
+ "o3": 20,
2538
+ "i1": 16,
2539
+ "i2": 16,
2540
+ "i3": 20,
2541
+ "r0": 124,
2542
+ "r1": 124,
2543
+ "r2": 124,
2544
+ "nnz": 1310720
2545
+ },
2546
+ "model.layers.30.self_attn.v_proj": {
2547
+ "o1": 16,
2548
+ "o2": 16,
2549
+ "o3": 20,
2550
+ "i1": 16,
2551
+ "i2": 16,
2552
+ "i3": 20,
2553
+ "r0": 124,
2554
+ "r1": 124,
2555
+ "r2": 124,
2556
+ "nnz": 1310720
2557
+ },
2558
+ "model.layers.30.self_attn.o_proj": {
2559
+ "o1": 16,
2560
+ "o2": 16,
2561
+ "o3": 20,
2562
+ "i1": 16,
2563
+ "i2": 16,
2564
+ "i3": 20,
2565
+ "r0": 124,
2566
+ "r1": 124,
2567
+ "r2": 124,
2568
+ "nnz": 1310720
2569
+ },
2570
+ "model.layers.30.mlp.gate_proj": {
2571
+ "o1": 24,
2572
+ "o2": 24,
2573
+ "o3": 24,
2574
+ "i1": 16,
2575
+ "i2": 16,
2576
+ "i3": 20,
2577
+ "r0": 174,
2578
+ "r1": 174,
2579
+ "r2": 174,
2580
+ "nnz": 3538944
2581
+ },
2582
+ "model.layers.30.mlp.up_proj": {
2583
+ "o1": 24,
2584
+ "o2": 24,
2585
+ "o3": 24,
2586
+ "i1": 16,
2587
+ "i2": 16,
2588
+ "i3": 20,
2589
+ "r0": 174,
2590
+ "r1": 174,
2591
+ "r2": 174,
2592
+ "nnz": 3538944
2593
+ },
2594
+ "model.layers.30.mlp.down_proj": {
2595
+ "o1": 16,
2596
+ "o2": 16,
2597
+ "o3": 20,
2598
+ "i1": 24,
2599
+ "i2": 24,
2600
+ "i3": 24,
2601
+ "r0": 174,
2602
+ "r1": 174,
2603
+ "r2": 174,
2604
+ "nnz": 3538944
2605
+ },
2606
+ "model.layers.31.self_attn.q_proj": {
2607
+ "o1": 16,
2608
+ "o2": 16,
2609
+ "o3": 20,
2610
+ "i1": 16,
2611
+ "i2": 16,
2612
+ "i3": 20,
2613
+ "r0": 124,
2614
+ "r1": 124,
2615
+ "r2": 124,
2616
+ "nnz": 1310720
2617
+ },
2618
+ "model.layers.31.self_attn.k_proj": {
2619
+ "o1": 16,
2620
+ "o2": 16,
2621
+ "o3": 20,
2622
+ "i1": 16,
2623
+ "i2": 16,
2624
+ "i3": 20,
2625
+ "r0": 124,
2626
+ "r1": 124,
2627
+ "r2": 124,
2628
+ "nnz": 1310720
2629
+ },
2630
+ "model.layers.31.self_attn.v_proj": {
2631
+ "o1": 16,
2632
+ "o2": 16,
2633
+ "o3": 20,
2634
+ "i1": 16,
2635
+ "i2": 16,
2636
+ "i3": 20,
2637
+ "r0": 124,
2638
+ "r1": 124,
2639
+ "r2": 124,
2640
+ "nnz": 1310720
2641
+ },
2642
+ "model.layers.31.self_attn.o_proj": {
2643
+ "o1": 16,
2644
+ "o2": 16,
2645
+ "o3": 20,
2646
+ "i1": 16,
2647
+ "i2": 16,
2648
+ "i3": 20,
2649
+ "r0": 124,
2650
+ "r1": 124,
2651
+ "r2": 124,
2652
+ "nnz": 1310720
2653
+ },
2654
+ "model.layers.31.mlp.gate_proj": {
2655
+ "o1": 24,
2656
+ "o2": 24,
2657
+ "o3": 24,
2658
+ "i1": 16,
2659
+ "i2": 16,
2660
+ "i3": 20,
2661
+ "r0": 174,
2662
+ "r1": 174,
2663
+ "r2": 174,
2664
+ "nnz": 3538944
2665
+ },
2666
+ "model.layers.31.mlp.up_proj": {
2667
+ "o1": 24,
2668
+ "o2": 24,
2669
+ "o3": 24,
2670
+ "i1": 16,
2671
+ "i2": 16,
2672
+ "i3": 20,
2673
+ "r0": 174,
2674
+ "r1": 174,
2675
+ "r2": 174,
2676
+ "nnz": 3538944
2677
+ },
2678
+ "model.layers.31.mlp.down_proj": {
2679
+ "o1": 16,
2680
+ "o2": 16,
2681
+ "o3": 20,
2682
+ "i1": 24,
2683
+ "i2": 24,
2684
+ "i3": 24,
2685
+ "r0": 174,
2686
+ "r1": 174,
2687
+ "r2": 174,
2688
+ "nnz": 3538944
2689
+ },
2690
+ "model.layers.32.self_attn.q_proj": {
2691
+ "o1": 16,
2692
+ "o2": 16,
2693
+ "o3": 20,
2694
+ "i1": 16,
2695
+ "i2": 16,
2696
+ "i3": 20,
2697
+ "r0": 124,
2698
+ "r1": 124,
2699
+ "r2": 124,
2700
+ "nnz": 1310720
2701
+ },
2702
+ "model.layers.32.self_attn.k_proj": {
2703
+ "o1": 16,
2704
+ "o2": 16,
2705
+ "o3": 20,
2706
+ "i1": 16,
2707
+ "i2": 16,
2708
+ "i3": 20,
2709
+ "r0": 124,
2710
+ "r1": 124,
2711
+ "r2": 124,
2712
+ "nnz": 1310720
2713
+ },
2714
+ "model.layers.32.self_attn.v_proj": {
2715
+ "o1": 16,
2716
+ "o2": 16,
2717
+ "o3": 20,
2718
+ "i1": 16,
2719
+ "i2": 16,
2720
+ "i3": 20,
2721
+ "r0": 124,
2722
+ "r1": 124,
2723
+ "r2": 124,
2724
+ "nnz": 1310720
2725
+ },
2726
+ "model.layers.32.self_attn.o_proj": {
2727
+ "o1": 16,
2728
+ "o2": 16,
2729
+ "o3": 20,
2730
+ "i1": 16,
2731
+ "i2": 16,
2732
+ "i3": 20,
2733
+ "r0": 124,
2734
+ "r1": 124,
2735
+ "r2": 124,
2736
+ "nnz": 1310720
2737
+ },
2738
+ "model.layers.32.mlp.gate_proj": {
2739
+ "o1": 24,
2740
+ "o2": 24,
2741
+ "o3": 24,
2742
+ "i1": 16,
2743
+ "i2": 16,
2744
+ "i3": 20,
2745
+ "r0": 174,
2746
+ "r1": 174,
2747
+ "r2": 174,
2748
+ "nnz": 3538944
2749
+ },
2750
+ "model.layers.32.mlp.up_proj": {
2751
+ "o1": 24,
2752
+ "o2": 24,
2753
+ "o3": 24,
2754
+ "i1": 16,
2755
+ "i2": 16,
2756
+ "i3": 20,
2757
+ "r0": 174,
2758
+ "r1": 174,
2759
+ "r2": 174,
2760
+ "nnz": 3538944
2761
+ },
2762
+ "model.layers.32.mlp.down_proj": {
2763
+ "o1": 16,
2764
+ "o2": 16,
2765
+ "o3": 20,
2766
+ "i1": 24,
2767
+ "i2": 24,
2768
+ "i3": 24,
2769
+ "r0": 174,
2770
+ "r1": 174,
2771
+ "r2": 174,
2772
+ "nnz": 3538944
2773
+ },
2774
+ "model.layers.33.self_attn.q_proj": {
2775
+ "o1": 16,
2776
+ "o2": 16,
2777
+ "o3": 20,
2778
+ "i1": 16,
2779
+ "i2": 16,
2780
+ "i3": 20,
2781
+ "r0": 124,
2782
+ "r1": 124,
2783
+ "r2": 124,
2784
+ "nnz": 1310720
2785
+ },
2786
+ "model.layers.33.self_attn.k_proj": {
2787
+ "o1": 16,
2788
+ "o2": 16,
2789
+ "o3": 20,
2790
+ "i1": 16,
2791
+ "i2": 16,
2792
+ "i3": 20,
2793
+ "r0": 124,
2794
+ "r1": 124,
2795
+ "r2": 124,
2796
+ "nnz": 1310720
2797
+ },
2798
+ "model.layers.33.self_attn.v_proj": {
2799
+ "o1": 16,
2800
+ "o2": 16,
2801
+ "o3": 20,
2802
+ "i1": 16,
2803
+ "i2": 16,
2804
+ "i3": 20,
2805
+ "r0": 124,
2806
+ "r1": 124,
2807
+ "r2": 124,
2808
+ "nnz": 1310720
2809
+ },
2810
+ "model.layers.33.self_attn.o_proj": {
2811
+ "o1": 16,
2812
+ "o2": 16,
2813
+ "o3": 20,
2814
+ "i1": 16,
2815
+ "i2": 16,
2816
+ "i3": 20,
2817
+ "r0": 124,
2818
+ "r1": 124,
2819
+ "r2": 124,
2820
+ "nnz": 1310720
2821
+ },
2822
+ "model.layers.33.mlp.gate_proj": {
2823
+ "o1": 24,
2824
+ "o2": 24,
2825
+ "o3": 24,
2826
+ "i1": 16,
2827
+ "i2": 16,
2828
+ "i3": 20,
2829
+ "r0": 174,
2830
+ "r1": 174,
2831
+ "r2": 174,
2832
+ "nnz": 3538944
2833
+ },
2834
+ "model.layers.33.mlp.up_proj": {
2835
+ "o1": 24,
2836
+ "o2": 24,
2837
+ "o3": 24,
2838
+ "i1": 16,
2839
+ "i2": 16,
2840
+ "i3": 20,
2841
+ "r0": 174,
2842
+ "r1": 174,
2843
+ "r2": 174,
2844
+ "nnz": 3538944
2845
+ },
2846
+ "model.layers.33.mlp.down_proj": {
2847
+ "o1": 16,
2848
+ "o2": 16,
2849
+ "o3": 20,
2850
+ "i1": 24,
2851
+ "i2": 24,
2852
+ "i3": 24,
2853
+ "r0": 174,
2854
+ "r1": 174,
2855
+ "r2": 174,
2856
+ "nnz": 3538944
2857
+ },
2858
+ "model.layers.34.self_attn.q_proj": {
2859
+ "o1": 16,
2860
+ "o2": 16,
2861
+ "o3": 20,
2862
+ "i1": 16,
2863
+ "i2": 16,
2864
+ "i3": 20,
2865
+ "r0": 124,
2866
+ "r1": 124,
2867
+ "r2": 124,
2868
+ "nnz": 1310720
2869
+ },
2870
+ "model.layers.34.self_attn.k_proj": {
2871
+ "o1": 16,
2872
+ "o2": 16,
2873
+ "o3": 20,
2874
+ "i1": 16,
2875
+ "i2": 16,
2876
+ "i3": 20,
2877
+ "r0": 124,
2878
+ "r1": 124,
2879
+ "r2": 124,
2880
+ "nnz": 1310720
2881
+ },
2882
+ "model.layers.34.self_attn.v_proj": {
2883
+ "o1": 16,
2884
+ "o2": 16,
2885
+ "o3": 20,
2886
+ "i1": 16,
2887
+ "i2": 16,
2888
+ "i3": 20,
2889
+ "r0": 124,
2890
+ "r1": 124,
2891
+ "r2": 124,
2892
+ "nnz": 1310720
2893
+ },
2894
+ "model.layers.34.self_attn.o_proj": {
2895
+ "o1": 16,
2896
+ "o2": 16,
2897
+ "o3": 20,
2898
+ "i1": 16,
2899
+ "i2": 16,
2900
+ "i3": 20,
2901
+ "r0": 124,
2902
+ "r1": 124,
2903
+ "r2": 124,
2904
+ "nnz": 1310720
2905
+ },
2906
+ "model.layers.34.mlp.gate_proj": {
2907
+ "o1": 24,
2908
+ "o2": 24,
2909
+ "o3": 24,
2910
+ "i1": 16,
2911
+ "i2": 16,
2912
+ "i3": 20,
2913
+ "r0": 174,
2914
+ "r1": 174,
2915
+ "r2": 174,
2916
+ "nnz": 3538944
2917
+ },
2918
+ "model.layers.34.mlp.up_proj": {
2919
+ "o1": 24,
2920
+ "o2": 24,
2921
+ "o3": 24,
2922
+ "i1": 16,
2923
+ "i2": 16,
2924
+ "i3": 20,
2925
+ "r0": 174,
2926
+ "r1": 174,
2927
+ "r2": 174,
2928
+ "nnz": 3538944
2929
+ },
2930
+ "model.layers.34.mlp.down_proj": {
2931
+ "o1": 16,
2932
+ "o2": 16,
2933
+ "o3": 20,
2934
+ "i1": 24,
2935
+ "i2": 24,
2936
+ "i3": 24,
2937
+ "r0": 174,
2938
+ "r1": 174,
2939
+ "r2": 174,
2940
+ "nnz": 3538944
2941
+ },
2942
+ "model.layers.35.self_attn.q_proj": {
2943
+ "o1": 16,
2944
+ "o2": 16,
2945
+ "o3": 20,
2946
+ "i1": 16,
2947
+ "i2": 16,
2948
+ "i3": 20,
2949
+ "r0": 124,
2950
+ "r1": 124,
2951
+ "r2": 124,
2952
+ "nnz": 1310720
2953
+ },
2954
+ "model.layers.35.self_attn.k_proj": {
2955
+ "o1": 16,
2956
+ "o2": 16,
2957
+ "o3": 20,
2958
+ "i1": 16,
2959
+ "i2": 16,
2960
+ "i3": 20,
2961
+ "r0": 124,
2962
+ "r1": 124,
2963
+ "r2": 124,
2964
+ "nnz": 1310720
2965
+ },
2966
+ "model.layers.35.self_attn.v_proj": {
2967
+ "o1": 16,
2968
+ "o2": 16,
2969
+ "o3": 20,
2970
+ "i1": 16,
2971
+ "i2": 16,
2972
+ "i3": 20,
2973
+ "r0": 124,
2974
+ "r1": 124,
2975
+ "r2": 124,
2976
+ "nnz": 1310720
2977
+ },
2978
+ "model.layers.35.self_attn.o_proj": {
2979
+ "o1": 16,
2980
+ "o2": 16,
2981
+ "o3": 20,
2982
+ "i1": 16,
2983
+ "i2": 16,
2984
+ "i3": 20,
2985
+ "r0": 124,
2986
+ "r1": 124,
2987
+ "r2": 124,
2988
+ "nnz": 1310720
2989
+ },
2990
+ "model.layers.35.mlp.gate_proj": {
2991
+ "o1": 24,
2992
+ "o2": 24,
2993
+ "o3": 24,
2994
+ "i1": 16,
2995
+ "i2": 16,
2996
+ "i3": 20,
2997
+ "r0": 174,
2998
+ "r1": 174,
2999
+ "r2": 174,
3000
+ "nnz": 3538944
3001
+ },
3002
+ "model.layers.35.mlp.up_proj": {
3003
+ "o1": 24,
3004
+ "o2": 24,
3005
+ "o3": 24,
3006
+ "i1": 16,
3007
+ "i2": 16,
3008
+ "i3": 20,
3009
+ "r0": 174,
3010
+ "r1": 174,
3011
+ "r2": 174,
3012
+ "nnz": 3538944
3013
+ },
3014
+ "model.layers.35.mlp.down_proj": {
3015
+ "o1": 16,
3016
+ "o2": 16,
3017
+ "o3": 20,
3018
+ "i1": 24,
3019
+ "i2": 24,
3020
+ "i3": 24,
3021
+ "r0": 174,
3022
+ "r1": 174,
3023
+ "r2": 174,
3024
+ "nnz": 3538944
3025
+ },
3026
+ "model.layers.36.self_attn.q_proj": {
3027
+ "o1": 16,
3028
+ "o2": 16,
3029
+ "o3": 20,
3030
+ "i1": 16,
3031
+ "i2": 16,
3032
+ "i3": 20,
3033
+ "r0": 124,
3034
+ "r1": 124,
3035
+ "r2": 124,
3036
+ "nnz": 1310720
3037
+ },
3038
+ "model.layers.36.self_attn.k_proj": {
3039
+ "o1": 16,
3040
+ "o2": 16,
3041
+ "o3": 20,
3042
+ "i1": 16,
3043
+ "i2": 16,
3044
+ "i3": 20,
3045
+ "r0": 124,
3046
+ "r1": 124,
3047
+ "r2": 124,
3048
+ "nnz": 1310720
3049
+ },
3050
+ "model.layers.36.self_attn.v_proj": {
3051
+ "o1": 16,
3052
+ "o2": 16,
3053
+ "o3": 20,
3054
+ "i1": 16,
3055
+ "i2": 16,
3056
+ "i3": 20,
3057
+ "r0": 124,
3058
+ "r1": 124,
3059
+ "r2": 124,
3060
+ "nnz": 1310720
3061
+ },
3062
+ "model.layers.36.self_attn.o_proj": {
3063
+ "o1": 16,
3064
+ "o2": 16,
3065
+ "o3": 20,
3066
+ "i1": 16,
3067
+ "i2": 16,
3068
+ "i3": 20,
3069
+ "r0": 124,
3070
+ "r1": 124,
3071
+ "r2": 124,
3072
+ "nnz": 1310720
3073
+ },
3074
+ "model.layers.36.mlp.gate_proj": {
3075
+ "o1": 24,
3076
+ "o2": 24,
3077
+ "o3": 24,
3078
+ "i1": 16,
3079
+ "i2": 16,
3080
+ "i3": 20,
3081
+ "r0": 174,
3082
+ "r1": 174,
3083
+ "r2": 174,
3084
+ "nnz": 3538944
3085
+ },
3086
+ "model.layers.36.mlp.up_proj": {
3087
+ "o1": 24,
3088
+ "o2": 24,
3089
+ "o3": 24,
3090
+ "i1": 16,
3091
+ "i2": 16,
3092
+ "i3": 20,
3093
+ "r0": 174,
3094
+ "r1": 174,
3095
+ "r2": 174,
3096
+ "nnz": 3538944
3097
+ },
3098
+ "model.layers.36.mlp.down_proj": {
3099
+ "o1": 16,
3100
+ "o2": 16,
3101
+ "o3": 20,
3102
+ "i1": 24,
3103
+ "i2": 24,
3104
+ "i3": 24,
3105
+ "r0": 174,
3106
+ "r1": 174,
3107
+ "r2": 174,
3108
+ "nnz": 3538944
3109
+ },
3110
+ "model.layers.37.self_attn.q_proj": {
3111
+ "o1": 16,
3112
+ "o2": 16,
3113
+ "o3": 20,
3114
+ "i1": 16,
3115
+ "i2": 16,
3116
+ "i3": 20,
3117
+ "r0": 124,
3118
+ "r1": 124,
3119
+ "r2": 124,
3120
+ "nnz": 1310720
3121
+ },
3122
+ "model.layers.37.self_attn.k_proj": {
3123
+ "o1": 16,
3124
+ "o2": 16,
3125
+ "o3": 20,
3126
+ "i1": 16,
3127
+ "i2": 16,
3128
+ "i3": 20,
3129
+ "r0": 124,
3130
+ "r1": 124,
3131
+ "r2": 124,
3132
+ "nnz": 1310720
3133
+ },
3134
+ "model.layers.37.self_attn.v_proj": {
3135
+ "o1": 16,
3136
+ "o2": 16,
3137
+ "o3": 20,
3138
+ "i1": 16,
3139
+ "i2": 16,
3140
+ "i3": 20,
3141
+ "r0": 124,
3142
+ "r1": 124,
3143
+ "r2": 124,
3144
+ "nnz": 1310720
3145
+ },
3146
+ "model.layers.37.self_attn.o_proj": {
3147
+ "o1": 16,
3148
+ "o2": 16,
3149
+ "o3": 20,
3150
+ "i1": 16,
3151
+ "i2": 16,
3152
+ "i3": 20,
3153
+ "r0": 124,
3154
+ "r1": 124,
3155
+ "r2": 124,
3156
+ "nnz": 1310720
3157
+ },
3158
+ "model.layers.37.mlp.gate_proj": {
3159
+ "o1": 24,
3160
+ "o2": 24,
3161
+ "o3": 24,
3162
+ "i1": 16,
3163
+ "i2": 16,
3164
+ "i3": 20,
3165
+ "r0": 174,
3166
+ "r1": 174,
3167
+ "r2": 174,
3168
+ "nnz": 3538944
3169
+ },
3170
+ "model.layers.37.mlp.up_proj": {
3171
+ "o1": 24,
3172
+ "o2": 24,
3173
+ "o3": 24,
3174
+ "i1": 16,
3175
+ "i2": 16,
3176
+ "i3": 20,
3177
+ "r0": 174,
3178
+ "r1": 174,
3179
+ "r2": 174,
3180
+ "nnz": 3538944
3181
+ },
3182
+ "model.layers.37.mlp.down_proj": {
3183
+ "o1": 16,
3184
+ "o2": 16,
3185
+ "o3": 20,
3186
+ "i1": 24,
3187
+ "i2": 24,
3188
+ "i3": 24,
3189
+ "r0": 174,
3190
+ "r1": 174,
3191
+ "r2": 174,
3192
+ "nnz": 3538944
3193
+ },
3194
+ "model.layers.38.self_attn.q_proj": {
3195
+ "o1": 16,
3196
+ "o2": 16,
3197
+ "o3": 20,
3198
+ "i1": 16,
3199
+ "i2": 16,
3200
+ "i3": 20,
3201
+ "r0": 124,
3202
+ "r1": 124,
3203
+ "r2": 124,
3204
+ "nnz": 1310720
3205
+ },
3206
+ "model.layers.38.self_attn.k_proj": {
3207
+ "o1": 16,
3208
+ "o2": 16,
3209
+ "o3": 20,
3210
+ "i1": 16,
3211
+ "i2": 16,
3212
+ "i3": 20,
3213
+ "r0": 124,
3214
+ "r1": 124,
3215
+ "r2": 124,
3216
+ "nnz": 1310720
3217
+ },
3218
+ "model.layers.38.self_attn.v_proj": {
3219
+ "o1": 16,
3220
+ "o2": 16,
3221
+ "o3": 20,
3222
+ "i1": 16,
3223
+ "i2": 16,
3224
+ "i3": 20,
3225
+ "r0": 124,
3226
+ "r1": 124,
3227
+ "r2": 124,
3228
+ "nnz": 1310720
3229
+ },
3230
+ "model.layers.38.self_attn.o_proj": {
3231
+ "o1": 16,
3232
+ "o2": 16,
3233
+ "o3": 20,
3234
+ "i1": 16,
3235
+ "i2": 16,
3236
+ "i3": 20,
3237
+ "r0": 124,
3238
+ "r1": 124,
3239
+ "r2": 124,
3240
+ "nnz": 1310720
3241
+ },
3242
+ "model.layers.38.mlp.gate_proj": {
3243
+ "o1": 24,
3244
+ "o2": 24,
3245
+ "o3": 24,
3246
+ "i1": 16,
3247
+ "i2": 16,
3248
+ "i3": 20,
3249
+ "r0": 174,
3250
+ "r1": 174,
3251
+ "r2": 174,
3252
+ "nnz": 3538944
3253
+ },
3254
+ "model.layers.38.mlp.up_proj": {
3255
+ "o1": 24,
3256
+ "o2": 24,
3257
+ "o3": 24,
3258
+ "i1": 16,
3259
+ "i2": 16,
3260
+ "i3": 20,
3261
+ "r0": 174,
3262
+ "r1": 174,
3263
+ "r2": 174,
3264
+ "nnz": 3538944
3265
+ },
3266
+ "model.layers.38.mlp.down_proj": {
3267
+ "o1": 16,
3268
+ "o2": 16,
3269
+ "o3": 20,
3270
+ "i1": 24,
3271
+ "i2": 24,
3272
+ "i3": 24,
3273
+ "r0": 174,
3274
+ "r1": 174,
3275
+ "r2": 174,
3276
+ "nnz": 3538944
3277
+ },
3278
+ "model.layers.39.self_attn.q_proj": {
3279
+ "o1": 16,
3280
+ "o2": 16,
3281
+ "o3": 20,
3282
+ "i1": 16,
3283
+ "i2": 16,
3284
+ "i3": 20,
3285
+ "r0": 124,
3286
+ "r1": 124,
3287
+ "r2": 124,
3288
+ "nnz": 1310720
3289
+ },
3290
+ "model.layers.39.self_attn.k_proj": {
3291
+ "o1": 16,
3292
+ "o2": 16,
3293
+ "o3": 20,
3294
+ "i1": 16,
3295
+ "i2": 16,
3296
+ "i3": 20,
3297
+ "r0": 124,
3298
+ "r1": 124,
3299
+ "r2": 124,
3300
+ "nnz": 1310720
3301
+ },
3302
+ "model.layers.39.self_attn.v_proj": {
3303
+ "o1": 16,
3304
+ "o2": 16,
3305
+ "o3": 20,
3306
+ "i1": 16,
3307
+ "i2": 16,
3308
+ "i3": 20,
3309
+ "r0": 124,
3310
+ "r1": 124,
3311
+ "r2": 124,
3312
+ "nnz": 1310720
3313
+ },
3314
+ "model.layers.39.self_attn.o_proj": {
3315
+ "o1": 16,
3316
+ "o2": 16,
3317
+ "o3": 20,
3318
+ "i1": 16,
3319
+ "i2": 16,
3320
+ "i3": 20,
3321
+ "r0": 124,
3322
+ "r1": 124,
3323
+ "r2": 124,
3324
+ "nnz": 1310720
3325
+ },
3326
+ "model.layers.39.mlp.gate_proj": {
3327
+ "o1": 24,
3328
+ "o2": 24,
3329
+ "o3": 24,
3330
+ "i1": 16,
3331
+ "i2": 16,
3332
+ "i3": 20,
3333
+ "r0": 174,
3334
+ "r1": 174,
3335
+ "r2": 174,
3336
+ "nnz": 3538944
3337
+ },
3338
+ "model.layers.39.mlp.up_proj": {
3339
+ "o1": 24,
3340
+ "o2": 24,
3341
+ "o3": 24,
3342
+ "i1": 16,
3343
+ "i2": 16,
3344
+ "i3": 20,
3345
+ "r0": 174,
3346
+ "r1": 174,
3347
+ "r2": 174,
3348
+ "nnz": 3538944
3349
+ },
3350
+ "model.layers.39.mlp.down_proj": {
3351
+ "o1": 16,
3352
+ "o2": 16,
3353
+ "o3": 20,
3354
+ "i1": 24,
3355
+ "i2": 24,
3356
+ "i3": 24,
3357
+ "r0": 174,
3358
+ "r1": 174,
3359
+ "r2": 174,
3360
+ "nnz": 3538944
3361
+ }
3362
+ }
tr3/heal/llama2-13b/state_dict_fp16.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f344018d52f0c8001b3721e6dcec601e82bb404ed755cecfbffcaf48057b52f
3
+ size 20556180503
tr3/heal/llama2-13b/tensor_formats.py ADDED
@@ -0,0 +1,768 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ """General N-core tensor formats for a linear layer: tensor train (MPO) and tensor ring.
4
+
5
+ WHY THIS EXISTS. The 2-core and 3-core results say the tensorisation step, not the healing
6
+ step, is where the leverage is: at equal parameters the 3-core beat the 2-core AFTER healing
7
+ at both budgets tried (4.72B: 38.94 vs ~36.5 full MMLU at 60M tokens; 5.74B: 44.91 vs 41.54
8
+ probe), and it got there on roughly a quarter of the tokens. That invites two orthogonal
9
+ questions this module exists to answer: how many cores, and which topology.
10
+
11
+ TENSOR TRAIN vs TENSOR RING. A TT/MPO pins the two boundary bonds to 1 -- the chain has open
12
+ ends. A tensor ring closes the chain: core k has shape (r_{k-1}, d_k, r_k) with r_N == r_0,
13
+ and the weight is the TRACE of the cyclic product. TT is exactly the TR special case r_0 = 1,
14
+ so at equal ranks TR is strictly more expressive. It is also strictly harder to fit: TT-SVD
15
+ is a sequence of Eckart-Young-optimal truncations, while a ring has no such closed form, so
16
+ TR is fitted here by TT initialisation followed by alternating least squares. That asymmetry
17
+ matters when reading results -- a TR loss could mean "the format is worse" OR "the fit did
18
+ not converge", so `fit_tr` reports its per-sweep error curve and refuses to return a fit
19
+ worse than its own TT initialisation.
20
+
21
+ INDEX CONVENTION (shared with mpo2.py / mpo3.py). Output mode k travels with input mode k:
22
+
23
+ R(W)[d_1, ..., d_N] = W[(o_1..o_N), (i_1..i_N)], d_k = (o_k, i_k) flattened
24
+
25
+ Every mode must be > 1. A mode of 1 collapses a site and silently reduces the core count,
26
+ which would make an "N-core" result actually be an (N-1)-core one.
27
+
28
+ WHITENING is diagonal and factorised across the N input modes, as in mpo3.py: the whitening
29
+ is then a mode-local rescaling that survives the fit exactly and un-whitens by division.
30
+ """
31
+
32
+ import torch
33
+
34
+
35
+ # --------------------------------------------------------------------------- rearrangement
36
+ def rearrange_n(W: torch.Tensor, osplit, isplit) -> torch.Tensor:
37
+ """W[(o_1..o_N),(i_1..i_N)] -> R[d_1,...,d_N] with d_k = o_k*i_k."""
38
+ n = len(osplit)
39
+ if len(isplit) != n:
40
+ raise ValueError("output and input must be split into the same number of modes")
41
+ perm = [j for k in range(n) for j in (k, n + k)]
42
+ return (W.reshape(*osplit, *isplit).permute(*perm)
43
+ .reshape(*[o * i for o, i in zip(osplit, isplit)]))
44
+
45
+
46
+ def inv_rearrange_n(R: torch.Tensor, osplit, isplit) -> torch.Tensor:
47
+ """Inverse of `rearrange_n`."""
48
+ n = len(osplit)
49
+ inter = [x for k in range(n) for x in (osplit[k], isplit[k])]
50
+ perm = list(range(0, 2 * n, 2)) + list(range(1, 2 * n, 2))
51
+ o = 1
52
+ i = 1
53
+ for k in range(n):
54
+ o *= osplit[k]
55
+ i *= isplit[k]
56
+ return R.reshape(*inter).permute(*perm).reshape(o, i)
57
+
58
+
59
+ def _apply_scales(R: torch.Tensor, osplit, isplit, scales, invert: bool):
60
+ """Multiply (or divide) R by sqrt(d_k[i_k]) along each input mode, in place of a dense L."""
61
+ n = len(osplit)
62
+ shape = [x for k in range(n) for x in (osplit[k], isplit[k])]
63
+ T = R.reshape(*shape)
64
+ for k in range(n):
65
+ s = scales[k].clamp_min(1e-12).sqrt()
66
+ view = [1] * (2 * n)
67
+ view[2 * k + 1] = isplit[k]
68
+ T = T / s.view(*view) if invert else T * s.view(*view)
69
+ return T.reshape(R.shape)
70
+
71
+
72
+ # --------------------------------------------------------------------------- contraction
73
+ def contract_tt(cores) -> torch.Tensor:
74
+ """Contract TT cores [(1,d1,r1), (r1,d2,r2), ..., (r_{N-1},dN,1)] -> R[d_1,...,d_N]."""
75
+ out = cores[0]
76
+ for g in cores[1:]:
77
+ a, b = out.shape[-1], g.shape[0]
78
+ if a != b:
79
+ raise ValueError(f"TT bond mismatch {a} vs {b}")
80
+ out = torch.tensordot(out, g, dims=([out.dim() - 1], [0]))
81
+ if out.shape[0] != 1 or out.shape[-1] != 1:
82
+ raise ValueError("TT boundary bonds must be 1")
83
+ return out.reshape(*out.shape[1:-1])
84
+
85
+
86
+ def contract_tr(cores, chunk: int = 0) -> torch.Tensor:
87
+ """Contract TR cores [(r0,d1,r1), ..., (r_{N-1},dN,r0)] -> R[d_1,...,d_N].
88
+
89
+ The obvious route -- chain every tensordot, then take the diagonal over the two ring
90
+ indices -- materialises (r_0, d_1..d_N, r_0), i.e. r_0^2 times the size of the ANSWER.
91
+ On one LLaMA attention layer at ring rank 118 that is 934 GB, so it does not merely run
92
+ slowly, it cannot run at all. Folding the last contraction and the trace into a single
93
+ einsum keeps the peak at r_0 * prod(d_1..d_{N-1}) * r_{N-1}, and chunking the first mode
94
+ bounds it further for the wide MLP layers.
95
+ """
96
+ n = len(cores)
97
+ if cores[0].shape[0] != cores[-1].shape[-1]:
98
+ raise ValueError(f"ring does not close: {cores[0].shape[0]} vs {cores[-1].shape[-1]}")
99
+ d0 = cores[0].shape[1]
100
+ if chunk and d0 > chunk:
101
+ parts = []
102
+ for lo in range(0, d0, chunk):
103
+ sub = [cores[0][:, lo:min(lo + chunk, d0), :]] + list(cores[1:])
104
+ parts.append(contract_tr(sub, chunk=0))
105
+ return torch.cat(parts, dim=0)
106
+ out = cores[0]
107
+ for g in cores[1:-1]:
108
+ out = torch.tensordot(out, g, dims=([out.dim() - 1], [0]))
109
+ return torch.einsum("i...k,kdi->...d", out, cores[-1])
110
+
111
+
112
+ # --------------------------------------------------------------------------- fitting
113
+ def fit_tt(R: torch.Tensor, ranks):
114
+ """TT-SVD with the given internal ranks. Singular values split symmetrically at each bond,
115
+ matching fit_mpo2/fit_mpo3's gauge so cores stay on comparable scales (fp16-safe and
116
+ kinder to a blockwise quantizer)."""
117
+ dims = list(R.shape)
118
+ n = len(dims)
119
+ if len(ranks) != n - 1:
120
+ raise ValueError(f"{n} sites need {n-1} internal ranks, got {len(ranks)}")
121
+ cores, rest, rprev = [], R.reshape(dims[0], -1), 1
122
+ for k in range(n - 1):
123
+ M = rest.reshape(rprev * dims[k], -1)
124
+ U, S, Vh = torch.linalg.svd(M, full_matrices=False)
125
+ r = min(int(ranks[k]), S.shape[0])
126
+ q = S[:r].clamp_min(0).sqrt()
127
+ cores.append((U[:, :r] * q).reshape(rprev, dims[k], r))
128
+ rest = q[:, None] * Vh[:r]
129
+ rprev = r
130
+ cores.append(rest.reshape(rprev, dims[-1], 1))
131
+ return cores
132
+
133
+
134
+ def tt_to_tr(cores):
135
+ """Reinterpret TT cores as TR cores with r_0 = 1 (an exact, lossless re-labelling)."""
136
+ return [c.clone() for c in cores]
137
+
138
+
139
+ def _subchain(cores, k):
140
+ """Contract every core except k, in cyclic order, -> E[r_k, D, r_{k-1}] with D = prod_{j!=k} d_j."""
141
+ n = len(cores)
142
+ order = [(k + 1 + t) % n for t in range(n - 1)]
143
+ out = cores[order[0]]
144
+ for j in order[1:]:
145
+ out = torch.tensordot(out, cores[j], dims=([out.dim() - 1], [0]))
146
+ return out
147
+
148
+
149
+ def _subchain_chunk(cores, k, lo, hi):
150
+ """`_subchain` with the FIRST following mode restricted to [lo, hi). The restriction rides
151
+ along the contraction untouched, so concatenating the chunks reproduces `_subchain`."""
152
+ n = len(cores)
153
+ order = [(k + 1 + t) % n for t in range(n - 1)]
154
+ out = cores[order[0]][:, lo:hi, :]
155
+ for j in order[1:]:
156
+ out = torch.tensordot(out, cores[j], dims=([out.dim() - 1], [0]))
157
+ return out
158
+
159
+
160
+ def rank_of(cores, k):
161
+ """r_{k-1} * r_k for core k -- the width of that core's least-squares system."""
162
+ n = len(cores)
163
+ return cores[k].shape[0] * cores[k].shape[2]
164
+
165
+
166
+ def _solve_maybe_cpu(AtA, AtW):
167
+ """Solve AtA X = AtW, falling back to the CPU when the GPU cannot hold the factorisation.
168
+
169
+ The normal-equation matrix is (r_{k-1} r_k) square, i.e. it grows as r^4. On down_proj at
170
+ ring rank 219 that is 47961^2 = 9.2 GB, and the factorisation needs a second copy -- no
171
+ amount of chunking the data helps, because this matrix does not depend on the data size.
172
+ Cholesky is tried first (the Gram is symmetric positive definite after the ridge) and
173
+ needs only one triangular factor; if even that does not fit, the solve moves to the host.
174
+ Slow, but a bounded slowdown beats an unbounded failure on the layers that matter most.
175
+ """
176
+ try:
177
+ L = torch.linalg.cholesky(AtA)
178
+ return torch.cholesky_solve(AtW, L)
179
+ except torch.OutOfMemoryError:
180
+ torch.cuda.empty_cache()
181
+ except Exception:
182
+ pass
183
+ try:
184
+ return torch.linalg.solve(AtA, AtW)
185
+ except torch.OutOfMemoryError:
186
+ torch.cuda.empty_cache()
187
+ dev = AtA.device
188
+ X = torch.linalg.solve(AtA.cpu().double(), AtW.cpu().double())
189
+ return X.to(device=dev, dtype=AtW.dtype)
190
+
191
+
192
+ def tr_rel_err(cores, R: torch.Tensor, chunk_elems: int = 250_000_000) -> float:
193
+ """||contract_tr(cores) - R||_F / ||R||_F, accumulated in chunks.
194
+
195
+ Materialising the reconstruction to subtract it needs the reconstruction AND the einsum's
196
+ intermediate at once; on down_proj at ring rank 155 that intermediate is (155, 64, 688,
197
+ 256) = 7 GB even with the first mode already chunked. Accumulating the squared error one
198
+ slice at a time keeps only one slice live, and the chunk width is derived from an element
199
+ budget rather than a hard-coded constant -- a constant is exactly what silently failed to
200
+ engage when a mode happened to equal it.
201
+ """
202
+ n = len(cores)
203
+ d0 = cores[0].shape[1]
204
+ mid = 1
205
+ for k in range(1, n - 1):
206
+ mid *= cores[k].shape[1]
207
+ per_unit = max(1, mid * cores[0].shape[0] * cores[-1].shape[0])
208
+ step = max(1, min(d0, int(chunk_elems // per_unit)))
209
+ acc = 0.0
210
+ for lo in range(0, d0, step):
211
+ hi = min(lo + step, d0)
212
+ sub = [cores[0][:, lo:hi, :]] + list(cores[1:])
213
+ diff = contract_tr(sub) - R[lo:hi]
214
+ acc += float(diff.pow(2).sum())
215
+ del sub, diff
216
+ return (acc ** 0.5) / float(R.norm())
217
+
218
+
219
+ def fit_tr(R: torch.Tensor, ranks, sweeps: int = 30, tol: float = 1e-8, verbose: bool = False,
220
+ seed: int = 1234, restarts: int = 2, solver: str = "lstsq",
221
+ chunk: int = 0, chunk_elems: int = 250_000_000):
222
+ """Fit a tensor ring by TT initialisation + alternating least squares.
223
+
224
+ ranks = [r_0, r_1, ..., r_{N-1}] with r_N == r_0. The TT init uses r_0 = 1 (a legal ring),
225
+ then each ALS sweep re-solves every core in closed form given the others; the ring's extra
226
+ boundary rank is opened up by padding the initialisation. Because ALS on a ring is not
227
+ guaranteed to improve monotonically from an arbitrary start, the best iterate seen is kept
228
+ and the routine REFUSES to return anything worse than its own TT initialisation -- without
229
+ that guard a fitting failure would be indistinguishable from the format being worse, which
230
+ is precisely the comparison this module exists to make.
231
+ """
232
+ n = len(R.shape)
233
+ if len(ranks) != n:
234
+ raise ValueError(f"a ring over {n} sites needs {n} ranks (r_0..r_{{N-1}})")
235
+ dims = list(R.shape)
236
+ rnorm = float(R.norm())
237
+ rnorm2 = float(R.pow(2).sum())
238
+ last_sq = None
239
+ tt = fit_tt(R, ranks[1:])
240
+ base_err = float((contract_tt(tt) - R).norm() / R.norm())
241
+ r0 = int(ranks[0])
242
+ gen = torch.Generator(device="cpu").manual_seed(seed)
243
+
244
+ def padded_init():
245
+ """TT solution embedded in the ring, with the OPENED bond seeded on BOTH ends.
246
+
247
+ Seeding only one end is not enough and is a silent failure: core 0's least-squares
248
+ environment is built from cores 1..N-1, whose ring index comes from core N-1's
249
+ trailing bond. If that stays zero, the environment vanishes on exactly the components
250
+ the ring adds, every ALS solve returns zero there, and the fit never leaves the TT
251
+ solution -- it looks like "the ring buys nothing" rather than "the ring was never
252
+ initialised".
253
+ """
254
+ out = []
255
+ for k, c in enumerate(tt):
256
+ a, d, b = c.shape
257
+ na = r0 if k == 0 else a
258
+ nb = r0 if k == n - 1 else b
259
+ g = torch.zeros(na, d, nb, dtype=R.dtype, device=R.device)
260
+ g[:a, :, :b] = c
261
+ eps = 0.05 * float(c.norm()) / max(1, c.numel()) ** 0.5
262
+ if k == 0 and na > a:
263
+ g[a:, :, :] = eps * torch.randn(na - a, d, nb, generator=gen,
264
+ dtype=R.dtype).to(R.device)
265
+ if k == n - 1 and nb > b:
266
+ g[:, :, b:] = eps * torch.randn(na, d, nb - b, generator=gen,
267
+ dtype=R.dtype).to(R.device)
268
+ out.append(g)
269
+ return out
270
+
271
+ def random_init(g=None):
272
+ """i.i.d. cores whose ring contraction has the right variance.
273
+
274
+ The scale is derived, not guessed. For cores with i.i.d. N(0, s^2) entries the trace
275
+ of the cyclic product is a sum of prod_k r_k independent products of N Gaussians, so
276
+ Var(W) ~= (prod_k r_k) * s^(2N). Matching that to the target mean square gives
277
+ s = (E[R^2] / prod_k r_k)^(1/(2N)). Getting this wrong by a constant factor per core
278
+ compounds to that factor^N in the product, which for N=4,5 puts the initial iterate
279
+ many orders of magnitude away from the data and leaves ALS crawling.
280
+ """
281
+ rr = [int(ranks[k]) for k in range(n)]
282
+ prod = 1.0
283
+ for x in rr:
284
+ prod *= x
285
+ ms = float(R.pow(2).mean())
286
+ s = (ms / prod) ** (1.0 / (2 * n))
287
+ gg = g if g is not None else gen
288
+ return [s * torch.randn(rr[k], dims[k], rr[(k + 1) % n], generator=gg,
289
+ dtype=R.dtype).to(R.device) for k in range(n)]
290
+
291
+ # ALS on a ring has genuine local minima -- a single start that stalls would be reported
292
+ # as "the ring is not better", which is exactly the confound this module must avoid. So
293
+ # several starts are run and the best kept; restarts are cheap next to the SVDs anyway.
294
+ inits = [("tt_padded", padded_init)]
295
+ for j in range(restarts):
296
+ g = torch.Generator(device="cpu").manual_seed(seed + 977 * (j + 1))
297
+ inits.append((f"random{j}", lambda g=g: random_init(g)))
298
+ best, best_err, hists, winner = tt_to_tr(tt), base_err, {}, "tt_init"
299
+ for init_name, init_fn in inits:
300
+ cores, ihist = init_fn(), []
301
+ for it in range(sweeps):
302
+ for k in range(n):
303
+ # The subchain leaves every d index separate and in CYCLIC order starting at
304
+ # k+1. R's remaining modes must be flattened in that SAME order -- movedim
305
+ # gives natural order, which for interior k is a different permutation and
306
+ # would solve the least-squares problem against mismatched columns. It still
307
+ # returns a finite "solution", just to the wrong system.
308
+ # The chunk decision is made from SHAPES ONLY and BEFORE anything large is
309
+ # built. An earlier version computed the full subchain first and then decided
310
+ # whether to chunk, so the unchunked allocation always happened anyway and the
311
+ # chunked branch saved nothing -- the memory-bounded path existed but could
312
+ # never take effect.
313
+ # Auto-size the chunk from a memory budget instead of comparing against a
314
+ # fixed number. A constant threshold silently does nothing when the mode
315
+ # happens to equal it -- which is exactly what let a 4-site fit try to
316
+ # materialise a 134 GB subchain (mode 64, chunk 64, "64 > 64" is false).
317
+ m_ = (k + 1) % n
318
+ other = 1
319
+ for j in range(n):
320
+ if j != k:
321
+ other *= dims[j]
322
+ per_unit = max(1, (other // max(1, dims[m_])) * rank_of(cores, k))
323
+ auto = max(1, min(dims[m_], int(chunk_elems // per_unit)))
324
+ use_chunk = auto < dims[m_]
325
+ if solver == "normal" and use_chunk:
326
+ # Memory-bounded normal equations. Materialising the subchain costs
327
+ # r_k * (prod_{j!=k} d_j) * r_{k-1} floats -- on down_proj at these ranks
328
+ # that is (155, 688, 256, 155) = 17 GB, so the unchunked path cannot run
329
+ # on the MLP layers at all. The Gram and right-hand side are sums over the
330
+ # flattened "others" index, so they accumulate exactly over slices of the
331
+ # first subchain mode; this is the same arithmetic, not an approximation.
332
+ m = m_
333
+ d_next = dims[m]
334
+ rk_, rkm1_ = None, None
335
+ AtA = AtW = None
336
+ Rp = R.permute(*([k] + [(k + 1 + t) % n for t in range(n - 1)]))
337
+ for lo in range(0, d_next, auto):
338
+ hi = min(lo + auto, d_next)
339
+ Ec = _subchain_chunk(cores, k, lo, hi)
340
+ rk_, rkm1_ = Ec.shape[0], Ec.shape[-1]
341
+ Ec = Ec.reshape(rk_, -1, rkm1_)
342
+ Ac = Ec.permute(1, 2, 0).reshape(Ec.shape[1], rkm1_ * rk_)
343
+ Wc = Rp[:, lo:hi].reshape(dims[k], -1)
344
+ g = Ac.transpose(0, 1) @ Ac
345
+ h = Ac.transpose(0, 1) @ Wc.transpose(0, 1)
346
+ AtA = g if AtA is None else AtA + g
347
+ AtW = h if AtW is None else AtW + h
348
+ del Ec, Ac, Wc, g, h
349
+ lam = 1e-8 * float(AtA.diagonal().abs().mean().clamp_min(1e-30))
350
+ AtA_r = AtA + lam * torch.eye(AtA.shape[0], dtype=AtA.dtype,
351
+ device=AtA.device)
352
+ G = _solve_maybe_cpu(AtA_r, AtW)
353
+ del AtA_r
354
+ # ||R - A G||^2 = ||R||^2 - 2<AtW, G> + <G, AtA G>, all from quantities
355
+ # already formed. Computing it by contracting the whole ring instead would
356
+ # cost one full O(prod d_k) tensor per sweep per core.
357
+ sq = rnorm2 - 2.0 * float((AtW * G).sum()) + float((G * (AtA @ G)).sum())
358
+ last_sq = max(sq, 0.0)
359
+ rkm1, rk = rkm1_, rk_
360
+ else:
361
+ # ONE branch builds A/Wk and ONE consumes them. Splitting the decision
362
+ # across two separate if/else chains left the non-chunked solve reachable
363
+ # after the chunked path had run, where `A` is whatever the PREVIOUS core
364
+ # left behind -- a silent wrong answer rather than an error.
365
+ E = _subchain(cores, k) # (r_k, d_{k+1},..,d_{k-1}, r_{k-1})
366
+ rk, rkm1 = E.shape[0], E.shape[-1]
367
+ E = E.reshape(rk, -1, rkm1)
368
+ D = E.shape[1]
369
+ A = E.permute(1, 2, 0).reshape(D, rkm1 * rk)
370
+ perm = [k] + [(k + 1 + t) % n for t in range(n - 1)]
371
+ # R's remaining modes must be flattened in the subchain's CYCLIC order --
372
+ # movedim gives natural order, which for interior k solves the
373
+ # least-squares problem against mismatched columns and still returns a
374
+ # finite "solution", just to the wrong system.
375
+ Wk = R.permute(*perm).reshape(dims[k], D)
376
+ del E
377
+ if solver == "normal":
378
+ AtA = A.transpose(0, 1) @ A
379
+ lam = 1e-8 * float(AtA.diagonal().abs().mean().clamp_min(1e-30))
380
+ AtA += lam * torch.eye(AtA.shape[0], dtype=A.dtype, device=A.device)
381
+ G = _solve_maybe_cpu(AtA, A.transpose(0, 1) @ Wk.transpose(0, 1))
382
+ del AtA
383
+ else:
384
+ G = torch.linalg.lstsq(A, Wk.transpose(0, 1)).solution
385
+ last_sq = None
386
+ del A, Wk
387
+ cores[k] = (G.transpose(0, 1).reshape(dims[k], rkm1, rk)
388
+ .permute(1, 0, 2).contiguous())
389
+ err = (float(last_sq) ** 0.5 / rnorm if last_sq is not None
390
+ else float((contract_tr(cores, chunk=chunk) - R).norm() / rnorm))
391
+ ihist.append(round(err, 8))
392
+ if verbose:
393
+ print(f" TR-ALS[{init_name}] sweep {it+1}: rel err {err:.6f}", flush=True)
394
+ if err < best_err - 1e-12:
395
+ best, best_err, winner = [c.clone() for c in cores], err, init_name
396
+ if it and abs(ihist[-2] - err) < tol * max(err, 1e-12):
397
+ break
398
+ hists[init_name] = ihist
399
+ # The algebraic residual is a difference of nearly equal large numbers; at a relative
400
+ # error of ~1e-2 it has already lost most of its fp32 significance. It is fine for
401
+ # steering ALS but not for the number that gets reported, so the winner is re-measured
402
+ # once by explicit contraction.
403
+ best_err = tr_rel_err(best, R)
404
+ if best_err > base_err:
405
+ return tt_to_tr(tt), base_err, {"fell_back_to_tt": True, "tt_err": base_err,
406
+ "winner": "tt_init", "als_hist": hists}
407
+ return best, best_err, {"fell_back_to_tt": winner == "tt_init", "tt_err": base_err,
408
+ "winner": winner, "als_hist": hists}
409
+
410
+
411
+ # --------------------------------------------------------------------------- bookkeeping
412
+ def tt_params(dims, ranks) -> int:
413
+ r = [1] + [int(x) for x in ranks] + [1]
414
+ return sum(r[k] * dims[k] * r[k + 1] for k in range(len(dims)))
415
+
416
+
417
+ def tr_params(dims, ranks) -> int:
418
+ r = [int(x) for x in ranks]
419
+ n = len(dims)
420
+ return sum(r[k] * dims[k] * r[(k + 1) % n] for k in range(n))
421
+
422
+
423
+ def tt_rank_ceilings(dims):
424
+ """r_k <= min(prod_{j<=k} d_j, prod_{j>k} d_j): above that the truncation is vacuous."""
425
+ n, out = len(dims), []
426
+ for k in range(n - 1):
427
+ left = 1
428
+ for j in range(k + 1):
429
+ left *= dims[j]
430
+ right = 1
431
+ for j in range(k + 1, n):
432
+ right *= dims[j]
433
+ out.append(min(left, right))
434
+ return out
435
+
436
+
437
+ def ranks_for_budget(dims, budget: int, ring: bool, alpha: float = 1.0):
438
+ """Largest ranks fitting `budget`, shaped by r_k proportional to ceiling_k ** alpha.
439
+
440
+ Bisection rather than a closed form: the count is linear in each rank but bilinear in
441
+ adjacent pairs, and cyclic for a ring, so there is no single quadratic to solve.
442
+
443
+ ALPHA EXISTS BECAUSE EQUAL FILL FRACTION IS WRONG WHEN THE CEILINGS ARE LOPSIDED. For a
444
+ 4-site split of 4096 the ceilings are (64, 4096, 64): alpha=1 spends the budget on the
445
+ huge middle bond and returns ranks like (36, 2327, 36), strangling the two bonds that
446
+ actually gate information flow through the chain. alpha=0 gives every bond the same rank
447
+ instead. Neither is right a priori, so the caller is expected to MEASURE across alpha --
448
+ the reconstruction error, not the heuristic, decides.
449
+ """
450
+ ceil_tt = tt_rank_ceilings(dims)
451
+ ceils = ([min(ceil_tt)] + ceil_tt) if ring else ceil_tt
452
+ fn = tr_params if ring else tt_params
453
+ mx = max(ceils)
454
+ shape = [(c / mx) ** alpha for c in ceils]
455
+
456
+ def build(t):
457
+ return [max(1, min(int(round(t * mx * s)), c)) for s, c in zip(shape, ceils)]
458
+
459
+ lo, hi = 0.0, 1.0
460
+ if fn(dims, build(1.0)) <= budget:
461
+ return build(1.0)
462
+ for _ in range(60):
463
+ mid = (lo + hi) / 2
464
+ if fn(dims, build(mid)) > budget:
465
+ hi = mid
466
+ else:
467
+ lo = mid
468
+ r = build(lo)
469
+ while fn(dims, r) > budget and max(r) > 1:
470
+ r[r.index(max(r))] -= 1
471
+ return r
472
+
473
+
474
+ def balanced_split(n: int, k: int):
475
+ """Most balanced k-way factorisation of n with every factor >= 2 (spread-minimising)."""
476
+ best = None
477
+ def rec(rem, parts):
478
+ nonlocal best
479
+ if len(parts) == k - 1:
480
+ if rem >= 2:
481
+ cand = parts + [rem]
482
+ key = max(cand) / min(cand)
483
+ if best is None or key < best[0]:
484
+ best = (key, cand)
485
+ return
486
+ d = 2
487
+ while d * d <= rem or d <= rem:
488
+ if d > rem:
489
+ break
490
+ if rem % d == 0:
491
+ rec(rem // d, parts + [d])
492
+ d += 1
493
+ rec(n, [])
494
+ if best is None:
495
+ raise ValueError(f"no {k}-way factorisation of {n} with all factors >= 2")
496
+ return sorted(best[1])
497
+
498
+
499
+ def self_test(device: str = "cpu") -> None:
500
+ torch.manual_seed(0)
501
+ dt = torch.float64
502
+ for osp, isp in [((4, 3), (2, 5)), ((4, 3, 2), (2, 5, 3)), ((2, 3, 2, 2), (2, 2, 3, 2))]:
503
+ n = len(osp)
504
+ out = 1
505
+ inn = 1
506
+ for x in osp:
507
+ out *= x
508
+ for x in isp:
509
+ inn *= x
510
+ W = torch.randn(out, inn, dtype=dt, device=device)
511
+ R = rearrange_n(W, osp, isp)
512
+ dims = [o * i for o, i in zip(osp, isp)]
513
+ assert list(R.shape) == dims, (R.shape, dims)
514
+ assert torch.equal(inv_rearrange_n(R, osp, isp), W), f"{n}-site rearrange not invertible"
515
+ # index identity, not just the round trip: a wrong-but-self-inverse permutation would
516
+ # pass the round trip and scramble every weight silently
517
+ for _ in range(40):
518
+ oi = [torch.randint(0, x, (1,)).item() for x in osp]
519
+ ii = [torch.randint(0, x, (1,)).item() for x in isp]
520
+ ridx = tuple(oi[k] * isp[k] + ii[k] for k in range(n))
521
+ orow = 0
522
+ for k in range(n):
523
+ orow = orow * osp[k] + oi[k]
524
+ ocol = 0
525
+ for k in range(n):
526
+ ocol = ocol * isp[k] + ii[k]
527
+ assert R[ridx] == W[orow, ocol], f"{n}-site rearrange index map wrong"
528
+
529
+ ceils = tt_rank_ceilings(dims)
530
+ cores = fit_tt(R, ceils)
531
+ e = float((contract_tt(cores) - R).norm() / R.norm())
532
+ assert e < 1e-10, f"{n}-site full-rank TT is not exact ({e:.3e})"
533
+ assert tt_params(dims, ceils) == sum(c.numel() for c in cores), "tt_params disagrees"
534
+
535
+ if n >= 3:
536
+ trunc = [max(1, c // 2) for c in ceils]
537
+ cores = fit_tt(R, trunc)
538
+ assert tt_params(dims, trunc) == sum(c.numel() for c in cores)
539
+ for a in (0.0, 0.5, 1.0):
540
+ rr = ranks_for_budget(dims, tt_params(dims, trunc), ring=False, alpha=a)
541
+ assert tt_params(dims, rr) <= tt_params(dims, trunc), \
542
+ f"TT budget solver overran at alpha={a}"
543
+ # a ring at the SAME parameter budget must not do worse than the TT it starts from
544
+ budget = tt_params(dims, trunc)
545
+ rring = ranks_for_budget(dims, budget, ring=True)
546
+ assert tr_params(dims, rring) <= budget, "TR budget solver overran"
547
+ _c, err_tr, info = fit_tr(R, rring, sweeps=6)
548
+ assert err_tr <= info["tt_err"] + 1e-12, "fit_tr returned worse than its own TT init"
549
+ assert abs(float((contract_tr(_c) - R).norm() / R.norm()) - err_tr) < 1e-8, \
550
+ "reported TR error does not match the returned cores"
551
+
552
+ ring_chk = [torch.randn(3, 5, 4, dtype=dt), torch.randn(4, 6, 2, dtype=dt),
553
+ torch.randn(2, 7, 3, dtype=dt)]
554
+ full = contract_tr(ring_chk)
555
+ assert torch.allclose(full, contract_tr(ring_chk, chunk=2), atol=1e-12), \
556
+ "chunked contract_tr disagrees with the unchunked one"
557
+ ref = torch.einsum("iaj,jbk,kci->abc", *ring_chk)
558
+ assert torch.allclose(full, ref, atol=1e-12), "contract_tr is not the cyclic trace"
559
+
560
+ # a ring with r_0 > 1 must be able to represent things a TT of the same internal ranks cannot
561
+ dims = [6, 6, 6]
562
+ torch.manual_seed(1)
563
+ ring = [torch.randn(3, 6, 3, dtype=dt) for _ in range(3)]
564
+ Rr = contract_tr(ring)
565
+ tt_same = fit_tt(Rr, [3, 3])
566
+ e_tt = float((contract_tt(tt_same) - Rr).norm() / Rr.norm())
567
+ assert e_tt > 1e-3, ("a rank-(3,3,3) ring was reproduced by a rank-(3,3) TT; the ring "
568
+ f"contraction is probably not closing the loop (err {e_tt:.3e})")
569
+ for slv in ("lstsq", "normal"):
570
+ got, err, info = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3, solver=slv)
571
+ assert err < 1e-4, (f"TR-ALS[{slv}] failed to recover an exact rank-3 ring "
572
+ f"(err {err:.3e}); winner={info['winner']} "
573
+ f"tt_init={info['tt_err']:.3e}")
574
+ got, err, info = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3)
575
+ # chunking changes only how the Gram is accumulated, so it must reach the same optimum
576
+ _g, err_ch, _i = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3, solver="normal", chunk=2)
577
+ assert err_ch < 1e-4, f"chunked TR-ALS failed to recover an exact ring (err {err_ch:.3e})"
578
+ assert err < 1e-4, (f"TR-ALS failed to recover an exact rank-3 ring (err {err:.3e}); "
579
+ f"winner={info['winner']} tt_init={info['tt_err']:.3e}")
580
+
581
+ assert balanced_split(4096, 3) == [16, 16, 16], balanced_split(4096, 3)
582
+ assert balanced_split(4096, 2) == [64, 64]
583
+ b = balanced_split(11008, 3)
584
+ assert 43 in b and b[0] * b[1] * b[2] == 11008, b
585
+ print("tensor_formats self-test PASSED (N-site rearrange exact & index-checked, full-rank "
586
+ "TT exact, budget solvers within budget, TR >= its TT init, TR strictly beats TT on "
587
+ "a true ring, balanced splits correct)")
588
+
589
+
590
+ if __name__ == "__main__":
591
+ self_test()
592
+
593
+
594
+ # --------------------------------------------------------------------------- layers
595
+ class TRLinear(torch.nn.Module):
596
+ """Tensor-ring linear layer: W = Tr[G_0 G_1 ... G_{N-1}] after the shared rearrangement.
597
+
598
+ NOT a LowRankLinear subclass, unlike MPO2Linear/MPO3Linear. Those two could pretend to be
599
+ a pair of factors because a train has open ends; a ring genuinely has N 3-D cores and no
600
+ A/B roles to borrow, so anything keyed on `.A`/`.B` (the blockwise quantizer, the bond
601
+ rebalancer) has to be taught about `.cores` explicitly rather than silently doing the
602
+ wrong thing to a subclass it thinks it understands.
603
+
604
+ RECONSTRUCTION IS CHUNKED BY DEFAULT. Merging any two cores of a 3-site ring costs
605
+ r*d_i*d_j*r entries -- on down_proj at ring rank 142 that is 7.1 GB in bf16, per layer,
606
+ per forward. Chunking the first mode bounds it; the cost is more, smaller matmuls.
607
+ """
608
+
609
+ def __init__(self, cores, osplit, isplit, chunk_elems: int = 500_000_000,
610
+ bias=None):
611
+ super().__init__()
612
+ n = len(cores)
613
+ if len(osplit) != n or len(isplit) != n:
614
+ raise ValueError(f"{n} cores need {n} output and {n} input modes")
615
+ if min(list(osplit) + list(isplit)) < 2:
616
+ raise ValueError(f"degenerate split o={tuple(osplit)} i={tuple(isplit)}: a mode of "
617
+ f"1 collapses a site, making this an (N-1)-site network")
618
+ for k in range(n):
619
+ if cores[k].shape[1] != osplit[k] * isplit[k]:
620
+ raise ValueError(f"core {k} has mode {cores[k].shape[1]}, expected "
621
+ f"{osplit[k]}*{isplit[k]}")
622
+ if cores[k].shape[2] != cores[(k + 1) % n].shape[0]:
623
+ raise ValueError(f"ring does not close between cores {k} and {(k+1)%n}")
624
+ self.cores = torch.nn.ParameterList([torch.nn.Parameter(c) for c in cores])
625
+ self.osplit, self.isplit = tuple(int(x) for x in osplit), tuple(int(x) for x in isplit)
626
+ o = i = 1
627
+ for k in range(n):
628
+ o *= self.osplit[k]
629
+ i *= self.isplit[k]
630
+ self.out_features, self.in_features = o, i
631
+ self.ranks = tuple(int(c.shape[0]) for c in cores)
632
+ # Elements per unit of the FIRST mode in contract_tr's peak intermediate, which is
633
+ # (r_0, c, d_1, ..., d_{n-2}, r_{n-1}) -- the LAST core's mode is contracted away by
634
+ # the closing einsum and must not be counted. Including it over-estimated the cost by
635
+ # d_{n-1} (256x on an MLP layer), which drove the chunk to 1 and would have made every
636
+ # MLP forward 256 sequential contractions instead of 8.
637
+ mid = 1
638
+ for k in range(1, n - 1):
639
+ mid *= cores[k].shape[1]
640
+ per_unit = max(1, mid * self.ranks[0] * self.ranks[-1])
641
+ self._chunk = max(1, min(cores[0].shape[1], int(chunk_elems // per_unit)))
642
+ # non-persistent: never wants to show up in a checkpoint, and materialize_() is an
643
+ # inference-only opt-in (see below), so a freshly-loaded layer must start uncached.
644
+ self.register_buffer("_cached_weight", None, persistent=False)
645
+ # LLaMA projections have no bias, but Qwen2's q/k/v do. Dropping it on
646
+ # replacement is SILENT -- the shapes still match, the parameter-count gate
647
+ # still balances (achieved excludes bias, and so would the rebuilt model), and
648
+ # only the accuracy moves. So the bias is carried, not discarded.
649
+ self.bias = None if bias is None else torch.nn.Parameter(bias)
650
+
651
+ def weight(self) -> torch.Tensor:
652
+ if self._cached_weight is not None:
653
+ return self._cached_weight
654
+ cs = list(self.cores)
655
+ R = contract_tr(cs, chunk=self._chunk if self._chunk < cs[0].shape[1] else 0)
656
+ return inv_rearrange_n(R, self.osplit, self.isplit)
657
+
658
+ @torch.no_grad()
659
+ def materialize_(self):
660
+ """Cache the dense weight once. INFERENCE ONLY -- gradients cannot flow through the
661
+ cached tensor back to the cores, so this must never be called before/during training.
662
+
663
+ forward() calls weight() on every call, which redoes the full chunked ring
664
+ contraction (two tensor contractions + a trace per core) from scratch. That is fine
665
+ for a single forward pass, but autoregressive generation calls forward() once per
666
+ layer per GENERATED TOKEN with the cores completely unchanged between calls. Measured
667
+ on tr3_ring4b04_h1's GSM8K eval before this existed: 209s/item, ETA 73h for 1319
668
+ items -- every one of ~200 generated tokens re-contracted all 224 ring layers.
669
+ A train layer (LowRankLinear/MPO2Linear) never had this problem: F.linear(F.linear(x,
670
+ B), A) applies the two factors straight to the activation and never materializes W at
671
+ all, so there was nothing to cache there.
672
+ """
673
+ self._cached_weight = self.weight().detach().clone()
674
+
675
+ def unmaterialize_(self):
676
+ self._cached_weight = None
677
+
678
+ def forward(self, x):
679
+ b = None if self.bias is None else self.bias.to(x.dtype)
680
+ return torch.nn.functional.linear(x, self.weight().to(x.dtype), b)
681
+
682
+ def extra_repr(self) -> str:
683
+ return (f"o={self.osplit}, i={self.isplit}, ranks={self.ranks}, "
684
+ f"chunk={self._chunk}, materialized={self._cached_weight is not None}")
685
+
686
+
687
+ class SparseAugTRLinear(TRLinear):
688
+ """TRLinear plus a sparse additive residual. Same int64-index contract as the MPO layers:
689
+ `sp_idx` must NEVER be cast to a floating dtype -- a `.half()` on a 45M-scale index
690
+ silently rounds it to a different, valid-looking position."""
691
+
692
+ def __init__(self, cores, osplit, isplit, sp_idx, sp_val,
693
+ chunk_elems: int = 500_000_000, bias=None):
694
+ super().__init__(cores, osplit, isplit, chunk_elems, bias)
695
+ if sp_idx.numel() != sp_val.numel():
696
+ raise ValueError(f"{sp_idx.numel()} indices for {sp_val.numel()} values")
697
+ n = self.out_features * self.in_features
698
+ if sp_idx.numel() and (int(sp_idx.max()) >= n or int(sp_idx.min()) < 0):
699
+ raise ValueError("sparse index out of range for this layer")
700
+ self.register_buffer("sp_idx", sp_idx.to(torch.int64))
701
+ self.sp_val = torch.nn.Parameter(sp_val)
702
+
703
+ def weight(self) -> torch.Tensor:
704
+ # must check the cache here too, not just in TRLinear.weight(): materialize_() caches
705
+ # THIS class's weight() (ring + sparse, since self.weight() dispatches polymorphically
706
+ # from inside materialize_()), so without this check a later call would go
707
+ # super().weight() -> see the cache -> return the already-sparse-augmented tensor ->
708
+ # and then add the sparse residual a second time on top of it.
709
+ if self._cached_weight is not None:
710
+ return self._cached_weight
711
+ W = super().weight()
712
+ if self.sp_idx.numel():
713
+ W = W.reshape(-1).index_add(0, self.sp_idx, self.sp_val.to(W.dtype)).view_as(W)
714
+ return W
715
+
716
+ def extra_repr(self) -> str:
717
+ return super().extra_repr() + f", nnz={self.sp_idx.numel()}"
718
+
719
+
720
+ def layer_self_test() -> None:
721
+ torch.manual_seed(0)
722
+ osp, isp = (4, 3, 2), (2, 5, 3)
723
+ dims = [o * i for o, i in zip(osp, isp)]
724
+ cores = [torch.randn(3, dims[0], 4), torch.randn(4, dims[1], 2), torch.randn(2, dims[2], 3)]
725
+ lay = TRLinear([c.clone() for c in cores], osp, isp, chunk_elems=10 ** 9)
726
+ ref = inv_rearrange_n(contract_tr(cores), osp, isp)
727
+ assert torch.allclose(lay.weight(), ref, atol=1e-5), "TRLinear.weight() != contract+inverse"
728
+ # chunking must not change the answer
729
+ lay_c = TRLinear([c.clone() for c in cores], osp, isp, chunk_elems=1)
730
+ assert lay_c._chunk < dims[0], "chunk did not engage"
731
+ assert torch.allclose(lay_c.weight(), ref, atol=1e-5), "chunked forward differs"
732
+ x = torch.randn(7, lay.in_features)
733
+ assert torch.allclose(lay(x), x @ ref.T, atol=1e-4), "forward != x W^T"
734
+ idx = torch.tensor([0, 5, lay.out_features * lay.in_features - 1], dtype=torch.int64)
735
+ val = torch.tensor([1.0, -2.0, 3.0])
736
+ sl = SparseAugTRLinear([c.clone() for c in cores], osp, isp, idx, val, chunk_elems=10 ** 9)
737
+ d = (sl.weight() - ref).reshape(-1)
738
+ assert torch.allclose(d[idx], val, atol=1e-5), "sparse residual not applied at sp_idx"
739
+ assert abs(float(d.abs().sum()) - float(val.abs().sum())) < 1e-4, "residual leaked"
740
+ try:
741
+ TRLinear([torch.zeros(2, 4, 2), torch.zeros(2, 3, 2), torch.zeros(2, 6, 2)],
742
+ (4, 1, 2), (1, 3, 3))
743
+ except ValueError:
744
+ pass
745
+ else:
746
+ raise AssertionError("a degenerate split (mode = 1) was accepted")
747
+ # gradients must reach every core
748
+ lay.zero_grad()
749
+ lay(x).sum().backward()
750
+ for k, c in enumerate(lay.cores):
751
+ assert c.grad is not None and float(c.grad.abs().sum()) > 0, f"core {k} got no gradient"
752
+ # materialize_() must be a pure inference-speed cache: same weight, same forward output,
753
+ # and -- the one bug this is actually guarding against -- the sparse residual must not
754
+ # get added twice once SparseAugTRLinear.weight() is short-circuited by the cache.
755
+ pre = lay.weight().clone()
756
+ lay.materialize_()
757
+ assert lay._cached_weight is not None, "materialize_() did not populate the cache"
758
+ assert torch.allclose(lay.weight(), pre, atol=1e-6), "materialize_() changed weight()"
759
+ assert torch.allclose(lay(x), x @ ref.T, atol=1e-4), "forward != x W^T after materialize_()"
760
+ lay.unmaterialize_()
761
+ assert lay._cached_weight is None, "unmaterialize_() left the cache populated"
762
+ sl_ref = sl.weight().clone()
763
+ sl.materialize_()
764
+ assert torch.allclose(sl.weight(), sl_ref, atol=1e-6), \
765
+ "materialized SparseAugTRLinear.weight() differs -- sparse residual likely double-added"
766
+ print("TRLinear self-test PASSED (weight matches contraction, chunking exact, forward "
767
+ "correct, sparse localised, degenerate split refused, all cores differentiable, "
768
+ "materialize_() cache exact and idempotent)")
tr3/heal/llama2-7b/README.md ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama2
3
+ base_model: NousResearch/Llama-2-7b-chat-hf
4
+ tags:
5
+ - tensor-decomposition
6
+ - tensor-ring
7
+ - model-compression
8
+ - llama2
9
+ ---
10
+
11
+ # TR-3: LLaMA-2-7B-chat compressed with a Tensor Ring
12
+
13
+ LLaMA-2-7B-chat with every attention/MLP projection replaced by a **3-site Tensor Ring**
14
+ (a cyclic tensor-network factorization, not a train/TT — the ring closes with a non-trivial
15
+ boundary bond) plus a 5% sparse residual, then healed with pure knowledge distillation.
16
+
17
+ - **4.02B params** (down from 6.74B, ~40% reduction)
18
+ - **60M healing tokens** (0.228 epoch, pure forward-KL distillation from the dense 7B teacher)
19
+ - Full five-task evaluation (lm-eval 0.4.12, full benchmark, not a subsample):
20
+
21
+ | Task (shots) | This model | Dense 7B teacher |
22
+ |---|---:|---:|
23
+ | MMLU (5-shot) | **43.21%** | 47.22% |
24
+ | HellaSwag (10-shot) | **70.75%** | 78.59% |
25
+ | BoolQ (0-shot) | **77.09%** | 80.58% |
26
+
27
+
28
+ ## ⚠️ This is NOT a standard `transformers` checkpoint
29
+
30
+ The weight tensors in `state_dict_fp16_healed.pt` are **ring cores**, not dense `nn.Linear` weights —
31
+ loading them requires reconstructing the model with the custom `TRLinear`/`SparseAugTRLinear`
32
+ layers from `tensor_formats.py` (included in this repo), using `ranks.json` for the per-layer
33
+ topology. `config.json` is included only as architecture metadata (it is the stock
34
+ LLaMA-2-7B-chat config) — you cannot `AutoModelForCausalLM.from_pretrained()` this repo
35
+ directly.
36
+
37
+ ## How to load it
38
+
39
+ ```python
40
+ import json
41
+ import torch
42
+ from huggingface_hub import hf_hub_download
43
+ from transformers import AutoModelForCausalLM, AutoTokenizer
44
+
45
+ REPO = "<your-username>/<this-repo-name>"
46
+
47
+ ranks = json.loads(open(hf_hub_download(REPO, "ranks.json")).read())
48
+ state_dict_path = hf_hub_download(REPO, "state_dict_fp16_healed.pt")
49
+ tensor_formats_path = hf_hub_download(REPO, "tensor_formats.py")
50
+
51
+ # tensor_formats.py has no local package dependencies -- exec it into a namespace
52
+ ns = {}
53
+ exec(open(tensor_formats_path).read(), ns)
54
+ TRLinear, SparseAugTRLinear = ns["TRLinear"], ns["SparseAugTRLinear"]
55
+
56
+ def set_sub(model, path, new):
57
+ parts = path.split(".")
58
+ parent = model
59
+ for p in parts[:-1]:
60
+ parent = getattr(parent, p)
61
+ setattr(parent, parts[-1], new)
62
+
63
+ model = AutoModelForCausalLM.from_pretrained(
64
+ "NousResearch/Llama-2-7b-chat-hf",
65
+ revision="351844e75ed0bcbbe3f10671b3c808d2b83894ee",
66
+ torch_dtype=torch.float16,
67
+ )
68
+ for path, spec in ranks.items():
69
+ osp = (spec["o1"], spec["o2"], spec["o3"])
70
+ isp = (spec["i1"], spec["i2"], spec["i3"])
71
+ rr = (spec["r0"], spec["r1"], spec["r2"])
72
+ dims = [o * i for o, i in zip(osp, isp)]
73
+ cores = [torch.zeros(rr[k], dims[k], rr[(k + 1) % 3], dtype=torch.float16) for k in range(3)]
74
+ nnz = spec.get("nnz", 0)
75
+ layer = (SparseAugTRLinear(cores, osp, isp,
76
+ torch.zeros(nnz, dtype=torch.int64),
77
+ torch.zeros(nnz, dtype=torch.float16))
78
+ if nnz else TRLinear(cores, osp, isp))
79
+ set_sub(model, path, layer)
80
+
81
+ sd = torch.load(state_dict_path, map_location="cpu")
82
+ missing, unexpected = model.load_state_dict(
83
+ {k: (v.to(torch.float16) if v.is_floating_point() else v) for k, v in sd.items()},
84
+ strict=False)
85
+ assert not missing and not unexpected
86
+
87
+ # generation-heavy inference (e.g. batch decoding) is 100x+ faster after this --
88
+ # forward() otherwise redoes the full ring contraction on every call. Never call
89
+ # before/during training: it detaches the cache from the ring cores' gradients.
90
+ for m in model.modules():
91
+ if isinstance(m, TRLinear):
92
+ m.materialize_()
93
+
94
+ tok = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
95
+ ```
96
+
97
+ ## Files
98
+
99
+ | File | What it is |
100
+ |---|---|
101
+ | `state_dict_fp16_healed.pt` | Healed weights (ring-core form) |
102
+ | `ranks.json` | Per-layer ring topology (output/input mode splits + bond ranks + sparse-residual nnz) |
103
+ | `tensor_formats.py` | `TRLinear`/`SparseAugTRLinear` layer implementations + the ring contraction/fitting code |
104
+ | `config.json` | Stock LLaMA-2-7B-chat architecture config, for reference only |
105
+
106
+ ## Provenance / method
107
+
108
+ Compression: 3-site tensor ring, TT-SVD initialization + ALS refinement (multi-restart, never
109
+ returns worse than its own TT baseline), diagonal 3-way input-activation whitening, 5% sparse
110
+ residual (activation-weighted magnitude selection). Healing: pure forward-KL distillation
111
+ (alpha=1.0, T=1.0), lr=2e-5, 60M tokens on a decontaminated alpaca/openhermes/ultrachat mixture.
112
+ Full method code and the complete experiment record (why this format was chosen over
113
+ TT/matrix-low-rank alternatives) are not included in this repo.
114
+
115
+ ## License
116
+
117
+ Derived from Meta's LLaMA 2 (`NousResearch/Llama-2-7b-chat-hf`, an unofficial redistribution of
118
+ the same weights). Subject to the **LLaMA 2 Community License** — see
119
+ https://ai.meta.com/llama/license/. This repo does not grant any rights beyond that license.
tr3/heal/llama2-7b/config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "NousResearch/Llama-2-7b-chat-hf",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "eos_token_id": 2,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 4096,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 11008,
15
+ "max_position_embeddings": 4096,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 32,
19
+ "num_hidden_layers": 32,
20
+ "num_key_value_heads": 32,
21
+ "pad_token_id": 0,
22
+ "pretraining_tp": 1,
23
+ "rms_norm_eps": 1e-05,
24
+ "rope_scaling": null,
25
+ "rope_theta": 10000.0,
26
+ "tie_word_embeddings": false,
27
+ "torch_dtype": "float16",
28
+ "transformers_version": "4.46.3",
29
+ "use_cache": true,
30
+ "vocab_size": 32000
31
+ }
32
+
tr3/heal/llama2-7b/ranks.json ADDED
@@ -0,0 +1,2690 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model.layers.0.self_attn.q_proj": {
3
+ "o1": 16,
4
+ "o2": 16,
5
+ "o3": 16,
6
+ "i1": 16,
7
+ "i2": 16,
8
+ "i3": 16,
9
+ "r0": 108,
10
+ "r1": 108,
11
+ "r2": 108,
12
+ "nnz": 838860
13
+ },
14
+ "model.layers.0.self_attn.k_proj": {
15
+ "o1": 16,
16
+ "o2": 16,
17
+ "o3": 16,
18
+ "i1": 16,
19
+ "i2": 16,
20
+ "i3": 16,
21
+ "r0": 108,
22
+ "r1": 108,
23
+ "r2": 108,
24
+ "nnz": 838860
25
+ },
26
+ "model.layers.0.self_attn.v_proj": {
27
+ "o1": 16,
28
+ "o2": 16,
29
+ "o3": 16,
30
+ "i1": 16,
31
+ "i2": 16,
32
+ "i3": 16,
33
+ "r0": 108,
34
+ "r1": 108,
35
+ "r2": 108,
36
+ "nnz": 838860
37
+ },
38
+ "model.layers.0.self_attn.o_proj": {
39
+ "o1": 16,
40
+ "o2": 16,
41
+ "o3": 16,
42
+ "i1": 16,
43
+ "i2": 16,
44
+ "i3": 16,
45
+ "r0": 108,
46
+ "r1": 108,
47
+ "r2": 108,
48
+ "nnz": 838860
49
+ },
50
+ "model.layers.0.mlp.gate_proj": {
51
+ "o1": 16,
52
+ "o2": 16,
53
+ "o3": 43,
54
+ "i1": 16,
55
+ "i2": 16,
56
+ "i3": 16,
57
+ "r0": 141,
58
+ "r1": 141,
59
+ "r2": 141,
60
+ "nnz": 2254438
61
+ },
62
+ "model.layers.0.mlp.up_proj": {
63
+ "o1": 16,
64
+ "o2": 16,
65
+ "o3": 43,
66
+ "i1": 16,
67
+ "i2": 16,
68
+ "i3": 16,
69
+ "r0": 141,
70
+ "r1": 141,
71
+ "r2": 141,
72
+ "nnz": 2254438
73
+ },
74
+ "model.layers.0.mlp.down_proj": {
75
+ "o1": 16,
76
+ "o2": 16,
77
+ "o3": 16,
78
+ "i1": 16,
79
+ "i2": 16,
80
+ "i3": 43,
81
+ "r0": 141,
82
+ "r1": 141,
83
+ "r2": 141,
84
+ "nnz": 2254438
85
+ },
86
+ "model.layers.1.self_attn.q_proj": {
87
+ "o1": 16,
88
+ "o2": 16,
89
+ "o3": 16,
90
+ "i1": 16,
91
+ "i2": 16,
92
+ "i3": 16,
93
+ "r0": 108,
94
+ "r1": 108,
95
+ "r2": 108,
96
+ "nnz": 838860
97
+ },
98
+ "model.layers.1.self_attn.k_proj": {
99
+ "o1": 16,
100
+ "o2": 16,
101
+ "o3": 16,
102
+ "i1": 16,
103
+ "i2": 16,
104
+ "i3": 16,
105
+ "r0": 108,
106
+ "r1": 108,
107
+ "r2": 108,
108
+ "nnz": 838860
109
+ },
110
+ "model.layers.1.self_attn.v_proj": {
111
+ "o1": 16,
112
+ "o2": 16,
113
+ "o3": 16,
114
+ "i1": 16,
115
+ "i2": 16,
116
+ "i3": 16,
117
+ "r0": 108,
118
+ "r1": 108,
119
+ "r2": 108,
120
+ "nnz": 838860
121
+ },
122
+ "model.layers.1.self_attn.o_proj": {
123
+ "o1": 16,
124
+ "o2": 16,
125
+ "o3": 16,
126
+ "i1": 16,
127
+ "i2": 16,
128
+ "i3": 16,
129
+ "r0": 108,
130
+ "r1": 108,
131
+ "r2": 108,
132
+ "nnz": 838860
133
+ },
134
+ "model.layers.1.mlp.gate_proj": {
135
+ "o1": 16,
136
+ "o2": 16,
137
+ "o3": 43,
138
+ "i1": 16,
139
+ "i2": 16,
140
+ "i3": 16,
141
+ "r0": 141,
142
+ "r1": 141,
143
+ "r2": 141,
144
+ "nnz": 2254438
145
+ },
146
+ "model.layers.1.mlp.up_proj": {
147
+ "o1": 16,
148
+ "o2": 16,
149
+ "o3": 43,
150
+ "i1": 16,
151
+ "i2": 16,
152
+ "i3": 16,
153
+ "r0": 141,
154
+ "r1": 141,
155
+ "r2": 141,
156
+ "nnz": 2254438
157
+ },
158
+ "model.layers.1.mlp.down_proj": {
159
+ "o1": 16,
160
+ "o2": 16,
161
+ "o3": 16,
162
+ "i1": 16,
163
+ "i2": 16,
164
+ "i3": 43,
165
+ "r0": 141,
166
+ "r1": 141,
167
+ "r2": 141,
168
+ "nnz": 2254438
169
+ },
170
+ "model.layers.2.self_attn.q_proj": {
171
+ "o1": 16,
172
+ "o2": 16,
173
+ "o3": 16,
174
+ "i1": 16,
175
+ "i2": 16,
176
+ "i3": 16,
177
+ "r0": 108,
178
+ "r1": 108,
179
+ "r2": 108,
180
+ "nnz": 838860
181
+ },
182
+ "model.layers.2.self_attn.k_proj": {
183
+ "o1": 16,
184
+ "o2": 16,
185
+ "o3": 16,
186
+ "i1": 16,
187
+ "i2": 16,
188
+ "i3": 16,
189
+ "r0": 108,
190
+ "r1": 108,
191
+ "r2": 108,
192
+ "nnz": 838860
193
+ },
194
+ "model.layers.2.self_attn.v_proj": {
195
+ "o1": 16,
196
+ "o2": 16,
197
+ "o3": 16,
198
+ "i1": 16,
199
+ "i2": 16,
200
+ "i3": 16,
201
+ "r0": 108,
202
+ "r1": 108,
203
+ "r2": 108,
204
+ "nnz": 838860
205
+ },
206
+ "model.layers.2.self_attn.o_proj": {
207
+ "o1": 16,
208
+ "o2": 16,
209
+ "o3": 16,
210
+ "i1": 16,
211
+ "i2": 16,
212
+ "i3": 16,
213
+ "r0": 108,
214
+ "r1": 108,
215
+ "r2": 108,
216
+ "nnz": 838860
217
+ },
218
+ "model.layers.2.mlp.gate_proj": {
219
+ "o1": 16,
220
+ "o2": 16,
221
+ "o3": 43,
222
+ "i1": 16,
223
+ "i2": 16,
224
+ "i3": 16,
225
+ "r0": 141,
226
+ "r1": 141,
227
+ "r2": 141,
228
+ "nnz": 2254438
229
+ },
230
+ "model.layers.2.mlp.up_proj": {
231
+ "o1": 16,
232
+ "o2": 16,
233
+ "o3": 43,
234
+ "i1": 16,
235
+ "i2": 16,
236
+ "i3": 16,
237
+ "r0": 141,
238
+ "r1": 141,
239
+ "r2": 141,
240
+ "nnz": 2254438
241
+ },
242
+ "model.layers.2.mlp.down_proj": {
243
+ "o1": 16,
244
+ "o2": 16,
245
+ "o3": 16,
246
+ "i1": 16,
247
+ "i2": 16,
248
+ "i3": 43,
249
+ "r0": 141,
250
+ "r1": 141,
251
+ "r2": 141,
252
+ "nnz": 2254438
253
+ },
254
+ "model.layers.3.self_attn.q_proj": {
255
+ "o1": 16,
256
+ "o2": 16,
257
+ "o3": 16,
258
+ "i1": 16,
259
+ "i2": 16,
260
+ "i3": 16,
261
+ "r0": 108,
262
+ "r1": 108,
263
+ "r2": 108,
264
+ "nnz": 838860
265
+ },
266
+ "model.layers.3.self_attn.k_proj": {
267
+ "o1": 16,
268
+ "o2": 16,
269
+ "o3": 16,
270
+ "i1": 16,
271
+ "i2": 16,
272
+ "i3": 16,
273
+ "r0": 108,
274
+ "r1": 108,
275
+ "r2": 108,
276
+ "nnz": 838860
277
+ },
278
+ "model.layers.3.self_attn.v_proj": {
279
+ "o1": 16,
280
+ "o2": 16,
281
+ "o3": 16,
282
+ "i1": 16,
283
+ "i2": 16,
284
+ "i3": 16,
285
+ "r0": 108,
286
+ "r1": 108,
287
+ "r2": 108,
288
+ "nnz": 838860
289
+ },
290
+ "model.layers.3.self_attn.o_proj": {
291
+ "o1": 16,
292
+ "o2": 16,
293
+ "o3": 16,
294
+ "i1": 16,
295
+ "i2": 16,
296
+ "i3": 16,
297
+ "r0": 108,
298
+ "r1": 108,
299
+ "r2": 108,
300
+ "nnz": 838860
301
+ },
302
+ "model.layers.3.mlp.gate_proj": {
303
+ "o1": 16,
304
+ "o2": 16,
305
+ "o3": 43,
306
+ "i1": 16,
307
+ "i2": 16,
308
+ "i3": 16,
309
+ "r0": 141,
310
+ "r1": 141,
311
+ "r2": 141,
312
+ "nnz": 2254438
313
+ },
314
+ "model.layers.3.mlp.up_proj": {
315
+ "o1": 16,
316
+ "o2": 16,
317
+ "o3": 43,
318
+ "i1": 16,
319
+ "i2": 16,
320
+ "i3": 16,
321
+ "r0": 141,
322
+ "r1": 141,
323
+ "r2": 141,
324
+ "nnz": 2254438
325
+ },
326
+ "model.layers.3.mlp.down_proj": {
327
+ "o1": 16,
328
+ "o2": 16,
329
+ "o3": 16,
330
+ "i1": 16,
331
+ "i2": 16,
332
+ "i3": 43,
333
+ "r0": 141,
334
+ "r1": 141,
335
+ "r2": 141,
336
+ "nnz": 2254438
337
+ },
338
+ "model.layers.4.self_attn.q_proj": {
339
+ "o1": 16,
340
+ "o2": 16,
341
+ "o3": 16,
342
+ "i1": 16,
343
+ "i2": 16,
344
+ "i3": 16,
345
+ "r0": 108,
346
+ "r1": 108,
347
+ "r2": 108,
348
+ "nnz": 838860
349
+ },
350
+ "model.layers.4.self_attn.k_proj": {
351
+ "o1": 16,
352
+ "o2": 16,
353
+ "o3": 16,
354
+ "i1": 16,
355
+ "i2": 16,
356
+ "i3": 16,
357
+ "r0": 108,
358
+ "r1": 108,
359
+ "r2": 108,
360
+ "nnz": 838860
361
+ },
362
+ "model.layers.4.self_attn.v_proj": {
363
+ "o1": 16,
364
+ "o2": 16,
365
+ "o3": 16,
366
+ "i1": 16,
367
+ "i2": 16,
368
+ "i3": 16,
369
+ "r0": 108,
370
+ "r1": 108,
371
+ "r2": 108,
372
+ "nnz": 838860
373
+ },
374
+ "model.layers.4.self_attn.o_proj": {
375
+ "o1": 16,
376
+ "o2": 16,
377
+ "o3": 16,
378
+ "i1": 16,
379
+ "i2": 16,
380
+ "i3": 16,
381
+ "r0": 108,
382
+ "r1": 108,
383
+ "r2": 108,
384
+ "nnz": 838860
385
+ },
386
+ "model.layers.4.mlp.gate_proj": {
387
+ "o1": 16,
388
+ "o2": 16,
389
+ "o3": 43,
390
+ "i1": 16,
391
+ "i2": 16,
392
+ "i3": 16,
393
+ "r0": 141,
394
+ "r1": 141,
395
+ "r2": 141,
396
+ "nnz": 2254438
397
+ },
398
+ "model.layers.4.mlp.up_proj": {
399
+ "o1": 16,
400
+ "o2": 16,
401
+ "o3": 43,
402
+ "i1": 16,
403
+ "i2": 16,
404
+ "i3": 16,
405
+ "r0": 141,
406
+ "r1": 141,
407
+ "r2": 141,
408
+ "nnz": 2254438
409
+ },
410
+ "model.layers.4.mlp.down_proj": {
411
+ "o1": 16,
412
+ "o2": 16,
413
+ "o3": 16,
414
+ "i1": 16,
415
+ "i2": 16,
416
+ "i3": 43,
417
+ "r0": 141,
418
+ "r1": 141,
419
+ "r2": 141,
420
+ "nnz": 2254438
421
+ },
422
+ "model.layers.5.self_attn.q_proj": {
423
+ "o1": 16,
424
+ "o2": 16,
425
+ "o3": 16,
426
+ "i1": 16,
427
+ "i2": 16,
428
+ "i3": 16,
429
+ "r0": 108,
430
+ "r1": 108,
431
+ "r2": 108,
432
+ "nnz": 838860
433
+ },
434
+ "model.layers.5.self_attn.k_proj": {
435
+ "o1": 16,
436
+ "o2": 16,
437
+ "o3": 16,
438
+ "i1": 16,
439
+ "i2": 16,
440
+ "i3": 16,
441
+ "r0": 108,
442
+ "r1": 108,
443
+ "r2": 108,
444
+ "nnz": 838860
445
+ },
446
+ "model.layers.5.self_attn.v_proj": {
447
+ "o1": 16,
448
+ "o2": 16,
449
+ "o3": 16,
450
+ "i1": 16,
451
+ "i2": 16,
452
+ "i3": 16,
453
+ "r0": 108,
454
+ "r1": 108,
455
+ "r2": 108,
456
+ "nnz": 838860
457
+ },
458
+ "model.layers.5.self_attn.o_proj": {
459
+ "o1": 16,
460
+ "o2": 16,
461
+ "o3": 16,
462
+ "i1": 16,
463
+ "i2": 16,
464
+ "i3": 16,
465
+ "r0": 108,
466
+ "r1": 108,
467
+ "r2": 108,
468
+ "nnz": 838860
469
+ },
470
+ "model.layers.5.mlp.gate_proj": {
471
+ "o1": 16,
472
+ "o2": 16,
473
+ "o3": 43,
474
+ "i1": 16,
475
+ "i2": 16,
476
+ "i3": 16,
477
+ "r0": 141,
478
+ "r1": 141,
479
+ "r2": 141,
480
+ "nnz": 2254438
481
+ },
482
+ "model.layers.5.mlp.up_proj": {
483
+ "o1": 16,
484
+ "o2": 16,
485
+ "o3": 43,
486
+ "i1": 16,
487
+ "i2": 16,
488
+ "i3": 16,
489
+ "r0": 141,
490
+ "r1": 141,
491
+ "r2": 141,
492
+ "nnz": 2254438
493
+ },
494
+ "model.layers.5.mlp.down_proj": {
495
+ "o1": 16,
496
+ "o2": 16,
497
+ "o3": 16,
498
+ "i1": 16,
499
+ "i2": 16,
500
+ "i3": 43,
501
+ "r0": 141,
502
+ "r1": 141,
503
+ "r2": 141,
504
+ "nnz": 2254438
505
+ },
506
+ "model.layers.6.self_attn.q_proj": {
507
+ "o1": 16,
508
+ "o2": 16,
509
+ "o3": 16,
510
+ "i1": 16,
511
+ "i2": 16,
512
+ "i3": 16,
513
+ "r0": 108,
514
+ "r1": 108,
515
+ "r2": 108,
516
+ "nnz": 838860
517
+ },
518
+ "model.layers.6.self_attn.k_proj": {
519
+ "o1": 16,
520
+ "o2": 16,
521
+ "o3": 16,
522
+ "i1": 16,
523
+ "i2": 16,
524
+ "i3": 16,
525
+ "r0": 108,
526
+ "r1": 108,
527
+ "r2": 108,
528
+ "nnz": 838860
529
+ },
530
+ "model.layers.6.self_attn.v_proj": {
531
+ "o1": 16,
532
+ "o2": 16,
533
+ "o3": 16,
534
+ "i1": 16,
535
+ "i2": 16,
536
+ "i3": 16,
537
+ "r0": 108,
538
+ "r1": 108,
539
+ "r2": 108,
540
+ "nnz": 838860
541
+ },
542
+ "model.layers.6.self_attn.o_proj": {
543
+ "o1": 16,
544
+ "o2": 16,
545
+ "o3": 16,
546
+ "i1": 16,
547
+ "i2": 16,
548
+ "i3": 16,
549
+ "r0": 108,
550
+ "r1": 108,
551
+ "r2": 108,
552
+ "nnz": 838860
553
+ },
554
+ "model.layers.6.mlp.gate_proj": {
555
+ "o1": 16,
556
+ "o2": 16,
557
+ "o3": 43,
558
+ "i1": 16,
559
+ "i2": 16,
560
+ "i3": 16,
561
+ "r0": 141,
562
+ "r1": 141,
563
+ "r2": 141,
564
+ "nnz": 2254438
565
+ },
566
+ "model.layers.6.mlp.up_proj": {
567
+ "o1": 16,
568
+ "o2": 16,
569
+ "o3": 43,
570
+ "i1": 16,
571
+ "i2": 16,
572
+ "i3": 16,
573
+ "r0": 141,
574
+ "r1": 141,
575
+ "r2": 141,
576
+ "nnz": 2254438
577
+ },
578
+ "model.layers.6.mlp.down_proj": {
579
+ "o1": 16,
580
+ "o2": 16,
581
+ "o3": 16,
582
+ "i1": 16,
583
+ "i2": 16,
584
+ "i3": 43,
585
+ "r0": 141,
586
+ "r1": 141,
587
+ "r2": 141,
588
+ "nnz": 2254438
589
+ },
590
+ "model.layers.7.self_attn.q_proj": {
591
+ "o1": 16,
592
+ "o2": 16,
593
+ "o3": 16,
594
+ "i1": 16,
595
+ "i2": 16,
596
+ "i3": 16,
597
+ "r0": 108,
598
+ "r1": 108,
599
+ "r2": 108,
600
+ "nnz": 838860
601
+ },
602
+ "model.layers.7.self_attn.k_proj": {
603
+ "o1": 16,
604
+ "o2": 16,
605
+ "o3": 16,
606
+ "i1": 16,
607
+ "i2": 16,
608
+ "i3": 16,
609
+ "r0": 108,
610
+ "r1": 108,
611
+ "r2": 108,
612
+ "nnz": 838860
613
+ },
614
+ "model.layers.7.self_attn.v_proj": {
615
+ "o1": 16,
616
+ "o2": 16,
617
+ "o3": 16,
618
+ "i1": 16,
619
+ "i2": 16,
620
+ "i3": 16,
621
+ "r0": 108,
622
+ "r1": 108,
623
+ "r2": 108,
624
+ "nnz": 838860
625
+ },
626
+ "model.layers.7.self_attn.o_proj": {
627
+ "o1": 16,
628
+ "o2": 16,
629
+ "o3": 16,
630
+ "i1": 16,
631
+ "i2": 16,
632
+ "i3": 16,
633
+ "r0": 108,
634
+ "r1": 108,
635
+ "r2": 108,
636
+ "nnz": 838860
637
+ },
638
+ "model.layers.7.mlp.gate_proj": {
639
+ "o1": 16,
640
+ "o2": 16,
641
+ "o3": 43,
642
+ "i1": 16,
643
+ "i2": 16,
644
+ "i3": 16,
645
+ "r0": 141,
646
+ "r1": 141,
647
+ "r2": 141,
648
+ "nnz": 2254438
649
+ },
650
+ "model.layers.7.mlp.up_proj": {
651
+ "o1": 16,
652
+ "o2": 16,
653
+ "o3": 43,
654
+ "i1": 16,
655
+ "i2": 16,
656
+ "i3": 16,
657
+ "r0": 141,
658
+ "r1": 141,
659
+ "r2": 141,
660
+ "nnz": 2254438
661
+ },
662
+ "model.layers.7.mlp.down_proj": {
663
+ "o1": 16,
664
+ "o2": 16,
665
+ "o3": 16,
666
+ "i1": 16,
667
+ "i2": 16,
668
+ "i3": 43,
669
+ "r0": 141,
670
+ "r1": 141,
671
+ "r2": 141,
672
+ "nnz": 2254438
673
+ },
674
+ "model.layers.8.self_attn.q_proj": {
675
+ "o1": 16,
676
+ "o2": 16,
677
+ "o3": 16,
678
+ "i1": 16,
679
+ "i2": 16,
680
+ "i3": 16,
681
+ "r0": 108,
682
+ "r1": 108,
683
+ "r2": 108,
684
+ "nnz": 838860
685
+ },
686
+ "model.layers.8.self_attn.k_proj": {
687
+ "o1": 16,
688
+ "o2": 16,
689
+ "o3": 16,
690
+ "i1": 16,
691
+ "i2": 16,
692
+ "i3": 16,
693
+ "r0": 108,
694
+ "r1": 108,
695
+ "r2": 108,
696
+ "nnz": 838860
697
+ },
698
+ "model.layers.8.self_attn.v_proj": {
699
+ "o1": 16,
700
+ "o2": 16,
701
+ "o3": 16,
702
+ "i1": 16,
703
+ "i2": 16,
704
+ "i3": 16,
705
+ "r0": 108,
706
+ "r1": 108,
707
+ "r2": 108,
708
+ "nnz": 838860
709
+ },
710
+ "model.layers.8.self_attn.o_proj": {
711
+ "o1": 16,
712
+ "o2": 16,
713
+ "o3": 16,
714
+ "i1": 16,
715
+ "i2": 16,
716
+ "i3": 16,
717
+ "r0": 108,
718
+ "r1": 108,
719
+ "r2": 108,
720
+ "nnz": 838860
721
+ },
722
+ "model.layers.8.mlp.gate_proj": {
723
+ "o1": 16,
724
+ "o2": 16,
725
+ "o3": 43,
726
+ "i1": 16,
727
+ "i2": 16,
728
+ "i3": 16,
729
+ "r0": 141,
730
+ "r1": 141,
731
+ "r2": 141,
732
+ "nnz": 2254438
733
+ },
734
+ "model.layers.8.mlp.up_proj": {
735
+ "o1": 16,
736
+ "o2": 16,
737
+ "o3": 43,
738
+ "i1": 16,
739
+ "i2": 16,
740
+ "i3": 16,
741
+ "r0": 141,
742
+ "r1": 141,
743
+ "r2": 141,
744
+ "nnz": 2254438
745
+ },
746
+ "model.layers.8.mlp.down_proj": {
747
+ "o1": 16,
748
+ "o2": 16,
749
+ "o3": 16,
750
+ "i1": 16,
751
+ "i2": 16,
752
+ "i3": 43,
753
+ "r0": 141,
754
+ "r1": 141,
755
+ "r2": 141,
756
+ "nnz": 2254438
757
+ },
758
+ "model.layers.9.self_attn.q_proj": {
759
+ "o1": 16,
760
+ "o2": 16,
761
+ "o3": 16,
762
+ "i1": 16,
763
+ "i2": 16,
764
+ "i3": 16,
765
+ "r0": 108,
766
+ "r1": 108,
767
+ "r2": 108,
768
+ "nnz": 838860
769
+ },
770
+ "model.layers.9.self_attn.k_proj": {
771
+ "o1": 16,
772
+ "o2": 16,
773
+ "o3": 16,
774
+ "i1": 16,
775
+ "i2": 16,
776
+ "i3": 16,
777
+ "r0": 108,
778
+ "r1": 108,
779
+ "r2": 108,
780
+ "nnz": 838860
781
+ },
782
+ "model.layers.9.self_attn.v_proj": {
783
+ "o1": 16,
784
+ "o2": 16,
785
+ "o3": 16,
786
+ "i1": 16,
787
+ "i2": 16,
788
+ "i3": 16,
789
+ "r0": 108,
790
+ "r1": 108,
791
+ "r2": 108,
792
+ "nnz": 838860
793
+ },
794
+ "model.layers.9.self_attn.o_proj": {
795
+ "o1": 16,
796
+ "o2": 16,
797
+ "o3": 16,
798
+ "i1": 16,
799
+ "i2": 16,
800
+ "i3": 16,
801
+ "r0": 108,
802
+ "r1": 108,
803
+ "r2": 108,
804
+ "nnz": 838860
805
+ },
806
+ "model.layers.9.mlp.gate_proj": {
807
+ "o1": 16,
808
+ "o2": 16,
809
+ "o3": 43,
810
+ "i1": 16,
811
+ "i2": 16,
812
+ "i3": 16,
813
+ "r0": 141,
814
+ "r1": 141,
815
+ "r2": 141,
816
+ "nnz": 2254438
817
+ },
818
+ "model.layers.9.mlp.up_proj": {
819
+ "o1": 16,
820
+ "o2": 16,
821
+ "o3": 43,
822
+ "i1": 16,
823
+ "i2": 16,
824
+ "i3": 16,
825
+ "r0": 141,
826
+ "r1": 141,
827
+ "r2": 141,
828
+ "nnz": 2254438
829
+ },
830
+ "model.layers.9.mlp.down_proj": {
831
+ "o1": 16,
832
+ "o2": 16,
833
+ "o3": 16,
834
+ "i1": 16,
835
+ "i2": 16,
836
+ "i3": 43,
837
+ "r0": 141,
838
+ "r1": 141,
839
+ "r2": 141,
840
+ "nnz": 2254438
841
+ },
842
+ "model.layers.10.self_attn.q_proj": {
843
+ "o1": 16,
844
+ "o2": 16,
845
+ "o3": 16,
846
+ "i1": 16,
847
+ "i2": 16,
848
+ "i3": 16,
849
+ "r0": 108,
850
+ "r1": 108,
851
+ "r2": 108,
852
+ "nnz": 838860
853
+ },
854
+ "model.layers.10.self_attn.k_proj": {
855
+ "o1": 16,
856
+ "o2": 16,
857
+ "o3": 16,
858
+ "i1": 16,
859
+ "i2": 16,
860
+ "i3": 16,
861
+ "r0": 108,
862
+ "r1": 108,
863
+ "r2": 108,
864
+ "nnz": 838860
865
+ },
866
+ "model.layers.10.self_attn.v_proj": {
867
+ "o1": 16,
868
+ "o2": 16,
869
+ "o3": 16,
870
+ "i1": 16,
871
+ "i2": 16,
872
+ "i3": 16,
873
+ "r0": 108,
874
+ "r1": 108,
875
+ "r2": 108,
876
+ "nnz": 838860
877
+ },
878
+ "model.layers.10.self_attn.o_proj": {
879
+ "o1": 16,
880
+ "o2": 16,
881
+ "o3": 16,
882
+ "i1": 16,
883
+ "i2": 16,
884
+ "i3": 16,
885
+ "r0": 108,
886
+ "r1": 108,
887
+ "r2": 108,
888
+ "nnz": 838860
889
+ },
890
+ "model.layers.10.mlp.gate_proj": {
891
+ "o1": 16,
892
+ "o2": 16,
893
+ "o3": 43,
894
+ "i1": 16,
895
+ "i2": 16,
896
+ "i3": 16,
897
+ "r0": 141,
898
+ "r1": 141,
899
+ "r2": 141,
900
+ "nnz": 2254438
901
+ },
902
+ "model.layers.10.mlp.up_proj": {
903
+ "o1": 16,
904
+ "o2": 16,
905
+ "o3": 43,
906
+ "i1": 16,
907
+ "i2": 16,
908
+ "i3": 16,
909
+ "r0": 141,
910
+ "r1": 141,
911
+ "r2": 141,
912
+ "nnz": 2254438
913
+ },
914
+ "model.layers.10.mlp.down_proj": {
915
+ "o1": 16,
916
+ "o2": 16,
917
+ "o3": 16,
918
+ "i1": 16,
919
+ "i2": 16,
920
+ "i3": 43,
921
+ "r0": 141,
922
+ "r1": 141,
923
+ "r2": 141,
924
+ "nnz": 2254438
925
+ },
926
+ "model.layers.11.self_attn.q_proj": {
927
+ "o1": 16,
928
+ "o2": 16,
929
+ "o3": 16,
930
+ "i1": 16,
931
+ "i2": 16,
932
+ "i3": 16,
933
+ "r0": 108,
934
+ "r1": 108,
935
+ "r2": 108,
936
+ "nnz": 838860
937
+ },
938
+ "model.layers.11.self_attn.k_proj": {
939
+ "o1": 16,
940
+ "o2": 16,
941
+ "o3": 16,
942
+ "i1": 16,
943
+ "i2": 16,
944
+ "i3": 16,
945
+ "r0": 108,
946
+ "r1": 108,
947
+ "r2": 108,
948
+ "nnz": 838860
949
+ },
950
+ "model.layers.11.self_attn.v_proj": {
951
+ "o1": 16,
952
+ "o2": 16,
953
+ "o3": 16,
954
+ "i1": 16,
955
+ "i2": 16,
956
+ "i3": 16,
957
+ "r0": 108,
958
+ "r1": 108,
959
+ "r2": 108,
960
+ "nnz": 838860
961
+ },
962
+ "model.layers.11.self_attn.o_proj": {
963
+ "o1": 16,
964
+ "o2": 16,
965
+ "o3": 16,
966
+ "i1": 16,
967
+ "i2": 16,
968
+ "i3": 16,
969
+ "r0": 108,
970
+ "r1": 108,
971
+ "r2": 108,
972
+ "nnz": 838860
973
+ },
974
+ "model.layers.11.mlp.gate_proj": {
975
+ "o1": 16,
976
+ "o2": 16,
977
+ "o3": 43,
978
+ "i1": 16,
979
+ "i2": 16,
980
+ "i3": 16,
981
+ "r0": 141,
982
+ "r1": 141,
983
+ "r2": 141,
984
+ "nnz": 2254438
985
+ },
986
+ "model.layers.11.mlp.up_proj": {
987
+ "o1": 16,
988
+ "o2": 16,
989
+ "o3": 43,
990
+ "i1": 16,
991
+ "i2": 16,
992
+ "i3": 16,
993
+ "r0": 141,
994
+ "r1": 141,
995
+ "r2": 141,
996
+ "nnz": 2254438
997
+ },
998
+ "model.layers.11.mlp.down_proj": {
999
+ "o1": 16,
1000
+ "o2": 16,
1001
+ "o3": 16,
1002
+ "i1": 16,
1003
+ "i2": 16,
1004
+ "i3": 43,
1005
+ "r0": 141,
1006
+ "r1": 141,
1007
+ "r2": 141,
1008
+ "nnz": 2254438
1009
+ },
1010
+ "model.layers.12.self_attn.q_proj": {
1011
+ "o1": 16,
1012
+ "o2": 16,
1013
+ "o3": 16,
1014
+ "i1": 16,
1015
+ "i2": 16,
1016
+ "i3": 16,
1017
+ "r0": 108,
1018
+ "r1": 108,
1019
+ "r2": 108,
1020
+ "nnz": 838860
1021
+ },
1022
+ "model.layers.12.self_attn.k_proj": {
1023
+ "o1": 16,
1024
+ "o2": 16,
1025
+ "o3": 16,
1026
+ "i1": 16,
1027
+ "i2": 16,
1028
+ "i3": 16,
1029
+ "r0": 108,
1030
+ "r1": 108,
1031
+ "r2": 108,
1032
+ "nnz": 838860
1033
+ },
1034
+ "model.layers.12.self_attn.v_proj": {
1035
+ "o1": 16,
1036
+ "o2": 16,
1037
+ "o3": 16,
1038
+ "i1": 16,
1039
+ "i2": 16,
1040
+ "i3": 16,
1041
+ "r0": 108,
1042
+ "r1": 108,
1043
+ "r2": 108,
1044
+ "nnz": 838860
1045
+ },
1046
+ "model.layers.12.self_attn.o_proj": {
1047
+ "o1": 16,
1048
+ "o2": 16,
1049
+ "o3": 16,
1050
+ "i1": 16,
1051
+ "i2": 16,
1052
+ "i3": 16,
1053
+ "r0": 108,
1054
+ "r1": 108,
1055
+ "r2": 108,
1056
+ "nnz": 838860
1057
+ },
1058
+ "model.layers.12.mlp.gate_proj": {
1059
+ "o1": 16,
1060
+ "o2": 16,
1061
+ "o3": 43,
1062
+ "i1": 16,
1063
+ "i2": 16,
1064
+ "i3": 16,
1065
+ "r0": 141,
1066
+ "r1": 141,
1067
+ "r2": 141,
1068
+ "nnz": 2254438
1069
+ },
1070
+ "model.layers.12.mlp.up_proj": {
1071
+ "o1": 16,
1072
+ "o2": 16,
1073
+ "o3": 43,
1074
+ "i1": 16,
1075
+ "i2": 16,
1076
+ "i3": 16,
1077
+ "r0": 141,
1078
+ "r1": 141,
1079
+ "r2": 141,
1080
+ "nnz": 2254438
1081
+ },
1082
+ "model.layers.12.mlp.down_proj": {
1083
+ "o1": 16,
1084
+ "o2": 16,
1085
+ "o3": 16,
1086
+ "i1": 16,
1087
+ "i2": 16,
1088
+ "i3": 43,
1089
+ "r0": 141,
1090
+ "r1": 141,
1091
+ "r2": 141,
1092
+ "nnz": 2254438
1093
+ },
1094
+ "model.layers.13.self_attn.q_proj": {
1095
+ "o1": 16,
1096
+ "o2": 16,
1097
+ "o3": 16,
1098
+ "i1": 16,
1099
+ "i2": 16,
1100
+ "i3": 16,
1101
+ "r0": 108,
1102
+ "r1": 108,
1103
+ "r2": 108,
1104
+ "nnz": 838860
1105
+ },
1106
+ "model.layers.13.self_attn.k_proj": {
1107
+ "o1": 16,
1108
+ "o2": 16,
1109
+ "o3": 16,
1110
+ "i1": 16,
1111
+ "i2": 16,
1112
+ "i3": 16,
1113
+ "r0": 108,
1114
+ "r1": 108,
1115
+ "r2": 108,
1116
+ "nnz": 838860
1117
+ },
1118
+ "model.layers.13.self_attn.v_proj": {
1119
+ "o1": 16,
1120
+ "o2": 16,
1121
+ "o3": 16,
1122
+ "i1": 16,
1123
+ "i2": 16,
1124
+ "i3": 16,
1125
+ "r0": 108,
1126
+ "r1": 108,
1127
+ "r2": 108,
1128
+ "nnz": 838860
1129
+ },
1130
+ "model.layers.13.self_attn.o_proj": {
1131
+ "o1": 16,
1132
+ "o2": 16,
1133
+ "o3": 16,
1134
+ "i1": 16,
1135
+ "i2": 16,
1136
+ "i3": 16,
1137
+ "r0": 108,
1138
+ "r1": 108,
1139
+ "r2": 108,
1140
+ "nnz": 838860
1141
+ },
1142
+ "model.layers.13.mlp.gate_proj": {
1143
+ "o1": 16,
1144
+ "o2": 16,
1145
+ "o3": 43,
1146
+ "i1": 16,
1147
+ "i2": 16,
1148
+ "i3": 16,
1149
+ "r0": 141,
1150
+ "r1": 141,
1151
+ "r2": 141,
1152
+ "nnz": 2254438
1153
+ },
1154
+ "model.layers.13.mlp.up_proj": {
1155
+ "o1": 16,
1156
+ "o2": 16,
1157
+ "o3": 43,
1158
+ "i1": 16,
1159
+ "i2": 16,
1160
+ "i3": 16,
1161
+ "r0": 141,
1162
+ "r1": 141,
1163
+ "r2": 141,
1164
+ "nnz": 2254438
1165
+ },
1166
+ "model.layers.13.mlp.down_proj": {
1167
+ "o1": 16,
1168
+ "o2": 16,
1169
+ "o3": 16,
1170
+ "i1": 16,
1171
+ "i2": 16,
1172
+ "i3": 43,
1173
+ "r0": 141,
1174
+ "r1": 141,
1175
+ "r2": 141,
1176
+ "nnz": 2254438
1177
+ },
1178
+ "model.layers.14.self_attn.q_proj": {
1179
+ "o1": 16,
1180
+ "o2": 16,
1181
+ "o3": 16,
1182
+ "i1": 16,
1183
+ "i2": 16,
1184
+ "i3": 16,
1185
+ "r0": 108,
1186
+ "r1": 108,
1187
+ "r2": 108,
1188
+ "nnz": 838860
1189
+ },
1190
+ "model.layers.14.self_attn.k_proj": {
1191
+ "o1": 16,
1192
+ "o2": 16,
1193
+ "o3": 16,
1194
+ "i1": 16,
1195
+ "i2": 16,
1196
+ "i3": 16,
1197
+ "r0": 108,
1198
+ "r1": 108,
1199
+ "r2": 108,
1200
+ "nnz": 838860
1201
+ },
1202
+ "model.layers.14.self_attn.v_proj": {
1203
+ "o1": 16,
1204
+ "o2": 16,
1205
+ "o3": 16,
1206
+ "i1": 16,
1207
+ "i2": 16,
1208
+ "i3": 16,
1209
+ "r0": 108,
1210
+ "r1": 108,
1211
+ "r2": 108,
1212
+ "nnz": 838860
1213
+ },
1214
+ "model.layers.14.self_attn.o_proj": {
1215
+ "o1": 16,
1216
+ "o2": 16,
1217
+ "o3": 16,
1218
+ "i1": 16,
1219
+ "i2": 16,
1220
+ "i3": 16,
1221
+ "r0": 108,
1222
+ "r1": 108,
1223
+ "r2": 108,
1224
+ "nnz": 838860
1225
+ },
1226
+ "model.layers.14.mlp.gate_proj": {
1227
+ "o1": 16,
1228
+ "o2": 16,
1229
+ "o3": 43,
1230
+ "i1": 16,
1231
+ "i2": 16,
1232
+ "i3": 16,
1233
+ "r0": 141,
1234
+ "r1": 141,
1235
+ "r2": 141,
1236
+ "nnz": 2254438
1237
+ },
1238
+ "model.layers.14.mlp.up_proj": {
1239
+ "o1": 16,
1240
+ "o2": 16,
1241
+ "o3": 43,
1242
+ "i1": 16,
1243
+ "i2": 16,
1244
+ "i3": 16,
1245
+ "r0": 141,
1246
+ "r1": 141,
1247
+ "r2": 141,
1248
+ "nnz": 2254438
1249
+ },
1250
+ "model.layers.14.mlp.down_proj": {
1251
+ "o1": 16,
1252
+ "o2": 16,
1253
+ "o3": 16,
1254
+ "i1": 16,
1255
+ "i2": 16,
1256
+ "i3": 43,
1257
+ "r0": 141,
1258
+ "r1": 141,
1259
+ "r2": 141,
1260
+ "nnz": 2254438
1261
+ },
1262
+ "model.layers.15.self_attn.q_proj": {
1263
+ "o1": 16,
1264
+ "o2": 16,
1265
+ "o3": 16,
1266
+ "i1": 16,
1267
+ "i2": 16,
1268
+ "i3": 16,
1269
+ "r0": 108,
1270
+ "r1": 108,
1271
+ "r2": 108,
1272
+ "nnz": 838860
1273
+ },
1274
+ "model.layers.15.self_attn.k_proj": {
1275
+ "o1": 16,
1276
+ "o2": 16,
1277
+ "o3": 16,
1278
+ "i1": 16,
1279
+ "i2": 16,
1280
+ "i3": 16,
1281
+ "r0": 108,
1282
+ "r1": 108,
1283
+ "r2": 108,
1284
+ "nnz": 838860
1285
+ },
1286
+ "model.layers.15.self_attn.v_proj": {
1287
+ "o1": 16,
1288
+ "o2": 16,
1289
+ "o3": 16,
1290
+ "i1": 16,
1291
+ "i2": 16,
1292
+ "i3": 16,
1293
+ "r0": 108,
1294
+ "r1": 108,
1295
+ "r2": 108,
1296
+ "nnz": 838860
1297
+ },
1298
+ "model.layers.15.self_attn.o_proj": {
1299
+ "o1": 16,
1300
+ "o2": 16,
1301
+ "o3": 16,
1302
+ "i1": 16,
1303
+ "i2": 16,
1304
+ "i3": 16,
1305
+ "r0": 108,
1306
+ "r1": 108,
1307
+ "r2": 108,
1308
+ "nnz": 838860
1309
+ },
1310
+ "model.layers.15.mlp.gate_proj": {
1311
+ "o1": 16,
1312
+ "o2": 16,
1313
+ "o3": 43,
1314
+ "i1": 16,
1315
+ "i2": 16,
1316
+ "i3": 16,
1317
+ "r0": 141,
1318
+ "r1": 141,
1319
+ "r2": 141,
1320
+ "nnz": 2254438
1321
+ },
1322
+ "model.layers.15.mlp.up_proj": {
1323
+ "o1": 16,
1324
+ "o2": 16,
1325
+ "o3": 43,
1326
+ "i1": 16,
1327
+ "i2": 16,
1328
+ "i3": 16,
1329
+ "r0": 141,
1330
+ "r1": 141,
1331
+ "r2": 141,
1332
+ "nnz": 2254438
1333
+ },
1334
+ "model.layers.15.mlp.down_proj": {
1335
+ "o1": 16,
1336
+ "o2": 16,
1337
+ "o3": 16,
1338
+ "i1": 16,
1339
+ "i2": 16,
1340
+ "i3": 43,
1341
+ "r0": 141,
1342
+ "r1": 141,
1343
+ "r2": 141,
1344
+ "nnz": 2254438
1345
+ },
1346
+ "model.layers.16.self_attn.q_proj": {
1347
+ "o1": 16,
1348
+ "o2": 16,
1349
+ "o3": 16,
1350
+ "i1": 16,
1351
+ "i2": 16,
1352
+ "i3": 16,
1353
+ "r0": 108,
1354
+ "r1": 108,
1355
+ "r2": 108,
1356
+ "nnz": 838860
1357
+ },
1358
+ "model.layers.16.self_attn.k_proj": {
1359
+ "o1": 16,
1360
+ "o2": 16,
1361
+ "o3": 16,
1362
+ "i1": 16,
1363
+ "i2": 16,
1364
+ "i3": 16,
1365
+ "r0": 108,
1366
+ "r1": 108,
1367
+ "r2": 108,
1368
+ "nnz": 838860
1369
+ },
1370
+ "model.layers.16.self_attn.v_proj": {
1371
+ "o1": 16,
1372
+ "o2": 16,
1373
+ "o3": 16,
1374
+ "i1": 16,
1375
+ "i2": 16,
1376
+ "i3": 16,
1377
+ "r0": 108,
1378
+ "r1": 108,
1379
+ "r2": 108,
1380
+ "nnz": 838860
1381
+ },
1382
+ "model.layers.16.self_attn.o_proj": {
1383
+ "o1": 16,
1384
+ "o2": 16,
1385
+ "o3": 16,
1386
+ "i1": 16,
1387
+ "i2": 16,
1388
+ "i3": 16,
1389
+ "r0": 108,
1390
+ "r1": 108,
1391
+ "r2": 108,
1392
+ "nnz": 838860
1393
+ },
1394
+ "model.layers.16.mlp.gate_proj": {
1395
+ "o1": 16,
1396
+ "o2": 16,
1397
+ "o3": 43,
1398
+ "i1": 16,
1399
+ "i2": 16,
1400
+ "i3": 16,
1401
+ "r0": 141,
1402
+ "r1": 141,
1403
+ "r2": 141,
1404
+ "nnz": 2254438
1405
+ },
1406
+ "model.layers.16.mlp.up_proj": {
1407
+ "o1": 16,
1408
+ "o2": 16,
1409
+ "o3": 43,
1410
+ "i1": 16,
1411
+ "i2": 16,
1412
+ "i3": 16,
1413
+ "r0": 141,
1414
+ "r1": 141,
1415
+ "r2": 141,
1416
+ "nnz": 2254438
1417
+ },
1418
+ "model.layers.16.mlp.down_proj": {
1419
+ "o1": 16,
1420
+ "o2": 16,
1421
+ "o3": 16,
1422
+ "i1": 16,
1423
+ "i2": 16,
1424
+ "i3": 43,
1425
+ "r0": 141,
1426
+ "r1": 141,
1427
+ "r2": 141,
1428
+ "nnz": 2254438
1429
+ },
1430
+ "model.layers.17.self_attn.q_proj": {
1431
+ "o1": 16,
1432
+ "o2": 16,
1433
+ "o3": 16,
1434
+ "i1": 16,
1435
+ "i2": 16,
1436
+ "i3": 16,
1437
+ "r0": 108,
1438
+ "r1": 108,
1439
+ "r2": 108,
1440
+ "nnz": 838860
1441
+ },
1442
+ "model.layers.17.self_attn.k_proj": {
1443
+ "o1": 16,
1444
+ "o2": 16,
1445
+ "o3": 16,
1446
+ "i1": 16,
1447
+ "i2": 16,
1448
+ "i3": 16,
1449
+ "r0": 108,
1450
+ "r1": 108,
1451
+ "r2": 108,
1452
+ "nnz": 838860
1453
+ },
1454
+ "model.layers.17.self_attn.v_proj": {
1455
+ "o1": 16,
1456
+ "o2": 16,
1457
+ "o3": 16,
1458
+ "i1": 16,
1459
+ "i2": 16,
1460
+ "i3": 16,
1461
+ "r0": 108,
1462
+ "r1": 108,
1463
+ "r2": 108,
1464
+ "nnz": 838860
1465
+ },
1466
+ "model.layers.17.self_attn.o_proj": {
1467
+ "o1": 16,
1468
+ "o2": 16,
1469
+ "o3": 16,
1470
+ "i1": 16,
1471
+ "i2": 16,
1472
+ "i3": 16,
1473
+ "r0": 108,
1474
+ "r1": 108,
1475
+ "r2": 108,
1476
+ "nnz": 838860
1477
+ },
1478
+ "model.layers.17.mlp.gate_proj": {
1479
+ "o1": 16,
1480
+ "o2": 16,
1481
+ "o3": 43,
1482
+ "i1": 16,
1483
+ "i2": 16,
1484
+ "i3": 16,
1485
+ "r0": 141,
1486
+ "r1": 141,
1487
+ "r2": 141,
1488
+ "nnz": 2254438
1489
+ },
1490
+ "model.layers.17.mlp.up_proj": {
1491
+ "o1": 16,
1492
+ "o2": 16,
1493
+ "o3": 43,
1494
+ "i1": 16,
1495
+ "i2": 16,
1496
+ "i3": 16,
1497
+ "r0": 141,
1498
+ "r1": 141,
1499
+ "r2": 141,
1500
+ "nnz": 2254438
1501
+ },
1502
+ "model.layers.17.mlp.down_proj": {
1503
+ "o1": 16,
1504
+ "o2": 16,
1505
+ "o3": 16,
1506
+ "i1": 16,
1507
+ "i2": 16,
1508
+ "i3": 43,
1509
+ "r0": 141,
1510
+ "r1": 141,
1511
+ "r2": 141,
1512
+ "nnz": 2254438
1513
+ },
1514
+ "model.layers.18.self_attn.q_proj": {
1515
+ "o1": 16,
1516
+ "o2": 16,
1517
+ "o3": 16,
1518
+ "i1": 16,
1519
+ "i2": 16,
1520
+ "i3": 16,
1521
+ "r0": 108,
1522
+ "r1": 108,
1523
+ "r2": 108,
1524
+ "nnz": 838860
1525
+ },
1526
+ "model.layers.18.self_attn.k_proj": {
1527
+ "o1": 16,
1528
+ "o2": 16,
1529
+ "o3": 16,
1530
+ "i1": 16,
1531
+ "i2": 16,
1532
+ "i3": 16,
1533
+ "r0": 108,
1534
+ "r1": 108,
1535
+ "r2": 108,
1536
+ "nnz": 838860
1537
+ },
1538
+ "model.layers.18.self_attn.v_proj": {
1539
+ "o1": 16,
1540
+ "o2": 16,
1541
+ "o3": 16,
1542
+ "i1": 16,
1543
+ "i2": 16,
1544
+ "i3": 16,
1545
+ "r0": 108,
1546
+ "r1": 108,
1547
+ "r2": 108,
1548
+ "nnz": 838860
1549
+ },
1550
+ "model.layers.18.self_attn.o_proj": {
1551
+ "o1": 16,
1552
+ "o2": 16,
1553
+ "o3": 16,
1554
+ "i1": 16,
1555
+ "i2": 16,
1556
+ "i3": 16,
1557
+ "r0": 108,
1558
+ "r1": 108,
1559
+ "r2": 108,
1560
+ "nnz": 838860
1561
+ },
1562
+ "model.layers.18.mlp.gate_proj": {
1563
+ "o1": 16,
1564
+ "o2": 16,
1565
+ "o3": 43,
1566
+ "i1": 16,
1567
+ "i2": 16,
1568
+ "i3": 16,
1569
+ "r0": 141,
1570
+ "r1": 141,
1571
+ "r2": 141,
1572
+ "nnz": 2254438
1573
+ },
1574
+ "model.layers.18.mlp.up_proj": {
1575
+ "o1": 16,
1576
+ "o2": 16,
1577
+ "o3": 43,
1578
+ "i1": 16,
1579
+ "i2": 16,
1580
+ "i3": 16,
1581
+ "r0": 141,
1582
+ "r1": 141,
1583
+ "r2": 141,
1584
+ "nnz": 2254438
1585
+ },
1586
+ "model.layers.18.mlp.down_proj": {
1587
+ "o1": 16,
1588
+ "o2": 16,
1589
+ "o3": 16,
1590
+ "i1": 16,
1591
+ "i2": 16,
1592
+ "i3": 43,
1593
+ "r0": 141,
1594
+ "r1": 141,
1595
+ "r2": 141,
1596
+ "nnz": 2254438
1597
+ },
1598
+ "model.layers.19.self_attn.q_proj": {
1599
+ "o1": 16,
1600
+ "o2": 16,
1601
+ "o3": 16,
1602
+ "i1": 16,
1603
+ "i2": 16,
1604
+ "i3": 16,
1605
+ "r0": 108,
1606
+ "r1": 108,
1607
+ "r2": 108,
1608
+ "nnz": 838860
1609
+ },
1610
+ "model.layers.19.self_attn.k_proj": {
1611
+ "o1": 16,
1612
+ "o2": 16,
1613
+ "o3": 16,
1614
+ "i1": 16,
1615
+ "i2": 16,
1616
+ "i3": 16,
1617
+ "r0": 108,
1618
+ "r1": 108,
1619
+ "r2": 108,
1620
+ "nnz": 838860
1621
+ },
1622
+ "model.layers.19.self_attn.v_proj": {
1623
+ "o1": 16,
1624
+ "o2": 16,
1625
+ "o3": 16,
1626
+ "i1": 16,
1627
+ "i2": 16,
1628
+ "i3": 16,
1629
+ "r0": 108,
1630
+ "r1": 108,
1631
+ "r2": 108,
1632
+ "nnz": 838860
1633
+ },
1634
+ "model.layers.19.self_attn.o_proj": {
1635
+ "o1": 16,
1636
+ "o2": 16,
1637
+ "o3": 16,
1638
+ "i1": 16,
1639
+ "i2": 16,
1640
+ "i3": 16,
1641
+ "r0": 108,
1642
+ "r1": 108,
1643
+ "r2": 108,
1644
+ "nnz": 838860
1645
+ },
1646
+ "model.layers.19.mlp.gate_proj": {
1647
+ "o1": 16,
1648
+ "o2": 16,
1649
+ "o3": 43,
1650
+ "i1": 16,
1651
+ "i2": 16,
1652
+ "i3": 16,
1653
+ "r0": 141,
1654
+ "r1": 141,
1655
+ "r2": 141,
1656
+ "nnz": 2254438
1657
+ },
1658
+ "model.layers.19.mlp.up_proj": {
1659
+ "o1": 16,
1660
+ "o2": 16,
1661
+ "o3": 43,
1662
+ "i1": 16,
1663
+ "i2": 16,
1664
+ "i3": 16,
1665
+ "r0": 141,
1666
+ "r1": 141,
1667
+ "r2": 141,
1668
+ "nnz": 2254438
1669
+ },
1670
+ "model.layers.19.mlp.down_proj": {
1671
+ "o1": 16,
1672
+ "o2": 16,
1673
+ "o3": 16,
1674
+ "i1": 16,
1675
+ "i2": 16,
1676
+ "i3": 43,
1677
+ "r0": 141,
1678
+ "r1": 141,
1679
+ "r2": 141,
1680
+ "nnz": 2254438
1681
+ },
1682
+ "model.layers.20.self_attn.q_proj": {
1683
+ "o1": 16,
1684
+ "o2": 16,
1685
+ "o3": 16,
1686
+ "i1": 16,
1687
+ "i2": 16,
1688
+ "i3": 16,
1689
+ "r0": 108,
1690
+ "r1": 108,
1691
+ "r2": 108,
1692
+ "nnz": 838860
1693
+ },
1694
+ "model.layers.20.self_attn.k_proj": {
1695
+ "o1": 16,
1696
+ "o2": 16,
1697
+ "o3": 16,
1698
+ "i1": 16,
1699
+ "i2": 16,
1700
+ "i3": 16,
1701
+ "r0": 108,
1702
+ "r1": 108,
1703
+ "r2": 108,
1704
+ "nnz": 838860
1705
+ },
1706
+ "model.layers.20.self_attn.v_proj": {
1707
+ "o1": 16,
1708
+ "o2": 16,
1709
+ "o3": 16,
1710
+ "i1": 16,
1711
+ "i2": 16,
1712
+ "i3": 16,
1713
+ "r0": 108,
1714
+ "r1": 108,
1715
+ "r2": 108,
1716
+ "nnz": 838860
1717
+ },
1718
+ "model.layers.20.self_attn.o_proj": {
1719
+ "o1": 16,
1720
+ "o2": 16,
1721
+ "o3": 16,
1722
+ "i1": 16,
1723
+ "i2": 16,
1724
+ "i3": 16,
1725
+ "r0": 108,
1726
+ "r1": 108,
1727
+ "r2": 108,
1728
+ "nnz": 838860
1729
+ },
1730
+ "model.layers.20.mlp.gate_proj": {
1731
+ "o1": 16,
1732
+ "o2": 16,
1733
+ "o3": 43,
1734
+ "i1": 16,
1735
+ "i2": 16,
1736
+ "i3": 16,
1737
+ "r0": 141,
1738
+ "r1": 141,
1739
+ "r2": 141,
1740
+ "nnz": 2254438
1741
+ },
1742
+ "model.layers.20.mlp.up_proj": {
1743
+ "o1": 16,
1744
+ "o2": 16,
1745
+ "o3": 43,
1746
+ "i1": 16,
1747
+ "i2": 16,
1748
+ "i3": 16,
1749
+ "r0": 141,
1750
+ "r1": 141,
1751
+ "r2": 141,
1752
+ "nnz": 2254438
1753
+ },
1754
+ "model.layers.20.mlp.down_proj": {
1755
+ "o1": 16,
1756
+ "o2": 16,
1757
+ "o3": 16,
1758
+ "i1": 16,
1759
+ "i2": 16,
1760
+ "i3": 43,
1761
+ "r0": 141,
1762
+ "r1": 141,
1763
+ "r2": 141,
1764
+ "nnz": 2254438
1765
+ },
1766
+ "model.layers.21.self_attn.q_proj": {
1767
+ "o1": 16,
1768
+ "o2": 16,
1769
+ "o3": 16,
1770
+ "i1": 16,
1771
+ "i2": 16,
1772
+ "i3": 16,
1773
+ "r0": 108,
1774
+ "r1": 108,
1775
+ "r2": 108,
1776
+ "nnz": 838860
1777
+ },
1778
+ "model.layers.21.self_attn.k_proj": {
1779
+ "o1": 16,
1780
+ "o2": 16,
1781
+ "o3": 16,
1782
+ "i1": 16,
1783
+ "i2": 16,
1784
+ "i3": 16,
1785
+ "r0": 108,
1786
+ "r1": 108,
1787
+ "r2": 108,
1788
+ "nnz": 838860
1789
+ },
1790
+ "model.layers.21.self_attn.v_proj": {
1791
+ "o1": 16,
1792
+ "o2": 16,
1793
+ "o3": 16,
1794
+ "i1": 16,
1795
+ "i2": 16,
1796
+ "i3": 16,
1797
+ "r0": 108,
1798
+ "r1": 108,
1799
+ "r2": 108,
1800
+ "nnz": 838860
1801
+ },
1802
+ "model.layers.21.self_attn.o_proj": {
1803
+ "o1": 16,
1804
+ "o2": 16,
1805
+ "o3": 16,
1806
+ "i1": 16,
1807
+ "i2": 16,
1808
+ "i3": 16,
1809
+ "r0": 108,
1810
+ "r1": 108,
1811
+ "r2": 108,
1812
+ "nnz": 838860
1813
+ },
1814
+ "model.layers.21.mlp.gate_proj": {
1815
+ "o1": 16,
1816
+ "o2": 16,
1817
+ "o3": 43,
1818
+ "i1": 16,
1819
+ "i2": 16,
1820
+ "i3": 16,
1821
+ "r0": 141,
1822
+ "r1": 141,
1823
+ "r2": 141,
1824
+ "nnz": 2254438
1825
+ },
1826
+ "model.layers.21.mlp.up_proj": {
1827
+ "o1": 16,
1828
+ "o2": 16,
1829
+ "o3": 43,
1830
+ "i1": 16,
1831
+ "i2": 16,
1832
+ "i3": 16,
1833
+ "r0": 141,
1834
+ "r1": 141,
1835
+ "r2": 141,
1836
+ "nnz": 2254438
1837
+ },
1838
+ "model.layers.21.mlp.down_proj": {
1839
+ "o1": 16,
1840
+ "o2": 16,
1841
+ "o3": 16,
1842
+ "i1": 16,
1843
+ "i2": 16,
1844
+ "i3": 43,
1845
+ "r0": 141,
1846
+ "r1": 141,
1847
+ "r2": 141,
1848
+ "nnz": 2254438
1849
+ },
1850
+ "model.layers.22.self_attn.q_proj": {
1851
+ "o1": 16,
1852
+ "o2": 16,
1853
+ "o3": 16,
1854
+ "i1": 16,
1855
+ "i2": 16,
1856
+ "i3": 16,
1857
+ "r0": 108,
1858
+ "r1": 108,
1859
+ "r2": 108,
1860
+ "nnz": 838860
1861
+ },
1862
+ "model.layers.22.self_attn.k_proj": {
1863
+ "o1": 16,
1864
+ "o2": 16,
1865
+ "o3": 16,
1866
+ "i1": 16,
1867
+ "i2": 16,
1868
+ "i3": 16,
1869
+ "r0": 108,
1870
+ "r1": 108,
1871
+ "r2": 108,
1872
+ "nnz": 838860
1873
+ },
1874
+ "model.layers.22.self_attn.v_proj": {
1875
+ "o1": 16,
1876
+ "o2": 16,
1877
+ "o3": 16,
1878
+ "i1": 16,
1879
+ "i2": 16,
1880
+ "i3": 16,
1881
+ "r0": 108,
1882
+ "r1": 108,
1883
+ "r2": 108,
1884
+ "nnz": 838860
1885
+ },
1886
+ "model.layers.22.self_attn.o_proj": {
1887
+ "o1": 16,
1888
+ "o2": 16,
1889
+ "o3": 16,
1890
+ "i1": 16,
1891
+ "i2": 16,
1892
+ "i3": 16,
1893
+ "r0": 108,
1894
+ "r1": 108,
1895
+ "r2": 108,
1896
+ "nnz": 838860
1897
+ },
1898
+ "model.layers.22.mlp.gate_proj": {
1899
+ "o1": 16,
1900
+ "o2": 16,
1901
+ "o3": 43,
1902
+ "i1": 16,
1903
+ "i2": 16,
1904
+ "i3": 16,
1905
+ "r0": 141,
1906
+ "r1": 141,
1907
+ "r2": 141,
1908
+ "nnz": 2254438
1909
+ },
1910
+ "model.layers.22.mlp.up_proj": {
1911
+ "o1": 16,
1912
+ "o2": 16,
1913
+ "o3": 43,
1914
+ "i1": 16,
1915
+ "i2": 16,
1916
+ "i3": 16,
1917
+ "r0": 141,
1918
+ "r1": 141,
1919
+ "r2": 141,
1920
+ "nnz": 2254438
1921
+ },
1922
+ "model.layers.22.mlp.down_proj": {
1923
+ "o1": 16,
1924
+ "o2": 16,
1925
+ "o3": 16,
1926
+ "i1": 16,
1927
+ "i2": 16,
1928
+ "i3": 43,
1929
+ "r0": 141,
1930
+ "r1": 141,
1931
+ "r2": 141,
1932
+ "nnz": 2254438
1933
+ },
1934
+ "model.layers.23.self_attn.q_proj": {
1935
+ "o1": 16,
1936
+ "o2": 16,
1937
+ "o3": 16,
1938
+ "i1": 16,
1939
+ "i2": 16,
1940
+ "i3": 16,
1941
+ "r0": 108,
1942
+ "r1": 108,
1943
+ "r2": 108,
1944
+ "nnz": 838860
1945
+ },
1946
+ "model.layers.23.self_attn.k_proj": {
1947
+ "o1": 16,
1948
+ "o2": 16,
1949
+ "o3": 16,
1950
+ "i1": 16,
1951
+ "i2": 16,
1952
+ "i3": 16,
1953
+ "r0": 108,
1954
+ "r1": 108,
1955
+ "r2": 108,
1956
+ "nnz": 838860
1957
+ },
1958
+ "model.layers.23.self_attn.v_proj": {
1959
+ "o1": 16,
1960
+ "o2": 16,
1961
+ "o3": 16,
1962
+ "i1": 16,
1963
+ "i2": 16,
1964
+ "i3": 16,
1965
+ "r0": 108,
1966
+ "r1": 108,
1967
+ "r2": 108,
1968
+ "nnz": 838860
1969
+ },
1970
+ "model.layers.23.self_attn.o_proj": {
1971
+ "o1": 16,
1972
+ "o2": 16,
1973
+ "o3": 16,
1974
+ "i1": 16,
1975
+ "i2": 16,
1976
+ "i3": 16,
1977
+ "r0": 108,
1978
+ "r1": 108,
1979
+ "r2": 108,
1980
+ "nnz": 838860
1981
+ },
1982
+ "model.layers.23.mlp.gate_proj": {
1983
+ "o1": 16,
1984
+ "o2": 16,
1985
+ "o3": 43,
1986
+ "i1": 16,
1987
+ "i2": 16,
1988
+ "i3": 16,
1989
+ "r0": 141,
1990
+ "r1": 141,
1991
+ "r2": 141,
1992
+ "nnz": 2254438
1993
+ },
1994
+ "model.layers.23.mlp.up_proj": {
1995
+ "o1": 16,
1996
+ "o2": 16,
1997
+ "o3": 43,
1998
+ "i1": 16,
1999
+ "i2": 16,
2000
+ "i3": 16,
2001
+ "r0": 141,
2002
+ "r1": 141,
2003
+ "r2": 141,
2004
+ "nnz": 2254438
2005
+ },
2006
+ "model.layers.23.mlp.down_proj": {
2007
+ "o1": 16,
2008
+ "o2": 16,
2009
+ "o3": 16,
2010
+ "i1": 16,
2011
+ "i2": 16,
2012
+ "i3": 43,
2013
+ "r0": 141,
2014
+ "r1": 141,
2015
+ "r2": 141,
2016
+ "nnz": 2254438
2017
+ },
2018
+ "model.layers.24.self_attn.q_proj": {
2019
+ "o1": 16,
2020
+ "o2": 16,
2021
+ "o3": 16,
2022
+ "i1": 16,
2023
+ "i2": 16,
2024
+ "i3": 16,
2025
+ "r0": 108,
2026
+ "r1": 108,
2027
+ "r2": 108,
2028
+ "nnz": 838860
2029
+ },
2030
+ "model.layers.24.self_attn.k_proj": {
2031
+ "o1": 16,
2032
+ "o2": 16,
2033
+ "o3": 16,
2034
+ "i1": 16,
2035
+ "i2": 16,
2036
+ "i3": 16,
2037
+ "r0": 108,
2038
+ "r1": 108,
2039
+ "r2": 108,
2040
+ "nnz": 838860
2041
+ },
2042
+ "model.layers.24.self_attn.v_proj": {
2043
+ "o1": 16,
2044
+ "o2": 16,
2045
+ "o3": 16,
2046
+ "i1": 16,
2047
+ "i2": 16,
2048
+ "i3": 16,
2049
+ "r0": 108,
2050
+ "r1": 108,
2051
+ "r2": 108,
2052
+ "nnz": 838860
2053
+ },
2054
+ "model.layers.24.self_attn.o_proj": {
2055
+ "o1": 16,
2056
+ "o2": 16,
2057
+ "o3": 16,
2058
+ "i1": 16,
2059
+ "i2": 16,
2060
+ "i3": 16,
2061
+ "r0": 108,
2062
+ "r1": 108,
2063
+ "r2": 108,
2064
+ "nnz": 838860
2065
+ },
2066
+ "model.layers.24.mlp.gate_proj": {
2067
+ "o1": 16,
2068
+ "o2": 16,
2069
+ "o3": 43,
2070
+ "i1": 16,
2071
+ "i2": 16,
2072
+ "i3": 16,
2073
+ "r0": 141,
2074
+ "r1": 141,
2075
+ "r2": 141,
2076
+ "nnz": 2254438
2077
+ },
2078
+ "model.layers.24.mlp.up_proj": {
2079
+ "o1": 16,
2080
+ "o2": 16,
2081
+ "o3": 43,
2082
+ "i1": 16,
2083
+ "i2": 16,
2084
+ "i3": 16,
2085
+ "r0": 141,
2086
+ "r1": 141,
2087
+ "r2": 141,
2088
+ "nnz": 2254438
2089
+ },
2090
+ "model.layers.24.mlp.down_proj": {
2091
+ "o1": 16,
2092
+ "o2": 16,
2093
+ "o3": 16,
2094
+ "i1": 16,
2095
+ "i2": 16,
2096
+ "i3": 43,
2097
+ "r0": 141,
2098
+ "r1": 141,
2099
+ "r2": 141,
2100
+ "nnz": 2254438
2101
+ },
2102
+ "model.layers.25.self_attn.q_proj": {
2103
+ "o1": 16,
2104
+ "o2": 16,
2105
+ "o3": 16,
2106
+ "i1": 16,
2107
+ "i2": 16,
2108
+ "i3": 16,
2109
+ "r0": 108,
2110
+ "r1": 108,
2111
+ "r2": 108,
2112
+ "nnz": 838860
2113
+ },
2114
+ "model.layers.25.self_attn.k_proj": {
2115
+ "o1": 16,
2116
+ "o2": 16,
2117
+ "o3": 16,
2118
+ "i1": 16,
2119
+ "i2": 16,
2120
+ "i3": 16,
2121
+ "r0": 108,
2122
+ "r1": 108,
2123
+ "r2": 108,
2124
+ "nnz": 838860
2125
+ },
2126
+ "model.layers.25.self_attn.v_proj": {
2127
+ "o1": 16,
2128
+ "o2": 16,
2129
+ "o3": 16,
2130
+ "i1": 16,
2131
+ "i2": 16,
2132
+ "i3": 16,
2133
+ "r0": 108,
2134
+ "r1": 108,
2135
+ "r2": 108,
2136
+ "nnz": 838860
2137
+ },
2138
+ "model.layers.25.self_attn.o_proj": {
2139
+ "o1": 16,
2140
+ "o2": 16,
2141
+ "o3": 16,
2142
+ "i1": 16,
2143
+ "i2": 16,
2144
+ "i3": 16,
2145
+ "r0": 108,
2146
+ "r1": 108,
2147
+ "r2": 108,
2148
+ "nnz": 838860
2149
+ },
2150
+ "model.layers.25.mlp.gate_proj": {
2151
+ "o1": 16,
2152
+ "o2": 16,
2153
+ "o3": 43,
2154
+ "i1": 16,
2155
+ "i2": 16,
2156
+ "i3": 16,
2157
+ "r0": 141,
2158
+ "r1": 141,
2159
+ "r2": 141,
2160
+ "nnz": 2254438
2161
+ },
2162
+ "model.layers.25.mlp.up_proj": {
2163
+ "o1": 16,
2164
+ "o2": 16,
2165
+ "o3": 43,
2166
+ "i1": 16,
2167
+ "i2": 16,
2168
+ "i3": 16,
2169
+ "r0": 141,
2170
+ "r1": 141,
2171
+ "r2": 141,
2172
+ "nnz": 2254438
2173
+ },
2174
+ "model.layers.25.mlp.down_proj": {
2175
+ "o1": 16,
2176
+ "o2": 16,
2177
+ "o3": 16,
2178
+ "i1": 16,
2179
+ "i2": 16,
2180
+ "i3": 43,
2181
+ "r0": 141,
2182
+ "r1": 141,
2183
+ "r2": 141,
2184
+ "nnz": 2254438
2185
+ },
2186
+ "model.layers.26.self_attn.q_proj": {
2187
+ "o1": 16,
2188
+ "o2": 16,
2189
+ "o3": 16,
2190
+ "i1": 16,
2191
+ "i2": 16,
2192
+ "i3": 16,
2193
+ "r0": 108,
2194
+ "r1": 108,
2195
+ "r2": 108,
2196
+ "nnz": 838860
2197
+ },
2198
+ "model.layers.26.self_attn.k_proj": {
2199
+ "o1": 16,
2200
+ "o2": 16,
2201
+ "o3": 16,
2202
+ "i1": 16,
2203
+ "i2": 16,
2204
+ "i3": 16,
2205
+ "r0": 108,
2206
+ "r1": 108,
2207
+ "r2": 108,
2208
+ "nnz": 838860
2209
+ },
2210
+ "model.layers.26.self_attn.v_proj": {
2211
+ "o1": 16,
2212
+ "o2": 16,
2213
+ "o3": 16,
2214
+ "i1": 16,
2215
+ "i2": 16,
2216
+ "i3": 16,
2217
+ "r0": 108,
2218
+ "r1": 108,
2219
+ "r2": 108,
2220
+ "nnz": 838860
2221
+ },
2222
+ "model.layers.26.self_attn.o_proj": {
2223
+ "o1": 16,
2224
+ "o2": 16,
2225
+ "o3": 16,
2226
+ "i1": 16,
2227
+ "i2": 16,
2228
+ "i3": 16,
2229
+ "r0": 108,
2230
+ "r1": 108,
2231
+ "r2": 108,
2232
+ "nnz": 838860
2233
+ },
2234
+ "model.layers.26.mlp.gate_proj": {
2235
+ "o1": 16,
2236
+ "o2": 16,
2237
+ "o3": 43,
2238
+ "i1": 16,
2239
+ "i2": 16,
2240
+ "i3": 16,
2241
+ "r0": 141,
2242
+ "r1": 141,
2243
+ "r2": 141,
2244
+ "nnz": 2254438
2245
+ },
2246
+ "model.layers.26.mlp.up_proj": {
2247
+ "o1": 16,
2248
+ "o2": 16,
2249
+ "o3": 43,
2250
+ "i1": 16,
2251
+ "i2": 16,
2252
+ "i3": 16,
2253
+ "r0": 141,
2254
+ "r1": 141,
2255
+ "r2": 141,
2256
+ "nnz": 2254438
2257
+ },
2258
+ "model.layers.26.mlp.down_proj": {
2259
+ "o1": 16,
2260
+ "o2": 16,
2261
+ "o3": 16,
2262
+ "i1": 16,
2263
+ "i2": 16,
2264
+ "i3": 43,
2265
+ "r0": 141,
2266
+ "r1": 141,
2267
+ "r2": 141,
2268
+ "nnz": 2254438
2269
+ },
2270
+ "model.layers.27.self_attn.q_proj": {
2271
+ "o1": 16,
2272
+ "o2": 16,
2273
+ "o3": 16,
2274
+ "i1": 16,
2275
+ "i2": 16,
2276
+ "i3": 16,
2277
+ "r0": 108,
2278
+ "r1": 108,
2279
+ "r2": 108,
2280
+ "nnz": 838860
2281
+ },
2282
+ "model.layers.27.self_attn.k_proj": {
2283
+ "o1": 16,
2284
+ "o2": 16,
2285
+ "o3": 16,
2286
+ "i1": 16,
2287
+ "i2": 16,
2288
+ "i3": 16,
2289
+ "r0": 108,
2290
+ "r1": 108,
2291
+ "r2": 108,
2292
+ "nnz": 838860
2293
+ },
2294
+ "model.layers.27.self_attn.v_proj": {
2295
+ "o1": 16,
2296
+ "o2": 16,
2297
+ "o3": 16,
2298
+ "i1": 16,
2299
+ "i2": 16,
2300
+ "i3": 16,
2301
+ "r0": 108,
2302
+ "r1": 108,
2303
+ "r2": 108,
2304
+ "nnz": 838860
2305
+ },
2306
+ "model.layers.27.self_attn.o_proj": {
2307
+ "o1": 16,
2308
+ "o2": 16,
2309
+ "o3": 16,
2310
+ "i1": 16,
2311
+ "i2": 16,
2312
+ "i3": 16,
2313
+ "r0": 108,
2314
+ "r1": 108,
2315
+ "r2": 108,
2316
+ "nnz": 838860
2317
+ },
2318
+ "model.layers.27.mlp.gate_proj": {
2319
+ "o1": 16,
2320
+ "o2": 16,
2321
+ "o3": 43,
2322
+ "i1": 16,
2323
+ "i2": 16,
2324
+ "i3": 16,
2325
+ "r0": 141,
2326
+ "r1": 141,
2327
+ "r2": 141,
2328
+ "nnz": 2254438
2329
+ },
2330
+ "model.layers.27.mlp.up_proj": {
2331
+ "o1": 16,
2332
+ "o2": 16,
2333
+ "o3": 43,
2334
+ "i1": 16,
2335
+ "i2": 16,
2336
+ "i3": 16,
2337
+ "r0": 141,
2338
+ "r1": 141,
2339
+ "r2": 141,
2340
+ "nnz": 2254438
2341
+ },
2342
+ "model.layers.27.mlp.down_proj": {
2343
+ "o1": 16,
2344
+ "o2": 16,
2345
+ "o3": 16,
2346
+ "i1": 16,
2347
+ "i2": 16,
2348
+ "i3": 43,
2349
+ "r0": 141,
2350
+ "r1": 141,
2351
+ "r2": 141,
2352
+ "nnz": 2254438
2353
+ },
2354
+ "model.layers.28.self_attn.q_proj": {
2355
+ "o1": 16,
2356
+ "o2": 16,
2357
+ "o3": 16,
2358
+ "i1": 16,
2359
+ "i2": 16,
2360
+ "i3": 16,
2361
+ "r0": 108,
2362
+ "r1": 108,
2363
+ "r2": 108,
2364
+ "nnz": 838860
2365
+ },
2366
+ "model.layers.28.self_attn.k_proj": {
2367
+ "o1": 16,
2368
+ "o2": 16,
2369
+ "o3": 16,
2370
+ "i1": 16,
2371
+ "i2": 16,
2372
+ "i3": 16,
2373
+ "r0": 108,
2374
+ "r1": 108,
2375
+ "r2": 108,
2376
+ "nnz": 838860
2377
+ },
2378
+ "model.layers.28.self_attn.v_proj": {
2379
+ "o1": 16,
2380
+ "o2": 16,
2381
+ "o3": 16,
2382
+ "i1": 16,
2383
+ "i2": 16,
2384
+ "i3": 16,
2385
+ "r0": 108,
2386
+ "r1": 108,
2387
+ "r2": 108,
2388
+ "nnz": 838860
2389
+ },
2390
+ "model.layers.28.self_attn.o_proj": {
2391
+ "o1": 16,
2392
+ "o2": 16,
2393
+ "o3": 16,
2394
+ "i1": 16,
2395
+ "i2": 16,
2396
+ "i3": 16,
2397
+ "r0": 108,
2398
+ "r1": 108,
2399
+ "r2": 108,
2400
+ "nnz": 838860
2401
+ },
2402
+ "model.layers.28.mlp.gate_proj": {
2403
+ "o1": 16,
2404
+ "o2": 16,
2405
+ "o3": 43,
2406
+ "i1": 16,
2407
+ "i2": 16,
2408
+ "i3": 16,
2409
+ "r0": 141,
2410
+ "r1": 141,
2411
+ "r2": 141,
2412
+ "nnz": 2254438
2413
+ },
2414
+ "model.layers.28.mlp.up_proj": {
2415
+ "o1": 16,
2416
+ "o2": 16,
2417
+ "o3": 43,
2418
+ "i1": 16,
2419
+ "i2": 16,
2420
+ "i3": 16,
2421
+ "r0": 141,
2422
+ "r1": 141,
2423
+ "r2": 141,
2424
+ "nnz": 2254438
2425
+ },
2426
+ "model.layers.28.mlp.down_proj": {
2427
+ "o1": 16,
2428
+ "o2": 16,
2429
+ "o3": 16,
2430
+ "i1": 16,
2431
+ "i2": 16,
2432
+ "i3": 43,
2433
+ "r0": 141,
2434
+ "r1": 141,
2435
+ "r2": 141,
2436
+ "nnz": 2254438
2437
+ },
2438
+ "model.layers.29.self_attn.q_proj": {
2439
+ "o1": 16,
2440
+ "o2": 16,
2441
+ "o3": 16,
2442
+ "i1": 16,
2443
+ "i2": 16,
2444
+ "i3": 16,
2445
+ "r0": 108,
2446
+ "r1": 108,
2447
+ "r2": 108,
2448
+ "nnz": 838860
2449
+ },
2450
+ "model.layers.29.self_attn.k_proj": {
2451
+ "o1": 16,
2452
+ "o2": 16,
2453
+ "o3": 16,
2454
+ "i1": 16,
2455
+ "i2": 16,
2456
+ "i3": 16,
2457
+ "r0": 108,
2458
+ "r1": 108,
2459
+ "r2": 108,
2460
+ "nnz": 838860
2461
+ },
2462
+ "model.layers.29.self_attn.v_proj": {
2463
+ "o1": 16,
2464
+ "o2": 16,
2465
+ "o3": 16,
2466
+ "i1": 16,
2467
+ "i2": 16,
2468
+ "i3": 16,
2469
+ "r0": 108,
2470
+ "r1": 108,
2471
+ "r2": 108,
2472
+ "nnz": 838860
2473
+ },
2474
+ "model.layers.29.self_attn.o_proj": {
2475
+ "o1": 16,
2476
+ "o2": 16,
2477
+ "o3": 16,
2478
+ "i1": 16,
2479
+ "i2": 16,
2480
+ "i3": 16,
2481
+ "r0": 108,
2482
+ "r1": 108,
2483
+ "r2": 108,
2484
+ "nnz": 838860
2485
+ },
2486
+ "model.layers.29.mlp.gate_proj": {
2487
+ "o1": 16,
2488
+ "o2": 16,
2489
+ "o3": 43,
2490
+ "i1": 16,
2491
+ "i2": 16,
2492
+ "i3": 16,
2493
+ "r0": 141,
2494
+ "r1": 141,
2495
+ "r2": 141,
2496
+ "nnz": 2254438
2497
+ },
2498
+ "model.layers.29.mlp.up_proj": {
2499
+ "o1": 16,
2500
+ "o2": 16,
2501
+ "o3": 43,
2502
+ "i1": 16,
2503
+ "i2": 16,
2504
+ "i3": 16,
2505
+ "r0": 141,
2506
+ "r1": 141,
2507
+ "r2": 141,
2508
+ "nnz": 2254438
2509
+ },
2510
+ "model.layers.29.mlp.down_proj": {
2511
+ "o1": 16,
2512
+ "o2": 16,
2513
+ "o3": 16,
2514
+ "i1": 16,
2515
+ "i2": 16,
2516
+ "i3": 43,
2517
+ "r0": 141,
2518
+ "r1": 141,
2519
+ "r2": 141,
2520
+ "nnz": 2254438
2521
+ },
2522
+ "model.layers.30.self_attn.q_proj": {
2523
+ "o1": 16,
2524
+ "o2": 16,
2525
+ "o3": 16,
2526
+ "i1": 16,
2527
+ "i2": 16,
2528
+ "i3": 16,
2529
+ "r0": 108,
2530
+ "r1": 108,
2531
+ "r2": 108,
2532
+ "nnz": 838860
2533
+ },
2534
+ "model.layers.30.self_attn.k_proj": {
2535
+ "o1": 16,
2536
+ "o2": 16,
2537
+ "o3": 16,
2538
+ "i1": 16,
2539
+ "i2": 16,
2540
+ "i3": 16,
2541
+ "r0": 108,
2542
+ "r1": 108,
2543
+ "r2": 108,
2544
+ "nnz": 838860
2545
+ },
2546
+ "model.layers.30.self_attn.v_proj": {
2547
+ "o1": 16,
2548
+ "o2": 16,
2549
+ "o3": 16,
2550
+ "i1": 16,
2551
+ "i2": 16,
2552
+ "i3": 16,
2553
+ "r0": 108,
2554
+ "r1": 108,
2555
+ "r2": 108,
2556
+ "nnz": 838860
2557
+ },
2558
+ "model.layers.30.self_attn.o_proj": {
2559
+ "o1": 16,
2560
+ "o2": 16,
2561
+ "o3": 16,
2562
+ "i1": 16,
2563
+ "i2": 16,
2564
+ "i3": 16,
2565
+ "r0": 108,
2566
+ "r1": 108,
2567
+ "r2": 108,
2568
+ "nnz": 838860
2569
+ },
2570
+ "model.layers.30.mlp.gate_proj": {
2571
+ "o1": 16,
2572
+ "o2": 16,
2573
+ "o3": 43,
2574
+ "i1": 16,
2575
+ "i2": 16,
2576
+ "i3": 16,
2577
+ "r0": 141,
2578
+ "r1": 141,
2579
+ "r2": 141,
2580
+ "nnz": 2254438
2581
+ },
2582
+ "model.layers.30.mlp.up_proj": {
2583
+ "o1": 16,
2584
+ "o2": 16,
2585
+ "o3": 43,
2586
+ "i1": 16,
2587
+ "i2": 16,
2588
+ "i3": 16,
2589
+ "r0": 141,
2590
+ "r1": 141,
2591
+ "r2": 141,
2592
+ "nnz": 2254438
2593
+ },
2594
+ "model.layers.30.mlp.down_proj": {
2595
+ "o1": 16,
2596
+ "o2": 16,
2597
+ "o3": 16,
2598
+ "i1": 16,
2599
+ "i2": 16,
2600
+ "i3": 43,
2601
+ "r0": 141,
2602
+ "r1": 141,
2603
+ "r2": 141,
2604
+ "nnz": 2254438
2605
+ },
2606
+ "model.layers.31.self_attn.q_proj": {
2607
+ "o1": 16,
2608
+ "o2": 16,
2609
+ "o3": 16,
2610
+ "i1": 16,
2611
+ "i2": 16,
2612
+ "i3": 16,
2613
+ "r0": 108,
2614
+ "r1": 108,
2615
+ "r2": 108,
2616
+ "nnz": 838860
2617
+ },
2618
+ "model.layers.31.self_attn.k_proj": {
2619
+ "o1": 16,
2620
+ "o2": 16,
2621
+ "o3": 16,
2622
+ "i1": 16,
2623
+ "i2": 16,
2624
+ "i3": 16,
2625
+ "r0": 108,
2626
+ "r1": 108,
2627
+ "r2": 108,
2628
+ "nnz": 838860
2629
+ },
2630
+ "model.layers.31.self_attn.v_proj": {
2631
+ "o1": 16,
2632
+ "o2": 16,
2633
+ "o3": 16,
2634
+ "i1": 16,
2635
+ "i2": 16,
2636
+ "i3": 16,
2637
+ "r0": 108,
2638
+ "r1": 108,
2639
+ "r2": 108,
2640
+ "nnz": 838860
2641
+ },
2642
+ "model.layers.31.self_attn.o_proj": {
2643
+ "o1": 16,
2644
+ "o2": 16,
2645
+ "o3": 16,
2646
+ "i1": 16,
2647
+ "i2": 16,
2648
+ "i3": 16,
2649
+ "r0": 108,
2650
+ "r1": 108,
2651
+ "r2": 108,
2652
+ "nnz": 838860
2653
+ },
2654
+ "model.layers.31.mlp.gate_proj": {
2655
+ "o1": 16,
2656
+ "o2": 16,
2657
+ "o3": 43,
2658
+ "i1": 16,
2659
+ "i2": 16,
2660
+ "i3": 16,
2661
+ "r0": 141,
2662
+ "r1": 141,
2663
+ "r2": 141,
2664
+ "nnz": 2254438
2665
+ },
2666
+ "model.layers.31.mlp.up_proj": {
2667
+ "o1": 16,
2668
+ "o2": 16,
2669
+ "o3": 43,
2670
+ "i1": 16,
2671
+ "i2": 16,
2672
+ "i3": 16,
2673
+ "r0": 141,
2674
+ "r1": 141,
2675
+ "r2": 141,
2676
+ "nnz": 2254438
2677
+ },
2678
+ "model.layers.31.mlp.down_proj": {
2679
+ "o1": 16,
2680
+ "o2": 16,
2681
+ "o3": 16,
2682
+ "i1": 16,
2683
+ "i2": 16,
2684
+ "i3": 43,
2685
+ "r0": 141,
2686
+ "r1": 141,
2687
+ "r2": 141,
2688
+ "nnz": 2254438
2689
+ }
2690
+ }
tr3/heal/llama2-7b/state_dict_fp16.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ed564af12d5e507abb68b7b5df13ef49b30fe23e11dd23b709b2baf488072e8
3
+ size 10637037868
tr3/heal/llama2-7b/tensor_formats.py ADDED
@@ -0,0 +1,761 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ """General N-core tensor formats for a linear layer: tensor train (MPO) and tensor ring.
4
+
5
+ WHY THIS EXISTS. The 2-core and 3-core results say the tensorisation step, not the healing
6
+ step, is where the leverage is: at equal parameters the 3-core beat the 2-core AFTER healing
7
+ at both budgets tried (4.72B: 38.94 vs ~36.5 full MMLU at 60M tokens; 5.74B: 44.91 vs 41.54
8
+ probe), and it got there on roughly a quarter of the tokens. That invites two orthogonal
9
+ questions this module exists to answer: how many cores, and which topology.
10
+
11
+ TENSOR TRAIN vs TENSOR RING. A TT/MPO pins the two boundary bonds to 1 -- the chain has open
12
+ ends. A tensor ring closes the chain: core k has shape (r_{k-1}, d_k, r_k) with r_N == r_0,
13
+ and the weight is the TRACE of the cyclic product. TT is exactly the TR special case r_0 = 1,
14
+ so at equal ranks TR is strictly more expressive. It is also strictly harder to fit: TT-SVD
15
+ is a sequence of Eckart-Young-optimal truncations, while a ring has no such closed form, so
16
+ TR is fitted here by TT initialisation followed by alternating least squares. That asymmetry
17
+ matters when reading results -- a TR loss could mean "the format is worse" OR "the fit did
18
+ not converge", so `fit_tr` reports its per-sweep error curve and refuses to return a fit
19
+ worse than its own TT initialisation.
20
+
21
+ INDEX CONVENTION (shared with mpo2.py / mpo3.py). Output mode k travels with input mode k:
22
+
23
+ R(W)[d_1, ..., d_N] = W[(o_1..o_N), (i_1..i_N)], d_k = (o_k, i_k) flattened
24
+
25
+ Every mode must be > 1. A mode of 1 collapses a site and silently reduces the core count,
26
+ which would make an "N-core" result actually be an (N-1)-core one.
27
+
28
+ WHITENING is diagonal and factorised across the N input modes, as in mpo3.py: the whitening
29
+ is then a mode-local rescaling that survives the fit exactly and un-whitens by division.
30
+ """
31
+
32
+ import torch
33
+
34
+
35
+ # --------------------------------------------------------------------------- rearrangement
36
+ def rearrange_n(W: torch.Tensor, osplit, isplit) -> torch.Tensor:
37
+ """W[(o_1..o_N),(i_1..i_N)] -> R[d_1,...,d_N] with d_k = o_k*i_k."""
38
+ n = len(osplit)
39
+ if len(isplit) != n:
40
+ raise ValueError("output and input must be split into the same number of modes")
41
+ perm = [j for k in range(n) for j in (k, n + k)]
42
+ return (W.reshape(*osplit, *isplit).permute(*perm)
43
+ .reshape(*[o * i for o, i in zip(osplit, isplit)]))
44
+
45
+
46
+ def inv_rearrange_n(R: torch.Tensor, osplit, isplit) -> torch.Tensor:
47
+ """Inverse of `rearrange_n`."""
48
+ n = len(osplit)
49
+ inter = [x for k in range(n) for x in (osplit[k], isplit[k])]
50
+ perm = list(range(0, 2 * n, 2)) + list(range(1, 2 * n, 2))
51
+ o = 1
52
+ i = 1
53
+ for k in range(n):
54
+ o *= osplit[k]
55
+ i *= isplit[k]
56
+ return R.reshape(*inter).permute(*perm).reshape(o, i)
57
+
58
+
59
+ def _apply_scales(R: torch.Tensor, osplit, isplit, scales, invert: bool):
60
+ """Multiply (or divide) R by sqrt(d_k[i_k]) along each input mode, in place of a dense L."""
61
+ n = len(osplit)
62
+ shape = [x for k in range(n) for x in (osplit[k], isplit[k])]
63
+ T = R.reshape(*shape)
64
+ for k in range(n):
65
+ s = scales[k].clamp_min(1e-12).sqrt()
66
+ view = [1] * (2 * n)
67
+ view[2 * k + 1] = isplit[k]
68
+ T = T / s.view(*view) if invert else T * s.view(*view)
69
+ return T.reshape(R.shape)
70
+
71
+
72
+ # --------------------------------------------------------------------------- contraction
73
+ def contract_tt(cores) -> torch.Tensor:
74
+ """Contract TT cores [(1,d1,r1), (r1,d2,r2), ..., (r_{N-1},dN,1)] -> R[d_1,...,d_N]."""
75
+ out = cores[0]
76
+ for g in cores[1:]:
77
+ a, b = out.shape[-1], g.shape[0]
78
+ if a != b:
79
+ raise ValueError(f"TT bond mismatch {a} vs {b}")
80
+ out = torch.tensordot(out, g, dims=([out.dim() - 1], [0]))
81
+ if out.shape[0] != 1 or out.shape[-1] != 1:
82
+ raise ValueError("TT boundary bonds must be 1")
83
+ return out.reshape(*out.shape[1:-1])
84
+
85
+
86
+ def contract_tr(cores, chunk: int = 0) -> torch.Tensor:
87
+ """Contract TR cores [(r0,d1,r1), ..., (r_{N-1},dN,r0)] -> R[d_1,...,d_N].
88
+
89
+ The obvious route -- chain every tensordot, then take the diagonal over the two ring
90
+ indices -- materialises (r_0, d_1..d_N, r_0), i.e. r_0^2 times the size of the ANSWER.
91
+ On one LLaMA attention layer at ring rank 118 that is 934 GB, so it does not merely run
92
+ slowly, it cannot run at all. Folding the last contraction and the trace into a single
93
+ einsum keeps the peak at r_0 * prod(d_1..d_{N-1}) * r_{N-1}, and chunking the first mode
94
+ bounds it further for the wide MLP layers.
95
+ """
96
+ n = len(cores)
97
+ if cores[0].shape[0] != cores[-1].shape[-1]:
98
+ raise ValueError(f"ring does not close: {cores[0].shape[0]} vs {cores[-1].shape[-1]}")
99
+ d0 = cores[0].shape[1]
100
+ if chunk and d0 > chunk:
101
+ parts = []
102
+ for lo in range(0, d0, chunk):
103
+ sub = [cores[0][:, lo:min(lo + chunk, d0), :]] + list(cores[1:])
104
+ parts.append(contract_tr(sub, chunk=0))
105
+ return torch.cat(parts, dim=0)
106
+ out = cores[0]
107
+ for g in cores[1:-1]:
108
+ out = torch.tensordot(out, g, dims=([out.dim() - 1], [0]))
109
+ return torch.einsum("i...k,kdi->...d", out, cores[-1])
110
+
111
+
112
+ # --------------------------------------------------------------------------- fitting
113
+ def fit_tt(R: torch.Tensor, ranks):
114
+ """TT-SVD with the given internal ranks. Singular values split symmetrically at each bond,
115
+ matching fit_mpo2/fit_mpo3's gauge so cores stay on comparable scales (fp16-safe and
116
+ kinder to a blockwise quantizer)."""
117
+ dims = list(R.shape)
118
+ n = len(dims)
119
+ if len(ranks) != n - 1:
120
+ raise ValueError(f"{n} sites need {n-1} internal ranks, got {len(ranks)}")
121
+ cores, rest, rprev = [], R.reshape(dims[0], -1), 1
122
+ for k in range(n - 1):
123
+ M = rest.reshape(rprev * dims[k], -1)
124
+ U, S, Vh = torch.linalg.svd(M, full_matrices=False)
125
+ r = min(int(ranks[k]), S.shape[0])
126
+ q = S[:r].clamp_min(0).sqrt()
127
+ cores.append((U[:, :r] * q).reshape(rprev, dims[k], r))
128
+ rest = q[:, None] * Vh[:r]
129
+ rprev = r
130
+ cores.append(rest.reshape(rprev, dims[-1], 1))
131
+ return cores
132
+
133
+
134
+ def tt_to_tr(cores):
135
+ """Reinterpret TT cores as TR cores with r_0 = 1 (an exact, lossless re-labelling)."""
136
+ return [c.clone() for c in cores]
137
+
138
+
139
+ def _subchain(cores, k):
140
+ """Contract every core except k, in cyclic order, -> E[r_k, D, r_{k-1}] with D = prod_{j!=k} d_j."""
141
+ n = len(cores)
142
+ order = [(k + 1 + t) % n for t in range(n - 1)]
143
+ out = cores[order[0]]
144
+ for j in order[1:]:
145
+ out = torch.tensordot(out, cores[j], dims=([out.dim() - 1], [0]))
146
+ return out
147
+
148
+
149
+ def _subchain_chunk(cores, k, lo, hi):
150
+ """`_subchain` with the FIRST following mode restricted to [lo, hi). The restriction rides
151
+ along the contraction untouched, so concatenating the chunks reproduces `_subchain`."""
152
+ n = len(cores)
153
+ order = [(k + 1 + t) % n for t in range(n - 1)]
154
+ out = cores[order[0]][:, lo:hi, :]
155
+ for j in order[1:]:
156
+ out = torch.tensordot(out, cores[j], dims=([out.dim() - 1], [0]))
157
+ return out
158
+
159
+
160
+ def rank_of(cores, k):
161
+ """r_{k-1} * r_k for core k -- the width of that core's least-squares system."""
162
+ n = len(cores)
163
+ return cores[k].shape[0] * cores[k].shape[2]
164
+
165
+
166
+ def _solve_maybe_cpu(AtA, AtW):
167
+ """Solve AtA X = AtW, falling back to the CPU when the GPU cannot hold the factorisation.
168
+
169
+ The normal-equation matrix is (r_{k-1} r_k) square, i.e. it grows as r^4. On down_proj at
170
+ ring rank 219 that is 47961^2 = 9.2 GB, and the factorisation needs a second copy -- no
171
+ amount of chunking the data helps, because this matrix does not depend on the data size.
172
+ Cholesky is tried first (the Gram is symmetric positive definite after the ridge) and
173
+ needs only one triangular factor; if even that does not fit, the solve moves to the host.
174
+ Slow, but a bounded slowdown beats an unbounded failure on the layers that matter most.
175
+ """
176
+ try:
177
+ L = torch.linalg.cholesky(AtA)
178
+ return torch.cholesky_solve(AtW, L)
179
+ except torch.OutOfMemoryError:
180
+ torch.cuda.empty_cache()
181
+ except Exception:
182
+ pass
183
+ try:
184
+ return torch.linalg.solve(AtA, AtW)
185
+ except torch.OutOfMemoryError:
186
+ torch.cuda.empty_cache()
187
+ dev = AtA.device
188
+ X = torch.linalg.solve(AtA.cpu().double(), AtW.cpu().double())
189
+ return X.to(device=dev, dtype=AtW.dtype)
190
+
191
+
192
+ def tr_rel_err(cores, R: torch.Tensor, chunk_elems: int = 250_000_000) -> float:
193
+ """||contract_tr(cores) - R||_F / ||R||_F, accumulated in chunks.
194
+
195
+ Materialising the reconstruction to subtract it needs the reconstruction AND the einsum's
196
+ intermediate at once; on down_proj at ring rank 155 that intermediate is (155, 64, 688,
197
+ 256) = 7 GB even with the first mode already chunked. Accumulating the squared error one
198
+ slice at a time keeps only one slice live, and the chunk width is derived from an element
199
+ budget rather than a hard-coded constant -- a constant is exactly what silently failed to
200
+ engage when a mode happened to equal it.
201
+ """
202
+ n = len(cores)
203
+ d0 = cores[0].shape[1]
204
+ mid = 1
205
+ for k in range(1, n - 1):
206
+ mid *= cores[k].shape[1]
207
+ per_unit = max(1, mid * cores[0].shape[0] * cores[-1].shape[0])
208
+ step = max(1, min(d0, int(chunk_elems // per_unit)))
209
+ acc = 0.0
210
+ for lo in range(0, d0, step):
211
+ hi = min(lo + step, d0)
212
+ sub = [cores[0][:, lo:hi, :]] + list(cores[1:])
213
+ diff = contract_tr(sub) - R[lo:hi]
214
+ acc += float(diff.pow(2).sum())
215
+ del sub, diff
216
+ return (acc ** 0.5) / float(R.norm())
217
+
218
+
219
+ def fit_tr(R: torch.Tensor, ranks, sweeps: int = 30, tol: float = 1e-8, verbose: bool = False,
220
+ seed: int = 1234, restarts: int = 2, solver: str = "lstsq",
221
+ chunk: int = 0, chunk_elems: int = 250_000_000):
222
+ """Fit a tensor ring by TT initialisation + alternating least squares.
223
+
224
+ ranks = [r_0, r_1, ..., r_{N-1}] with r_N == r_0. The TT init uses r_0 = 1 (a legal ring),
225
+ then each ALS sweep re-solves every core in closed form given the others; the ring's extra
226
+ boundary rank is opened up by padding the initialisation. Because ALS on a ring is not
227
+ guaranteed to improve monotonically from an arbitrary start, the best iterate seen is kept
228
+ and the routine REFUSES to return anything worse than its own TT initialisation -- without
229
+ that guard a fitting failure would be indistinguishable from the format being worse, which
230
+ is precisely the comparison this module exists to make.
231
+ """
232
+ n = len(R.shape)
233
+ if len(ranks) != n:
234
+ raise ValueError(f"a ring over {n} sites needs {n} ranks (r_0..r_{{N-1}})")
235
+ dims = list(R.shape)
236
+ rnorm = float(R.norm())
237
+ rnorm2 = float(R.pow(2).sum())
238
+ last_sq = None
239
+ tt = fit_tt(R, ranks[1:])
240
+ base_err = float((contract_tt(tt) - R).norm() / R.norm())
241
+ r0 = int(ranks[0])
242
+ gen = torch.Generator(device="cpu").manual_seed(seed)
243
+
244
+ def padded_init():
245
+ """TT solution embedded in the ring, with the OPENED bond seeded on BOTH ends.
246
+
247
+ Seeding only one end is not enough and is a silent failure: core 0's least-squares
248
+ environment is built from cores 1..N-1, whose ring index comes from core N-1's
249
+ trailing bond. If that stays zero, the environment vanishes on exactly the components
250
+ the ring adds, every ALS solve returns zero there, and the fit never leaves the TT
251
+ solution -- it looks like "the ring buys nothing" rather than "the ring was never
252
+ initialised".
253
+ """
254
+ out = []
255
+ for k, c in enumerate(tt):
256
+ a, d, b = c.shape
257
+ na = r0 if k == 0 else a
258
+ nb = r0 if k == n - 1 else b
259
+ g = torch.zeros(na, d, nb, dtype=R.dtype, device=R.device)
260
+ g[:a, :, :b] = c
261
+ eps = 0.05 * float(c.norm()) / max(1, c.numel()) ** 0.5
262
+ if k == 0 and na > a:
263
+ g[a:, :, :] = eps * torch.randn(na - a, d, nb, generator=gen,
264
+ dtype=R.dtype).to(R.device)
265
+ if k == n - 1 and nb > b:
266
+ g[:, :, b:] = eps * torch.randn(na, d, nb - b, generator=gen,
267
+ dtype=R.dtype).to(R.device)
268
+ out.append(g)
269
+ return out
270
+
271
+ def random_init(g=None):
272
+ """i.i.d. cores whose ring contraction has the right variance.
273
+
274
+ The scale is derived, not guessed. For cores with i.i.d. N(0, s^2) entries the trace
275
+ of the cyclic product is a sum of prod_k r_k independent products of N Gaussians, so
276
+ Var(W) ~= (prod_k r_k) * s^(2N). Matching that to the target mean square gives
277
+ s = (E[R^2] / prod_k r_k)^(1/(2N)). Getting this wrong by a constant factor per core
278
+ compounds to that factor^N in the product, which for N=4,5 puts the initial iterate
279
+ many orders of magnitude away from the data and leaves ALS crawling.
280
+ """
281
+ rr = [int(ranks[k]) for k in range(n)]
282
+ prod = 1.0
283
+ for x in rr:
284
+ prod *= x
285
+ ms = float(R.pow(2).mean())
286
+ s = (ms / prod) ** (1.0 / (2 * n))
287
+ gg = g if g is not None else gen
288
+ return [s * torch.randn(rr[k], dims[k], rr[(k + 1) % n], generator=gg,
289
+ dtype=R.dtype).to(R.device) for k in range(n)]
290
+
291
+ # ALS on a ring has genuine local minima -- a single start that stalls would be reported
292
+ # as "the ring is not better", which is exactly the confound this module must avoid. So
293
+ # several starts are run and the best kept; restarts are cheap next to the SVDs anyway.
294
+ inits = [("tt_padded", padded_init)]
295
+ for j in range(restarts):
296
+ g = torch.Generator(device="cpu").manual_seed(seed + 977 * (j + 1))
297
+ inits.append((f"random{j}", lambda g=g: random_init(g)))
298
+ best, best_err, hists, winner = tt_to_tr(tt), base_err, {}, "tt_init"
299
+ for init_name, init_fn in inits:
300
+ cores, ihist = init_fn(), []
301
+ for it in range(sweeps):
302
+ for k in range(n):
303
+ # The subchain leaves every d index separate and in CYCLIC order starting at
304
+ # k+1. R's remaining modes must be flattened in that SAME order -- movedim
305
+ # gives natural order, which for interior k is a different permutation and
306
+ # would solve the least-squares problem against mismatched columns. It still
307
+ # returns a finite "solution", just to the wrong system.
308
+ # The chunk decision is made from SHAPES ONLY and BEFORE anything large is
309
+ # built. An earlier version computed the full subchain first and then decided
310
+ # whether to chunk, so the unchunked allocation always happened anyway and the
311
+ # chunked branch saved nothing -- the memory-bounded path existed but could
312
+ # never take effect.
313
+ # Auto-size the chunk from a memory budget instead of comparing against a
314
+ # fixed number. A constant threshold silently does nothing when the mode
315
+ # happens to equal it -- which is exactly what let a 4-site fit try to
316
+ # materialise a 134 GB subchain (mode 64, chunk 64, "64 > 64" is false).
317
+ m_ = (k + 1) % n
318
+ other = 1
319
+ for j in range(n):
320
+ if j != k:
321
+ other *= dims[j]
322
+ per_unit = max(1, (other // max(1, dims[m_])) * rank_of(cores, k))
323
+ auto = max(1, min(dims[m_], int(chunk_elems // per_unit)))
324
+ use_chunk = auto < dims[m_]
325
+ if solver == "normal" and use_chunk:
326
+ # Memory-bounded normal equations. Materialising the subchain costs
327
+ # r_k * (prod_{j!=k} d_j) * r_{k-1} floats -- on down_proj at these ranks
328
+ # that is (155, 688, 256, 155) = 17 GB, so the unchunked path cannot run
329
+ # on the MLP layers at all. The Gram and right-hand side are sums over the
330
+ # flattened "others" index, so they accumulate exactly over slices of the
331
+ # first subchain mode; this is the same arithmetic, not an approximation.
332
+ m = m_
333
+ d_next = dims[m]
334
+ rk_, rkm1_ = None, None
335
+ AtA = AtW = None
336
+ Rp = R.permute(*([k] + [(k + 1 + t) % n for t in range(n - 1)]))
337
+ for lo in range(0, d_next, auto):
338
+ hi = min(lo + auto, d_next)
339
+ Ec = _subchain_chunk(cores, k, lo, hi)
340
+ rk_, rkm1_ = Ec.shape[0], Ec.shape[-1]
341
+ Ec = Ec.reshape(rk_, -1, rkm1_)
342
+ Ac = Ec.permute(1, 2, 0).reshape(Ec.shape[1], rkm1_ * rk_)
343
+ Wc = Rp[:, lo:hi].reshape(dims[k], -1)
344
+ g = Ac.transpose(0, 1) @ Ac
345
+ h = Ac.transpose(0, 1) @ Wc.transpose(0, 1)
346
+ AtA = g if AtA is None else AtA + g
347
+ AtW = h if AtW is None else AtW + h
348
+ del Ec, Ac, Wc, g, h
349
+ lam = 1e-8 * float(AtA.diagonal().abs().mean().clamp_min(1e-30))
350
+ AtA_r = AtA + lam * torch.eye(AtA.shape[0], dtype=AtA.dtype,
351
+ device=AtA.device)
352
+ G = _solve_maybe_cpu(AtA_r, AtW)
353
+ del AtA_r
354
+ # ||R - A G||^2 = ||R||^2 - 2<AtW, G> + <G, AtA G>, all from quantities
355
+ # already formed. Computing it by contracting the whole ring instead would
356
+ # cost one full O(prod d_k) tensor per sweep per core.
357
+ sq = rnorm2 - 2.0 * float((AtW * G).sum()) + float((G * (AtA @ G)).sum())
358
+ last_sq = max(sq, 0.0)
359
+ rkm1, rk = rkm1_, rk_
360
+ else:
361
+ # ONE branch builds A/Wk and ONE consumes them. Splitting the decision
362
+ # across two separate if/else chains left the non-chunked solve reachable
363
+ # after the chunked path had run, where `A` is whatever the PREVIOUS core
364
+ # left behind -- a silent wrong answer rather than an error.
365
+ E = _subchain(cores, k) # (r_k, d_{k+1},..,d_{k-1}, r_{k-1})
366
+ rk, rkm1 = E.shape[0], E.shape[-1]
367
+ E = E.reshape(rk, -1, rkm1)
368
+ D = E.shape[1]
369
+ A = E.permute(1, 2, 0).reshape(D, rkm1 * rk)
370
+ perm = [k] + [(k + 1 + t) % n for t in range(n - 1)]
371
+ # R's remaining modes must be flattened in the subchain's CYCLIC order --
372
+ # movedim gives natural order, which for interior k solves the
373
+ # least-squares problem against mismatched columns and still returns a
374
+ # finite "solution", just to the wrong system.
375
+ Wk = R.permute(*perm).reshape(dims[k], D)
376
+ del E
377
+ if solver == "normal":
378
+ AtA = A.transpose(0, 1) @ A
379
+ lam = 1e-8 * float(AtA.diagonal().abs().mean().clamp_min(1e-30))
380
+ AtA += lam * torch.eye(AtA.shape[0], dtype=A.dtype, device=A.device)
381
+ G = _solve_maybe_cpu(AtA, A.transpose(0, 1) @ Wk.transpose(0, 1))
382
+ del AtA
383
+ else:
384
+ G = torch.linalg.lstsq(A, Wk.transpose(0, 1)).solution
385
+ last_sq = None
386
+ del A, Wk
387
+ cores[k] = (G.transpose(0, 1).reshape(dims[k], rkm1, rk)
388
+ .permute(1, 0, 2).contiguous())
389
+ err = (float(last_sq) ** 0.5 / rnorm if last_sq is not None
390
+ else float((contract_tr(cores, chunk=chunk) - R).norm() / rnorm))
391
+ ihist.append(round(err, 8))
392
+ if verbose:
393
+ print(f" TR-ALS[{init_name}] sweep {it+1}: rel err {err:.6f}", flush=True)
394
+ if err < best_err - 1e-12:
395
+ best, best_err, winner = [c.clone() for c in cores], err, init_name
396
+ if it and abs(ihist[-2] - err) < tol * max(err, 1e-12):
397
+ break
398
+ hists[init_name] = ihist
399
+ # The algebraic residual is a difference of nearly equal large numbers; at a relative
400
+ # error of ~1e-2 it has already lost most of its fp32 significance. It is fine for
401
+ # steering ALS but not for the number that gets reported, so the winner is re-measured
402
+ # once by explicit contraction.
403
+ best_err = tr_rel_err(best, R)
404
+ if best_err > base_err:
405
+ return tt_to_tr(tt), base_err, {"fell_back_to_tt": True, "tt_err": base_err,
406
+ "winner": "tt_init", "als_hist": hists}
407
+ return best, best_err, {"fell_back_to_tt": winner == "tt_init", "tt_err": base_err,
408
+ "winner": winner, "als_hist": hists}
409
+
410
+
411
+ # --------------------------------------------------------------------------- bookkeeping
412
+ def tt_params(dims, ranks) -> int:
413
+ r = [1] + [int(x) for x in ranks] + [1]
414
+ return sum(r[k] * dims[k] * r[k + 1] for k in range(len(dims)))
415
+
416
+
417
+ def tr_params(dims, ranks) -> int:
418
+ r = [int(x) for x in ranks]
419
+ n = len(dims)
420
+ return sum(r[k] * dims[k] * r[(k + 1) % n] for k in range(n))
421
+
422
+
423
+ def tt_rank_ceilings(dims):
424
+ """r_k <= min(prod_{j<=k} d_j, prod_{j>k} d_j): above that the truncation is vacuous."""
425
+ n, out = len(dims), []
426
+ for k in range(n - 1):
427
+ left = 1
428
+ for j in range(k + 1):
429
+ left *= dims[j]
430
+ right = 1
431
+ for j in range(k + 1, n):
432
+ right *= dims[j]
433
+ out.append(min(left, right))
434
+ return out
435
+
436
+
437
+ def ranks_for_budget(dims, budget: int, ring: bool, alpha: float = 1.0):
438
+ """Largest ranks fitting `budget`, shaped by r_k proportional to ceiling_k ** alpha.
439
+
440
+ Bisection rather than a closed form: the count is linear in each rank but bilinear in
441
+ adjacent pairs, and cyclic for a ring, so there is no single quadratic to solve.
442
+
443
+ ALPHA EXISTS BECAUSE EQUAL FILL FRACTION IS WRONG WHEN THE CEILINGS ARE LOPSIDED. For a
444
+ 4-site split of 4096 the ceilings are (64, 4096, 64): alpha=1 spends the budget on the
445
+ huge middle bond and returns ranks like (36, 2327, 36), strangling the two bonds that
446
+ actually gate information flow through the chain. alpha=0 gives every bond the same rank
447
+ instead. Neither is right a priori, so the caller is expected to MEASURE across alpha --
448
+ the reconstruction error, not the heuristic, decides.
449
+ """
450
+ ceil_tt = tt_rank_ceilings(dims)
451
+ ceils = ([min(ceil_tt)] + ceil_tt) if ring else ceil_tt
452
+ fn = tr_params if ring else tt_params
453
+ mx = max(ceils)
454
+ shape = [(c / mx) ** alpha for c in ceils]
455
+
456
+ def build(t):
457
+ return [max(1, min(int(round(t * mx * s)), c)) for s, c in zip(shape, ceils)]
458
+
459
+ lo, hi = 0.0, 1.0
460
+ if fn(dims, build(1.0)) <= budget:
461
+ return build(1.0)
462
+ for _ in range(60):
463
+ mid = (lo + hi) / 2
464
+ if fn(dims, build(mid)) > budget:
465
+ hi = mid
466
+ else:
467
+ lo = mid
468
+ r = build(lo)
469
+ while fn(dims, r) > budget and max(r) > 1:
470
+ r[r.index(max(r))] -= 1
471
+ return r
472
+
473
+
474
+ def balanced_split(n: int, k: int):
475
+ """Most balanced k-way factorisation of n with every factor >= 2 (spread-minimising)."""
476
+ best = None
477
+ def rec(rem, parts):
478
+ nonlocal best
479
+ if len(parts) == k - 1:
480
+ if rem >= 2:
481
+ cand = parts + [rem]
482
+ key = max(cand) / min(cand)
483
+ if best is None or key < best[0]:
484
+ best = (key, cand)
485
+ return
486
+ d = 2
487
+ while d * d <= rem or d <= rem:
488
+ if d > rem:
489
+ break
490
+ if rem % d == 0:
491
+ rec(rem // d, parts + [d])
492
+ d += 1
493
+ rec(n, [])
494
+ if best is None:
495
+ raise ValueError(f"no {k}-way factorisation of {n} with all factors >= 2")
496
+ return sorted(best[1])
497
+
498
+
499
+ def self_test(device: str = "cpu") -> None:
500
+ torch.manual_seed(0)
501
+ dt = torch.float64
502
+ for osp, isp in [((4, 3), (2, 5)), ((4, 3, 2), (2, 5, 3)), ((2, 3, 2, 2), (2, 2, 3, 2))]:
503
+ n = len(osp)
504
+ out = 1
505
+ inn = 1
506
+ for x in osp:
507
+ out *= x
508
+ for x in isp:
509
+ inn *= x
510
+ W = torch.randn(out, inn, dtype=dt, device=device)
511
+ R = rearrange_n(W, osp, isp)
512
+ dims = [o * i for o, i in zip(osp, isp)]
513
+ assert list(R.shape) == dims, (R.shape, dims)
514
+ assert torch.equal(inv_rearrange_n(R, osp, isp), W), f"{n}-site rearrange not invertible"
515
+ # index identity, not just the round trip: a wrong-but-self-inverse permutation would
516
+ # pass the round trip and scramble every weight silently
517
+ for _ in range(40):
518
+ oi = [torch.randint(0, x, (1,)).item() for x in osp]
519
+ ii = [torch.randint(0, x, (1,)).item() for x in isp]
520
+ ridx = tuple(oi[k] * isp[k] + ii[k] for k in range(n))
521
+ orow = 0
522
+ for k in range(n):
523
+ orow = orow * osp[k] + oi[k]
524
+ ocol = 0
525
+ for k in range(n):
526
+ ocol = ocol * isp[k] + ii[k]
527
+ assert R[ridx] == W[orow, ocol], f"{n}-site rearrange index map wrong"
528
+
529
+ ceils = tt_rank_ceilings(dims)
530
+ cores = fit_tt(R, ceils)
531
+ e = float((contract_tt(cores) - R).norm() / R.norm())
532
+ assert e < 1e-10, f"{n}-site full-rank TT is not exact ({e:.3e})"
533
+ assert tt_params(dims, ceils) == sum(c.numel() for c in cores), "tt_params disagrees"
534
+
535
+ if n >= 3:
536
+ trunc = [max(1, c // 2) for c in ceils]
537
+ cores = fit_tt(R, trunc)
538
+ assert tt_params(dims, trunc) == sum(c.numel() for c in cores)
539
+ for a in (0.0, 0.5, 1.0):
540
+ rr = ranks_for_budget(dims, tt_params(dims, trunc), ring=False, alpha=a)
541
+ assert tt_params(dims, rr) <= tt_params(dims, trunc), \
542
+ f"TT budget solver overran at alpha={a}"
543
+ # a ring at the SAME parameter budget must not do worse than the TT it starts from
544
+ budget = tt_params(dims, trunc)
545
+ rring = ranks_for_budget(dims, budget, ring=True)
546
+ assert tr_params(dims, rring) <= budget, "TR budget solver overran"
547
+ _c, err_tr, info = fit_tr(R, rring, sweeps=6)
548
+ assert err_tr <= info["tt_err"] + 1e-12, "fit_tr returned worse than its own TT init"
549
+ assert abs(float((contract_tr(_c) - R).norm() / R.norm()) - err_tr) < 1e-8, \
550
+ "reported TR error does not match the returned cores"
551
+
552
+ ring_chk = [torch.randn(3, 5, 4, dtype=dt), torch.randn(4, 6, 2, dtype=dt),
553
+ torch.randn(2, 7, 3, dtype=dt)]
554
+ full = contract_tr(ring_chk)
555
+ assert torch.allclose(full, contract_tr(ring_chk, chunk=2), atol=1e-12), \
556
+ "chunked contract_tr disagrees with the unchunked one"
557
+ ref = torch.einsum("iaj,jbk,kci->abc", *ring_chk)
558
+ assert torch.allclose(full, ref, atol=1e-12), "contract_tr is not the cyclic trace"
559
+
560
+ # a ring with r_0 > 1 must be able to represent things a TT of the same internal ranks cannot
561
+ dims = [6, 6, 6]
562
+ torch.manual_seed(1)
563
+ ring = [torch.randn(3, 6, 3, dtype=dt) for _ in range(3)]
564
+ Rr = contract_tr(ring)
565
+ tt_same = fit_tt(Rr, [3, 3])
566
+ e_tt = float((contract_tt(tt_same) - Rr).norm() / Rr.norm())
567
+ assert e_tt > 1e-3, ("a rank-(3,3,3) ring was reproduced by a rank-(3,3) TT; the ring "
568
+ f"contraction is probably not closing the loop (err {e_tt:.3e})")
569
+ for slv in ("lstsq", "normal"):
570
+ got, err, info = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3, solver=slv)
571
+ assert err < 1e-4, (f"TR-ALS[{slv}] failed to recover an exact rank-3 ring "
572
+ f"(err {err:.3e}); winner={info['winner']} "
573
+ f"tt_init={info['tt_err']:.3e}")
574
+ got, err, info = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3)
575
+ # chunking changes only how the Gram is accumulated, so it must reach the same optimum
576
+ _g, err_ch, _i = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3, solver="normal", chunk=2)
577
+ assert err_ch < 1e-4, f"chunked TR-ALS failed to recover an exact ring (err {err_ch:.3e})"
578
+ assert err < 1e-4, (f"TR-ALS failed to recover an exact rank-3 ring (err {err:.3e}); "
579
+ f"winner={info['winner']} tt_init={info['tt_err']:.3e}")
580
+
581
+ assert balanced_split(4096, 3) == [16, 16, 16], balanced_split(4096, 3)
582
+ assert balanced_split(4096, 2) == [64, 64]
583
+ b = balanced_split(11008, 3)
584
+ assert 43 in b and b[0] * b[1] * b[2] == 11008, b
585
+ print("tensor_formats self-test PASSED (N-site rearrange exact & index-checked, full-rank "
586
+ "TT exact, budget solvers within budget, TR >= its TT init, TR strictly beats TT on "
587
+ "a true ring, balanced splits correct)")
588
+
589
+
590
+ if __name__ == "__main__":
591
+ self_test()
592
+
593
+
594
+ # --------------------------------------------------------------------------- layers
595
+ class TRLinear(torch.nn.Module):
596
+ """Tensor-ring linear layer: W = Tr[G_0 G_1 ... G_{N-1}] after the shared rearrangement.
597
+
598
+ NOT a LowRankLinear subclass, unlike MPO2Linear/MPO3Linear. Those two could pretend to be
599
+ a pair of factors because a train has open ends; a ring genuinely has N 3-D cores and no
600
+ A/B roles to borrow, so anything keyed on `.A`/`.B` (the blockwise quantizer, the bond
601
+ rebalancer) has to be taught about `.cores` explicitly rather than silently doing the
602
+ wrong thing to a subclass it thinks it understands.
603
+
604
+ RECONSTRUCTION IS CHUNKED BY DEFAULT. Merging any two cores of a 3-site ring costs
605
+ r*d_i*d_j*r entries -- on down_proj at ring rank 142 that is 7.1 GB in bf16, per layer,
606
+ per forward. Chunking the first mode bounds it; the cost is more, smaller matmuls.
607
+ """
608
+
609
+ def __init__(self, cores, osplit, isplit, chunk_elems: int = 500_000_000):
610
+ super().__init__()
611
+ n = len(cores)
612
+ if len(osplit) != n or len(isplit) != n:
613
+ raise ValueError(f"{n} cores need {n} output and {n} input modes")
614
+ if min(list(osplit) + list(isplit)) < 2:
615
+ raise ValueError(f"degenerate split o={tuple(osplit)} i={tuple(isplit)}: a mode of "
616
+ f"1 collapses a site, making this an (N-1)-site network")
617
+ for k in range(n):
618
+ if cores[k].shape[1] != osplit[k] * isplit[k]:
619
+ raise ValueError(f"core {k} has mode {cores[k].shape[1]}, expected "
620
+ f"{osplit[k]}*{isplit[k]}")
621
+ if cores[k].shape[2] != cores[(k + 1) % n].shape[0]:
622
+ raise ValueError(f"ring does not close between cores {k} and {(k+1)%n}")
623
+ self.cores = torch.nn.ParameterList([torch.nn.Parameter(c) for c in cores])
624
+ self.osplit, self.isplit = tuple(int(x) for x in osplit), tuple(int(x) for x in isplit)
625
+ o = i = 1
626
+ for k in range(n):
627
+ o *= self.osplit[k]
628
+ i *= self.isplit[k]
629
+ self.out_features, self.in_features = o, i
630
+ self.ranks = tuple(int(c.shape[0]) for c in cores)
631
+ # Elements per unit of the FIRST mode in contract_tr's peak intermediate, which is
632
+ # (r_0, c, d_1, ..., d_{n-2}, r_{n-1}) -- the LAST core's mode is contracted away by
633
+ # the closing einsum and must not be counted. Including it over-estimated the cost by
634
+ # d_{n-1} (256x on an MLP layer), which drove the chunk to 1 and would have made every
635
+ # MLP forward 256 sequential contractions instead of 8.
636
+ mid = 1
637
+ for k in range(1, n - 1):
638
+ mid *= cores[k].shape[1]
639
+ per_unit = max(1, mid * self.ranks[0] * self.ranks[-1])
640
+ self._chunk = max(1, min(cores[0].shape[1], int(chunk_elems // per_unit)))
641
+ # non-persistent: never wants to show up in a checkpoint, and materialize_() is an
642
+ # inference-only opt-in (see below), so a freshly-loaded layer must start uncached.
643
+ self.register_buffer("_cached_weight", None, persistent=False)
644
+
645
+ def weight(self) -> torch.Tensor:
646
+ if self._cached_weight is not None:
647
+ return self._cached_weight
648
+ cs = list(self.cores)
649
+ R = contract_tr(cs, chunk=self._chunk if self._chunk < cs[0].shape[1] else 0)
650
+ return inv_rearrange_n(R, self.osplit, self.isplit)
651
+
652
+ @torch.no_grad()
653
+ def materialize_(self):
654
+ """Cache the dense weight once. INFERENCE ONLY -- gradients cannot flow through the
655
+ cached tensor back to the cores, so this must never be called before/during training.
656
+
657
+ forward() calls weight() on every call, which redoes the full chunked ring
658
+ contraction (two tensor contractions + a trace per core) from scratch. That is fine
659
+ for a single forward pass, but autoregressive generation calls forward() once per
660
+ layer per GENERATED TOKEN with the cores completely unchanged between calls. Measured
661
+ on tr3_ring4b04_h1's GSM8K eval before this existed: 209s/item, ETA 73h for 1319
662
+ items -- every one of ~200 generated tokens re-contracted all 224 ring layers.
663
+ A train layer (LowRankLinear/MPO2Linear) never had this problem: F.linear(F.linear(x,
664
+ B), A) applies the two factors straight to the activation and never materializes W at
665
+ all, so there was nothing to cache there.
666
+ """
667
+ self._cached_weight = self.weight().detach().clone()
668
+
669
+ def unmaterialize_(self):
670
+ self._cached_weight = None
671
+
672
+ def forward(self, x):
673
+ return torch.nn.functional.linear(x, self.weight().to(x.dtype))
674
+
675
+ def extra_repr(self) -> str:
676
+ return (f"o={self.osplit}, i={self.isplit}, ranks={self.ranks}, "
677
+ f"chunk={self._chunk}, materialized={self._cached_weight is not None}")
678
+
679
+
680
+ class SparseAugTRLinear(TRLinear):
681
+ """TRLinear plus a sparse additive residual. Same int64-index contract as the MPO layers:
682
+ `sp_idx` must NEVER be cast to a floating dtype -- a `.half()` on a 45M-scale index
683
+ silently rounds it to a different, valid-looking position."""
684
+
685
+ def __init__(self, cores, osplit, isplit, sp_idx, sp_val,
686
+ chunk_elems: int = 500_000_000):
687
+ super().__init__(cores, osplit, isplit, chunk_elems)
688
+ if sp_idx.numel() != sp_val.numel():
689
+ raise ValueError(f"{sp_idx.numel()} indices for {sp_val.numel()} values")
690
+ n = self.out_features * self.in_features
691
+ if sp_idx.numel() and (int(sp_idx.max()) >= n or int(sp_idx.min()) < 0):
692
+ raise ValueError("sparse index out of range for this layer")
693
+ self.register_buffer("sp_idx", sp_idx.to(torch.int64))
694
+ self.sp_val = torch.nn.Parameter(sp_val)
695
+
696
+ def weight(self) -> torch.Tensor:
697
+ # must check the cache here too, not just in TRLinear.weight(): materialize_() caches
698
+ # THIS class's weight() (ring + sparse, since self.weight() dispatches polymorphically
699
+ # from inside materialize_()), so without this check a later call would go
700
+ # super().weight() -> see the cache -> return the already-sparse-augmented tensor ->
701
+ # and then add the sparse residual a second time on top of it.
702
+ if self._cached_weight is not None:
703
+ return self._cached_weight
704
+ W = super().weight()
705
+ if self.sp_idx.numel():
706
+ W = W.reshape(-1).index_add(0, self.sp_idx, self.sp_val.to(W.dtype)).view_as(W)
707
+ return W
708
+
709
+ def extra_repr(self) -> str:
710
+ return super().extra_repr() + f", nnz={self.sp_idx.numel()}"
711
+
712
+
713
+ def layer_self_test() -> None:
714
+ torch.manual_seed(0)
715
+ osp, isp = (4, 3, 2), (2, 5, 3)
716
+ dims = [o * i for o, i in zip(osp, isp)]
717
+ cores = [torch.randn(3, dims[0], 4), torch.randn(4, dims[1], 2), torch.randn(2, dims[2], 3)]
718
+ lay = TRLinear([c.clone() for c in cores], osp, isp, chunk_elems=10 ** 9)
719
+ ref = inv_rearrange_n(contract_tr(cores), osp, isp)
720
+ assert torch.allclose(lay.weight(), ref, atol=1e-5), "TRLinear.weight() != contract+inverse"
721
+ # chunking must not change the answer
722
+ lay_c = TRLinear([c.clone() for c in cores], osp, isp, chunk_elems=1)
723
+ assert lay_c._chunk < dims[0], "chunk did not engage"
724
+ assert torch.allclose(lay_c.weight(), ref, atol=1e-5), "chunked forward differs"
725
+ x = torch.randn(7, lay.in_features)
726
+ assert torch.allclose(lay(x), x @ ref.T, atol=1e-4), "forward != x W^T"
727
+ idx = torch.tensor([0, 5, lay.out_features * lay.in_features - 1], dtype=torch.int64)
728
+ val = torch.tensor([1.0, -2.0, 3.0])
729
+ sl = SparseAugTRLinear([c.clone() for c in cores], osp, isp, idx, val, chunk_elems=10 ** 9)
730
+ d = (sl.weight() - ref).reshape(-1)
731
+ assert torch.allclose(d[idx], val, atol=1e-5), "sparse residual not applied at sp_idx"
732
+ assert abs(float(d.abs().sum()) - float(val.abs().sum())) < 1e-4, "residual leaked"
733
+ try:
734
+ TRLinear([torch.zeros(2, 4, 2), torch.zeros(2, 3, 2), torch.zeros(2, 6, 2)],
735
+ (4, 1, 2), (1, 3, 3))
736
+ except ValueError:
737
+ pass
738
+ else:
739
+ raise AssertionError("a degenerate split (mode = 1) was accepted")
740
+ # gradients must reach every core
741
+ lay.zero_grad()
742
+ lay(x).sum().backward()
743
+ for k, c in enumerate(lay.cores):
744
+ assert c.grad is not None and float(c.grad.abs().sum()) > 0, f"core {k} got no gradient"
745
+ # materialize_() must be a pure inference-speed cache: same weight, same forward output,
746
+ # and -- the one bug this is actually guarding against -- the sparse residual must not
747
+ # get added twice once SparseAugTRLinear.weight() is short-circuited by the cache.
748
+ pre = lay.weight().clone()
749
+ lay.materialize_()
750
+ assert lay._cached_weight is not None, "materialize_() did not populate the cache"
751
+ assert torch.allclose(lay.weight(), pre, atol=1e-6), "materialize_() changed weight()"
752
+ assert torch.allclose(lay(x), x @ ref.T, atol=1e-4), "forward != x W^T after materialize_()"
753
+ lay.unmaterialize_()
754
+ assert lay._cached_weight is None, "unmaterialize_() left the cache populated"
755
+ sl_ref = sl.weight().clone()
756
+ sl.materialize_()
757
+ assert torch.allclose(sl.weight(), sl_ref, atol=1e-6), \
758
+ "materialized SparseAugTRLinear.weight() differs -- sparse residual likely double-added"
759
+ print("TRLinear self-test PASSED (weight matches contraction, chunking exact, forward "
760
+ "correct, sparse localised, degenerate split refused, all cores differentiable, "
761
+ "materialize_() cache exact and idempotent)")
tr3/heal/qwen2.5-3b/LICENSE ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Qwen RESEARCH LICENSE AGREEMENT
2
+
3
+ Qwen RESEARCH LICENSE AGREEMENT Release Date: September 19, 2024
4
+
5
+ By clicking to agree or by using or distributing any portion or element of the Qwen Materials, you will be deemed to have recognized and accepted the content of this Agreement, which is effective immediately.
6
+
7
+ 1. Definitions
8
+ a. This Qwen RESEARCH LICENSE AGREEMENT (this "Agreement") shall mean the terms and conditions for use, reproduction, distribution and modification of the Materials as defined by this Agreement.
9
+ b. "We" (or "Us") shall mean Alibaba Cloud.
10
+ c. "You" (or "Your") shall mean a natural person or legal entity exercising the rights granted by this Agreement and/or using the Materials for any purpose and in any field of use.
11
+ d. "Third Parties" shall mean individuals or legal entities that are not under common control with us or you.
12
+ e. "Qwen" shall mean the large language models, and software and algorithms, consisting of trained model weights, parameters (including optimizer states), machine-learning model code, inference-enabling code, training-enabling code, fine-tuning enabling code and other elements of the foregoing distributed by us.
13
+ f. "Materials" shall mean, collectively, Alibaba Cloud's proprietary Qwen and Documentation (and any portion thereof) made available under this Agreement.
14
+ g. "Source" form shall mean the preferred form for making modifications, including but not limited to model source code, documentation source, and configuration files.
15
+ h. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
16
+ i. "Non-Commercial" shall mean for research or evaluation purposes only.
17
+
18
+ 2. Grant of Rights
19
+ a. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Alibaba Cloud's intellectual property or other rights owned by us embodied in the Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Materials FOR NON-COMMERCIAL PURPOSES ONLY.
20
+ b. If you are commercially using the Materials, you shall request a license from us.
21
+
22
+ 3. Redistribution
23
+ You may distribute copies or make the Materials, or derivative works thereof, available as part of a product or service that contains any of them, with or without modifications, and in Source or Object form, provided that you meet the following conditions:
24
+ a. You shall give any other recipients of the Materials or derivative works a copy of this Agreement;
25
+ b. You shall cause any modified files to carry prominent notices stating that you changed the files;
26
+ c. You shall retain in all copies of the Materials that you distribute the following attribution notices within a "Notice" text file distributed as a part of such copies: "Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) Alibaba Cloud. All Rights Reserved."; and
27
+ d. You may add your own copyright statement to your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of your modifications, or for any such derivative works as a whole, provided your use, reproduction, and distribution of the work otherwise complies with the terms and conditions of this Agreement.
28
+
29
+ 4. Rules of use
30
+ a. The Materials may be subject to export controls or restrictions in China, the United States or other countries or regions. You shall comply with applicable laws and regulations in your use of the Materials.
31
+ b. If you use the Materials or any outputs or results therefrom to create, train, fine-tune, or improve an AI model that is distributed or made available, you shall prominently display “Built with Qwen” or “Improved using Qwen” in the related product documentation.
32
+
33
+ 5. Intellectual Property
34
+ a. We retain ownership of all intellectual property rights in and to the Materials and derivatives made by or for us. Conditioned upon compliance with the terms and conditions of this Agreement, with respect to any derivative works and modifications of the Materials that are made by you, you are and will be the owner of such derivative works and modifications.
35
+ b. No trademark license is granted to use the trade names, trademarks, service marks, or product names of us, except as required to fulfill notice requirements under this Agreement or as required for reasonable and customary use in describing and redistributing the Materials.
36
+ c. If you commence a lawsuit or other proceedings (including a cross-claim or counterclaim in a lawsuit) against us or any entity alleging that the Materials or any output therefrom, or any part of the foregoing, infringe any intellectual property or other right owned or licensable by you, then all licenses granted to you under this Agreement shall terminate as of the date such lawsuit or other proceeding is commenced or brought.
37
+
38
+ 6. Disclaimer of Warranty and Limitation of Liability
39
+ a. We are not obligated to support, update, provide training for, or develop any further version of the Qwen Materials or to grant any license thereto.
40
+ b. THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. WE MAKE NO WARRANTY AND ASSUME NO RESPONSIBILITY FOR THE SAFETY OR STABILITY OF THE MATERIALS AND ANY OUTPUT THEREFROM.
41
+ c. IN NO EVENT SHALL WE BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE MATERIALS OR ANY OUTPUT OF IT, NO MATTER HOW IT’S CAUSED.
42
+ d. You will defend, indemnify and hold harmless us from and against any claim by any third party arising out of or related to your use or distribution of the Materials.
43
+
44
+ 7. Survival and Termination.
45
+ a. The term of this Agreement shall commence upon your acceptance of this Agreement or access to the Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein.
46
+ b. We may terminate this Agreement if you breach any of the terms or conditions of this Agreement. Upon termination of this Agreement, you must delete and cease use of the Materials. Sections 6 and 8 shall survive the termination of this Agreement.
47
+
48
+ 8. Governing Law and Jurisdiction.
49
+ a. This Agreement and any dispute arising out of or relating to it will be governed by the laws of China, without regard to conflict of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
50
+ b. The People's Courts in Hangzhou City shall have exclusive jurisdiction over any dispute arising out of this Agreement.
51
+
52
+ 9. Other Terms and Conditions.
53
+ a. Any arrangements, understandings, or agreements regarding the Material not stated herein are separate from and independent of the terms and conditions of this Agreement. You shall request a separate license from us, if you use the Materials in ways not expressly agreed to in this Agreement.
54
+ b. We shall not be bound by any additional or different terms or conditions communicated by you unless expressly agreed.
tr3/heal/qwen2.5-3b/NOTICE ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT,
2
+ Copyright (c) Alibaba Cloud. All Rights Reserved.
3
+
4
+ This repository contains a DERIVATIVE WORK of Qwen/Qwen2.5-3B-Instruct.
5
+
6
+ Modifications made to the Qwen Materials (Qwen RESEARCH LICENSE AGREEMENT, section 3.b):
7
+ * Every attention and MLP projection weight has been replaced by a 3-site Tensor Ring
8
+ factorisation plus a 5% sparse residual. The original dense nn.Linear weights are NOT
9
+ present in this repository; state_dict_fp16.pt contains ring cores, not dense matrices.
10
+ * The resulting network was further trained by pure forward-KL knowledge distillation
11
+ from the unmodified Qwen2.5-3B-Instruct teacher for 60M tokens.
12
+ * config.json is copied unmodified from the base model and is retained only as
13
+ architecture metadata; it does NOT describe the weights in this repository.
14
+
15
+ USE IS RESTRICTED TO NON-COMMERCIAL PURPOSES (research or evaluation only), per section 2.a
16
+ of the Qwen RESEARCH LICENSE AGREEMENT. Commercial use requires a separate licence from
17
+ Alibaba Cloud. See the LICENSE file in this repository for the full agreement.
tr3/heal/qwen2.5-3b/README.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: qwen-research
4
+ license_link: LICENSE
5
+ base_model: Qwen/Qwen2.5-3B-Instruct
6
+ tags:
7
+ - tensor-decomposition
8
+ - tensor-ring
9
+ - model-compression
10
+ - qwen2
11
+ ---
12
+
13
+ # TR-3: Qwen2.5-3B-Instruct compressed with a Tensor Ring
14
+
15
+ Every attention and MLP projection replaced by a **3-site Tensor Ring** (a cyclic
16
+ tensor-network factorisation — the ring closes with a non-trivial boundary bond, so it is not
17
+ a train/TT) plus a 5% sparse residual, then healed with pure knowledge distillation.
18
+
19
+ - **2.078B parameters**, down from 3.086B — **32.65% reduction**
20
+ - **60M healing tokens** (pure forward-KL distillation from the unmodified 3B teacher, no gold labels)
21
+ - Held-out token-mean KL vs the teacher: **0.8882 → 0.1729** over healing
22
+
23
+ ## ⚠️ Non-commercial use only
24
+
25
+ Derived from Qwen2.5-3B-Instruct, which is released under the **Qwen RESEARCH LICENSE
26
+ AGREEMENT** — research and evaluation only. Commercial use requires a separate licence from
27
+ Alibaba Cloud. See `LICENSE` and `NOTICE`.
28
+
29
+ ## Results (lm-eval 0.4.12, full benchmarks, no subsampling)
30
+
31
+ | Task (shots) | This model | Dense teacher |
32
+ |---|---:|---:|
33
+ | MMLU (5-shot) | 56.02 | 66.39 |
34
+ | HellaSwag (10-shot) | 66.39 | 75.24 |
35
+ | BoolQ (0-shot) | 76.33 | 80.09 |
36
+ | TriviaQA (5-shot) | 27.61 | 45.82 |
37
+ | GSM8K (5-shot) | 41.77 † | 10.16 † |
38
+
39
+ **† Do not read the GSM8K row as a capability gain from compression.** Both numbers were
40
+ measured with `apply_chat_template=false`, chosen so every model in the study shares one
41
+ protocol. The dense 3B scores far below its published ~65-79%, and the compressed model —
42
+ healed on 340k plain-text instruction examples — scores higher than its own teacher, which
43
+ compression cannot cause. The mechanism is unresolved: an earlier explanation blaming
44
+ family-wide chat-template dependence is **contradicted** by Qwen2.5-7B-Instruct scoring 75.51%
45
+ under the identical protocol. Across the other four tasks the honest degradation is
46
+ **-10.30 points** (66.89 → 56.59). Full evidence in `eval_protocol_qwen3b.json`.
47
+
48
+ ## Why 32.65% and not 40%
49
+
50
+ The LLaMA-2 rows of this study compress by ~40%. Qwen2.5-3B **collapses** at that rate — a
51
+ measured budget sweep gives:
52
+
53
+ | Reduction | held-out KL | pre-heal MMLU |
54
+ |---:|---:|---:|
55
+ | 4.76% | 0.0828 | 65.83% |
56
+ | 22.84% | 0.4193 | 58.11% |
57
+ | **32.65%** | **0.8882** | **44.30%** |
58
+ | 40.94% | 3.5810 | 25.66% (chance) |
59
+
60
+ The transition is sharp rather than gradual: KL grows ~1.09x per point of extra reduction
61
+ through the usable range, then 1.18x per point in the last stretch. 32.65% was chosen because
62
+ its pre-heal KL (0.8882) matches the damage LLaMA-2-7B takes at 40.30% (0.6915), so the rows
63
+ are aligned by **damage inflicted** rather than by nominal compression rate.
64
+
65
+ ## ⚠️ This is NOT a standard `transformers` checkpoint
66
+
67
+ The weight tensors in `state_dict_fp16_healed.pt` are **ring cores**, not dense `nn.Linear` weights.
68
+ Loading requires rebuilding the model with the `TRLinear`/`SparseAugTRLinear` layers from
69
+ `tensor_formats.py` (included), using `ranks.json` for the per-layer topology. `config.json` is
70
+ the stock Qwen2.5-3B-Instruct config, included only as architecture metadata — you **cannot**
71
+ `AutoModelForCausalLM.from_pretrained()` this repository.
72
+
73
+ Three Qwen2-specific details the loader must respect, each verified against an instantiated
74
+ model rather than inferred from the config:
75
+
76
+ - **Grouped-query attention** — `k_proj`/`v_proj` emit 256, not 2048.
77
+ - **q/k/v biases** — Qwen2 hardcodes `bias=True` on these three projections and its config has
78
+ no `attention_bias` key at all, so reading the config alone reports "no bias" and is wrong.
79
+ The biases are preserved here; dropping them is silent, since shapes still match.
80
+ - **Tied embeddings** — `tie_word_embeddings=true`, so the embedding matrix is stored once.
81
+
82
+ ## How to load it
83
+
84
+ ```python
85
+ import json, torch
86
+ from transformers import AutoModelForCausalLM
87
+ from tensor_formats import TRLinear, SparseAugTRLinear
88
+
89
+ BASE = "Qwen/Qwen2.5-3B-Instruct"
90
+ m = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.float16)
91
+ ranks = json.load(open("ranks.json"))
92
+
93
+ def get_sub(root, path):
94
+ o = root
95
+ for p in path.split("."):
96
+ o = o[int(p)] if p.isdigit() else getattr(o, p)
97
+ return o
98
+
99
+ for path, spec in ranks.items():
100
+ parent = get_sub(m, path.rsplit(".", 1)[0])
101
+ leaf = path.rsplit(".", 1)[1]
102
+ osp = tuple(spec[k] for k in ("o1", "o2", "o3"))
103
+ isp = tuple(spec[k] for k in ("i1", "i2", "i3"))
104
+ rr = [spec[k] for k in ("r0", "r1", "r2")]
105
+ dims = [a * b for a, b in zip(osp, isp)]
106
+ cores = [torch.zeros(rr[k], dims[k], rr[(k + 1) % 3], dtype=torch.float16) for k in range(3)]
107
+ nnz = int(spec.get("nnz", 0))
108
+ # q/k/v carry a bias in Qwen2; it must exist here or load_state_dict reports it unexpected
109
+ old = getattr(parent, leaf)
110
+ bias = torch.zeros(old.out_features, dtype=torch.float16) if old.bias is not None else None
111
+ if nnz:
112
+ layer = SparseAugTRLinear(cores, osp, isp, torch.zeros(nnz, dtype=torch.int64),
113
+ torch.zeros(nnz, dtype=torch.float16), bias=bias)
114
+ else:
115
+ layer = TRLinear(cores, osp, isp, bias=bias)
116
+ setattr(parent, leaf, layer)
117
+
118
+ sd = torch.load("state_dict_fp16_healed.pt", map_location="cpu")
119
+ missing, unexpected = m.load_state_dict(sd, strict=False)
120
+ assert not missing and not unexpected, (len(missing), len(unexpected))
121
+ m.eval()
122
+
123
+ # INFERENCE ONLY. TRLinear.forward() re-contracts the whole ring on every call, which during
124
+ # generation happens once per layer per generated token. Caching the dense weight is ~15x
125
+ # faster but cuts the gradient path, so never call this before or during training.
126
+ for mod in m.modules():
127
+ if isinstance(mod, TRLinear):
128
+ mod.materialize_()
129
+ ```
130
+
131
+ ## Reproduction notes
132
+
133
+ Evaluated with `lm_eval==0.4.12` under the protocol pinned in `eval_protocol_qwen3b.json`
134
+ (shot counts, metric keys, dtype and seed are identical to every other row of the study).
135
+ Healing used `micro=8, grad_accum=2, seq_len=1024` — `tokens_per_step = 16384`, matching the
136
+ LLaMA-2 runs, so the global batch, step count and LR schedule are the same.
tr3/heal/qwen2.5-3b/config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "eos_token_id": 151645,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 2048,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 11008,
12
+ "max_position_embeddings": 32768,
13
+ "max_window_layers": 70,
14
+ "model_type": "qwen2",
15
+ "num_attention_heads": 16,
16
+ "num_hidden_layers": 36,
17
+ "num_key_value_heads": 2,
18
+ "rms_norm_eps": 1e-06,
19
+ "rope_theta": 1000000.0,
20
+ "sliding_window": 32768,
21
+ "tie_word_embeddings": true,
22
+ "torch_dtype": "bfloat16",
23
+ "transformers_version": "4.43.1",
24
+ "use_cache": true,
25
+ "use_sliding_window": false,
26
+ "vocab_size": 151936
27
+ }
tr3/heal/qwen2.5-3b/eval_protocol_qwen3b.json ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_id": "Qwen/Qwen2.5-3B-Instruct",
3
+ "model_revision": "aa8e72537993ba99e69dfaafa59ed015b17504d1",
4
+ "lm_eval_revision": "0.4.12",
5
+ "tasks": {
6
+ "mmlu": "mmlu",
7
+ "hellaswag": "hellaswag",
8
+ "boolq": "boolq",
9
+ "triviaqa": "triviaqa",
10
+ "gsm8k": "gsm8k"
11
+ },
12
+ "num_fewshot": {
13
+ "mmlu": 5,
14
+ "hellaswag": 10,
15
+ "boolq": 0,
16
+ "triviaqa": 5,
17
+ "gsm8k": 5
18
+ },
19
+ "apply_chat_template": false,
20
+ "batch_size": "auto",
21
+ "dtype": "float16",
22
+ "seed": 1234,
23
+ "score_scale": "fraction",
24
+ "result_parser": {
25
+ "mmlu": "acc,none",
26
+ "hellaswag": "acc_norm,none",
27
+ "boolq": "acc,none",
28
+ "triviaqa": "exact_match,remove_whitespace",
29
+ "gsm8k": "exact_match,strict-match"
30
+ },
31
+ "hardware": {
32
+ "gpus_max": 4,
33
+ "gpu_model": "NVIDIA GB200 (Grace-Blackwell NVL4, sm_100)",
34
+ "note": "RIKYU compute node. Same stack as eval_protocol_13b.json, NOT the stack the LLaMA-2-7B numbers in eval_protocol.json were produced on."
35
+ },
36
+ "architecture": {
37
+ "model_type": "qwen2",
38
+ "hidden": 2048,
39
+ "intermediate": 11008,
40
+ "layers": 36,
41
+ "vocab": 151936,
42
+ "num_attention_heads": 16,
43
+ "num_key_value_heads": 2,
44
+ "head_dim": 128,
45
+ "q_out": 2048,
46
+ "kv_out": 256,
47
+ "tie_word_embeddings": true,
48
+ "qkv_bias": true,
49
+ "note": "Three departures from LLaMA that the pipeline handles EXPLICITLY, each verified against an instantiated model rather than inferred from the config. (1) GQA: k_proj/v_proj emit 256, not 2048, so OUT_DIM is architecture-derived. (2) q/k/v carry a bias -- Qwen2 hardcodes bias=True in its modeling code and the config has no attention_bias key at all, so config inspection alone reports 'no bias' and is wrong; TRLinear/SparseAugTRLinear were given an optional bias so replacement preserves it. (3) tie_word_embeddings=true, so the embedding matrix is counted once, not twice."
50
+ },
51
+ "parameter_budget": {
52
+ "dense_total": 3085938688,
53
+ "embed": 311164928,
54
+ "norms": 149504,
55
+ "qkv_biases": 92160,
56
+ "linear": 2774532096,
57
+ "uncompressible_fraction": 0.1009,
58
+ "target_total": 1842436054,
59
+ "sparse_values_total_expected": 138726604,
60
+ "target_params_b_flag": 1.7037,
61
+ "note": "Budget is matched to the LLaMA-2-7B ACHIEVED ratio 4023119424/6738415616 = 0.597042 (40.30% reduction) on TOTAL parameters. Because Qwen2.5-3B's vocabulary is 151936 against LLaMA-2's 32000, the uncompressible base (embed+norms+bias) is 10.09% of the model against LLaMA-2-7B's 3.90%. Matching the TOTAL rate therefore compresses the transformer body HARDER: the linear layers keep 0.5518 here, and 44.82% of them are removed, against 40.30% for LLaMA-2-7B. This is a deliberate choice of convention -- headline compression rate is held constant so the table rows are directly comparable, at the cost of the per-matrix method strength not being identical across rows. Say so in the paper rather than letting a reader assume otherwise."
62
+ },
63
+ "torch_deviation": {
64
+ "locked": "torch==2.4.1+cu121",
65
+ "actual": "torch==2.7.1+cu128",
66
+ "reason": "requirements.compactifai.lock.txt was exported from an x86_64 box. torch 2.4.1+cu121 ships no aarch64 wheel and its whole nvidia-*-cu12==12.1.x dependency stack is x86_64/win_amd64 only; independently, CUDA 12.1 predates Blackwell and GB200 is sm_100, needing CUDA 12.8+. Every other locked package is at its locked version. Forced, not chosen.",
67
+ "added_packages": {
68
+ "sentencepiece": "0.2.2",
69
+ "protobuf": "7.36.1",
70
+ "note": "Not in the lock at any version. Needed to convert tokenizer.model where a repo ships no prebuilt tokenizer.json."
71
+ }
72
+ },
73
+ "assumptions": [
74
+ "Model source: Qwen/Qwen2.5-3B-Instruct is not gated; pinned at aa8e72537993ba99e69dfaafa59ed015b17504d1. This is the official Qwen repository, not a mirror, so unlike the LLaMA rows there is no host-provenance caveat.",
75
+ "Every protocol field except model_id/model_revision/hardware/architecture/parameter_budget is copied UNCHANGED from eval_protocol.json. Shot counts, metric keys, dtype, seed, batch_size and score_scale are identical across all three protocols, so rows differ in the model and the compression budget and nothing else.",
76
+ "apply_chat_template=false is kept for consistency with the LLaMA protocols even though Qwen2.5-3B-Instruct is instruction-tuned. This is a CONSISTENCY choice, not a claim that it is optimal for this model; an instruct model evaluated without its template will generally score below its templated number, and that affects the dense baseline and the compressed model alike.",
77
+ "Healing uses micro=8/grad_accum=2 where the LLaMA-2-7B run used 2/8. tokens_per_step = micro*grad_accum*seq_len = 16384 in both cases, so the global batch, step count and LR schedule are identical; only float summation order differs.",
78
+ "TriviaQA remains the least certain task, exactly as documented in the 7B protocol; the same 5-shot exact_match (remove_whitespace) convention is locked here."
79
+ ],
80
+ "gsm8k_artifact_caveat": {
81
+ "observation": "Dense Qwen2.5-3B-Instruct scores 10.16% on GSM8K under this protocol while the TR-3 compressed+healed model scores 41.77%. Compression cannot improve arithmetic ability, so the comparison is not measuring what the column header says.",
82
+ "SUPERSEDED_EXPLANATION": "An earlier version of this record attributed the 10.16% to Qwen2.5-Instruct's dependence on its chat template under apply_chat_template=false. That explanation is now CONTRADICTED and must not be used: Qwen2.5-7B-Instruct, the same family with the same template, scores 75.51% under the IDENTICAL protocol. Template dependence is therefore not a family-wide property and does not explain the 3B's number.",
83
+ "what_is_actually_known": [
84
+ "Dense Qwen2.5-3B-Instruct: 10.16% (5-shot, no template, exact_match strict-match).",
85
+ "Dense Qwen2.5-7B-Instruct: 75.51% under the identical protocol -- same family, same template, same shots, same metric key.",
86
+ "Dense LLaMA-2-13B-chat: 35.18% under the identical protocol.",
87
+ "TR-3 compressed+healed Qwen2.5-3B: 41.77%, having been distilled on 340,000 plain-text instruction examples (alpha=1.0 pure KD, no gold labels).",
88
+ "Published GSM8K for Qwen2.5-3B-Instruct is roughly 65-79%, measured WITH its chat template."
89
+ ],
90
+ "current_hypothesis": "A strict-match FORMAT failure specific to this model, not to the family: the 3B appears not to emit an answer in the shape the strict-match filter extracts under 5-shot no-template prompting, while the 7B is strong enough to do so. The healing corpus is 340k plain-text instruction examples, which plausibly taught the compressed 3B that format. This is consistent with every number above but is NOT established.",
91
+ "how_to_settle_it": "Two cheap controls, neither of which has been run: (1) re-score dense Qwen2.5-3B GSM8K reading exact_match,flexible-extract instead of strict-match -- if it jumps, the reasoning was there and only the extraction failed; (2) re-score dense and compressed with apply_chat_template=true. Until one of these is done the mechanism is unresolved.",
92
+ "effect_on_the_average": "Across the other four tasks the compressed model loses 10.30 points (66.89 -> 56.59). Including GSM8K the five-task gap shrinks to 1.91 points, making the compression look about five times gentler than it is.",
93
+ "reporting_decision": "Reported at face value with a footnote, by explicit choice. The +31.61 GSM8K delta must NOT be described as a capability gain from compression, and the footnote must not assert the template explanation."
94
+ }
95
+ }
tr3/heal/qwen2.5-3b/ranks.json ADDED
@@ -0,0 +1,3026 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model.layers.0.self_attn.q_proj": {
3
+ "o1": 8,
4
+ "o2": 16,
5
+ "o3": 16,
6
+ "i1": 8,
7
+ "i2": 16,
8
+ "i3": 16,
9
+ "r0": 64,
10
+ "r1": 64,
11
+ "r2": 68,
12
+ "nnz": 209715
13
+ },
14
+ "model.layers.0.self_attn.k_proj": {
15
+ "o1": 4,
16
+ "o2": 8,
17
+ "o3": 8,
18
+ "i1": 8,
19
+ "i2": 16,
20
+ "i3": 16,
21
+ "r0": 32,
22
+ "r1": 32,
23
+ "r2": 34,
24
+ "nnz": 26214
25
+ },
26
+ "model.layers.0.self_attn.v_proj": {
27
+ "o1": 4,
28
+ "o2": 8,
29
+ "o3": 8,
30
+ "i1": 8,
31
+ "i2": 16,
32
+ "i3": 16,
33
+ "r0": 32,
34
+ "r1": 32,
35
+ "r2": 34,
36
+ "nnz": 26214
37
+ },
38
+ "model.layers.0.self_attn.o_proj": {
39
+ "o1": 8,
40
+ "o2": 16,
41
+ "o3": 16,
42
+ "i1": 8,
43
+ "i2": 16,
44
+ "i3": 16,
45
+ "r0": 64,
46
+ "r1": 64,
47
+ "r2": 68,
48
+ "nnz": 209715
49
+ },
50
+ "model.layers.0.mlp.gate_proj": {
51
+ "o1": 16,
52
+ "o2": 16,
53
+ "o3": 43,
54
+ "i1": 8,
55
+ "i2": 16,
56
+ "i3": 16,
57
+ "r0": 111,
58
+ "r1": 111,
59
+ "r2": 111,
60
+ "nnz": 1127219
61
+ },
62
+ "model.layers.0.mlp.up_proj": {
63
+ "o1": 16,
64
+ "o2": 16,
65
+ "o3": 43,
66
+ "i1": 8,
67
+ "i2": 16,
68
+ "i3": 16,
69
+ "r0": 111,
70
+ "r1": 111,
71
+ "r2": 111,
72
+ "nnz": 1127219
73
+ },
74
+ "model.layers.0.mlp.down_proj": {
75
+ "o1": 8,
76
+ "o2": 16,
77
+ "o3": 16,
78
+ "i1": 16,
79
+ "i2": 16,
80
+ "i3": 43,
81
+ "r0": 111,
82
+ "r1": 111,
83
+ "r2": 111,
84
+ "nnz": 1127219
85
+ },
86
+ "model.layers.1.self_attn.q_proj": {
87
+ "o1": 8,
88
+ "o2": 16,
89
+ "o3": 16,
90
+ "i1": 8,
91
+ "i2": 16,
92
+ "i3": 16,
93
+ "r0": 64,
94
+ "r1": 64,
95
+ "r2": 68,
96
+ "nnz": 209715
97
+ },
98
+ "model.layers.1.self_attn.k_proj": {
99
+ "o1": 4,
100
+ "o2": 8,
101
+ "o3": 8,
102
+ "i1": 8,
103
+ "i2": 16,
104
+ "i3": 16,
105
+ "r0": 32,
106
+ "r1": 32,
107
+ "r2": 34,
108
+ "nnz": 26214
109
+ },
110
+ "model.layers.1.self_attn.v_proj": {
111
+ "o1": 4,
112
+ "o2": 8,
113
+ "o3": 8,
114
+ "i1": 8,
115
+ "i2": 16,
116
+ "i3": 16,
117
+ "r0": 32,
118
+ "r1": 32,
119
+ "r2": 34,
120
+ "nnz": 26214
121
+ },
122
+ "model.layers.1.self_attn.o_proj": {
123
+ "o1": 8,
124
+ "o2": 16,
125
+ "o3": 16,
126
+ "i1": 8,
127
+ "i2": 16,
128
+ "i3": 16,
129
+ "r0": 64,
130
+ "r1": 64,
131
+ "r2": 68,
132
+ "nnz": 209715
133
+ },
134
+ "model.layers.1.mlp.gate_proj": {
135
+ "o1": 16,
136
+ "o2": 16,
137
+ "o3": 43,
138
+ "i1": 8,
139
+ "i2": 16,
140
+ "i3": 16,
141
+ "r0": 111,
142
+ "r1": 111,
143
+ "r2": 111,
144
+ "nnz": 1127219
145
+ },
146
+ "model.layers.1.mlp.up_proj": {
147
+ "o1": 16,
148
+ "o2": 16,
149
+ "o3": 43,
150
+ "i1": 8,
151
+ "i2": 16,
152
+ "i3": 16,
153
+ "r0": 111,
154
+ "r1": 111,
155
+ "r2": 111,
156
+ "nnz": 1127219
157
+ },
158
+ "model.layers.1.mlp.down_proj": {
159
+ "o1": 8,
160
+ "o2": 16,
161
+ "o3": 16,
162
+ "i1": 16,
163
+ "i2": 16,
164
+ "i3": 43,
165
+ "r0": 111,
166
+ "r1": 111,
167
+ "r2": 111,
168
+ "nnz": 1127219
169
+ },
170
+ "model.layers.2.self_attn.q_proj": {
171
+ "o1": 8,
172
+ "o2": 16,
173
+ "o3": 16,
174
+ "i1": 8,
175
+ "i2": 16,
176
+ "i3": 16,
177
+ "r0": 64,
178
+ "r1": 64,
179
+ "r2": 68,
180
+ "nnz": 209715
181
+ },
182
+ "model.layers.2.self_attn.k_proj": {
183
+ "o1": 4,
184
+ "o2": 8,
185
+ "o3": 8,
186
+ "i1": 8,
187
+ "i2": 16,
188
+ "i3": 16,
189
+ "r0": 32,
190
+ "r1": 32,
191
+ "r2": 34,
192
+ "nnz": 26214
193
+ },
194
+ "model.layers.2.self_attn.v_proj": {
195
+ "o1": 4,
196
+ "o2": 8,
197
+ "o3": 8,
198
+ "i1": 8,
199
+ "i2": 16,
200
+ "i3": 16,
201
+ "r0": 32,
202
+ "r1": 32,
203
+ "r2": 34,
204
+ "nnz": 26214
205
+ },
206
+ "model.layers.2.self_attn.o_proj": {
207
+ "o1": 8,
208
+ "o2": 16,
209
+ "o3": 16,
210
+ "i1": 8,
211
+ "i2": 16,
212
+ "i3": 16,
213
+ "r0": 64,
214
+ "r1": 64,
215
+ "r2": 68,
216
+ "nnz": 209715
217
+ },
218
+ "model.layers.2.mlp.gate_proj": {
219
+ "o1": 16,
220
+ "o2": 16,
221
+ "o3": 43,
222
+ "i1": 8,
223
+ "i2": 16,
224
+ "i3": 16,
225
+ "r0": 111,
226
+ "r1": 111,
227
+ "r2": 111,
228
+ "nnz": 1127219
229
+ },
230
+ "model.layers.2.mlp.up_proj": {
231
+ "o1": 16,
232
+ "o2": 16,
233
+ "o3": 43,
234
+ "i1": 8,
235
+ "i2": 16,
236
+ "i3": 16,
237
+ "r0": 111,
238
+ "r1": 111,
239
+ "r2": 111,
240
+ "nnz": 1127219
241
+ },
242
+ "model.layers.2.mlp.down_proj": {
243
+ "o1": 8,
244
+ "o2": 16,
245
+ "o3": 16,
246
+ "i1": 16,
247
+ "i2": 16,
248
+ "i3": 43,
249
+ "r0": 111,
250
+ "r1": 111,
251
+ "r2": 111,
252
+ "nnz": 1127219
253
+ },
254
+ "model.layers.3.self_attn.q_proj": {
255
+ "o1": 8,
256
+ "o2": 16,
257
+ "o3": 16,
258
+ "i1": 8,
259
+ "i2": 16,
260
+ "i3": 16,
261
+ "r0": 64,
262
+ "r1": 64,
263
+ "r2": 68,
264
+ "nnz": 209715
265
+ },
266
+ "model.layers.3.self_attn.k_proj": {
267
+ "o1": 4,
268
+ "o2": 8,
269
+ "o3": 8,
270
+ "i1": 8,
271
+ "i2": 16,
272
+ "i3": 16,
273
+ "r0": 32,
274
+ "r1": 32,
275
+ "r2": 34,
276
+ "nnz": 26214
277
+ },
278
+ "model.layers.3.self_attn.v_proj": {
279
+ "o1": 4,
280
+ "o2": 8,
281
+ "o3": 8,
282
+ "i1": 8,
283
+ "i2": 16,
284
+ "i3": 16,
285
+ "r0": 32,
286
+ "r1": 32,
287
+ "r2": 34,
288
+ "nnz": 26214
289
+ },
290
+ "model.layers.3.self_attn.o_proj": {
291
+ "o1": 8,
292
+ "o2": 16,
293
+ "o3": 16,
294
+ "i1": 8,
295
+ "i2": 16,
296
+ "i3": 16,
297
+ "r0": 64,
298
+ "r1": 64,
299
+ "r2": 68,
300
+ "nnz": 209715
301
+ },
302
+ "model.layers.3.mlp.gate_proj": {
303
+ "o1": 16,
304
+ "o2": 16,
305
+ "o3": 43,
306
+ "i1": 8,
307
+ "i2": 16,
308
+ "i3": 16,
309
+ "r0": 111,
310
+ "r1": 111,
311
+ "r2": 111,
312
+ "nnz": 1127219
313
+ },
314
+ "model.layers.3.mlp.up_proj": {
315
+ "o1": 16,
316
+ "o2": 16,
317
+ "o3": 43,
318
+ "i1": 8,
319
+ "i2": 16,
320
+ "i3": 16,
321
+ "r0": 111,
322
+ "r1": 111,
323
+ "r2": 111,
324
+ "nnz": 1127219
325
+ },
326
+ "model.layers.3.mlp.down_proj": {
327
+ "o1": 8,
328
+ "o2": 16,
329
+ "o3": 16,
330
+ "i1": 16,
331
+ "i2": 16,
332
+ "i3": 43,
333
+ "r0": 111,
334
+ "r1": 111,
335
+ "r2": 111,
336
+ "nnz": 1127219
337
+ },
338
+ "model.layers.4.self_attn.q_proj": {
339
+ "o1": 8,
340
+ "o2": 16,
341
+ "o3": 16,
342
+ "i1": 8,
343
+ "i2": 16,
344
+ "i3": 16,
345
+ "r0": 64,
346
+ "r1": 64,
347
+ "r2": 68,
348
+ "nnz": 209715
349
+ },
350
+ "model.layers.4.self_attn.k_proj": {
351
+ "o1": 4,
352
+ "o2": 8,
353
+ "o3": 8,
354
+ "i1": 8,
355
+ "i2": 16,
356
+ "i3": 16,
357
+ "r0": 32,
358
+ "r1": 32,
359
+ "r2": 34,
360
+ "nnz": 26214
361
+ },
362
+ "model.layers.4.self_attn.v_proj": {
363
+ "o1": 4,
364
+ "o2": 8,
365
+ "o3": 8,
366
+ "i1": 8,
367
+ "i2": 16,
368
+ "i3": 16,
369
+ "r0": 32,
370
+ "r1": 32,
371
+ "r2": 34,
372
+ "nnz": 26214
373
+ },
374
+ "model.layers.4.self_attn.o_proj": {
375
+ "o1": 8,
376
+ "o2": 16,
377
+ "o3": 16,
378
+ "i1": 8,
379
+ "i2": 16,
380
+ "i3": 16,
381
+ "r0": 64,
382
+ "r1": 64,
383
+ "r2": 68,
384
+ "nnz": 209715
385
+ },
386
+ "model.layers.4.mlp.gate_proj": {
387
+ "o1": 16,
388
+ "o2": 16,
389
+ "o3": 43,
390
+ "i1": 8,
391
+ "i2": 16,
392
+ "i3": 16,
393
+ "r0": 111,
394
+ "r1": 111,
395
+ "r2": 111,
396
+ "nnz": 1127219
397
+ },
398
+ "model.layers.4.mlp.up_proj": {
399
+ "o1": 16,
400
+ "o2": 16,
401
+ "o3": 43,
402
+ "i1": 8,
403
+ "i2": 16,
404
+ "i3": 16,
405
+ "r0": 111,
406
+ "r1": 111,
407
+ "r2": 111,
408
+ "nnz": 1127219
409
+ },
410
+ "model.layers.4.mlp.down_proj": {
411
+ "o1": 8,
412
+ "o2": 16,
413
+ "o3": 16,
414
+ "i1": 16,
415
+ "i2": 16,
416
+ "i3": 43,
417
+ "r0": 111,
418
+ "r1": 111,
419
+ "r2": 111,
420
+ "nnz": 1127219
421
+ },
422
+ "model.layers.5.self_attn.q_proj": {
423
+ "o1": 8,
424
+ "o2": 16,
425
+ "o3": 16,
426
+ "i1": 8,
427
+ "i2": 16,
428
+ "i3": 16,
429
+ "r0": 64,
430
+ "r1": 64,
431
+ "r2": 68,
432
+ "nnz": 209715
433
+ },
434
+ "model.layers.5.self_attn.k_proj": {
435
+ "o1": 4,
436
+ "o2": 8,
437
+ "o3": 8,
438
+ "i1": 8,
439
+ "i2": 16,
440
+ "i3": 16,
441
+ "r0": 32,
442
+ "r1": 32,
443
+ "r2": 34,
444
+ "nnz": 26214
445
+ },
446
+ "model.layers.5.self_attn.v_proj": {
447
+ "o1": 4,
448
+ "o2": 8,
449
+ "o3": 8,
450
+ "i1": 8,
451
+ "i2": 16,
452
+ "i3": 16,
453
+ "r0": 32,
454
+ "r1": 32,
455
+ "r2": 34,
456
+ "nnz": 26214
457
+ },
458
+ "model.layers.5.self_attn.o_proj": {
459
+ "o1": 8,
460
+ "o2": 16,
461
+ "o3": 16,
462
+ "i1": 8,
463
+ "i2": 16,
464
+ "i3": 16,
465
+ "r0": 64,
466
+ "r1": 64,
467
+ "r2": 68,
468
+ "nnz": 209715
469
+ },
470
+ "model.layers.5.mlp.gate_proj": {
471
+ "o1": 16,
472
+ "o2": 16,
473
+ "o3": 43,
474
+ "i1": 8,
475
+ "i2": 16,
476
+ "i3": 16,
477
+ "r0": 111,
478
+ "r1": 111,
479
+ "r2": 111,
480
+ "nnz": 1127219
481
+ },
482
+ "model.layers.5.mlp.up_proj": {
483
+ "o1": 16,
484
+ "o2": 16,
485
+ "o3": 43,
486
+ "i1": 8,
487
+ "i2": 16,
488
+ "i3": 16,
489
+ "r0": 111,
490
+ "r1": 111,
491
+ "r2": 111,
492
+ "nnz": 1127219
493
+ },
494
+ "model.layers.5.mlp.down_proj": {
495
+ "o1": 8,
496
+ "o2": 16,
497
+ "o3": 16,
498
+ "i1": 16,
499
+ "i2": 16,
500
+ "i3": 43,
501
+ "r0": 111,
502
+ "r1": 111,
503
+ "r2": 111,
504
+ "nnz": 1127219
505
+ },
506
+ "model.layers.6.self_attn.q_proj": {
507
+ "o1": 8,
508
+ "o2": 16,
509
+ "o3": 16,
510
+ "i1": 8,
511
+ "i2": 16,
512
+ "i3": 16,
513
+ "r0": 64,
514
+ "r1": 64,
515
+ "r2": 68,
516
+ "nnz": 209715
517
+ },
518
+ "model.layers.6.self_attn.k_proj": {
519
+ "o1": 4,
520
+ "o2": 8,
521
+ "o3": 8,
522
+ "i1": 8,
523
+ "i2": 16,
524
+ "i3": 16,
525
+ "r0": 32,
526
+ "r1": 32,
527
+ "r2": 34,
528
+ "nnz": 26214
529
+ },
530
+ "model.layers.6.self_attn.v_proj": {
531
+ "o1": 4,
532
+ "o2": 8,
533
+ "o3": 8,
534
+ "i1": 8,
535
+ "i2": 16,
536
+ "i3": 16,
537
+ "r0": 32,
538
+ "r1": 32,
539
+ "r2": 34,
540
+ "nnz": 26214
541
+ },
542
+ "model.layers.6.self_attn.o_proj": {
543
+ "o1": 8,
544
+ "o2": 16,
545
+ "o3": 16,
546
+ "i1": 8,
547
+ "i2": 16,
548
+ "i3": 16,
549
+ "r0": 64,
550
+ "r1": 64,
551
+ "r2": 68,
552
+ "nnz": 209715
553
+ },
554
+ "model.layers.6.mlp.gate_proj": {
555
+ "o1": 16,
556
+ "o2": 16,
557
+ "o3": 43,
558
+ "i1": 8,
559
+ "i2": 16,
560
+ "i3": 16,
561
+ "r0": 111,
562
+ "r1": 111,
563
+ "r2": 111,
564
+ "nnz": 1127219
565
+ },
566
+ "model.layers.6.mlp.up_proj": {
567
+ "o1": 16,
568
+ "o2": 16,
569
+ "o3": 43,
570
+ "i1": 8,
571
+ "i2": 16,
572
+ "i3": 16,
573
+ "r0": 111,
574
+ "r1": 111,
575
+ "r2": 111,
576
+ "nnz": 1127219
577
+ },
578
+ "model.layers.6.mlp.down_proj": {
579
+ "o1": 8,
580
+ "o2": 16,
581
+ "o3": 16,
582
+ "i1": 16,
583
+ "i2": 16,
584
+ "i3": 43,
585
+ "r0": 111,
586
+ "r1": 111,
587
+ "r2": 111,
588
+ "nnz": 1127219
589
+ },
590
+ "model.layers.7.self_attn.q_proj": {
591
+ "o1": 8,
592
+ "o2": 16,
593
+ "o3": 16,
594
+ "i1": 8,
595
+ "i2": 16,
596
+ "i3": 16,
597
+ "r0": 64,
598
+ "r1": 64,
599
+ "r2": 68,
600
+ "nnz": 209715
601
+ },
602
+ "model.layers.7.self_attn.k_proj": {
603
+ "o1": 4,
604
+ "o2": 8,
605
+ "o3": 8,
606
+ "i1": 8,
607
+ "i2": 16,
608
+ "i3": 16,
609
+ "r0": 32,
610
+ "r1": 32,
611
+ "r2": 34,
612
+ "nnz": 26214
613
+ },
614
+ "model.layers.7.self_attn.v_proj": {
615
+ "o1": 4,
616
+ "o2": 8,
617
+ "o3": 8,
618
+ "i1": 8,
619
+ "i2": 16,
620
+ "i3": 16,
621
+ "r0": 32,
622
+ "r1": 32,
623
+ "r2": 34,
624
+ "nnz": 26214
625
+ },
626
+ "model.layers.7.self_attn.o_proj": {
627
+ "o1": 8,
628
+ "o2": 16,
629
+ "o3": 16,
630
+ "i1": 8,
631
+ "i2": 16,
632
+ "i3": 16,
633
+ "r0": 64,
634
+ "r1": 64,
635
+ "r2": 68,
636
+ "nnz": 209715
637
+ },
638
+ "model.layers.7.mlp.gate_proj": {
639
+ "o1": 16,
640
+ "o2": 16,
641
+ "o3": 43,
642
+ "i1": 8,
643
+ "i2": 16,
644
+ "i3": 16,
645
+ "r0": 111,
646
+ "r1": 111,
647
+ "r2": 111,
648
+ "nnz": 1127219
649
+ },
650
+ "model.layers.7.mlp.up_proj": {
651
+ "o1": 16,
652
+ "o2": 16,
653
+ "o3": 43,
654
+ "i1": 8,
655
+ "i2": 16,
656
+ "i3": 16,
657
+ "r0": 111,
658
+ "r1": 111,
659
+ "r2": 111,
660
+ "nnz": 1127219
661
+ },
662
+ "model.layers.7.mlp.down_proj": {
663
+ "o1": 8,
664
+ "o2": 16,
665
+ "o3": 16,
666
+ "i1": 16,
667
+ "i2": 16,
668
+ "i3": 43,
669
+ "r0": 111,
670
+ "r1": 111,
671
+ "r2": 111,
672
+ "nnz": 1127219
673
+ },
674
+ "model.layers.8.self_attn.q_proj": {
675
+ "o1": 8,
676
+ "o2": 16,
677
+ "o3": 16,
678
+ "i1": 8,
679
+ "i2": 16,
680
+ "i3": 16,
681
+ "r0": 64,
682
+ "r1": 64,
683
+ "r2": 68,
684
+ "nnz": 209715
685
+ },
686
+ "model.layers.8.self_attn.k_proj": {
687
+ "o1": 4,
688
+ "o2": 8,
689
+ "o3": 8,
690
+ "i1": 8,
691
+ "i2": 16,
692
+ "i3": 16,
693
+ "r0": 32,
694
+ "r1": 32,
695
+ "r2": 34,
696
+ "nnz": 26214
697
+ },
698
+ "model.layers.8.self_attn.v_proj": {
699
+ "o1": 4,
700
+ "o2": 8,
701
+ "o3": 8,
702
+ "i1": 8,
703
+ "i2": 16,
704
+ "i3": 16,
705
+ "r0": 32,
706
+ "r1": 32,
707
+ "r2": 34,
708
+ "nnz": 26214
709
+ },
710
+ "model.layers.8.self_attn.o_proj": {
711
+ "o1": 8,
712
+ "o2": 16,
713
+ "o3": 16,
714
+ "i1": 8,
715
+ "i2": 16,
716
+ "i3": 16,
717
+ "r0": 64,
718
+ "r1": 64,
719
+ "r2": 68,
720
+ "nnz": 209715
721
+ },
722
+ "model.layers.8.mlp.gate_proj": {
723
+ "o1": 16,
724
+ "o2": 16,
725
+ "o3": 43,
726
+ "i1": 8,
727
+ "i2": 16,
728
+ "i3": 16,
729
+ "r0": 111,
730
+ "r1": 111,
731
+ "r2": 111,
732
+ "nnz": 1127219
733
+ },
734
+ "model.layers.8.mlp.up_proj": {
735
+ "o1": 16,
736
+ "o2": 16,
737
+ "o3": 43,
738
+ "i1": 8,
739
+ "i2": 16,
740
+ "i3": 16,
741
+ "r0": 111,
742
+ "r1": 111,
743
+ "r2": 111,
744
+ "nnz": 1127219
745
+ },
746
+ "model.layers.8.mlp.down_proj": {
747
+ "o1": 8,
748
+ "o2": 16,
749
+ "o3": 16,
750
+ "i1": 16,
751
+ "i2": 16,
752
+ "i3": 43,
753
+ "r0": 111,
754
+ "r1": 111,
755
+ "r2": 111,
756
+ "nnz": 1127219
757
+ },
758
+ "model.layers.9.self_attn.q_proj": {
759
+ "o1": 8,
760
+ "o2": 16,
761
+ "o3": 16,
762
+ "i1": 8,
763
+ "i2": 16,
764
+ "i3": 16,
765
+ "r0": 64,
766
+ "r1": 64,
767
+ "r2": 68,
768
+ "nnz": 209715
769
+ },
770
+ "model.layers.9.self_attn.k_proj": {
771
+ "o1": 4,
772
+ "o2": 8,
773
+ "o3": 8,
774
+ "i1": 8,
775
+ "i2": 16,
776
+ "i3": 16,
777
+ "r0": 32,
778
+ "r1": 32,
779
+ "r2": 34,
780
+ "nnz": 26214
781
+ },
782
+ "model.layers.9.self_attn.v_proj": {
783
+ "o1": 4,
784
+ "o2": 8,
785
+ "o3": 8,
786
+ "i1": 8,
787
+ "i2": 16,
788
+ "i3": 16,
789
+ "r0": 32,
790
+ "r1": 32,
791
+ "r2": 34,
792
+ "nnz": 26214
793
+ },
794
+ "model.layers.9.self_attn.o_proj": {
795
+ "o1": 8,
796
+ "o2": 16,
797
+ "o3": 16,
798
+ "i1": 8,
799
+ "i2": 16,
800
+ "i3": 16,
801
+ "r0": 64,
802
+ "r1": 64,
803
+ "r2": 68,
804
+ "nnz": 209715
805
+ },
806
+ "model.layers.9.mlp.gate_proj": {
807
+ "o1": 16,
808
+ "o2": 16,
809
+ "o3": 43,
810
+ "i1": 8,
811
+ "i2": 16,
812
+ "i3": 16,
813
+ "r0": 111,
814
+ "r1": 111,
815
+ "r2": 111,
816
+ "nnz": 1127219
817
+ },
818
+ "model.layers.9.mlp.up_proj": {
819
+ "o1": 16,
820
+ "o2": 16,
821
+ "o3": 43,
822
+ "i1": 8,
823
+ "i2": 16,
824
+ "i3": 16,
825
+ "r0": 111,
826
+ "r1": 111,
827
+ "r2": 111,
828
+ "nnz": 1127219
829
+ },
830
+ "model.layers.9.mlp.down_proj": {
831
+ "o1": 8,
832
+ "o2": 16,
833
+ "o3": 16,
834
+ "i1": 16,
835
+ "i2": 16,
836
+ "i3": 43,
837
+ "r0": 111,
838
+ "r1": 111,
839
+ "r2": 111,
840
+ "nnz": 1127219
841
+ },
842
+ "model.layers.10.self_attn.q_proj": {
843
+ "o1": 8,
844
+ "o2": 16,
845
+ "o3": 16,
846
+ "i1": 8,
847
+ "i2": 16,
848
+ "i3": 16,
849
+ "r0": 64,
850
+ "r1": 64,
851
+ "r2": 68,
852
+ "nnz": 209715
853
+ },
854
+ "model.layers.10.self_attn.k_proj": {
855
+ "o1": 4,
856
+ "o2": 8,
857
+ "o3": 8,
858
+ "i1": 8,
859
+ "i2": 16,
860
+ "i3": 16,
861
+ "r0": 32,
862
+ "r1": 32,
863
+ "r2": 34,
864
+ "nnz": 26214
865
+ },
866
+ "model.layers.10.self_attn.v_proj": {
867
+ "o1": 4,
868
+ "o2": 8,
869
+ "o3": 8,
870
+ "i1": 8,
871
+ "i2": 16,
872
+ "i3": 16,
873
+ "r0": 32,
874
+ "r1": 32,
875
+ "r2": 34,
876
+ "nnz": 26214
877
+ },
878
+ "model.layers.10.self_attn.o_proj": {
879
+ "o1": 8,
880
+ "o2": 16,
881
+ "o3": 16,
882
+ "i1": 8,
883
+ "i2": 16,
884
+ "i3": 16,
885
+ "r0": 64,
886
+ "r1": 64,
887
+ "r2": 68,
888
+ "nnz": 209715
889
+ },
890
+ "model.layers.10.mlp.gate_proj": {
891
+ "o1": 16,
892
+ "o2": 16,
893
+ "o3": 43,
894
+ "i1": 8,
895
+ "i2": 16,
896
+ "i3": 16,
897
+ "r0": 111,
898
+ "r1": 111,
899
+ "r2": 111,
900
+ "nnz": 1127219
901
+ },
902
+ "model.layers.10.mlp.up_proj": {
903
+ "o1": 16,
904
+ "o2": 16,
905
+ "o3": 43,
906
+ "i1": 8,
907
+ "i2": 16,
908
+ "i3": 16,
909
+ "r0": 111,
910
+ "r1": 111,
911
+ "r2": 111,
912
+ "nnz": 1127219
913
+ },
914
+ "model.layers.10.mlp.down_proj": {
915
+ "o1": 8,
916
+ "o2": 16,
917
+ "o3": 16,
918
+ "i1": 16,
919
+ "i2": 16,
920
+ "i3": 43,
921
+ "r0": 111,
922
+ "r1": 111,
923
+ "r2": 111,
924
+ "nnz": 1127219
925
+ },
926
+ "model.layers.11.self_attn.q_proj": {
927
+ "o1": 8,
928
+ "o2": 16,
929
+ "o3": 16,
930
+ "i1": 8,
931
+ "i2": 16,
932
+ "i3": 16,
933
+ "r0": 64,
934
+ "r1": 64,
935
+ "r2": 68,
936
+ "nnz": 209715
937
+ },
938
+ "model.layers.11.self_attn.k_proj": {
939
+ "o1": 4,
940
+ "o2": 8,
941
+ "o3": 8,
942
+ "i1": 8,
943
+ "i2": 16,
944
+ "i3": 16,
945
+ "r0": 32,
946
+ "r1": 32,
947
+ "r2": 34,
948
+ "nnz": 26214
949
+ },
950
+ "model.layers.11.self_attn.v_proj": {
951
+ "o1": 4,
952
+ "o2": 8,
953
+ "o3": 8,
954
+ "i1": 8,
955
+ "i2": 16,
956
+ "i3": 16,
957
+ "r0": 32,
958
+ "r1": 32,
959
+ "r2": 34,
960
+ "nnz": 26214
961
+ },
962
+ "model.layers.11.self_attn.o_proj": {
963
+ "o1": 8,
964
+ "o2": 16,
965
+ "o3": 16,
966
+ "i1": 8,
967
+ "i2": 16,
968
+ "i3": 16,
969
+ "r0": 64,
970
+ "r1": 64,
971
+ "r2": 68,
972
+ "nnz": 209715
973
+ },
974
+ "model.layers.11.mlp.gate_proj": {
975
+ "o1": 16,
976
+ "o2": 16,
977
+ "o3": 43,
978
+ "i1": 8,
979
+ "i2": 16,
980
+ "i3": 16,
981
+ "r0": 111,
982
+ "r1": 111,
983
+ "r2": 111,
984
+ "nnz": 1127219
985
+ },
986
+ "model.layers.11.mlp.up_proj": {
987
+ "o1": 16,
988
+ "o2": 16,
989
+ "o3": 43,
990
+ "i1": 8,
991
+ "i2": 16,
992
+ "i3": 16,
993
+ "r0": 111,
994
+ "r1": 111,
995
+ "r2": 111,
996
+ "nnz": 1127219
997
+ },
998
+ "model.layers.11.mlp.down_proj": {
999
+ "o1": 8,
1000
+ "o2": 16,
1001
+ "o3": 16,
1002
+ "i1": 16,
1003
+ "i2": 16,
1004
+ "i3": 43,
1005
+ "r0": 111,
1006
+ "r1": 111,
1007
+ "r2": 111,
1008
+ "nnz": 1127219
1009
+ },
1010
+ "model.layers.12.self_attn.q_proj": {
1011
+ "o1": 8,
1012
+ "o2": 16,
1013
+ "o3": 16,
1014
+ "i1": 8,
1015
+ "i2": 16,
1016
+ "i3": 16,
1017
+ "r0": 64,
1018
+ "r1": 64,
1019
+ "r2": 68,
1020
+ "nnz": 209715
1021
+ },
1022
+ "model.layers.12.self_attn.k_proj": {
1023
+ "o1": 4,
1024
+ "o2": 8,
1025
+ "o3": 8,
1026
+ "i1": 8,
1027
+ "i2": 16,
1028
+ "i3": 16,
1029
+ "r0": 32,
1030
+ "r1": 32,
1031
+ "r2": 34,
1032
+ "nnz": 26214
1033
+ },
1034
+ "model.layers.12.self_attn.v_proj": {
1035
+ "o1": 4,
1036
+ "o2": 8,
1037
+ "o3": 8,
1038
+ "i1": 8,
1039
+ "i2": 16,
1040
+ "i3": 16,
1041
+ "r0": 32,
1042
+ "r1": 32,
1043
+ "r2": 34,
1044
+ "nnz": 26214
1045
+ },
1046
+ "model.layers.12.self_attn.o_proj": {
1047
+ "o1": 8,
1048
+ "o2": 16,
1049
+ "o3": 16,
1050
+ "i1": 8,
1051
+ "i2": 16,
1052
+ "i3": 16,
1053
+ "r0": 64,
1054
+ "r1": 64,
1055
+ "r2": 68,
1056
+ "nnz": 209715
1057
+ },
1058
+ "model.layers.12.mlp.gate_proj": {
1059
+ "o1": 16,
1060
+ "o2": 16,
1061
+ "o3": 43,
1062
+ "i1": 8,
1063
+ "i2": 16,
1064
+ "i3": 16,
1065
+ "r0": 111,
1066
+ "r1": 111,
1067
+ "r2": 111,
1068
+ "nnz": 1127219
1069
+ },
1070
+ "model.layers.12.mlp.up_proj": {
1071
+ "o1": 16,
1072
+ "o2": 16,
1073
+ "o3": 43,
1074
+ "i1": 8,
1075
+ "i2": 16,
1076
+ "i3": 16,
1077
+ "r0": 111,
1078
+ "r1": 111,
1079
+ "r2": 111,
1080
+ "nnz": 1127219
1081
+ },
1082
+ "model.layers.12.mlp.down_proj": {
1083
+ "o1": 8,
1084
+ "o2": 16,
1085
+ "o3": 16,
1086
+ "i1": 16,
1087
+ "i2": 16,
1088
+ "i3": 43,
1089
+ "r0": 111,
1090
+ "r1": 111,
1091
+ "r2": 111,
1092
+ "nnz": 1127219
1093
+ },
1094
+ "model.layers.13.self_attn.q_proj": {
1095
+ "o1": 8,
1096
+ "o2": 16,
1097
+ "o3": 16,
1098
+ "i1": 8,
1099
+ "i2": 16,
1100
+ "i3": 16,
1101
+ "r0": 64,
1102
+ "r1": 64,
1103
+ "r2": 68,
1104
+ "nnz": 209715
1105
+ },
1106
+ "model.layers.13.self_attn.k_proj": {
1107
+ "o1": 4,
1108
+ "o2": 8,
1109
+ "o3": 8,
1110
+ "i1": 8,
1111
+ "i2": 16,
1112
+ "i3": 16,
1113
+ "r0": 32,
1114
+ "r1": 32,
1115
+ "r2": 34,
1116
+ "nnz": 26214
1117
+ },
1118
+ "model.layers.13.self_attn.v_proj": {
1119
+ "o1": 4,
1120
+ "o2": 8,
1121
+ "o3": 8,
1122
+ "i1": 8,
1123
+ "i2": 16,
1124
+ "i3": 16,
1125
+ "r0": 32,
1126
+ "r1": 32,
1127
+ "r2": 34,
1128
+ "nnz": 26214
1129
+ },
1130
+ "model.layers.13.self_attn.o_proj": {
1131
+ "o1": 8,
1132
+ "o2": 16,
1133
+ "o3": 16,
1134
+ "i1": 8,
1135
+ "i2": 16,
1136
+ "i3": 16,
1137
+ "r0": 64,
1138
+ "r1": 64,
1139
+ "r2": 68,
1140
+ "nnz": 209715
1141
+ },
1142
+ "model.layers.13.mlp.gate_proj": {
1143
+ "o1": 16,
1144
+ "o2": 16,
1145
+ "o3": 43,
1146
+ "i1": 8,
1147
+ "i2": 16,
1148
+ "i3": 16,
1149
+ "r0": 111,
1150
+ "r1": 111,
1151
+ "r2": 111,
1152
+ "nnz": 1127219
1153
+ },
1154
+ "model.layers.13.mlp.up_proj": {
1155
+ "o1": 16,
1156
+ "o2": 16,
1157
+ "o3": 43,
1158
+ "i1": 8,
1159
+ "i2": 16,
1160
+ "i3": 16,
1161
+ "r0": 111,
1162
+ "r1": 111,
1163
+ "r2": 111,
1164
+ "nnz": 1127219
1165
+ },
1166
+ "model.layers.13.mlp.down_proj": {
1167
+ "o1": 8,
1168
+ "o2": 16,
1169
+ "o3": 16,
1170
+ "i1": 16,
1171
+ "i2": 16,
1172
+ "i3": 43,
1173
+ "r0": 111,
1174
+ "r1": 111,
1175
+ "r2": 111,
1176
+ "nnz": 1127219
1177
+ },
1178
+ "model.layers.14.self_attn.q_proj": {
1179
+ "o1": 8,
1180
+ "o2": 16,
1181
+ "o3": 16,
1182
+ "i1": 8,
1183
+ "i2": 16,
1184
+ "i3": 16,
1185
+ "r0": 64,
1186
+ "r1": 64,
1187
+ "r2": 68,
1188
+ "nnz": 209715
1189
+ },
1190
+ "model.layers.14.self_attn.k_proj": {
1191
+ "o1": 4,
1192
+ "o2": 8,
1193
+ "o3": 8,
1194
+ "i1": 8,
1195
+ "i2": 16,
1196
+ "i3": 16,
1197
+ "r0": 32,
1198
+ "r1": 32,
1199
+ "r2": 34,
1200
+ "nnz": 26214
1201
+ },
1202
+ "model.layers.14.self_attn.v_proj": {
1203
+ "o1": 4,
1204
+ "o2": 8,
1205
+ "o3": 8,
1206
+ "i1": 8,
1207
+ "i2": 16,
1208
+ "i3": 16,
1209
+ "r0": 32,
1210
+ "r1": 32,
1211
+ "r2": 34,
1212
+ "nnz": 26214
1213
+ },
1214
+ "model.layers.14.self_attn.o_proj": {
1215
+ "o1": 8,
1216
+ "o2": 16,
1217
+ "o3": 16,
1218
+ "i1": 8,
1219
+ "i2": 16,
1220
+ "i3": 16,
1221
+ "r0": 64,
1222
+ "r1": 64,
1223
+ "r2": 68,
1224
+ "nnz": 209715
1225
+ },
1226
+ "model.layers.14.mlp.gate_proj": {
1227
+ "o1": 16,
1228
+ "o2": 16,
1229
+ "o3": 43,
1230
+ "i1": 8,
1231
+ "i2": 16,
1232
+ "i3": 16,
1233
+ "r0": 111,
1234
+ "r1": 111,
1235
+ "r2": 111,
1236
+ "nnz": 1127219
1237
+ },
1238
+ "model.layers.14.mlp.up_proj": {
1239
+ "o1": 16,
1240
+ "o2": 16,
1241
+ "o3": 43,
1242
+ "i1": 8,
1243
+ "i2": 16,
1244
+ "i3": 16,
1245
+ "r0": 111,
1246
+ "r1": 111,
1247
+ "r2": 111,
1248
+ "nnz": 1127219
1249
+ },
1250
+ "model.layers.14.mlp.down_proj": {
1251
+ "o1": 8,
1252
+ "o2": 16,
1253
+ "o3": 16,
1254
+ "i1": 16,
1255
+ "i2": 16,
1256
+ "i3": 43,
1257
+ "r0": 111,
1258
+ "r1": 111,
1259
+ "r2": 111,
1260
+ "nnz": 1127219
1261
+ },
1262
+ "model.layers.15.self_attn.q_proj": {
1263
+ "o1": 8,
1264
+ "o2": 16,
1265
+ "o3": 16,
1266
+ "i1": 8,
1267
+ "i2": 16,
1268
+ "i3": 16,
1269
+ "r0": 64,
1270
+ "r1": 64,
1271
+ "r2": 68,
1272
+ "nnz": 209715
1273
+ },
1274
+ "model.layers.15.self_attn.k_proj": {
1275
+ "o1": 4,
1276
+ "o2": 8,
1277
+ "o3": 8,
1278
+ "i1": 8,
1279
+ "i2": 16,
1280
+ "i3": 16,
1281
+ "r0": 32,
1282
+ "r1": 32,
1283
+ "r2": 34,
1284
+ "nnz": 26214
1285
+ },
1286
+ "model.layers.15.self_attn.v_proj": {
1287
+ "o1": 4,
1288
+ "o2": 8,
1289
+ "o3": 8,
1290
+ "i1": 8,
1291
+ "i2": 16,
1292
+ "i3": 16,
1293
+ "r0": 32,
1294
+ "r1": 32,
1295
+ "r2": 34,
1296
+ "nnz": 26214
1297
+ },
1298
+ "model.layers.15.self_attn.o_proj": {
1299
+ "o1": 8,
1300
+ "o2": 16,
1301
+ "o3": 16,
1302
+ "i1": 8,
1303
+ "i2": 16,
1304
+ "i3": 16,
1305
+ "r0": 64,
1306
+ "r1": 64,
1307
+ "r2": 68,
1308
+ "nnz": 209715
1309
+ },
1310
+ "model.layers.15.mlp.gate_proj": {
1311
+ "o1": 16,
1312
+ "o2": 16,
1313
+ "o3": 43,
1314
+ "i1": 8,
1315
+ "i2": 16,
1316
+ "i3": 16,
1317
+ "r0": 111,
1318
+ "r1": 111,
1319
+ "r2": 111,
1320
+ "nnz": 1127219
1321
+ },
1322
+ "model.layers.15.mlp.up_proj": {
1323
+ "o1": 16,
1324
+ "o2": 16,
1325
+ "o3": 43,
1326
+ "i1": 8,
1327
+ "i2": 16,
1328
+ "i3": 16,
1329
+ "r0": 111,
1330
+ "r1": 111,
1331
+ "r2": 111,
1332
+ "nnz": 1127219
1333
+ },
1334
+ "model.layers.15.mlp.down_proj": {
1335
+ "o1": 8,
1336
+ "o2": 16,
1337
+ "o3": 16,
1338
+ "i1": 16,
1339
+ "i2": 16,
1340
+ "i3": 43,
1341
+ "r0": 111,
1342
+ "r1": 111,
1343
+ "r2": 111,
1344
+ "nnz": 1127219
1345
+ },
1346
+ "model.layers.16.self_attn.q_proj": {
1347
+ "o1": 8,
1348
+ "o2": 16,
1349
+ "o3": 16,
1350
+ "i1": 8,
1351
+ "i2": 16,
1352
+ "i3": 16,
1353
+ "r0": 64,
1354
+ "r1": 64,
1355
+ "r2": 68,
1356
+ "nnz": 209715
1357
+ },
1358
+ "model.layers.16.self_attn.k_proj": {
1359
+ "o1": 4,
1360
+ "o2": 8,
1361
+ "o3": 8,
1362
+ "i1": 8,
1363
+ "i2": 16,
1364
+ "i3": 16,
1365
+ "r0": 32,
1366
+ "r1": 32,
1367
+ "r2": 34,
1368
+ "nnz": 26214
1369
+ },
1370
+ "model.layers.16.self_attn.v_proj": {
1371
+ "o1": 4,
1372
+ "o2": 8,
1373
+ "o3": 8,
1374
+ "i1": 8,
1375
+ "i2": 16,
1376
+ "i3": 16,
1377
+ "r0": 32,
1378
+ "r1": 32,
1379
+ "r2": 34,
1380
+ "nnz": 26214
1381
+ },
1382
+ "model.layers.16.self_attn.o_proj": {
1383
+ "o1": 8,
1384
+ "o2": 16,
1385
+ "o3": 16,
1386
+ "i1": 8,
1387
+ "i2": 16,
1388
+ "i3": 16,
1389
+ "r0": 64,
1390
+ "r1": 64,
1391
+ "r2": 68,
1392
+ "nnz": 209715
1393
+ },
1394
+ "model.layers.16.mlp.gate_proj": {
1395
+ "o1": 16,
1396
+ "o2": 16,
1397
+ "o3": 43,
1398
+ "i1": 8,
1399
+ "i2": 16,
1400
+ "i3": 16,
1401
+ "r0": 111,
1402
+ "r1": 111,
1403
+ "r2": 111,
1404
+ "nnz": 1127219
1405
+ },
1406
+ "model.layers.16.mlp.up_proj": {
1407
+ "o1": 16,
1408
+ "o2": 16,
1409
+ "o3": 43,
1410
+ "i1": 8,
1411
+ "i2": 16,
1412
+ "i3": 16,
1413
+ "r0": 111,
1414
+ "r1": 111,
1415
+ "r2": 111,
1416
+ "nnz": 1127219
1417
+ },
1418
+ "model.layers.16.mlp.down_proj": {
1419
+ "o1": 8,
1420
+ "o2": 16,
1421
+ "o3": 16,
1422
+ "i1": 16,
1423
+ "i2": 16,
1424
+ "i3": 43,
1425
+ "r0": 111,
1426
+ "r1": 111,
1427
+ "r2": 111,
1428
+ "nnz": 1127219
1429
+ },
1430
+ "model.layers.17.self_attn.q_proj": {
1431
+ "o1": 8,
1432
+ "o2": 16,
1433
+ "o3": 16,
1434
+ "i1": 8,
1435
+ "i2": 16,
1436
+ "i3": 16,
1437
+ "r0": 64,
1438
+ "r1": 64,
1439
+ "r2": 68,
1440
+ "nnz": 209715
1441
+ },
1442
+ "model.layers.17.self_attn.k_proj": {
1443
+ "o1": 4,
1444
+ "o2": 8,
1445
+ "o3": 8,
1446
+ "i1": 8,
1447
+ "i2": 16,
1448
+ "i3": 16,
1449
+ "r0": 32,
1450
+ "r1": 32,
1451
+ "r2": 34,
1452
+ "nnz": 26214
1453
+ },
1454
+ "model.layers.17.self_attn.v_proj": {
1455
+ "o1": 4,
1456
+ "o2": 8,
1457
+ "o3": 8,
1458
+ "i1": 8,
1459
+ "i2": 16,
1460
+ "i3": 16,
1461
+ "r0": 32,
1462
+ "r1": 32,
1463
+ "r2": 34,
1464
+ "nnz": 26214
1465
+ },
1466
+ "model.layers.17.self_attn.o_proj": {
1467
+ "o1": 8,
1468
+ "o2": 16,
1469
+ "o3": 16,
1470
+ "i1": 8,
1471
+ "i2": 16,
1472
+ "i3": 16,
1473
+ "r0": 64,
1474
+ "r1": 64,
1475
+ "r2": 68,
1476
+ "nnz": 209715
1477
+ },
1478
+ "model.layers.17.mlp.gate_proj": {
1479
+ "o1": 16,
1480
+ "o2": 16,
1481
+ "o3": 43,
1482
+ "i1": 8,
1483
+ "i2": 16,
1484
+ "i3": 16,
1485
+ "r0": 111,
1486
+ "r1": 111,
1487
+ "r2": 111,
1488
+ "nnz": 1127219
1489
+ },
1490
+ "model.layers.17.mlp.up_proj": {
1491
+ "o1": 16,
1492
+ "o2": 16,
1493
+ "o3": 43,
1494
+ "i1": 8,
1495
+ "i2": 16,
1496
+ "i3": 16,
1497
+ "r0": 111,
1498
+ "r1": 111,
1499
+ "r2": 111,
1500
+ "nnz": 1127219
1501
+ },
1502
+ "model.layers.17.mlp.down_proj": {
1503
+ "o1": 8,
1504
+ "o2": 16,
1505
+ "o3": 16,
1506
+ "i1": 16,
1507
+ "i2": 16,
1508
+ "i3": 43,
1509
+ "r0": 111,
1510
+ "r1": 111,
1511
+ "r2": 111,
1512
+ "nnz": 1127219
1513
+ },
1514
+ "model.layers.18.self_attn.q_proj": {
1515
+ "o1": 8,
1516
+ "o2": 16,
1517
+ "o3": 16,
1518
+ "i1": 8,
1519
+ "i2": 16,
1520
+ "i3": 16,
1521
+ "r0": 64,
1522
+ "r1": 64,
1523
+ "r2": 68,
1524
+ "nnz": 209715
1525
+ },
1526
+ "model.layers.18.self_attn.k_proj": {
1527
+ "o1": 4,
1528
+ "o2": 8,
1529
+ "o3": 8,
1530
+ "i1": 8,
1531
+ "i2": 16,
1532
+ "i3": 16,
1533
+ "r0": 32,
1534
+ "r1": 32,
1535
+ "r2": 34,
1536
+ "nnz": 26214
1537
+ },
1538
+ "model.layers.18.self_attn.v_proj": {
1539
+ "o1": 4,
1540
+ "o2": 8,
1541
+ "o3": 8,
1542
+ "i1": 8,
1543
+ "i2": 16,
1544
+ "i3": 16,
1545
+ "r0": 32,
1546
+ "r1": 32,
1547
+ "r2": 34,
1548
+ "nnz": 26214
1549
+ },
1550
+ "model.layers.18.self_attn.o_proj": {
1551
+ "o1": 8,
1552
+ "o2": 16,
1553
+ "o3": 16,
1554
+ "i1": 8,
1555
+ "i2": 16,
1556
+ "i3": 16,
1557
+ "r0": 64,
1558
+ "r1": 64,
1559
+ "r2": 68,
1560
+ "nnz": 209715
1561
+ },
1562
+ "model.layers.18.mlp.gate_proj": {
1563
+ "o1": 16,
1564
+ "o2": 16,
1565
+ "o3": 43,
1566
+ "i1": 8,
1567
+ "i2": 16,
1568
+ "i3": 16,
1569
+ "r0": 111,
1570
+ "r1": 111,
1571
+ "r2": 111,
1572
+ "nnz": 1127219
1573
+ },
1574
+ "model.layers.18.mlp.up_proj": {
1575
+ "o1": 16,
1576
+ "o2": 16,
1577
+ "o3": 43,
1578
+ "i1": 8,
1579
+ "i2": 16,
1580
+ "i3": 16,
1581
+ "r0": 111,
1582
+ "r1": 111,
1583
+ "r2": 111,
1584
+ "nnz": 1127219
1585
+ },
1586
+ "model.layers.18.mlp.down_proj": {
1587
+ "o1": 8,
1588
+ "o2": 16,
1589
+ "o3": 16,
1590
+ "i1": 16,
1591
+ "i2": 16,
1592
+ "i3": 43,
1593
+ "r0": 111,
1594
+ "r1": 111,
1595
+ "r2": 111,
1596
+ "nnz": 1127219
1597
+ },
1598
+ "model.layers.19.self_attn.q_proj": {
1599
+ "o1": 8,
1600
+ "o2": 16,
1601
+ "o3": 16,
1602
+ "i1": 8,
1603
+ "i2": 16,
1604
+ "i3": 16,
1605
+ "r0": 64,
1606
+ "r1": 64,
1607
+ "r2": 68,
1608
+ "nnz": 209715
1609
+ },
1610
+ "model.layers.19.self_attn.k_proj": {
1611
+ "o1": 4,
1612
+ "o2": 8,
1613
+ "o3": 8,
1614
+ "i1": 8,
1615
+ "i2": 16,
1616
+ "i3": 16,
1617
+ "r0": 32,
1618
+ "r1": 32,
1619
+ "r2": 34,
1620
+ "nnz": 26214
1621
+ },
1622
+ "model.layers.19.self_attn.v_proj": {
1623
+ "o1": 4,
1624
+ "o2": 8,
1625
+ "o3": 8,
1626
+ "i1": 8,
1627
+ "i2": 16,
1628
+ "i3": 16,
1629
+ "r0": 32,
1630
+ "r1": 32,
1631
+ "r2": 34,
1632
+ "nnz": 26214
1633
+ },
1634
+ "model.layers.19.self_attn.o_proj": {
1635
+ "o1": 8,
1636
+ "o2": 16,
1637
+ "o3": 16,
1638
+ "i1": 8,
1639
+ "i2": 16,
1640
+ "i3": 16,
1641
+ "r0": 64,
1642
+ "r1": 64,
1643
+ "r2": 68,
1644
+ "nnz": 209715
1645
+ },
1646
+ "model.layers.19.mlp.gate_proj": {
1647
+ "o1": 16,
1648
+ "o2": 16,
1649
+ "o3": 43,
1650
+ "i1": 8,
1651
+ "i2": 16,
1652
+ "i3": 16,
1653
+ "r0": 111,
1654
+ "r1": 111,
1655
+ "r2": 111,
1656
+ "nnz": 1127219
1657
+ },
1658
+ "model.layers.19.mlp.up_proj": {
1659
+ "o1": 16,
1660
+ "o2": 16,
1661
+ "o3": 43,
1662
+ "i1": 8,
1663
+ "i2": 16,
1664
+ "i3": 16,
1665
+ "r0": 111,
1666
+ "r1": 111,
1667
+ "r2": 111,
1668
+ "nnz": 1127219
1669
+ },
1670
+ "model.layers.19.mlp.down_proj": {
1671
+ "o1": 8,
1672
+ "o2": 16,
1673
+ "o3": 16,
1674
+ "i1": 16,
1675
+ "i2": 16,
1676
+ "i3": 43,
1677
+ "r0": 111,
1678
+ "r1": 111,
1679
+ "r2": 111,
1680
+ "nnz": 1127219
1681
+ },
1682
+ "model.layers.20.self_attn.q_proj": {
1683
+ "o1": 8,
1684
+ "o2": 16,
1685
+ "o3": 16,
1686
+ "i1": 8,
1687
+ "i2": 16,
1688
+ "i3": 16,
1689
+ "r0": 64,
1690
+ "r1": 64,
1691
+ "r2": 68,
1692
+ "nnz": 209715
1693
+ },
1694
+ "model.layers.20.self_attn.k_proj": {
1695
+ "o1": 4,
1696
+ "o2": 8,
1697
+ "o3": 8,
1698
+ "i1": 8,
1699
+ "i2": 16,
1700
+ "i3": 16,
1701
+ "r0": 32,
1702
+ "r1": 32,
1703
+ "r2": 34,
1704
+ "nnz": 26214
1705
+ },
1706
+ "model.layers.20.self_attn.v_proj": {
1707
+ "o1": 4,
1708
+ "o2": 8,
1709
+ "o3": 8,
1710
+ "i1": 8,
1711
+ "i2": 16,
1712
+ "i3": 16,
1713
+ "r0": 32,
1714
+ "r1": 32,
1715
+ "r2": 34,
1716
+ "nnz": 26214
1717
+ },
1718
+ "model.layers.20.self_attn.o_proj": {
1719
+ "o1": 8,
1720
+ "o2": 16,
1721
+ "o3": 16,
1722
+ "i1": 8,
1723
+ "i2": 16,
1724
+ "i3": 16,
1725
+ "r0": 64,
1726
+ "r1": 64,
1727
+ "r2": 68,
1728
+ "nnz": 209715
1729
+ },
1730
+ "model.layers.20.mlp.gate_proj": {
1731
+ "o1": 16,
1732
+ "o2": 16,
1733
+ "o3": 43,
1734
+ "i1": 8,
1735
+ "i2": 16,
1736
+ "i3": 16,
1737
+ "r0": 111,
1738
+ "r1": 111,
1739
+ "r2": 111,
1740
+ "nnz": 1127219
1741
+ },
1742
+ "model.layers.20.mlp.up_proj": {
1743
+ "o1": 16,
1744
+ "o2": 16,
1745
+ "o3": 43,
1746
+ "i1": 8,
1747
+ "i2": 16,
1748
+ "i3": 16,
1749
+ "r0": 111,
1750
+ "r1": 111,
1751
+ "r2": 111,
1752
+ "nnz": 1127219
1753
+ },
1754
+ "model.layers.20.mlp.down_proj": {
1755
+ "o1": 8,
1756
+ "o2": 16,
1757
+ "o3": 16,
1758
+ "i1": 16,
1759
+ "i2": 16,
1760
+ "i3": 43,
1761
+ "r0": 111,
1762
+ "r1": 111,
1763
+ "r2": 111,
1764
+ "nnz": 1127219
1765
+ },
1766
+ "model.layers.21.self_attn.q_proj": {
1767
+ "o1": 8,
1768
+ "o2": 16,
1769
+ "o3": 16,
1770
+ "i1": 8,
1771
+ "i2": 16,
1772
+ "i3": 16,
1773
+ "r0": 64,
1774
+ "r1": 64,
1775
+ "r2": 68,
1776
+ "nnz": 209715
1777
+ },
1778
+ "model.layers.21.self_attn.k_proj": {
1779
+ "o1": 4,
1780
+ "o2": 8,
1781
+ "o3": 8,
1782
+ "i1": 8,
1783
+ "i2": 16,
1784
+ "i3": 16,
1785
+ "r0": 32,
1786
+ "r1": 32,
1787
+ "r2": 34,
1788
+ "nnz": 26214
1789
+ },
1790
+ "model.layers.21.self_attn.v_proj": {
1791
+ "o1": 4,
1792
+ "o2": 8,
1793
+ "o3": 8,
1794
+ "i1": 8,
1795
+ "i2": 16,
1796
+ "i3": 16,
1797
+ "r0": 32,
1798
+ "r1": 32,
1799
+ "r2": 34,
1800
+ "nnz": 26214
1801
+ },
1802
+ "model.layers.21.self_attn.o_proj": {
1803
+ "o1": 8,
1804
+ "o2": 16,
1805
+ "o3": 16,
1806
+ "i1": 8,
1807
+ "i2": 16,
1808
+ "i3": 16,
1809
+ "r0": 64,
1810
+ "r1": 64,
1811
+ "r2": 68,
1812
+ "nnz": 209715
1813
+ },
1814
+ "model.layers.21.mlp.gate_proj": {
1815
+ "o1": 16,
1816
+ "o2": 16,
1817
+ "o3": 43,
1818
+ "i1": 8,
1819
+ "i2": 16,
1820
+ "i3": 16,
1821
+ "r0": 111,
1822
+ "r1": 111,
1823
+ "r2": 111,
1824
+ "nnz": 1127219
1825
+ },
1826
+ "model.layers.21.mlp.up_proj": {
1827
+ "o1": 16,
1828
+ "o2": 16,
1829
+ "o3": 43,
1830
+ "i1": 8,
1831
+ "i2": 16,
1832
+ "i3": 16,
1833
+ "r0": 111,
1834
+ "r1": 111,
1835
+ "r2": 111,
1836
+ "nnz": 1127219
1837
+ },
1838
+ "model.layers.21.mlp.down_proj": {
1839
+ "o1": 8,
1840
+ "o2": 16,
1841
+ "o3": 16,
1842
+ "i1": 16,
1843
+ "i2": 16,
1844
+ "i3": 43,
1845
+ "r0": 111,
1846
+ "r1": 111,
1847
+ "r2": 111,
1848
+ "nnz": 1127219
1849
+ },
1850
+ "model.layers.22.self_attn.q_proj": {
1851
+ "o1": 8,
1852
+ "o2": 16,
1853
+ "o3": 16,
1854
+ "i1": 8,
1855
+ "i2": 16,
1856
+ "i3": 16,
1857
+ "r0": 64,
1858
+ "r1": 64,
1859
+ "r2": 68,
1860
+ "nnz": 209715
1861
+ },
1862
+ "model.layers.22.self_attn.k_proj": {
1863
+ "o1": 4,
1864
+ "o2": 8,
1865
+ "o3": 8,
1866
+ "i1": 8,
1867
+ "i2": 16,
1868
+ "i3": 16,
1869
+ "r0": 32,
1870
+ "r1": 32,
1871
+ "r2": 34,
1872
+ "nnz": 26214
1873
+ },
1874
+ "model.layers.22.self_attn.v_proj": {
1875
+ "o1": 4,
1876
+ "o2": 8,
1877
+ "o3": 8,
1878
+ "i1": 8,
1879
+ "i2": 16,
1880
+ "i3": 16,
1881
+ "r0": 32,
1882
+ "r1": 32,
1883
+ "r2": 34,
1884
+ "nnz": 26214
1885
+ },
1886
+ "model.layers.22.self_attn.o_proj": {
1887
+ "o1": 8,
1888
+ "o2": 16,
1889
+ "o3": 16,
1890
+ "i1": 8,
1891
+ "i2": 16,
1892
+ "i3": 16,
1893
+ "r0": 64,
1894
+ "r1": 64,
1895
+ "r2": 68,
1896
+ "nnz": 209715
1897
+ },
1898
+ "model.layers.22.mlp.gate_proj": {
1899
+ "o1": 16,
1900
+ "o2": 16,
1901
+ "o3": 43,
1902
+ "i1": 8,
1903
+ "i2": 16,
1904
+ "i3": 16,
1905
+ "r0": 111,
1906
+ "r1": 111,
1907
+ "r2": 111,
1908
+ "nnz": 1127219
1909
+ },
1910
+ "model.layers.22.mlp.up_proj": {
1911
+ "o1": 16,
1912
+ "o2": 16,
1913
+ "o3": 43,
1914
+ "i1": 8,
1915
+ "i2": 16,
1916
+ "i3": 16,
1917
+ "r0": 111,
1918
+ "r1": 111,
1919
+ "r2": 111,
1920
+ "nnz": 1127219
1921
+ },
1922
+ "model.layers.22.mlp.down_proj": {
1923
+ "o1": 8,
1924
+ "o2": 16,
1925
+ "o3": 16,
1926
+ "i1": 16,
1927
+ "i2": 16,
1928
+ "i3": 43,
1929
+ "r0": 111,
1930
+ "r1": 111,
1931
+ "r2": 111,
1932
+ "nnz": 1127219
1933
+ },
1934
+ "model.layers.23.self_attn.q_proj": {
1935
+ "o1": 8,
1936
+ "o2": 16,
1937
+ "o3": 16,
1938
+ "i1": 8,
1939
+ "i2": 16,
1940
+ "i3": 16,
1941
+ "r0": 64,
1942
+ "r1": 64,
1943
+ "r2": 68,
1944
+ "nnz": 209715
1945
+ },
1946
+ "model.layers.23.self_attn.k_proj": {
1947
+ "o1": 4,
1948
+ "o2": 8,
1949
+ "o3": 8,
1950
+ "i1": 8,
1951
+ "i2": 16,
1952
+ "i3": 16,
1953
+ "r0": 32,
1954
+ "r1": 32,
1955
+ "r2": 34,
1956
+ "nnz": 26214
1957
+ },
1958
+ "model.layers.23.self_attn.v_proj": {
1959
+ "o1": 4,
1960
+ "o2": 8,
1961
+ "o3": 8,
1962
+ "i1": 8,
1963
+ "i2": 16,
1964
+ "i3": 16,
1965
+ "r0": 32,
1966
+ "r1": 32,
1967
+ "r2": 34,
1968
+ "nnz": 26214
1969
+ },
1970
+ "model.layers.23.self_attn.o_proj": {
1971
+ "o1": 8,
1972
+ "o2": 16,
1973
+ "o3": 16,
1974
+ "i1": 8,
1975
+ "i2": 16,
1976
+ "i3": 16,
1977
+ "r0": 64,
1978
+ "r1": 64,
1979
+ "r2": 68,
1980
+ "nnz": 209715
1981
+ },
1982
+ "model.layers.23.mlp.gate_proj": {
1983
+ "o1": 16,
1984
+ "o2": 16,
1985
+ "o3": 43,
1986
+ "i1": 8,
1987
+ "i2": 16,
1988
+ "i3": 16,
1989
+ "r0": 111,
1990
+ "r1": 111,
1991
+ "r2": 111,
1992
+ "nnz": 1127219
1993
+ },
1994
+ "model.layers.23.mlp.up_proj": {
1995
+ "o1": 16,
1996
+ "o2": 16,
1997
+ "o3": 43,
1998
+ "i1": 8,
1999
+ "i2": 16,
2000
+ "i3": 16,
2001
+ "r0": 111,
2002
+ "r1": 111,
2003
+ "r2": 111,
2004
+ "nnz": 1127219
2005
+ },
2006
+ "model.layers.23.mlp.down_proj": {
2007
+ "o1": 8,
2008
+ "o2": 16,
2009
+ "o3": 16,
2010
+ "i1": 16,
2011
+ "i2": 16,
2012
+ "i3": 43,
2013
+ "r0": 111,
2014
+ "r1": 111,
2015
+ "r2": 111,
2016
+ "nnz": 1127219
2017
+ },
2018
+ "model.layers.24.self_attn.q_proj": {
2019
+ "o1": 8,
2020
+ "o2": 16,
2021
+ "o3": 16,
2022
+ "i1": 8,
2023
+ "i2": 16,
2024
+ "i3": 16,
2025
+ "r0": 64,
2026
+ "r1": 64,
2027
+ "r2": 68,
2028
+ "nnz": 209715
2029
+ },
2030
+ "model.layers.24.self_attn.k_proj": {
2031
+ "o1": 4,
2032
+ "o2": 8,
2033
+ "o3": 8,
2034
+ "i1": 8,
2035
+ "i2": 16,
2036
+ "i3": 16,
2037
+ "r0": 32,
2038
+ "r1": 32,
2039
+ "r2": 34,
2040
+ "nnz": 26214
2041
+ },
2042
+ "model.layers.24.self_attn.v_proj": {
2043
+ "o1": 4,
2044
+ "o2": 8,
2045
+ "o3": 8,
2046
+ "i1": 8,
2047
+ "i2": 16,
2048
+ "i3": 16,
2049
+ "r0": 32,
2050
+ "r1": 32,
2051
+ "r2": 34,
2052
+ "nnz": 26214
2053
+ },
2054
+ "model.layers.24.self_attn.o_proj": {
2055
+ "o1": 8,
2056
+ "o2": 16,
2057
+ "o3": 16,
2058
+ "i1": 8,
2059
+ "i2": 16,
2060
+ "i3": 16,
2061
+ "r0": 64,
2062
+ "r1": 64,
2063
+ "r2": 68,
2064
+ "nnz": 209715
2065
+ },
2066
+ "model.layers.24.mlp.gate_proj": {
2067
+ "o1": 16,
2068
+ "o2": 16,
2069
+ "o3": 43,
2070
+ "i1": 8,
2071
+ "i2": 16,
2072
+ "i3": 16,
2073
+ "r0": 111,
2074
+ "r1": 111,
2075
+ "r2": 111,
2076
+ "nnz": 1127219
2077
+ },
2078
+ "model.layers.24.mlp.up_proj": {
2079
+ "o1": 16,
2080
+ "o2": 16,
2081
+ "o3": 43,
2082
+ "i1": 8,
2083
+ "i2": 16,
2084
+ "i3": 16,
2085
+ "r0": 111,
2086
+ "r1": 111,
2087
+ "r2": 111,
2088
+ "nnz": 1127219
2089
+ },
2090
+ "model.layers.24.mlp.down_proj": {
2091
+ "o1": 8,
2092
+ "o2": 16,
2093
+ "o3": 16,
2094
+ "i1": 16,
2095
+ "i2": 16,
2096
+ "i3": 43,
2097
+ "r0": 111,
2098
+ "r1": 111,
2099
+ "r2": 111,
2100
+ "nnz": 1127219
2101
+ },
2102
+ "model.layers.25.self_attn.q_proj": {
2103
+ "o1": 8,
2104
+ "o2": 16,
2105
+ "o3": 16,
2106
+ "i1": 8,
2107
+ "i2": 16,
2108
+ "i3": 16,
2109
+ "r0": 64,
2110
+ "r1": 64,
2111
+ "r2": 68,
2112
+ "nnz": 209715
2113
+ },
2114
+ "model.layers.25.self_attn.k_proj": {
2115
+ "o1": 4,
2116
+ "o2": 8,
2117
+ "o3": 8,
2118
+ "i1": 8,
2119
+ "i2": 16,
2120
+ "i3": 16,
2121
+ "r0": 32,
2122
+ "r1": 32,
2123
+ "r2": 34,
2124
+ "nnz": 26214
2125
+ },
2126
+ "model.layers.25.self_attn.v_proj": {
2127
+ "o1": 4,
2128
+ "o2": 8,
2129
+ "o3": 8,
2130
+ "i1": 8,
2131
+ "i2": 16,
2132
+ "i3": 16,
2133
+ "r0": 32,
2134
+ "r1": 32,
2135
+ "r2": 34,
2136
+ "nnz": 26214
2137
+ },
2138
+ "model.layers.25.self_attn.o_proj": {
2139
+ "o1": 8,
2140
+ "o2": 16,
2141
+ "o3": 16,
2142
+ "i1": 8,
2143
+ "i2": 16,
2144
+ "i3": 16,
2145
+ "r0": 64,
2146
+ "r1": 64,
2147
+ "r2": 68,
2148
+ "nnz": 209715
2149
+ },
2150
+ "model.layers.25.mlp.gate_proj": {
2151
+ "o1": 16,
2152
+ "o2": 16,
2153
+ "o3": 43,
2154
+ "i1": 8,
2155
+ "i2": 16,
2156
+ "i3": 16,
2157
+ "r0": 111,
2158
+ "r1": 111,
2159
+ "r2": 111,
2160
+ "nnz": 1127219
2161
+ },
2162
+ "model.layers.25.mlp.up_proj": {
2163
+ "o1": 16,
2164
+ "o2": 16,
2165
+ "o3": 43,
2166
+ "i1": 8,
2167
+ "i2": 16,
2168
+ "i3": 16,
2169
+ "r0": 111,
2170
+ "r1": 111,
2171
+ "r2": 111,
2172
+ "nnz": 1127219
2173
+ },
2174
+ "model.layers.25.mlp.down_proj": {
2175
+ "o1": 8,
2176
+ "o2": 16,
2177
+ "o3": 16,
2178
+ "i1": 16,
2179
+ "i2": 16,
2180
+ "i3": 43,
2181
+ "r0": 111,
2182
+ "r1": 111,
2183
+ "r2": 111,
2184
+ "nnz": 1127219
2185
+ },
2186
+ "model.layers.26.self_attn.q_proj": {
2187
+ "o1": 8,
2188
+ "o2": 16,
2189
+ "o3": 16,
2190
+ "i1": 8,
2191
+ "i2": 16,
2192
+ "i3": 16,
2193
+ "r0": 64,
2194
+ "r1": 64,
2195
+ "r2": 68,
2196
+ "nnz": 209715
2197
+ },
2198
+ "model.layers.26.self_attn.k_proj": {
2199
+ "o1": 4,
2200
+ "o2": 8,
2201
+ "o3": 8,
2202
+ "i1": 8,
2203
+ "i2": 16,
2204
+ "i3": 16,
2205
+ "r0": 32,
2206
+ "r1": 32,
2207
+ "r2": 34,
2208
+ "nnz": 26214
2209
+ },
2210
+ "model.layers.26.self_attn.v_proj": {
2211
+ "o1": 4,
2212
+ "o2": 8,
2213
+ "o3": 8,
2214
+ "i1": 8,
2215
+ "i2": 16,
2216
+ "i3": 16,
2217
+ "r0": 32,
2218
+ "r1": 32,
2219
+ "r2": 34,
2220
+ "nnz": 26214
2221
+ },
2222
+ "model.layers.26.self_attn.o_proj": {
2223
+ "o1": 8,
2224
+ "o2": 16,
2225
+ "o3": 16,
2226
+ "i1": 8,
2227
+ "i2": 16,
2228
+ "i3": 16,
2229
+ "r0": 64,
2230
+ "r1": 64,
2231
+ "r2": 68,
2232
+ "nnz": 209715
2233
+ },
2234
+ "model.layers.26.mlp.gate_proj": {
2235
+ "o1": 16,
2236
+ "o2": 16,
2237
+ "o3": 43,
2238
+ "i1": 8,
2239
+ "i2": 16,
2240
+ "i3": 16,
2241
+ "r0": 111,
2242
+ "r1": 111,
2243
+ "r2": 111,
2244
+ "nnz": 1127219
2245
+ },
2246
+ "model.layers.26.mlp.up_proj": {
2247
+ "o1": 16,
2248
+ "o2": 16,
2249
+ "o3": 43,
2250
+ "i1": 8,
2251
+ "i2": 16,
2252
+ "i3": 16,
2253
+ "r0": 111,
2254
+ "r1": 111,
2255
+ "r2": 111,
2256
+ "nnz": 1127219
2257
+ },
2258
+ "model.layers.26.mlp.down_proj": {
2259
+ "o1": 8,
2260
+ "o2": 16,
2261
+ "o3": 16,
2262
+ "i1": 16,
2263
+ "i2": 16,
2264
+ "i3": 43,
2265
+ "r0": 111,
2266
+ "r1": 111,
2267
+ "r2": 111,
2268
+ "nnz": 1127219
2269
+ },
2270
+ "model.layers.27.self_attn.q_proj": {
2271
+ "o1": 8,
2272
+ "o2": 16,
2273
+ "o3": 16,
2274
+ "i1": 8,
2275
+ "i2": 16,
2276
+ "i3": 16,
2277
+ "r0": 64,
2278
+ "r1": 64,
2279
+ "r2": 68,
2280
+ "nnz": 209715
2281
+ },
2282
+ "model.layers.27.self_attn.k_proj": {
2283
+ "o1": 4,
2284
+ "o2": 8,
2285
+ "o3": 8,
2286
+ "i1": 8,
2287
+ "i2": 16,
2288
+ "i3": 16,
2289
+ "r0": 32,
2290
+ "r1": 32,
2291
+ "r2": 34,
2292
+ "nnz": 26214
2293
+ },
2294
+ "model.layers.27.self_attn.v_proj": {
2295
+ "o1": 4,
2296
+ "o2": 8,
2297
+ "o3": 8,
2298
+ "i1": 8,
2299
+ "i2": 16,
2300
+ "i3": 16,
2301
+ "r0": 32,
2302
+ "r1": 32,
2303
+ "r2": 34,
2304
+ "nnz": 26214
2305
+ },
2306
+ "model.layers.27.self_attn.o_proj": {
2307
+ "o1": 8,
2308
+ "o2": 16,
2309
+ "o3": 16,
2310
+ "i1": 8,
2311
+ "i2": 16,
2312
+ "i3": 16,
2313
+ "r0": 64,
2314
+ "r1": 64,
2315
+ "r2": 68,
2316
+ "nnz": 209715
2317
+ },
2318
+ "model.layers.27.mlp.gate_proj": {
2319
+ "o1": 16,
2320
+ "o2": 16,
2321
+ "o3": 43,
2322
+ "i1": 8,
2323
+ "i2": 16,
2324
+ "i3": 16,
2325
+ "r0": 111,
2326
+ "r1": 111,
2327
+ "r2": 111,
2328
+ "nnz": 1127219
2329
+ },
2330
+ "model.layers.27.mlp.up_proj": {
2331
+ "o1": 16,
2332
+ "o2": 16,
2333
+ "o3": 43,
2334
+ "i1": 8,
2335
+ "i2": 16,
2336
+ "i3": 16,
2337
+ "r0": 111,
2338
+ "r1": 111,
2339
+ "r2": 111,
2340
+ "nnz": 1127219
2341
+ },
2342
+ "model.layers.27.mlp.down_proj": {
2343
+ "o1": 8,
2344
+ "o2": 16,
2345
+ "o3": 16,
2346
+ "i1": 16,
2347
+ "i2": 16,
2348
+ "i3": 43,
2349
+ "r0": 111,
2350
+ "r1": 111,
2351
+ "r2": 111,
2352
+ "nnz": 1127219
2353
+ },
2354
+ "model.layers.28.self_attn.q_proj": {
2355
+ "o1": 8,
2356
+ "o2": 16,
2357
+ "o3": 16,
2358
+ "i1": 8,
2359
+ "i2": 16,
2360
+ "i3": 16,
2361
+ "r0": 64,
2362
+ "r1": 64,
2363
+ "r2": 68,
2364
+ "nnz": 209715
2365
+ },
2366
+ "model.layers.28.self_attn.k_proj": {
2367
+ "o1": 4,
2368
+ "o2": 8,
2369
+ "o3": 8,
2370
+ "i1": 8,
2371
+ "i2": 16,
2372
+ "i3": 16,
2373
+ "r0": 32,
2374
+ "r1": 32,
2375
+ "r2": 34,
2376
+ "nnz": 26214
2377
+ },
2378
+ "model.layers.28.self_attn.v_proj": {
2379
+ "o1": 4,
2380
+ "o2": 8,
2381
+ "o3": 8,
2382
+ "i1": 8,
2383
+ "i2": 16,
2384
+ "i3": 16,
2385
+ "r0": 32,
2386
+ "r1": 32,
2387
+ "r2": 34,
2388
+ "nnz": 26214
2389
+ },
2390
+ "model.layers.28.self_attn.o_proj": {
2391
+ "o1": 8,
2392
+ "o2": 16,
2393
+ "o3": 16,
2394
+ "i1": 8,
2395
+ "i2": 16,
2396
+ "i3": 16,
2397
+ "r0": 64,
2398
+ "r1": 64,
2399
+ "r2": 68,
2400
+ "nnz": 209715
2401
+ },
2402
+ "model.layers.28.mlp.gate_proj": {
2403
+ "o1": 16,
2404
+ "o2": 16,
2405
+ "o3": 43,
2406
+ "i1": 8,
2407
+ "i2": 16,
2408
+ "i3": 16,
2409
+ "r0": 111,
2410
+ "r1": 111,
2411
+ "r2": 111,
2412
+ "nnz": 1127219
2413
+ },
2414
+ "model.layers.28.mlp.up_proj": {
2415
+ "o1": 16,
2416
+ "o2": 16,
2417
+ "o3": 43,
2418
+ "i1": 8,
2419
+ "i2": 16,
2420
+ "i3": 16,
2421
+ "r0": 111,
2422
+ "r1": 111,
2423
+ "r2": 111,
2424
+ "nnz": 1127219
2425
+ },
2426
+ "model.layers.28.mlp.down_proj": {
2427
+ "o1": 8,
2428
+ "o2": 16,
2429
+ "o3": 16,
2430
+ "i1": 16,
2431
+ "i2": 16,
2432
+ "i3": 43,
2433
+ "r0": 111,
2434
+ "r1": 111,
2435
+ "r2": 111,
2436
+ "nnz": 1127219
2437
+ },
2438
+ "model.layers.29.self_attn.q_proj": {
2439
+ "o1": 8,
2440
+ "o2": 16,
2441
+ "o3": 16,
2442
+ "i1": 8,
2443
+ "i2": 16,
2444
+ "i3": 16,
2445
+ "r0": 64,
2446
+ "r1": 64,
2447
+ "r2": 68,
2448
+ "nnz": 209715
2449
+ },
2450
+ "model.layers.29.self_attn.k_proj": {
2451
+ "o1": 4,
2452
+ "o2": 8,
2453
+ "o3": 8,
2454
+ "i1": 8,
2455
+ "i2": 16,
2456
+ "i3": 16,
2457
+ "r0": 32,
2458
+ "r1": 32,
2459
+ "r2": 34,
2460
+ "nnz": 26214
2461
+ },
2462
+ "model.layers.29.self_attn.v_proj": {
2463
+ "o1": 4,
2464
+ "o2": 8,
2465
+ "o3": 8,
2466
+ "i1": 8,
2467
+ "i2": 16,
2468
+ "i3": 16,
2469
+ "r0": 32,
2470
+ "r1": 32,
2471
+ "r2": 34,
2472
+ "nnz": 26214
2473
+ },
2474
+ "model.layers.29.self_attn.o_proj": {
2475
+ "o1": 8,
2476
+ "o2": 16,
2477
+ "o3": 16,
2478
+ "i1": 8,
2479
+ "i2": 16,
2480
+ "i3": 16,
2481
+ "r0": 64,
2482
+ "r1": 64,
2483
+ "r2": 68,
2484
+ "nnz": 209715
2485
+ },
2486
+ "model.layers.29.mlp.gate_proj": {
2487
+ "o1": 16,
2488
+ "o2": 16,
2489
+ "o3": 43,
2490
+ "i1": 8,
2491
+ "i2": 16,
2492
+ "i3": 16,
2493
+ "r0": 111,
2494
+ "r1": 111,
2495
+ "r2": 111,
2496
+ "nnz": 1127219
2497
+ },
2498
+ "model.layers.29.mlp.up_proj": {
2499
+ "o1": 16,
2500
+ "o2": 16,
2501
+ "o3": 43,
2502
+ "i1": 8,
2503
+ "i2": 16,
2504
+ "i3": 16,
2505
+ "r0": 111,
2506
+ "r1": 111,
2507
+ "r2": 111,
2508
+ "nnz": 1127219
2509
+ },
2510
+ "model.layers.29.mlp.down_proj": {
2511
+ "o1": 8,
2512
+ "o2": 16,
2513
+ "o3": 16,
2514
+ "i1": 16,
2515
+ "i2": 16,
2516
+ "i3": 43,
2517
+ "r0": 111,
2518
+ "r1": 111,
2519
+ "r2": 111,
2520
+ "nnz": 1127219
2521
+ },
2522
+ "model.layers.30.self_attn.q_proj": {
2523
+ "o1": 8,
2524
+ "o2": 16,
2525
+ "o3": 16,
2526
+ "i1": 8,
2527
+ "i2": 16,
2528
+ "i3": 16,
2529
+ "r0": 64,
2530
+ "r1": 64,
2531
+ "r2": 68,
2532
+ "nnz": 209715
2533
+ },
2534
+ "model.layers.30.self_attn.k_proj": {
2535
+ "o1": 4,
2536
+ "o2": 8,
2537
+ "o3": 8,
2538
+ "i1": 8,
2539
+ "i2": 16,
2540
+ "i3": 16,
2541
+ "r0": 32,
2542
+ "r1": 32,
2543
+ "r2": 34,
2544
+ "nnz": 26214
2545
+ },
2546
+ "model.layers.30.self_attn.v_proj": {
2547
+ "o1": 4,
2548
+ "o2": 8,
2549
+ "o3": 8,
2550
+ "i1": 8,
2551
+ "i2": 16,
2552
+ "i3": 16,
2553
+ "r0": 32,
2554
+ "r1": 32,
2555
+ "r2": 34,
2556
+ "nnz": 26214
2557
+ },
2558
+ "model.layers.30.self_attn.o_proj": {
2559
+ "o1": 8,
2560
+ "o2": 16,
2561
+ "o3": 16,
2562
+ "i1": 8,
2563
+ "i2": 16,
2564
+ "i3": 16,
2565
+ "r0": 64,
2566
+ "r1": 64,
2567
+ "r2": 68,
2568
+ "nnz": 209715
2569
+ },
2570
+ "model.layers.30.mlp.gate_proj": {
2571
+ "o1": 16,
2572
+ "o2": 16,
2573
+ "o3": 43,
2574
+ "i1": 8,
2575
+ "i2": 16,
2576
+ "i3": 16,
2577
+ "r0": 111,
2578
+ "r1": 111,
2579
+ "r2": 111,
2580
+ "nnz": 1127219
2581
+ },
2582
+ "model.layers.30.mlp.up_proj": {
2583
+ "o1": 16,
2584
+ "o2": 16,
2585
+ "o3": 43,
2586
+ "i1": 8,
2587
+ "i2": 16,
2588
+ "i3": 16,
2589
+ "r0": 111,
2590
+ "r1": 111,
2591
+ "r2": 111,
2592
+ "nnz": 1127219
2593
+ },
2594
+ "model.layers.30.mlp.down_proj": {
2595
+ "o1": 8,
2596
+ "o2": 16,
2597
+ "o3": 16,
2598
+ "i1": 16,
2599
+ "i2": 16,
2600
+ "i3": 43,
2601
+ "r0": 111,
2602
+ "r1": 111,
2603
+ "r2": 111,
2604
+ "nnz": 1127219
2605
+ },
2606
+ "model.layers.31.self_attn.q_proj": {
2607
+ "o1": 8,
2608
+ "o2": 16,
2609
+ "o3": 16,
2610
+ "i1": 8,
2611
+ "i2": 16,
2612
+ "i3": 16,
2613
+ "r0": 64,
2614
+ "r1": 64,
2615
+ "r2": 68,
2616
+ "nnz": 209715
2617
+ },
2618
+ "model.layers.31.self_attn.k_proj": {
2619
+ "o1": 4,
2620
+ "o2": 8,
2621
+ "o3": 8,
2622
+ "i1": 8,
2623
+ "i2": 16,
2624
+ "i3": 16,
2625
+ "r0": 32,
2626
+ "r1": 32,
2627
+ "r2": 34,
2628
+ "nnz": 26214
2629
+ },
2630
+ "model.layers.31.self_attn.v_proj": {
2631
+ "o1": 4,
2632
+ "o2": 8,
2633
+ "o3": 8,
2634
+ "i1": 8,
2635
+ "i2": 16,
2636
+ "i3": 16,
2637
+ "r0": 32,
2638
+ "r1": 32,
2639
+ "r2": 34,
2640
+ "nnz": 26214
2641
+ },
2642
+ "model.layers.31.self_attn.o_proj": {
2643
+ "o1": 8,
2644
+ "o2": 16,
2645
+ "o3": 16,
2646
+ "i1": 8,
2647
+ "i2": 16,
2648
+ "i3": 16,
2649
+ "r0": 64,
2650
+ "r1": 64,
2651
+ "r2": 68,
2652
+ "nnz": 209715
2653
+ },
2654
+ "model.layers.31.mlp.gate_proj": {
2655
+ "o1": 16,
2656
+ "o2": 16,
2657
+ "o3": 43,
2658
+ "i1": 8,
2659
+ "i2": 16,
2660
+ "i3": 16,
2661
+ "r0": 111,
2662
+ "r1": 111,
2663
+ "r2": 111,
2664
+ "nnz": 1127219
2665
+ },
2666
+ "model.layers.31.mlp.up_proj": {
2667
+ "o1": 16,
2668
+ "o2": 16,
2669
+ "o3": 43,
2670
+ "i1": 8,
2671
+ "i2": 16,
2672
+ "i3": 16,
2673
+ "r0": 111,
2674
+ "r1": 111,
2675
+ "r2": 111,
2676
+ "nnz": 1127219
2677
+ },
2678
+ "model.layers.31.mlp.down_proj": {
2679
+ "o1": 8,
2680
+ "o2": 16,
2681
+ "o3": 16,
2682
+ "i1": 16,
2683
+ "i2": 16,
2684
+ "i3": 43,
2685
+ "r0": 111,
2686
+ "r1": 111,
2687
+ "r2": 111,
2688
+ "nnz": 1127219
2689
+ },
2690
+ "model.layers.32.self_attn.q_proj": {
2691
+ "o1": 8,
2692
+ "o2": 16,
2693
+ "o3": 16,
2694
+ "i1": 8,
2695
+ "i2": 16,
2696
+ "i3": 16,
2697
+ "r0": 64,
2698
+ "r1": 64,
2699
+ "r2": 68,
2700
+ "nnz": 209715
2701
+ },
2702
+ "model.layers.32.self_attn.k_proj": {
2703
+ "o1": 4,
2704
+ "o2": 8,
2705
+ "o3": 8,
2706
+ "i1": 8,
2707
+ "i2": 16,
2708
+ "i3": 16,
2709
+ "r0": 32,
2710
+ "r1": 32,
2711
+ "r2": 34,
2712
+ "nnz": 26214
2713
+ },
2714
+ "model.layers.32.self_attn.v_proj": {
2715
+ "o1": 4,
2716
+ "o2": 8,
2717
+ "o3": 8,
2718
+ "i1": 8,
2719
+ "i2": 16,
2720
+ "i3": 16,
2721
+ "r0": 32,
2722
+ "r1": 32,
2723
+ "r2": 34,
2724
+ "nnz": 26214
2725
+ },
2726
+ "model.layers.32.self_attn.o_proj": {
2727
+ "o1": 8,
2728
+ "o2": 16,
2729
+ "o3": 16,
2730
+ "i1": 8,
2731
+ "i2": 16,
2732
+ "i3": 16,
2733
+ "r0": 64,
2734
+ "r1": 64,
2735
+ "r2": 68,
2736
+ "nnz": 209715
2737
+ },
2738
+ "model.layers.32.mlp.gate_proj": {
2739
+ "o1": 16,
2740
+ "o2": 16,
2741
+ "o3": 43,
2742
+ "i1": 8,
2743
+ "i2": 16,
2744
+ "i3": 16,
2745
+ "r0": 111,
2746
+ "r1": 111,
2747
+ "r2": 111,
2748
+ "nnz": 1127219
2749
+ },
2750
+ "model.layers.32.mlp.up_proj": {
2751
+ "o1": 16,
2752
+ "o2": 16,
2753
+ "o3": 43,
2754
+ "i1": 8,
2755
+ "i2": 16,
2756
+ "i3": 16,
2757
+ "r0": 111,
2758
+ "r1": 111,
2759
+ "r2": 111,
2760
+ "nnz": 1127219
2761
+ },
2762
+ "model.layers.32.mlp.down_proj": {
2763
+ "o1": 8,
2764
+ "o2": 16,
2765
+ "o3": 16,
2766
+ "i1": 16,
2767
+ "i2": 16,
2768
+ "i3": 43,
2769
+ "r0": 111,
2770
+ "r1": 111,
2771
+ "r2": 111,
2772
+ "nnz": 1127219
2773
+ },
2774
+ "model.layers.33.self_attn.q_proj": {
2775
+ "o1": 8,
2776
+ "o2": 16,
2777
+ "o3": 16,
2778
+ "i1": 8,
2779
+ "i2": 16,
2780
+ "i3": 16,
2781
+ "r0": 64,
2782
+ "r1": 64,
2783
+ "r2": 68,
2784
+ "nnz": 209715
2785
+ },
2786
+ "model.layers.33.self_attn.k_proj": {
2787
+ "o1": 4,
2788
+ "o2": 8,
2789
+ "o3": 8,
2790
+ "i1": 8,
2791
+ "i2": 16,
2792
+ "i3": 16,
2793
+ "r0": 32,
2794
+ "r1": 32,
2795
+ "r2": 34,
2796
+ "nnz": 26214
2797
+ },
2798
+ "model.layers.33.self_attn.v_proj": {
2799
+ "o1": 4,
2800
+ "o2": 8,
2801
+ "o3": 8,
2802
+ "i1": 8,
2803
+ "i2": 16,
2804
+ "i3": 16,
2805
+ "r0": 32,
2806
+ "r1": 32,
2807
+ "r2": 34,
2808
+ "nnz": 26214
2809
+ },
2810
+ "model.layers.33.self_attn.o_proj": {
2811
+ "o1": 8,
2812
+ "o2": 16,
2813
+ "o3": 16,
2814
+ "i1": 8,
2815
+ "i2": 16,
2816
+ "i3": 16,
2817
+ "r0": 64,
2818
+ "r1": 64,
2819
+ "r2": 68,
2820
+ "nnz": 209715
2821
+ },
2822
+ "model.layers.33.mlp.gate_proj": {
2823
+ "o1": 16,
2824
+ "o2": 16,
2825
+ "o3": 43,
2826
+ "i1": 8,
2827
+ "i2": 16,
2828
+ "i3": 16,
2829
+ "r0": 111,
2830
+ "r1": 111,
2831
+ "r2": 111,
2832
+ "nnz": 1127219
2833
+ },
2834
+ "model.layers.33.mlp.up_proj": {
2835
+ "o1": 16,
2836
+ "o2": 16,
2837
+ "o3": 43,
2838
+ "i1": 8,
2839
+ "i2": 16,
2840
+ "i3": 16,
2841
+ "r0": 111,
2842
+ "r1": 111,
2843
+ "r2": 111,
2844
+ "nnz": 1127219
2845
+ },
2846
+ "model.layers.33.mlp.down_proj": {
2847
+ "o1": 8,
2848
+ "o2": 16,
2849
+ "o3": 16,
2850
+ "i1": 16,
2851
+ "i2": 16,
2852
+ "i3": 43,
2853
+ "r0": 111,
2854
+ "r1": 111,
2855
+ "r2": 111,
2856
+ "nnz": 1127219
2857
+ },
2858
+ "model.layers.34.self_attn.q_proj": {
2859
+ "o1": 8,
2860
+ "o2": 16,
2861
+ "o3": 16,
2862
+ "i1": 8,
2863
+ "i2": 16,
2864
+ "i3": 16,
2865
+ "r0": 64,
2866
+ "r1": 64,
2867
+ "r2": 68,
2868
+ "nnz": 209715
2869
+ },
2870
+ "model.layers.34.self_attn.k_proj": {
2871
+ "o1": 4,
2872
+ "o2": 8,
2873
+ "o3": 8,
2874
+ "i1": 8,
2875
+ "i2": 16,
2876
+ "i3": 16,
2877
+ "r0": 32,
2878
+ "r1": 32,
2879
+ "r2": 34,
2880
+ "nnz": 26214
2881
+ },
2882
+ "model.layers.34.self_attn.v_proj": {
2883
+ "o1": 4,
2884
+ "o2": 8,
2885
+ "o3": 8,
2886
+ "i1": 8,
2887
+ "i2": 16,
2888
+ "i3": 16,
2889
+ "r0": 32,
2890
+ "r1": 32,
2891
+ "r2": 34,
2892
+ "nnz": 26214
2893
+ },
2894
+ "model.layers.34.self_attn.o_proj": {
2895
+ "o1": 8,
2896
+ "o2": 16,
2897
+ "o3": 16,
2898
+ "i1": 8,
2899
+ "i2": 16,
2900
+ "i3": 16,
2901
+ "r0": 64,
2902
+ "r1": 64,
2903
+ "r2": 68,
2904
+ "nnz": 209715
2905
+ },
2906
+ "model.layers.34.mlp.gate_proj": {
2907
+ "o1": 16,
2908
+ "o2": 16,
2909
+ "o3": 43,
2910
+ "i1": 8,
2911
+ "i2": 16,
2912
+ "i3": 16,
2913
+ "r0": 111,
2914
+ "r1": 111,
2915
+ "r2": 111,
2916
+ "nnz": 1127219
2917
+ },
2918
+ "model.layers.34.mlp.up_proj": {
2919
+ "o1": 16,
2920
+ "o2": 16,
2921
+ "o3": 43,
2922
+ "i1": 8,
2923
+ "i2": 16,
2924
+ "i3": 16,
2925
+ "r0": 111,
2926
+ "r1": 111,
2927
+ "r2": 111,
2928
+ "nnz": 1127219
2929
+ },
2930
+ "model.layers.34.mlp.down_proj": {
2931
+ "o1": 8,
2932
+ "o2": 16,
2933
+ "o3": 16,
2934
+ "i1": 16,
2935
+ "i2": 16,
2936
+ "i3": 43,
2937
+ "r0": 111,
2938
+ "r1": 111,
2939
+ "r2": 111,
2940
+ "nnz": 1127219
2941
+ },
2942
+ "model.layers.35.self_attn.q_proj": {
2943
+ "o1": 8,
2944
+ "o2": 16,
2945
+ "o3": 16,
2946
+ "i1": 8,
2947
+ "i2": 16,
2948
+ "i3": 16,
2949
+ "r0": 64,
2950
+ "r1": 64,
2951
+ "r2": 68,
2952
+ "nnz": 209715
2953
+ },
2954
+ "model.layers.35.self_attn.k_proj": {
2955
+ "o1": 4,
2956
+ "o2": 8,
2957
+ "o3": 8,
2958
+ "i1": 8,
2959
+ "i2": 16,
2960
+ "i3": 16,
2961
+ "r0": 32,
2962
+ "r1": 32,
2963
+ "r2": 34,
2964
+ "nnz": 26214
2965
+ },
2966
+ "model.layers.35.self_attn.v_proj": {
2967
+ "o1": 4,
2968
+ "o2": 8,
2969
+ "o3": 8,
2970
+ "i1": 8,
2971
+ "i2": 16,
2972
+ "i3": 16,
2973
+ "r0": 32,
2974
+ "r1": 32,
2975
+ "r2": 34,
2976
+ "nnz": 26214
2977
+ },
2978
+ "model.layers.35.self_attn.o_proj": {
2979
+ "o1": 8,
2980
+ "o2": 16,
2981
+ "o3": 16,
2982
+ "i1": 8,
2983
+ "i2": 16,
2984
+ "i3": 16,
2985
+ "r0": 64,
2986
+ "r1": 64,
2987
+ "r2": 68,
2988
+ "nnz": 209715
2989
+ },
2990
+ "model.layers.35.mlp.gate_proj": {
2991
+ "o1": 16,
2992
+ "o2": 16,
2993
+ "o3": 43,
2994
+ "i1": 8,
2995
+ "i2": 16,
2996
+ "i3": 16,
2997
+ "r0": 111,
2998
+ "r1": 111,
2999
+ "r2": 111,
3000
+ "nnz": 1127219
3001
+ },
3002
+ "model.layers.35.mlp.up_proj": {
3003
+ "o1": 16,
3004
+ "o2": 16,
3005
+ "o3": 43,
3006
+ "i1": 8,
3007
+ "i2": 16,
3008
+ "i3": 16,
3009
+ "r0": 111,
3010
+ "r1": 111,
3011
+ "r2": 111,
3012
+ "nnz": 1127219
3013
+ },
3014
+ "model.layers.35.mlp.down_proj": {
3015
+ "o1": 8,
3016
+ "o2": 16,
3017
+ "o3": 16,
3018
+ "i1": 16,
3019
+ "i2": 16,
3020
+ "i3": 43,
3021
+ "r0": 111,
3022
+ "r1": 111,
3023
+ "r2": 111,
3024
+ "nnz": 1127219
3025
+ }
3026
+ }
tr3/heal/qwen2.5-3b/state_dict_fp16.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:069a91b82dad7429469cb26cc747927e6b85f97937d5a6e45a82d83a5afc6e00
3
+ size 5889266183
tr3/heal/qwen2.5-3b/tensor_formats.py ADDED
@@ -0,0 +1,768 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ """General N-core tensor formats for a linear layer: tensor train (MPO) and tensor ring.
4
+
5
+ WHY THIS EXISTS. The 2-core and 3-core results say the tensorisation step, not the healing
6
+ step, is where the leverage is: at equal parameters the 3-core beat the 2-core AFTER healing
7
+ at both budgets tried (4.72B: 38.94 vs ~36.5 full MMLU at 60M tokens; 5.74B: 44.91 vs 41.54
8
+ probe), and it got there on roughly a quarter of the tokens. That invites two orthogonal
9
+ questions this module exists to answer: how many cores, and which topology.
10
+
11
+ TENSOR TRAIN vs TENSOR RING. A TT/MPO pins the two boundary bonds to 1 -- the chain has open
12
+ ends. A tensor ring closes the chain: core k has shape (r_{k-1}, d_k, r_k) with r_N == r_0,
13
+ and the weight is the TRACE of the cyclic product. TT is exactly the TR special case r_0 = 1,
14
+ so at equal ranks TR is strictly more expressive. It is also strictly harder to fit: TT-SVD
15
+ is a sequence of Eckart-Young-optimal truncations, while a ring has no such closed form, so
16
+ TR is fitted here by TT initialisation followed by alternating least squares. That asymmetry
17
+ matters when reading results -- a TR loss could mean "the format is worse" OR "the fit did
18
+ not converge", so `fit_tr` reports its per-sweep error curve and refuses to return a fit
19
+ worse than its own TT initialisation.
20
+
21
+ INDEX CONVENTION (shared with mpo2.py / mpo3.py). Output mode k travels with input mode k:
22
+
23
+ R(W)[d_1, ..., d_N] = W[(o_1..o_N), (i_1..i_N)], d_k = (o_k, i_k) flattened
24
+
25
+ Every mode must be > 1. A mode of 1 collapses a site and silently reduces the core count,
26
+ which would make an "N-core" result actually be an (N-1)-core one.
27
+
28
+ WHITENING is diagonal and factorised across the N input modes, as in mpo3.py: the whitening
29
+ is then a mode-local rescaling that survives the fit exactly and un-whitens by division.
30
+ """
31
+
32
+ import torch
33
+
34
+
35
+ # --------------------------------------------------------------------------- rearrangement
36
+ def rearrange_n(W: torch.Tensor, osplit, isplit) -> torch.Tensor:
37
+ """W[(o_1..o_N),(i_1..i_N)] -> R[d_1,...,d_N] with d_k = o_k*i_k."""
38
+ n = len(osplit)
39
+ if len(isplit) != n:
40
+ raise ValueError("output and input must be split into the same number of modes")
41
+ perm = [j for k in range(n) for j in (k, n + k)]
42
+ return (W.reshape(*osplit, *isplit).permute(*perm)
43
+ .reshape(*[o * i for o, i in zip(osplit, isplit)]))
44
+
45
+
46
+ def inv_rearrange_n(R: torch.Tensor, osplit, isplit) -> torch.Tensor:
47
+ """Inverse of `rearrange_n`."""
48
+ n = len(osplit)
49
+ inter = [x for k in range(n) for x in (osplit[k], isplit[k])]
50
+ perm = list(range(0, 2 * n, 2)) + list(range(1, 2 * n, 2))
51
+ o = 1
52
+ i = 1
53
+ for k in range(n):
54
+ o *= osplit[k]
55
+ i *= isplit[k]
56
+ return R.reshape(*inter).permute(*perm).reshape(o, i)
57
+
58
+
59
+ def _apply_scales(R: torch.Tensor, osplit, isplit, scales, invert: bool):
60
+ """Multiply (or divide) R by sqrt(d_k[i_k]) along each input mode, in place of a dense L."""
61
+ n = len(osplit)
62
+ shape = [x for k in range(n) for x in (osplit[k], isplit[k])]
63
+ T = R.reshape(*shape)
64
+ for k in range(n):
65
+ s = scales[k].clamp_min(1e-12).sqrt()
66
+ view = [1] * (2 * n)
67
+ view[2 * k + 1] = isplit[k]
68
+ T = T / s.view(*view) if invert else T * s.view(*view)
69
+ return T.reshape(R.shape)
70
+
71
+
72
+ # --------------------------------------------------------------------------- contraction
73
+ def contract_tt(cores) -> torch.Tensor:
74
+ """Contract TT cores [(1,d1,r1), (r1,d2,r2), ..., (r_{N-1},dN,1)] -> R[d_1,...,d_N]."""
75
+ out = cores[0]
76
+ for g in cores[1:]:
77
+ a, b = out.shape[-1], g.shape[0]
78
+ if a != b:
79
+ raise ValueError(f"TT bond mismatch {a} vs {b}")
80
+ out = torch.tensordot(out, g, dims=([out.dim() - 1], [0]))
81
+ if out.shape[0] != 1 or out.shape[-1] != 1:
82
+ raise ValueError("TT boundary bonds must be 1")
83
+ return out.reshape(*out.shape[1:-1])
84
+
85
+
86
+ def contract_tr(cores, chunk: int = 0) -> torch.Tensor:
87
+ """Contract TR cores [(r0,d1,r1), ..., (r_{N-1},dN,r0)] -> R[d_1,...,d_N].
88
+
89
+ The obvious route -- chain every tensordot, then take the diagonal over the two ring
90
+ indices -- materialises (r_0, d_1..d_N, r_0), i.e. r_0^2 times the size of the ANSWER.
91
+ On one LLaMA attention layer at ring rank 118 that is 934 GB, so it does not merely run
92
+ slowly, it cannot run at all. Folding the last contraction and the trace into a single
93
+ einsum keeps the peak at r_0 * prod(d_1..d_{N-1}) * r_{N-1}, and chunking the first mode
94
+ bounds it further for the wide MLP layers.
95
+ """
96
+ n = len(cores)
97
+ if cores[0].shape[0] != cores[-1].shape[-1]:
98
+ raise ValueError(f"ring does not close: {cores[0].shape[0]} vs {cores[-1].shape[-1]}")
99
+ d0 = cores[0].shape[1]
100
+ if chunk and d0 > chunk:
101
+ parts = []
102
+ for lo in range(0, d0, chunk):
103
+ sub = [cores[0][:, lo:min(lo + chunk, d0), :]] + list(cores[1:])
104
+ parts.append(contract_tr(sub, chunk=0))
105
+ return torch.cat(parts, dim=0)
106
+ out = cores[0]
107
+ for g in cores[1:-1]:
108
+ out = torch.tensordot(out, g, dims=([out.dim() - 1], [0]))
109
+ return torch.einsum("i...k,kdi->...d", out, cores[-1])
110
+
111
+
112
+ # --------------------------------------------------------------------------- fitting
113
+ def fit_tt(R: torch.Tensor, ranks):
114
+ """TT-SVD with the given internal ranks. Singular values split symmetrically at each bond,
115
+ matching fit_mpo2/fit_mpo3's gauge so cores stay on comparable scales (fp16-safe and
116
+ kinder to a blockwise quantizer)."""
117
+ dims = list(R.shape)
118
+ n = len(dims)
119
+ if len(ranks) != n - 1:
120
+ raise ValueError(f"{n} sites need {n-1} internal ranks, got {len(ranks)}")
121
+ cores, rest, rprev = [], R.reshape(dims[0], -1), 1
122
+ for k in range(n - 1):
123
+ M = rest.reshape(rprev * dims[k], -1)
124
+ U, S, Vh = torch.linalg.svd(M, full_matrices=False)
125
+ r = min(int(ranks[k]), S.shape[0])
126
+ q = S[:r].clamp_min(0).sqrt()
127
+ cores.append((U[:, :r] * q).reshape(rprev, dims[k], r))
128
+ rest = q[:, None] * Vh[:r]
129
+ rprev = r
130
+ cores.append(rest.reshape(rprev, dims[-1], 1))
131
+ return cores
132
+
133
+
134
+ def tt_to_tr(cores):
135
+ """Reinterpret TT cores as TR cores with r_0 = 1 (an exact, lossless re-labelling)."""
136
+ return [c.clone() for c in cores]
137
+
138
+
139
+ def _subchain(cores, k):
140
+ """Contract every core except k, in cyclic order, -> E[r_k, D, r_{k-1}] with D = prod_{j!=k} d_j."""
141
+ n = len(cores)
142
+ order = [(k + 1 + t) % n for t in range(n - 1)]
143
+ out = cores[order[0]]
144
+ for j in order[1:]:
145
+ out = torch.tensordot(out, cores[j], dims=([out.dim() - 1], [0]))
146
+ return out
147
+
148
+
149
+ def _subchain_chunk(cores, k, lo, hi):
150
+ """`_subchain` with the FIRST following mode restricted to [lo, hi). The restriction rides
151
+ along the contraction untouched, so concatenating the chunks reproduces `_subchain`."""
152
+ n = len(cores)
153
+ order = [(k + 1 + t) % n for t in range(n - 1)]
154
+ out = cores[order[0]][:, lo:hi, :]
155
+ for j in order[1:]:
156
+ out = torch.tensordot(out, cores[j], dims=([out.dim() - 1], [0]))
157
+ return out
158
+
159
+
160
+ def rank_of(cores, k):
161
+ """r_{k-1} * r_k for core k -- the width of that core's least-squares system."""
162
+ n = len(cores)
163
+ return cores[k].shape[0] * cores[k].shape[2]
164
+
165
+
166
+ def _solve_maybe_cpu(AtA, AtW):
167
+ """Solve AtA X = AtW, falling back to the CPU when the GPU cannot hold the factorisation.
168
+
169
+ The normal-equation matrix is (r_{k-1} r_k) square, i.e. it grows as r^4. On down_proj at
170
+ ring rank 219 that is 47961^2 = 9.2 GB, and the factorisation needs a second copy -- no
171
+ amount of chunking the data helps, because this matrix does not depend on the data size.
172
+ Cholesky is tried first (the Gram is symmetric positive definite after the ridge) and
173
+ needs only one triangular factor; if even that does not fit, the solve moves to the host.
174
+ Slow, but a bounded slowdown beats an unbounded failure on the layers that matter most.
175
+ """
176
+ try:
177
+ L = torch.linalg.cholesky(AtA)
178
+ return torch.cholesky_solve(AtW, L)
179
+ except torch.OutOfMemoryError:
180
+ torch.cuda.empty_cache()
181
+ except Exception:
182
+ pass
183
+ try:
184
+ return torch.linalg.solve(AtA, AtW)
185
+ except torch.OutOfMemoryError:
186
+ torch.cuda.empty_cache()
187
+ dev = AtA.device
188
+ X = torch.linalg.solve(AtA.cpu().double(), AtW.cpu().double())
189
+ return X.to(device=dev, dtype=AtW.dtype)
190
+
191
+
192
+ def tr_rel_err(cores, R: torch.Tensor, chunk_elems: int = 250_000_000) -> float:
193
+ """||contract_tr(cores) - R||_F / ||R||_F, accumulated in chunks.
194
+
195
+ Materialising the reconstruction to subtract it needs the reconstruction AND the einsum's
196
+ intermediate at once; on down_proj at ring rank 155 that intermediate is (155, 64, 688,
197
+ 256) = 7 GB even with the first mode already chunked. Accumulating the squared error one
198
+ slice at a time keeps only one slice live, and the chunk width is derived from an element
199
+ budget rather than a hard-coded constant -- a constant is exactly what silently failed to
200
+ engage when a mode happened to equal it.
201
+ """
202
+ n = len(cores)
203
+ d0 = cores[0].shape[1]
204
+ mid = 1
205
+ for k in range(1, n - 1):
206
+ mid *= cores[k].shape[1]
207
+ per_unit = max(1, mid * cores[0].shape[0] * cores[-1].shape[0])
208
+ step = max(1, min(d0, int(chunk_elems // per_unit)))
209
+ acc = 0.0
210
+ for lo in range(0, d0, step):
211
+ hi = min(lo + step, d0)
212
+ sub = [cores[0][:, lo:hi, :]] + list(cores[1:])
213
+ diff = contract_tr(sub) - R[lo:hi]
214
+ acc += float(diff.pow(2).sum())
215
+ del sub, diff
216
+ return (acc ** 0.5) / float(R.norm())
217
+
218
+
219
+ def fit_tr(R: torch.Tensor, ranks, sweeps: int = 30, tol: float = 1e-8, verbose: bool = False,
220
+ seed: int = 1234, restarts: int = 2, solver: str = "lstsq",
221
+ chunk: int = 0, chunk_elems: int = 250_000_000):
222
+ """Fit a tensor ring by TT initialisation + alternating least squares.
223
+
224
+ ranks = [r_0, r_1, ..., r_{N-1}] with r_N == r_0. The TT init uses r_0 = 1 (a legal ring),
225
+ then each ALS sweep re-solves every core in closed form given the others; the ring's extra
226
+ boundary rank is opened up by padding the initialisation. Because ALS on a ring is not
227
+ guaranteed to improve monotonically from an arbitrary start, the best iterate seen is kept
228
+ and the routine REFUSES to return anything worse than its own TT initialisation -- without
229
+ that guard a fitting failure would be indistinguishable from the format being worse, which
230
+ is precisely the comparison this module exists to make.
231
+ """
232
+ n = len(R.shape)
233
+ if len(ranks) != n:
234
+ raise ValueError(f"a ring over {n} sites needs {n} ranks (r_0..r_{{N-1}})")
235
+ dims = list(R.shape)
236
+ rnorm = float(R.norm())
237
+ rnorm2 = float(R.pow(2).sum())
238
+ last_sq = None
239
+ tt = fit_tt(R, ranks[1:])
240
+ base_err = float((contract_tt(tt) - R).norm() / R.norm())
241
+ r0 = int(ranks[0])
242
+ gen = torch.Generator(device="cpu").manual_seed(seed)
243
+
244
+ def padded_init():
245
+ """TT solution embedded in the ring, with the OPENED bond seeded on BOTH ends.
246
+
247
+ Seeding only one end is not enough and is a silent failure: core 0's least-squares
248
+ environment is built from cores 1..N-1, whose ring index comes from core N-1's
249
+ trailing bond. If that stays zero, the environment vanishes on exactly the components
250
+ the ring adds, every ALS solve returns zero there, and the fit never leaves the TT
251
+ solution -- it looks like "the ring buys nothing" rather than "the ring was never
252
+ initialised".
253
+ """
254
+ out = []
255
+ for k, c in enumerate(tt):
256
+ a, d, b = c.shape
257
+ na = r0 if k == 0 else a
258
+ nb = r0 if k == n - 1 else b
259
+ g = torch.zeros(na, d, nb, dtype=R.dtype, device=R.device)
260
+ g[:a, :, :b] = c
261
+ eps = 0.05 * float(c.norm()) / max(1, c.numel()) ** 0.5
262
+ if k == 0 and na > a:
263
+ g[a:, :, :] = eps * torch.randn(na - a, d, nb, generator=gen,
264
+ dtype=R.dtype).to(R.device)
265
+ if k == n - 1 and nb > b:
266
+ g[:, :, b:] = eps * torch.randn(na, d, nb - b, generator=gen,
267
+ dtype=R.dtype).to(R.device)
268
+ out.append(g)
269
+ return out
270
+
271
+ def random_init(g=None):
272
+ """i.i.d. cores whose ring contraction has the right variance.
273
+
274
+ The scale is derived, not guessed. For cores with i.i.d. N(0, s^2) entries the trace
275
+ of the cyclic product is a sum of prod_k r_k independent products of N Gaussians, so
276
+ Var(W) ~= (prod_k r_k) * s^(2N). Matching that to the target mean square gives
277
+ s = (E[R^2] / prod_k r_k)^(1/(2N)). Getting this wrong by a constant factor per core
278
+ compounds to that factor^N in the product, which for N=4,5 puts the initial iterate
279
+ many orders of magnitude away from the data and leaves ALS crawling.
280
+ """
281
+ rr = [int(ranks[k]) for k in range(n)]
282
+ prod = 1.0
283
+ for x in rr:
284
+ prod *= x
285
+ ms = float(R.pow(2).mean())
286
+ s = (ms / prod) ** (1.0 / (2 * n))
287
+ gg = g if g is not None else gen
288
+ return [s * torch.randn(rr[k], dims[k], rr[(k + 1) % n], generator=gg,
289
+ dtype=R.dtype).to(R.device) for k in range(n)]
290
+
291
+ # ALS on a ring has genuine local minima -- a single start that stalls would be reported
292
+ # as "the ring is not better", which is exactly the confound this module must avoid. So
293
+ # several starts are run and the best kept; restarts are cheap next to the SVDs anyway.
294
+ inits = [("tt_padded", padded_init)]
295
+ for j in range(restarts):
296
+ g = torch.Generator(device="cpu").manual_seed(seed + 977 * (j + 1))
297
+ inits.append((f"random{j}", lambda g=g: random_init(g)))
298
+ best, best_err, hists, winner = tt_to_tr(tt), base_err, {}, "tt_init"
299
+ for init_name, init_fn in inits:
300
+ cores, ihist = init_fn(), []
301
+ for it in range(sweeps):
302
+ for k in range(n):
303
+ # The subchain leaves every d index separate and in CYCLIC order starting at
304
+ # k+1. R's remaining modes must be flattened in that SAME order -- movedim
305
+ # gives natural order, which for interior k is a different permutation and
306
+ # would solve the least-squares problem against mismatched columns. It still
307
+ # returns a finite "solution", just to the wrong system.
308
+ # The chunk decision is made from SHAPES ONLY and BEFORE anything large is
309
+ # built. An earlier version computed the full subchain first and then decided
310
+ # whether to chunk, so the unchunked allocation always happened anyway and the
311
+ # chunked branch saved nothing -- the memory-bounded path existed but could
312
+ # never take effect.
313
+ # Auto-size the chunk from a memory budget instead of comparing against a
314
+ # fixed number. A constant threshold silently does nothing when the mode
315
+ # happens to equal it -- which is exactly what let a 4-site fit try to
316
+ # materialise a 134 GB subchain (mode 64, chunk 64, "64 > 64" is false).
317
+ m_ = (k + 1) % n
318
+ other = 1
319
+ for j in range(n):
320
+ if j != k:
321
+ other *= dims[j]
322
+ per_unit = max(1, (other // max(1, dims[m_])) * rank_of(cores, k))
323
+ auto = max(1, min(dims[m_], int(chunk_elems // per_unit)))
324
+ use_chunk = auto < dims[m_]
325
+ if solver == "normal" and use_chunk:
326
+ # Memory-bounded normal equations. Materialising the subchain costs
327
+ # r_k * (prod_{j!=k} d_j) * r_{k-1} floats -- on down_proj at these ranks
328
+ # that is (155, 688, 256, 155) = 17 GB, so the unchunked path cannot run
329
+ # on the MLP layers at all. The Gram and right-hand side are sums over the
330
+ # flattened "others" index, so they accumulate exactly over slices of the
331
+ # first subchain mode; this is the same arithmetic, not an approximation.
332
+ m = m_
333
+ d_next = dims[m]
334
+ rk_, rkm1_ = None, None
335
+ AtA = AtW = None
336
+ Rp = R.permute(*([k] + [(k + 1 + t) % n for t in range(n - 1)]))
337
+ for lo in range(0, d_next, auto):
338
+ hi = min(lo + auto, d_next)
339
+ Ec = _subchain_chunk(cores, k, lo, hi)
340
+ rk_, rkm1_ = Ec.shape[0], Ec.shape[-1]
341
+ Ec = Ec.reshape(rk_, -1, rkm1_)
342
+ Ac = Ec.permute(1, 2, 0).reshape(Ec.shape[1], rkm1_ * rk_)
343
+ Wc = Rp[:, lo:hi].reshape(dims[k], -1)
344
+ g = Ac.transpose(0, 1) @ Ac
345
+ h = Ac.transpose(0, 1) @ Wc.transpose(0, 1)
346
+ AtA = g if AtA is None else AtA + g
347
+ AtW = h if AtW is None else AtW + h
348
+ del Ec, Ac, Wc, g, h
349
+ lam = 1e-8 * float(AtA.diagonal().abs().mean().clamp_min(1e-30))
350
+ AtA_r = AtA + lam * torch.eye(AtA.shape[0], dtype=AtA.dtype,
351
+ device=AtA.device)
352
+ G = _solve_maybe_cpu(AtA_r, AtW)
353
+ del AtA_r
354
+ # ||R - A G||^2 = ||R||^2 - 2<AtW, G> + <G, AtA G>, all from quantities
355
+ # already formed. Computing it by contracting the whole ring instead would
356
+ # cost one full O(prod d_k) tensor per sweep per core.
357
+ sq = rnorm2 - 2.0 * float((AtW * G).sum()) + float((G * (AtA @ G)).sum())
358
+ last_sq = max(sq, 0.0)
359
+ rkm1, rk = rkm1_, rk_
360
+ else:
361
+ # ONE branch builds A/Wk and ONE consumes them. Splitting the decision
362
+ # across two separate if/else chains left the non-chunked solve reachable
363
+ # after the chunked path had run, where `A` is whatever the PREVIOUS core
364
+ # left behind -- a silent wrong answer rather than an error.
365
+ E = _subchain(cores, k) # (r_k, d_{k+1},..,d_{k-1}, r_{k-1})
366
+ rk, rkm1 = E.shape[0], E.shape[-1]
367
+ E = E.reshape(rk, -1, rkm1)
368
+ D = E.shape[1]
369
+ A = E.permute(1, 2, 0).reshape(D, rkm1 * rk)
370
+ perm = [k] + [(k + 1 + t) % n for t in range(n - 1)]
371
+ # R's remaining modes must be flattened in the subchain's CYCLIC order --
372
+ # movedim gives natural order, which for interior k solves the
373
+ # least-squares problem against mismatched columns and still returns a
374
+ # finite "solution", just to the wrong system.
375
+ Wk = R.permute(*perm).reshape(dims[k], D)
376
+ del E
377
+ if solver == "normal":
378
+ AtA = A.transpose(0, 1) @ A
379
+ lam = 1e-8 * float(AtA.diagonal().abs().mean().clamp_min(1e-30))
380
+ AtA += lam * torch.eye(AtA.shape[0], dtype=A.dtype, device=A.device)
381
+ G = _solve_maybe_cpu(AtA, A.transpose(0, 1) @ Wk.transpose(0, 1))
382
+ del AtA
383
+ else:
384
+ G = torch.linalg.lstsq(A, Wk.transpose(0, 1)).solution
385
+ last_sq = None
386
+ del A, Wk
387
+ cores[k] = (G.transpose(0, 1).reshape(dims[k], rkm1, rk)
388
+ .permute(1, 0, 2).contiguous())
389
+ err = (float(last_sq) ** 0.5 / rnorm if last_sq is not None
390
+ else float((contract_tr(cores, chunk=chunk) - R).norm() / rnorm))
391
+ ihist.append(round(err, 8))
392
+ if verbose:
393
+ print(f" TR-ALS[{init_name}] sweep {it+1}: rel err {err:.6f}", flush=True)
394
+ if err < best_err - 1e-12:
395
+ best, best_err, winner = [c.clone() for c in cores], err, init_name
396
+ if it and abs(ihist[-2] - err) < tol * max(err, 1e-12):
397
+ break
398
+ hists[init_name] = ihist
399
+ # The algebraic residual is a difference of nearly equal large numbers; at a relative
400
+ # error of ~1e-2 it has already lost most of its fp32 significance. It is fine for
401
+ # steering ALS but not for the number that gets reported, so the winner is re-measured
402
+ # once by explicit contraction.
403
+ best_err = tr_rel_err(best, R)
404
+ if best_err > base_err:
405
+ return tt_to_tr(tt), base_err, {"fell_back_to_tt": True, "tt_err": base_err,
406
+ "winner": "tt_init", "als_hist": hists}
407
+ return best, best_err, {"fell_back_to_tt": winner == "tt_init", "tt_err": base_err,
408
+ "winner": winner, "als_hist": hists}
409
+
410
+
411
+ # --------------------------------------------------------------------------- bookkeeping
412
+ def tt_params(dims, ranks) -> int:
413
+ r = [1] + [int(x) for x in ranks] + [1]
414
+ return sum(r[k] * dims[k] * r[k + 1] for k in range(len(dims)))
415
+
416
+
417
+ def tr_params(dims, ranks) -> int:
418
+ r = [int(x) for x in ranks]
419
+ n = len(dims)
420
+ return sum(r[k] * dims[k] * r[(k + 1) % n] for k in range(n))
421
+
422
+
423
+ def tt_rank_ceilings(dims):
424
+ """r_k <= min(prod_{j<=k} d_j, prod_{j>k} d_j): above that the truncation is vacuous."""
425
+ n, out = len(dims), []
426
+ for k in range(n - 1):
427
+ left = 1
428
+ for j in range(k + 1):
429
+ left *= dims[j]
430
+ right = 1
431
+ for j in range(k + 1, n):
432
+ right *= dims[j]
433
+ out.append(min(left, right))
434
+ return out
435
+
436
+
437
+ def ranks_for_budget(dims, budget: int, ring: bool, alpha: float = 1.0):
438
+ """Largest ranks fitting `budget`, shaped by r_k proportional to ceiling_k ** alpha.
439
+
440
+ Bisection rather than a closed form: the count is linear in each rank but bilinear in
441
+ adjacent pairs, and cyclic for a ring, so there is no single quadratic to solve.
442
+
443
+ ALPHA EXISTS BECAUSE EQUAL FILL FRACTION IS WRONG WHEN THE CEILINGS ARE LOPSIDED. For a
444
+ 4-site split of 4096 the ceilings are (64, 4096, 64): alpha=1 spends the budget on the
445
+ huge middle bond and returns ranks like (36, 2327, 36), strangling the two bonds that
446
+ actually gate information flow through the chain. alpha=0 gives every bond the same rank
447
+ instead. Neither is right a priori, so the caller is expected to MEASURE across alpha --
448
+ the reconstruction error, not the heuristic, decides.
449
+ """
450
+ ceil_tt = tt_rank_ceilings(dims)
451
+ ceils = ([min(ceil_tt)] + ceil_tt) if ring else ceil_tt
452
+ fn = tr_params if ring else tt_params
453
+ mx = max(ceils)
454
+ shape = [(c / mx) ** alpha for c in ceils]
455
+
456
+ def build(t):
457
+ return [max(1, min(int(round(t * mx * s)), c)) for s, c in zip(shape, ceils)]
458
+
459
+ lo, hi = 0.0, 1.0
460
+ if fn(dims, build(1.0)) <= budget:
461
+ return build(1.0)
462
+ for _ in range(60):
463
+ mid = (lo + hi) / 2
464
+ if fn(dims, build(mid)) > budget:
465
+ hi = mid
466
+ else:
467
+ lo = mid
468
+ r = build(lo)
469
+ while fn(dims, r) > budget and max(r) > 1:
470
+ r[r.index(max(r))] -= 1
471
+ return r
472
+
473
+
474
+ def balanced_split(n: int, k: int):
475
+ """Most balanced k-way factorisation of n with every factor >= 2 (spread-minimising)."""
476
+ best = None
477
+ def rec(rem, parts):
478
+ nonlocal best
479
+ if len(parts) == k - 1:
480
+ if rem >= 2:
481
+ cand = parts + [rem]
482
+ key = max(cand) / min(cand)
483
+ if best is None or key < best[0]:
484
+ best = (key, cand)
485
+ return
486
+ d = 2
487
+ while d * d <= rem or d <= rem:
488
+ if d > rem:
489
+ break
490
+ if rem % d == 0:
491
+ rec(rem // d, parts + [d])
492
+ d += 1
493
+ rec(n, [])
494
+ if best is None:
495
+ raise ValueError(f"no {k}-way factorisation of {n} with all factors >= 2")
496
+ return sorted(best[1])
497
+
498
+
499
+ def self_test(device: str = "cpu") -> None:
500
+ torch.manual_seed(0)
501
+ dt = torch.float64
502
+ for osp, isp in [((4, 3), (2, 5)), ((4, 3, 2), (2, 5, 3)), ((2, 3, 2, 2), (2, 2, 3, 2))]:
503
+ n = len(osp)
504
+ out = 1
505
+ inn = 1
506
+ for x in osp:
507
+ out *= x
508
+ for x in isp:
509
+ inn *= x
510
+ W = torch.randn(out, inn, dtype=dt, device=device)
511
+ R = rearrange_n(W, osp, isp)
512
+ dims = [o * i for o, i in zip(osp, isp)]
513
+ assert list(R.shape) == dims, (R.shape, dims)
514
+ assert torch.equal(inv_rearrange_n(R, osp, isp), W), f"{n}-site rearrange not invertible"
515
+ # index identity, not just the round trip: a wrong-but-self-inverse permutation would
516
+ # pass the round trip and scramble every weight silently
517
+ for _ in range(40):
518
+ oi = [torch.randint(0, x, (1,)).item() for x in osp]
519
+ ii = [torch.randint(0, x, (1,)).item() for x in isp]
520
+ ridx = tuple(oi[k] * isp[k] + ii[k] for k in range(n))
521
+ orow = 0
522
+ for k in range(n):
523
+ orow = orow * osp[k] + oi[k]
524
+ ocol = 0
525
+ for k in range(n):
526
+ ocol = ocol * isp[k] + ii[k]
527
+ assert R[ridx] == W[orow, ocol], f"{n}-site rearrange index map wrong"
528
+
529
+ ceils = tt_rank_ceilings(dims)
530
+ cores = fit_tt(R, ceils)
531
+ e = float((contract_tt(cores) - R).norm() / R.norm())
532
+ assert e < 1e-10, f"{n}-site full-rank TT is not exact ({e:.3e})"
533
+ assert tt_params(dims, ceils) == sum(c.numel() for c in cores), "tt_params disagrees"
534
+
535
+ if n >= 3:
536
+ trunc = [max(1, c // 2) for c in ceils]
537
+ cores = fit_tt(R, trunc)
538
+ assert tt_params(dims, trunc) == sum(c.numel() for c in cores)
539
+ for a in (0.0, 0.5, 1.0):
540
+ rr = ranks_for_budget(dims, tt_params(dims, trunc), ring=False, alpha=a)
541
+ assert tt_params(dims, rr) <= tt_params(dims, trunc), \
542
+ f"TT budget solver overran at alpha={a}"
543
+ # a ring at the SAME parameter budget must not do worse than the TT it starts from
544
+ budget = tt_params(dims, trunc)
545
+ rring = ranks_for_budget(dims, budget, ring=True)
546
+ assert tr_params(dims, rring) <= budget, "TR budget solver overran"
547
+ _c, err_tr, info = fit_tr(R, rring, sweeps=6)
548
+ assert err_tr <= info["tt_err"] + 1e-12, "fit_tr returned worse than its own TT init"
549
+ assert abs(float((contract_tr(_c) - R).norm() / R.norm()) - err_tr) < 1e-8, \
550
+ "reported TR error does not match the returned cores"
551
+
552
+ ring_chk = [torch.randn(3, 5, 4, dtype=dt), torch.randn(4, 6, 2, dtype=dt),
553
+ torch.randn(2, 7, 3, dtype=dt)]
554
+ full = contract_tr(ring_chk)
555
+ assert torch.allclose(full, contract_tr(ring_chk, chunk=2), atol=1e-12), \
556
+ "chunked contract_tr disagrees with the unchunked one"
557
+ ref = torch.einsum("iaj,jbk,kci->abc", *ring_chk)
558
+ assert torch.allclose(full, ref, atol=1e-12), "contract_tr is not the cyclic trace"
559
+
560
+ # a ring with r_0 > 1 must be able to represent things a TT of the same internal ranks cannot
561
+ dims = [6, 6, 6]
562
+ torch.manual_seed(1)
563
+ ring = [torch.randn(3, 6, 3, dtype=dt) for _ in range(3)]
564
+ Rr = contract_tr(ring)
565
+ tt_same = fit_tt(Rr, [3, 3])
566
+ e_tt = float((contract_tt(tt_same) - Rr).norm() / Rr.norm())
567
+ assert e_tt > 1e-3, ("a rank-(3,3,3) ring was reproduced by a rank-(3,3) TT; the ring "
568
+ f"contraction is probably not closing the loop (err {e_tt:.3e})")
569
+ for slv in ("lstsq", "normal"):
570
+ got, err, info = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3, solver=slv)
571
+ assert err < 1e-4, (f"TR-ALS[{slv}] failed to recover an exact rank-3 ring "
572
+ f"(err {err:.3e}); winner={info['winner']} "
573
+ f"tt_init={info['tt_err']:.3e}")
574
+ got, err, info = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3)
575
+ # chunking changes only how the Gram is accumulated, so it must reach the same optimum
576
+ _g, err_ch, _i = fit_tr(Rr, [3, 3, 3], sweeps=200, restarts=3, solver="normal", chunk=2)
577
+ assert err_ch < 1e-4, f"chunked TR-ALS failed to recover an exact ring (err {err_ch:.3e})"
578
+ assert err < 1e-4, (f"TR-ALS failed to recover an exact rank-3 ring (err {err:.3e}); "
579
+ f"winner={info['winner']} tt_init={info['tt_err']:.3e}")
580
+
581
+ assert balanced_split(4096, 3) == [16, 16, 16], balanced_split(4096, 3)
582
+ assert balanced_split(4096, 2) == [64, 64]
583
+ b = balanced_split(11008, 3)
584
+ assert 43 in b and b[0] * b[1] * b[2] == 11008, b
585
+ print("tensor_formats self-test PASSED (N-site rearrange exact & index-checked, full-rank "
586
+ "TT exact, budget solvers within budget, TR >= its TT init, TR strictly beats TT on "
587
+ "a true ring, balanced splits correct)")
588
+
589
+
590
+ if __name__ == "__main__":
591
+ self_test()
592
+
593
+
594
+ # --------------------------------------------------------------------------- layers
595
+ class TRLinear(torch.nn.Module):
596
+ """Tensor-ring linear layer: W = Tr[G_0 G_1 ... G_{N-1}] after the shared rearrangement.
597
+
598
+ NOT a LowRankLinear subclass, unlike MPO2Linear/MPO3Linear. Those two could pretend to be
599
+ a pair of factors because a train has open ends; a ring genuinely has N 3-D cores and no
600
+ A/B roles to borrow, so anything keyed on `.A`/`.B` (the blockwise quantizer, the bond
601
+ rebalancer) has to be taught about `.cores` explicitly rather than silently doing the
602
+ wrong thing to a subclass it thinks it understands.
603
+
604
+ RECONSTRUCTION IS CHUNKED BY DEFAULT. Merging any two cores of a 3-site ring costs
605
+ r*d_i*d_j*r entries -- on down_proj at ring rank 142 that is 7.1 GB in bf16, per layer,
606
+ per forward. Chunking the first mode bounds it; the cost is more, smaller matmuls.
607
+ """
608
+
609
+ def __init__(self, cores, osplit, isplit, chunk_elems: int = 500_000_000,
610
+ bias=None):
611
+ super().__init__()
612
+ n = len(cores)
613
+ if len(osplit) != n or len(isplit) != n:
614
+ raise ValueError(f"{n} cores need {n} output and {n} input modes")
615
+ if min(list(osplit) + list(isplit)) < 2:
616
+ raise ValueError(f"degenerate split o={tuple(osplit)} i={tuple(isplit)}: a mode of "
617
+ f"1 collapses a site, making this an (N-1)-site network")
618
+ for k in range(n):
619
+ if cores[k].shape[1] != osplit[k] * isplit[k]:
620
+ raise ValueError(f"core {k} has mode {cores[k].shape[1]}, expected "
621
+ f"{osplit[k]}*{isplit[k]}")
622
+ if cores[k].shape[2] != cores[(k + 1) % n].shape[0]:
623
+ raise ValueError(f"ring does not close between cores {k} and {(k+1)%n}")
624
+ self.cores = torch.nn.ParameterList([torch.nn.Parameter(c) for c in cores])
625
+ self.osplit, self.isplit = tuple(int(x) for x in osplit), tuple(int(x) for x in isplit)
626
+ o = i = 1
627
+ for k in range(n):
628
+ o *= self.osplit[k]
629
+ i *= self.isplit[k]
630
+ self.out_features, self.in_features = o, i
631
+ self.ranks = tuple(int(c.shape[0]) for c in cores)
632
+ # Elements per unit of the FIRST mode in contract_tr's peak intermediate, which is
633
+ # (r_0, c, d_1, ..., d_{n-2}, r_{n-1}) -- the LAST core's mode is contracted away by
634
+ # the closing einsum and must not be counted. Including it over-estimated the cost by
635
+ # d_{n-1} (256x on an MLP layer), which drove the chunk to 1 and would have made every
636
+ # MLP forward 256 sequential contractions instead of 8.
637
+ mid = 1
638
+ for k in range(1, n - 1):
639
+ mid *= cores[k].shape[1]
640
+ per_unit = max(1, mid * self.ranks[0] * self.ranks[-1])
641
+ self._chunk = max(1, min(cores[0].shape[1], int(chunk_elems // per_unit)))
642
+ # non-persistent: never wants to show up in a checkpoint, and materialize_() is an
643
+ # inference-only opt-in (see below), so a freshly-loaded layer must start uncached.
644
+ self.register_buffer("_cached_weight", None, persistent=False)
645
+ # LLaMA projections have no bias, but Qwen2's q/k/v do. Dropping it on
646
+ # replacement is SILENT -- the shapes still match, the parameter-count gate
647
+ # still balances (achieved excludes bias, and so would the rebuilt model), and
648
+ # only the accuracy moves. So the bias is carried, not discarded.
649
+ self.bias = None if bias is None else torch.nn.Parameter(bias)
650
+
651
+ def weight(self) -> torch.Tensor:
652
+ if self._cached_weight is not None:
653
+ return self._cached_weight
654
+ cs = list(self.cores)
655
+ R = contract_tr(cs, chunk=self._chunk if self._chunk < cs[0].shape[1] else 0)
656
+ return inv_rearrange_n(R, self.osplit, self.isplit)
657
+
658
+ @torch.no_grad()
659
+ def materialize_(self):
660
+ """Cache the dense weight once. INFERENCE ONLY -- gradients cannot flow through the
661
+ cached tensor back to the cores, so this must never be called before/during training.
662
+
663
+ forward() calls weight() on every call, which redoes the full chunked ring
664
+ contraction (two tensor contractions + a trace per core) from scratch. That is fine
665
+ for a single forward pass, but autoregressive generation calls forward() once per
666
+ layer per GENERATED TOKEN with the cores completely unchanged between calls. Measured
667
+ on tr3_ring4b04_h1's GSM8K eval before this existed: 209s/item, ETA 73h for 1319
668
+ items -- every one of ~200 generated tokens re-contracted all 224 ring layers.
669
+ A train layer (LowRankLinear/MPO2Linear) never had this problem: F.linear(F.linear(x,
670
+ B), A) applies the two factors straight to the activation and never materializes W at
671
+ all, so there was nothing to cache there.
672
+ """
673
+ self._cached_weight = self.weight().detach().clone()
674
+
675
+ def unmaterialize_(self):
676
+ self._cached_weight = None
677
+
678
+ def forward(self, x):
679
+ b = None if self.bias is None else self.bias.to(x.dtype)
680
+ return torch.nn.functional.linear(x, self.weight().to(x.dtype), b)
681
+
682
+ def extra_repr(self) -> str:
683
+ return (f"o={self.osplit}, i={self.isplit}, ranks={self.ranks}, "
684
+ f"chunk={self._chunk}, materialized={self._cached_weight is not None}")
685
+
686
+
687
+ class SparseAugTRLinear(TRLinear):
688
+ """TRLinear plus a sparse additive residual. Same int64-index contract as the MPO layers:
689
+ `sp_idx` must NEVER be cast to a floating dtype -- a `.half()` on a 45M-scale index
690
+ silently rounds it to a different, valid-looking position."""
691
+
692
+ def __init__(self, cores, osplit, isplit, sp_idx, sp_val,
693
+ chunk_elems: int = 500_000_000, bias=None):
694
+ super().__init__(cores, osplit, isplit, chunk_elems, bias)
695
+ if sp_idx.numel() != sp_val.numel():
696
+ raise ValueError(f"{sp_idx.numel()} indices for {sp_val.numel()} values")
697
+ n = self.out_features * self.in_features
698
+ if sp_idx.numel() and (int(sp_idx.max()) >= n or int(sp_idx.min()) < 0):
699
+ raise ValueError("sparse index out of range for this layer")
700
+ self.register_buffer("sp_idx", sp_idx.to(torch.int64))
701
+ self.sp_val = torch.nn.Parameter(sp_val)
702
+
703
+ def weight(self) -> torch.Tensor:
704
+ # must check the cache here too, not just in TRLinear.weight(): materialize_() caches
705
+ # THIS class's weight() (ring + sparse, since self.weight() dispatches polymorphically
706
+ # from inside materialize_()), so without this check a later call would go
707
+ # super().weight() -> see the cache -> return the already-sparse-augmented tensor ->
708
+ # and then add the sparse residual a second time on top of it.
709
+ if self._cached_weight is not None:
710
+ return self._cached_weight
711
+ W = super().weight()
712
+ if self.sp_idx.numel():
713
+ W = W.reshape(-1).index_add(0, self.sp_idx, self.sp_val.to(W.dtype)).view_as(W)
714
+ return W
715
+
716
+ def extra_repr(self) -> str:
717
+ return super().extra_repr() + f", nnz={self.sp_idx.numel()}"
718
+
719
+
720
+ def layer_self_test() -> None:
721
+ torch.manual_seed(0)
722
+ osp, isp = (4, 3, 2), (2, 5, 3)
723
+ dims = [o * i for o, i in zip(osp, isp)]
724
+ cores = [torch.randn(3, dims[0], 4), torch.randn(4, dims[1], 2), torch.randn(2, dims[2], 3)]
725
+ lay = TRLinear([c.clone() for c in cores], osp, isp, chunk_elems=10 ** 9)
726
+ ref = inv_rearrange_n(contract_tr(cores), osp, isp)
727
+ assert torch.allclose(lay.weight(), ref, atol=1e-5), "TRLinear.weight() != contract+inverse"
728
+ # chunking must not change the answer
729
+ lay_c = TRLinear([c.clone() for c in cores], osp, isp, chunk_elems=1)
730
+ assert lay_c._chunk < dims[0], "chunk did not engage"
731
+ assert torch.allclose(lay_c.weight(), ref, atol=1e-5), "chunked forward differs"
732
+ x = torch.randn(7, lay.in_features)
733
+ assert torch.allclose(lay(x), x @ ref.T, atol=1e-4), "forward != x W^T"
734
+ idx = torch.tensor([0, 5, lay.out_features * lay.in_features - 1], dtype=torch.int64)
735
+ val = torch.tensor([1.0, -2.0, 3.0])
736
+ sl = SparseAugTRLinear([c.clone() for c in cores], osp, isp, idx, val, chunk_elems=10 ** 9)
737
+ d = (sl.weight() - ref).reshape(-1)
738
+ assert torch.allclose(d[idx], val, atol=1e-5), "sparse residual not applied at sp_idx"
739
+ assert abs(float(d.abs().sum()) - float(val.abs().sum())) < 1e-4, "residual leaked"
740
+ try:
741
+ TRLinear([torch.zeros(2, 4, 2), torch.zeros(2, 3, 2), torch.zeros(2, 6, 2)],
742
+ (4, 1, 2), (1, 3, 3))
743
+ except ValueError:
744
+ pass
745
+ else:
746
+ raise AssertionError("a degenerate split (mode = 1) was accepted")
747
+ # gradients must reach every core
748
+ lay.zero_grad()
749
+ lay(x).sum().backward()
750
+ for k, c in enumerate(lay.cores):
751
+ assert c.grad is not None and float(c.grad.abs().sum()) > 0, f"core {k} got no gradient"
752
+ # materialize_() must be a pure inference-speed cache: same weight, same forward output,
753
+ # and -- the one bug this is actually guarding against -- the sparse residual must not
754
+ # get added twice once SparseAugTRLinear.weight() is short-circuited by the cache.
755
+ pre = lay.weight().clone()
756
+ lay.materialize_()
757
+ assert lay._cached_weight is not None, "materialize_() did not populate the cache"
758
+ assert torch.allclose(lay.weight(), pre, atol=1e-6), "materialize_() changed weight()"
759
+ assert torch.allclose(lay(x), x @ ref.T, atol=1e-4), "forward != x W^T after materialize_()"
760
+ lay.unmaterialize_()
761
+ assert lay._cached_weight is None, "unmaterialize_() left the cache populated"
762
+ sl_ref = sl.weight().clone()
763
+ sl.materialize_()
764
+ assert torch.allclose(sl.weight(), sl_ref, atol=1e-6), \
765
+ "materialized SparseAugTRLinear.weight() differs -- sparse residual likely double-added"
766
+ print("TRLinear self-test PASSED (weight matches contraction, chunking exact, forward "
767
+ "correct, sparse localised, degenerate split refused, all cores differentiable, "
768
+ "materialize_() cache exact and idempotent)")