Reorganize repo: <method>/<stage>/<model> (tr3, svd_llm, svd_llm2 x heal/unheal)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- README.md +31 -87
- svd_llm/heal/llama2-13b/README.md +29 -0
- svd_llm/heal/llama2-13b/config.json +26 -0
- svd_llm/heal/llama2-13b/lowrank_linear.py +83 -0
- svd_llm/heal/llama2-13b/provenance.json +199 -0
- svd_llm/heal/llama2-13b/ranks.json +282 -0
- svd_llm/heal/llama2-13b/state_dict_fp16.pt +3 -0
- svd_llm/heal/llama2-7b/README.md +43 -0
- svd_llm/heal/llama2-7b/config.json +28 -0
- svd_llm/heal/llama2-7b/lowrank_linear.py +83 -0
- svd_llm/heal/llama2-7b/provenance.json +196 -0
- svd_llm/heal/llama2-7b/ranks.json +226 -0
- svd_llm/heal/llama2-7b/state_dict_fp16.pt +3 -0
- svd_llm/unheal/llama2-13b/README.md +16 -0
- svd_llm/unheal/llama2-13b/config.json +26 -0
- svd_llm/unheal/llama2-13b/lowrank_linear.py +83 -0
- svd_llm/unheal/llama2-13b/provenance.json +7 -0
- svd_llm/unheal/llama2-13b/ranks.json +282 -0
- svd_llm/unheal/llama2-13b/state_dict_fp16.pt +3 -0
- svd_llm/unheal/llama2-7b/README.md +13 -0
- svd_llm/unheal/llama2-7b/config.json +28 -0
- svd_llm/unheal/llama2-7b/lowrank_linear.py +83 -0
- svd_llm/unheal/llama2-7b/ranks.json +226 -0
- svd_llm/unheal/llama2-7b/state_dict_fp16.pt +3 -0
- svd_llm2/heal/llama2-13b/README.md +29 -0
- svd_llm2/heal/llama2-13b/config.json +26 -0
- svd_llm2/heal/llama2-13b/lowrank_linear.py +83 -0
- svd_llm2/heal/llama2-13b/provenance.json +199 -0
- svd_llm2/heal/llama2-13b/ranks.json +282 -0
- svd_llm2/heal/llama2-13b/state_dict_fp16.pt +3 -0
- svd_llm2/heal/llama2-7b/README.md +43 -0
- svd_llm2/heal/llama2-7b/config.json +28 -0
- svd_llm2/heal/llama2-7b/lowrank_linear.py +83 -0
- svd_llm2/heal/llama2-7b/provenance.json +196 -0
- svd_llm2/heal/llama2-7b/ranks.json +226 -0
- svd_llm2/heal/llama2-7b/state_dict_fp16.pt +3 -0
- svd_llm2/unheal/llama2-13b/README.md +16 -0
- svd_llm2/unheal/llama2-13b/config.json +26 -0
- svd_llm2/unheal/llama2-13b/lowrank_linear.py +83 -0
- svd_llm2/unheal/llama2-13b/provenance.json +7 -0
- svd_llm2/unheal/llama2-13b/ranks.json +282 -0
- svd_llm2/unheal/llama2-13b/state_dict_fp16.pt +3 -0
- svd_llm2/unheal/llama2-7b/README.md +13 -0
- svd_llm2/unheal/llama2-7b/config.json +28 -0
- svd_llm2/unheal/llama2-7b/lowrank_linear.py +83 -0
- svd_llm2/unheal/llama2-7b/ranks.json +226 -0
- svd_llm2/unheal/llama2-7b/state_dict_fp16.pt +3 -0
- tr3/unheal/llama2-13b/README.md +12 -0
- tr3/unheal/llama2-13b/ranks.json +3362 -0
- tr3/unheal/llama2-13b/state_dict_fp16.pt +3 -0
README.md
CHANGED
|
@@ -1,95 +1,39 @@
|
|
| 1 |
---
|
| 2 |
license: other
|
| 3 |
license_name: see-each-subdirectory
|
| 4 |
-
tags:
|
| 5 |
-
- tensor-decomposition
|
| 6 |
-
- tensor-ring
|
| 7 |
-
- model-compression
|
| 8 |
---
|
| 9 |
|
| 10 |
-
# TR-3
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
| 17 |
-
|---|---|---
|
| 18 |
-
| [`llama2-7b
|
| 19 |
-
| [`llama2-13b
|
| 20 |
-
| [`qwen2.5-3b
|
| 21 |
-
| [`
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
| 26 |
-
|
|
| 27 |
-
| [`
|
| 28 |
-
| [`
|
| 29 |
-
| [`
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
structural difference is the closed ring versus the open chain:
|
| 38 |
-
|
| 39 |
-
| Model | Arm | KL compressed | KL healed | MMLU healed |
|
| 40 |
-
|---|---|---:|---:|---:|
|
| 41 |
-
| LLaMA-2-7B | TT-3 | 6.6868 | 0.4077 | 33.38% |
|
| 42 |
-
| LLaMA-2-7B | **TR-3** | **0.6932** | **0.1822** | **43.82%** |
|
| 43 |
-
| Qwen2.5-3B | TT-3 | 6.3507 | 0.3955 | 43.33% |
|
| 44 |
-
| Qwen2.5-3B | **TR-3** | **0.8888** | **0.1729** | **57.41%** |
|
| 45 |
-
|
| 46 |
-
Roughly **9x lower KL before healing** and **~2.3x after**, worth 10-14 MMLU points. Each
|
| 47 |
-
control's README states the two confounds that qualify this (a batch-size difference in the
|
| 48 |
-
healed rows, and uneven ALS coverage) and the per-layer evidence that the ALS gap is an order
|
| 49 |
-
of magnitude too small to explain the result.
|
| 50 |
-
|
| 51 |
-
## Why the compression rates differ
|
| 52 |
-
|
| 53 |
-
Rates are matched by the **damage compression inflicts**, not by the nominal percentage. Both
|
| 54 |
-
Qwen2.5 sizes collapse to chance at the ~40% the LLaMA-2 models tolerate:
|
| 55 |
-
|
| 56 |
-
| Model | Reduction | pre-heal KL |
|
| 57 |
-
|---|---:|---:|
|
| 58 |
-
| LLaMA-2-13B | 40.53% | 0.3616 |
|
| 59 |
-
| Qwen2.5-7B | 31.89% | 0.4965 |
|
| 60 |
-
| LLaMA-2-7B | 40.30% | 0.6915 |
|
| 61 |
-
| Qwen2.5-3B | 32.65% | 0.8882 |
|
| 62 |
-
| Qwen2.5-7B | 40.60% | 2.0204 — collapses |
|
| 63 |
-
| Qwen2.5-3B | 40.94% | 3.5810 — collapses |
|
| 64 |
-
|
| 65 |
-
Two effects are separable and both real: damage falls with model size, and at equal size and
|
| 66 |
-
equal rate the Qwen2.5 architecture is harder to compress than LLaMA-2 (2.0204 vs 0.6915, both
|
| 67 |
-
~7B at ~40%). Scale mitigates the architecture effect without removing it.
|
| 68 |
-
|
| 69 |
-
## ⚠️ Licences differ per subdirectory
|
| 70 |
-
|
| 71 |
-
The Hub shows one `license` field, so it is `other`; **the binding terms are per directory**.
|
| 72 |
-
`qwen2.5-3b/` and `tt3-qwen2.5-3b/` are **Qwen RESEARCH LICENSE — research/evaluation only**,
|
| 73 |
-
while `qwen2.5-7b/` is Apache 2.0: Alibaba released the two Qwen sizes under different terms,
|
| 74 |
-
so the permissive licence does not carry across. LLaMA directories are Llama 2 Community
|
| 75 |
-
License. Do not assume one subdirectory's terms apply to another.
|
| 76 |
|
| 77 |
## ⚠️ These are NOT standard `transformers` checkpoints
|
| 78 |
|
| 79 |
-
`
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
Each subdirectory's README carries a complete loading recipe.
|
| 83 |
-
|
| 84 |
-
## LLaMA-2-13B SVD baselines (healed vs unhealed)
|
| 85 |
-
|
| 86 |
-
13B counterparts of the 7B SVD baselines at the matched 13B budget (7.7403B, 59.47% kept —
|
| 87 |
-
same as TR-3 13B), KD-healed with the identical 60M-token protocol. `*-unhealed` dirs hold the
|
| 88 |
-
raw compression weights (no distillation) so the healing delta is directly measurable:
|
| 89 |
-
|
| 90 |
-
| Directory | Stage | Method | Params |
|
| 91 |
-
|---|---|---|---:|
|
| 92 |
-
| [`svd-llm-13b/`](./svd-llm-13b) | KD-healed | SVD-LLM | 7.738B |
|
| 93 |
-
| [`svd-llm-13b-unhealed/`](./svd-llm-13b-unhealed) | raw compression | SVD-LLM | 7.738B |
|
| 94 |
-
| [`svd-llm-v2-13b/`](./svd-llm-v2-13b) | KD-healed | SVD-LLM V2 ‡ | 7.7403B |
|
| 95 |
-
| [`svd-llm-v2-13b-unhealed/`](./svd-llm-v2-13b-unhealed) | raw compression | SVD-LLM V2 ‡ | 7.7403B |
|
|
|
|
| 1 |
---
|
| 2 |
license: other
|
| 3 |
license_name: see-each-subdirectory
|
| 4 |
+
tags: [tensor-decomposition, svd, low-rank, model-compression, knowledge-distillation]
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
+
# TR-3 study models: main compressed models and matched-budget baselines
|
| 8 |
+
|
| 9 |
+
Layout: **<method> / <stage> / <model>**. Method families are `tr3` (our 3-site tensor ring +
|
| 10 |
+
sparse residual), `svd_llm` and `svd_llm_v2` (matched-budget baselines). Stages are `heal`
|
| 11 |
+
(KD-distilled, deployable) and `unheal` (raw post-compression, for measuring the healing delta).
|
| 12 |
+
|
| 13 |
+
| method | stage | model | params (B) | licence | KD result (probe) |
|
| 14 |
+
|---|---|---|---:|---|---|
|
| 15 |
+
| tr3 | heal | [`llama2-7b`](tr3/heal/llama2-7b) | 4.023 | llama2 | MMLU 43.21* |
|
| 16 |
+
| tr3 | heal | [`llama2-13b`](tr3/heal/llama2-13b) | 7.740 | llama2 | see dir |
|
| 17 |
+
| tr3 | heal | [`qwen2.5-3b`](tr3/heal/qwen2.5-3b) | 2.078 | qwen-research (non-commercial) | see dir |
|
| 18 |
+
| tr3 | unheal | [`llama2-13b`](tr3/unheal/llama2-13b) | 7.740 | llama2 | — |
|
| 19 |
+
| tr3 | unheal | [`llama2-7b`](tr3/unheal/llama2-7b) | (off-cluster archive) | llama2 | — |
|
| 20 |
+
| svd_llm | heal | [`llama2-7b`](svd_llm/heal/llama2-7b) | 4.022 | llama2 | MMLU 39.47 |
|
| 21 |
+
| svd_llm | heal | [`llama2-13b`](svd_llm/heal/llama2-13b) | 7.738 | llama2 | MMLU 46.54 |
|
| 22 |
+
| svd_llm | unheal | [`llama2-7b`](svd_llm/unheal/llama2-7b) | 4.022 | llama2 | — |
|
| 23 |
+
| svd_llm | unheal | [`llama2-13b`](svd_llm/unheal/llama2-13b) | 7.738 | llama2 | — |
|
| 24 |
+
| svd_llm_v2 ‡ | heal | [`llama2-7b`](svd_llm2/heal/llama2-7b) | 4.023 | llama2 | MMLU 40.22 |
|
| 25 |
+
| svd_llm_v2 ‡ | heal | [`llama2-13b`](svd_llm2/heal/llama2-13b) | 7.740 | llama2 | MMLU 44.96 |
|
| 26 |
+
| svd_llm_v2 ‡ | unheal | [`llama2-7b`](svd_llm2/unheal/llama2-7b) | 4.023 | llama2 | — |
|
| 27 |
+
| svd_llm_v2 ‡ | unheal | [`llama2-13b`](svd_llm2/unheal/llama2-13b) | 7.740 | llama2 | — |
|
| 28 |
+
|
| 29 |
+
\* full-benchmark lm-eval 0.4.12 result; SVD probe columns are limit-40 healing probes here —
|
| 30 |
+
each dir's README/provenance carries the precise protocol.
|
| 31 |
+
|
| 32 |
+
‡ Official SVD-LLM V2 code was never released; `svd_llm_v2` artifacts are our faithful
|
| 33 |
+
implementation of the published algorithms (per-layer ranks document the allocation).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
## ⚠️ These are NOT standard `transformers` checkpoints
|
| 36 |
|
| 37 |
+
`tr3/**` stores **ring cores** (load with each dir's `tensor_formats.py`); `svd_llm*/**` stores
|
| 38 |
+
**low-rank factor pairs** (load with each dir's `lowrank_linear.py`). Weight files are
|
| 39 |
+
uniformly named `state_dict_fp16.pt`. `from_pretrained()` will not work on this repo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
svd_llm/heal/llama2-13b/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-13b-chat-hf
|
| 4 |
+
tags: [svd, low-rank, model-compression, llama2, knowledge-distillation]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# SVD-LLM @ 7.74B (59.47% kept of LLaMA-2-13B-chat), KD-healed 60M tokens
|
| 8 |
+
|
| 9 |
+
SVD-LLM (ICLR 2025): truncation-aware data whitening + closed-form parameter update, official code (@ 7538cca), uniform 41.58% removal across all 7 projection types of all 40 layers.
|
| 10 |
+
|
| 11 |
+
- **HEALED checkpoint** (this dir). The matching **UNHEALED** pre-distillation weights are in
|
| 12 |
+
`svd-llm-13b-unhealed/` — do not mix them up: same `ranks.json`, different `state_dict_fp16.pt` (see
|
| 13 |
+
`provenance.json` SHA256 here vs the unhealed dir's record).
|
| 14 |
+
- Healing: pure forward-KL distillation from frozen NousResearch/Llama-2-13b-chat-hf teacher,
|
| 15 |
+
60M tokens, held-out KL **2.0904 -> 0.3007**, probe MMLU (5-shot, limit 40) **24.56% -> 46.54%**.
|
| 16 |
+
- Identical recipe/protocol to the TR-3 13B and the 7B SVD baselines (see their dirs).
|
| 17 |
+
|
| 18 |
+
## Load
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
import json
|
| 22 |
+
from lowrank_linear import build, materialize_all
|
| 23 |
+
model = build("NousResearch/Llama-2-13b-chat-hf", json.load(open("ranks.json")),
|
| 24 |
+
"state_dict_fp16.pt", device="cuda")
|
| 25 |
+
materialize_all(model) # inference-only fusion U@V
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
Full provenance (data mixture + revisions, decontamination, SHA256 of every input and
|
| 29 |
+
checkpoint, 12 x 5M milestone trajectory) in `provenance.json`.
|
svd_llm/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 |
+
}
|
svd_llm/heal/llama2-13b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm/heal/llama2-13b/provenance.json
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"method": "KD healing: alpha*T^2*KL(teacher||student) + (1-alpha)*CE",
|
| 3 |
+
"student_init": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm1_r04158_tr3fmt/state_dict_fp16.pt",
|
| 4 |
+
"teacher": "NousResearch/Llama-2-13b-chat-hf",
|
| 5 |
+
"alpha": 1.0,
|
| 6 |
+
"temperature": 1.0,
|
| 7 |
+
"lr": 2e-05,
|
| 8 |
+
"tokens_seen": 59998208,
|
| 9 |
+
"epochs": 0.228,
|
| 10 |
+
"global_batch_tokens": 32768,
|
| 11 |
+
"dataset_mixture_pre_exclusion": {
|
| 12 |
+
"alpaca": 50000,
|
| 13 |
+
"openhermes": 200000,
|
| 14 |
+
"ultrachat": 100000
|
| 15 |
+
},
|
| 16 |
+
"dataset_revisions": {
|
| 17 |
+
"tatsu-lab/alpaca": "dce01c9b08f87459cf36a430d809084718273017",
|
| 18 |
+
"teknium/OpenHermes-2.5": "b82037821055c377bed0d495e72e46de3bc72e84",
|
| 19 |
+
"HuggingFaceH4/ultrachat_200k": "8049631c405ae6576f93f445c6b8166f76f5505a"
|
| 20 |
+
},
|
| 21 |
+
"canonical_pool_excluded_texts": 10000,
|
| 22 |
+
"train_texts_after_exclusion": 356000,
|
| 23 |
+
"chat_texts": 340000,
|
| 24 |
+
"mmlu_aux_texts_kept": 16000,
|
| 25 |
+
"mmlu_aux_split": "cais/mmlu auxiliary_train (official TRAIN split, disjoint from the evaluated test split; audit verified 0/99842 exact overlap)",
|
| 26 |
+
"mmlu_aux_stats": {
|
| 27 |
+
"requested_groups": 16000,
|
| 28 |
+
"rendered_groups": 16000,
|
| 29 |
+
"shots": 5,
|
| 30 |
+
"rows_total": 99842,
|
| 31 |
+
"rows_dropped_by_decontam": 71,
|
| 32 |
+
"rows_clean": 99771,
|
| 33 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe",
|
| 34 |
+
"format": "MMLU-shaped (NOT byte-identical to lm-eval; auxiliary_train has no subject)"
|
| 35 |
+
},
|
| 36 |
+
"gold_label_supervision": false,
|
| 37 |
+
"attribution_note": "alpha=1.0 => pure KD, no gold-label CE, so any MMLU change is attributable to distillation on in-domain text. alpha<1 adds CE on text containing answers = labeled MCQ training, which is a DIFFERENT and weaker claim.",
|
| 38 |
+
"train_tokens_total": 263112704,
|
| 39 |
+
"decontamination": {
|
| 40 |
+
"removed": {
|
| 41 |
+
"alpaca": 11,
|
| 42 |
+
"openhermes": 120,
|
| 43 |
+
"ultrachat": 33
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"start_kl": 2.0904040336608887,
|
| 47 |
+
"final_kl": 0.30065654776990414,
|
| 48 |
+
"start_mmlu": 0.24561403508771928,
|
| 49 |
+
"final_mmlu": 0.46535087719298246,
|
| 50 |
+
"history": [
|
| 51 |
+
{
|
| 52 |
+
"tokens_m": 5.01,
|
| 53 |
+
"step": 153,
|
| 54 |
+
"held_out_kl": 0.5967434793710709,
|
| 55 |
+
"mmlu": 0.3929824561403509
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"tokens_m": 10.03,
|
| 59 |
+
"step": 306,
|
| 60 |
+
"held_out_kl": 0.5406020767986774,
|
| 61 |
+
"mmlu": 0.3956140350877193
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"tokens_m": 15.01,
|
| 65 |
+
"step": 458,
|
| 66 |
+
"held_out_kl": 0.5206542909145355,
|
| 67 |
+
"mmlu": 0.4083333333333333
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"tokens_m": 20.02,
|
| 71 |
+
"step": 611,
|
| 72 |
+
"held_out_kl": 0.4988052695989609,
|
| 73 |
+
"mmlu": 0.40087719298245617
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"tokens_m": 25.0,
|
| 77 |
+
"step": 763,
|
| 78 |
+
"held_out_kl": 0.4575178399682045,
|
| 79 |
+
"mmlu": 0.40350877192982454
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"tokens_m": 30.02,
|
| 83 |
+
"step": 916,
|
| 84 |
+
"held_out_kl": 0.4198819752782583,
|
| 85 |
+
"mmlu": 0.4298245614035088
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"tokens_m": 35.03,
|
| 89 |
+
"step": 1069,
|
| 90 |
+
"held_out_kl": 0.38331497088074684,
|
| 91 |
+
"mmlu": 0.43157894736842106
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"tokens_m": 40.01,
|
| 95 |
+
"step": 1221,
|
| 96 |
+
"held_out_kl": 0.34914770163595676,
|
| 97 |
+
"mmlu": 0.4425438596491228
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"tokens_m": 45.02,
|
| 101 |
+
"step": 1374,
|
| 102 |
+
"held_out_kl": 0.32529739663004875,
|
| 103 |
+
"mmlu": 0.44956140350877194
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"tokens_m": 50.0,
|
| 107 |
+
"step": 1526,
|
| 108 |
+
"held_out_kl": 0.31298027001321316,
|
| 109 |
+
"mmlu": 0.4587719298245614
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"tokens_m": 55.02,
|
| 113 |
+
"step": 1679,
|
| 114 |
+
"held_out_kl": 0.30493565648794174,
|
| 115 |
+
"mmlu": 0.46403508771929824
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"tokens_m": 60.0,
|
| 119 |
+
"step": 1831,
|
| 120 |
+
"held_out_kl": 0.30065654776990414,
|
| 121 |
+
"mmlu": 0.46535087719298246,
|
| 122 |
+
"final": true
|
| 123 |
+
}
|
| 124 |
+
],
|
| 125 |
+
"teacher_mmlu_same_limit": 0.5442982456140351,
|
| 126 |
+
"checkpoint": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04158_h1/state_dict_fp16.pt",
|
| 127 |
+
"sha256": "42b2f5c959e8fdd07ef526e6d182cab2f7685354859e1262b035eef39ba98387",
|
| 128 |
+
"seed": 1234,
|
| 129 |
+
"mmlu_limit_per_subtask": 40,
|
| 130 |
+
"teacher_revision": "d73f5fa9c4bc135502e04c27b39660747172d76b",
|
| 131 |
+
"student_init_sha256": "5625041bed874f21664b6a2bff3ce4722612302630028c9b60ac7f2cb8d7c605",
|
| 132 |
+
"ranks_file": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm1_r04158_tr3fmt/ranks.json",
|
| 133 |
+
"ranks_sha256": "5c9ed0db91c9c81c51e62e6f82c7c2772478cc353c6f28040164843e64219b55",
|
| 134 |
+
"input_identity_gate": {
|
| 135 |
+
"student_ckpt": {
|
| 136 |
+
"key": "svdllm1_r04158_tr3fmt",
|
| 137 |
+
"sha256": "5625041bed874f21664b6a2bff3ce4722612302630028c9b60ac7f2cb8d7c605",
|
| 138 |
+
"status": "unregistered_allowed"
|
| 139 |
+
},
|
| 140 |
+
"ranks": {
|
| 141 |
+
"key": "svdllm1_r04158_tr3fmt",
|
| 142 |
+
"sha256": "5c9ed0db91c9c81c51e62e6f82c7c2772478cc353c6f28040164843e64219b55",
|
| 143 |
+
"status": "unregistered_allowed"
|
| 144 |
+
}
|
| 145 |
+
},
|
| 146 |
+
"train_seed": 1234,
|
| 147 |
+
"mmlu_seed": 1234,
|
| 148 |
+
"dynamic_batch": false,
|
| 149 |
+
"dbl": null,
|
| 150 |
+
"snapshot_milestones": true,
|
| 151 |
+
"snapshots": [
|
| 152 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04158_h1_snap15m'), 15.007744)",
|
| 153 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04158_h1_snap30m'), 30.015488)",
|
| 154 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04158_h1_snap45m'), 45.023232)",
|
| 155 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04158_h1_snap50m'), 50.003968)",
|
| 156 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04158_h1_snap55m'), 55.017472)"
|
| 157 |
+
],
|
| 158 |
+
"stream_skip_tokens_m": 0.0,
|
| 159 |
+
"stream_blocks_consumed": [
|
| 160 |
+
0,
|
| 161 |
+
58592
|
| 162 |
+
],
|
| 163 |
+
"stream_note": "the block order is a seeded permutation consumed from index 0; stages sharing a --seed with stream_skip=0 re-train on the SAME blocks. [start, end] block indices are recorded so any continuation can be checked for overlap with what earlier stages consumed.",
|
| 164 |
+
"student_master_dtype": "bf16",
|
| 165 |
+
"fake_quant": null,
|
| 166 |
+
"rebalance_report": null,
|
| 167 |
+
"student_param_count": 7737799680,
|
| 168 |
+
"micro": 8,
|
| 169 |
+
"grad_accum": 4,
|
| 170 |
+
"seq_len": 1024,
|
| 171 |
+
"held_out_source": "canonical: mixture 2000/4000/4000, seed 1234, seq 1024, blocks 256:264 (identical to the compression gates)",
|
| 172 |
+
"decontam_stats": {
|
| 173 |
+
"mmlu": {
|
| 174 |
+
"items": 14042,
|
| 175 |
+
"new_ngrams": 764261,
|
| 176 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe"
|
| 177 |
+
},
|
| 178 |
+
"hellaswag": {
|
| 179 |
+
"items": 10042,
|
| 180 |
+
"new_ngrams": 1334302,
|
| 181 |
+
"revision": "218ec52e09a7e7462a5400043bb9a69a41d06b76"
|
| 182 |
+
},
|
| 183 |
+
"boolq": {
|
| 184 |
+
"items": 3270,
|
| 185 |
+
"new_ngrams": 276806,
|
| 186 |
+
"revision": "3de24cf8022e94f4ee4b9d55a6f539891524d646"
|
| 187 |
+
},
|
| 188 |
+
"triviaqa": {
|
| 189 |
+
"items": 17944,
|
| 190 |
+
"new_ngrams": 32608,
|
| 191 |
+
"revision": "0f7faf33a3908546c6fd5b73a660e0f8ff173c2f"
|
| 192 |
+
},
|
| 193 |
+
"gsm8k": {
|
| 194 |
+
"items": 1319,
|
| 195 |
+
"new_ngrams": 46281,
|
| 196 |
+
"revision": "740312add88f781978c0658806c59bc2815b9866"
|
| 197 |
+
}
|
| 198 |
+
}
|
| 199 |
+
}
|
svd_llm/heal/llama2-13b/ranks.json
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model.layers.0.self_attn.q_proj": 1495,
|
| 3 |
+
"model.layers.0.self_attn.k_proj": 1495,
|
| 4 |
+
"model.layers.0.self_attn.v_proj": 1495,
|
| 5 |
+
"model.layers.0.self_attn.o_proj": 1495,
|
| 6 |
+
"model.layers.0.mlp.gate_proj": 2182,
|
| 7 |
+
"model.layers.0.mlp.up_proj": 2182,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 2182,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 1495,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 1495,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 1495,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 1495,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 2182,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 2182,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 2182,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1495,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1495,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1495,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 1495,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 2182,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 2182,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 2182,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1495,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1495,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1495,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 1495,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 2182,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 2182,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 2182,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1495,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1495,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1495,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1495,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 2182,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 2182,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 2182,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1495,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1495,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1495,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1495,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 2182,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 2182,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 2182,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1495,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1495,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1495,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1495,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 2182,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 2182,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 2182,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1495,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1495,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1495,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1495,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 2182,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 2182,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 2182,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1495,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1495,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1495,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1495,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 2182,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 2182,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 2182,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1495,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1495,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1495,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1495,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 2182,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 2182,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 2182,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1495,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1495,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1495,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1495,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 2182,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 2182,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 2182,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1495,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1495,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1495,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1495,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 2182,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 2182,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 2182,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1495,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1495,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1495,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1495,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 2182,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 2182,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 2182,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1495,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1495,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1495,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1495,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 2182,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 2182,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 2182,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1495,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1495,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1495,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1495,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 2182,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 2182,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 2182,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1495,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1495,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1495,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1495,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 2182,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 2182,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 2182,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1495,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1495,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1495,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1495,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 2182,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 2182,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 2182,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1495,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1495,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1495,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1495,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 2182,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 2182,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 2182,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1495,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1495,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1495,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1495,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 2182,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 2182,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 2182,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1495,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1495,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1495,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1495,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 2182,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 2182,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 2182,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1495,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1495,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1495,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1495,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 2182,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 2182,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 2182,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1495,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1495,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1495,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1495,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 2182,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 2182,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 2182,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1495,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1495,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1495,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1495,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 2182,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 2182,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 2182,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1495,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1495,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1495,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1495,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 2182,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 2182,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 2182,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1495,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1495,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1495,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1495,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 2182,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 2182,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 2182,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1495,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1495,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1495,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1495,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 2182,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 2182,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 2182,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1495,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1495,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1495,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1495,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 2182,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 2182,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 2182,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1495,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1495,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1495,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1495,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 2182,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 2182,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 2182,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1495,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1495,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1495,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1495,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 2182,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 2182,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 2182,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1495,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1495,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1495,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1495,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 2182,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 2182,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 2182,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1495,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1495,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1495,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1495,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 2182,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 2182,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 2182,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1495,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1495,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1495,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1495,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 2182,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 2182,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 2182,
|
| 226 |
+
"model.layers.32.self_attn.q_proj": 1495,
|
| 227 |
+
"model.layers.32.self_attn.k_proj": 1495,
|
| 228 |
+
"model.layers.32.self_attn.v_proj": 1495,
|
| 229 |
+
"model.layers.32.self_attn.o_proj": 1495,
|
| 230 |
+
"model.layers.32.mlp.gate_proj": 2182,
|
| 231 |
+
"model.layers.32.mlp.up_proj": 2182,
|
| 232 |
+
"model.layers.32.mlp.down_proj": 2182,
|
| 233 |
+
"model.layers.33.self_attn.q_proj": 1495,
|
| 234 |
+
"model.layers.33.self_attn.k_proj": 1495,
|
| 235 |
+
"model.layers.33.self_attn.v_proj": 1495,
|
| 236 |
+
"model.layers.33.self_attn.o_proj": 1495,
|
| 237 |
+
"model.layers.33.mlp.gate_proj": 2182,
|
| 238 |
+
"model.layers.33.mlp.up_proj": 2182,
|
| 239 |
+
"model.layers.33.mlp.down_proj": 2182,
|
| 240 |
+
"model.layers.34.self_attn.q_proj": 1495,
|
| 241 |
+
"model.layers.34.self_attn.k_proj": 1495,
|
| 242 |
+
"model.layers.34.self_attn.v_proj": 1495,
|
| 243 |
+
"model.layers.34.self_attn.o_proj": 1495,
|
| 244 |
+
"model.layers.34.mlp.gate_proj": 2182,
|
| 245 |
+
"model.layers.34.mlp.up_proj": 2182,
|
| 246 |
+
"model.layers.34.mlp.down_proj": 2182,
|
| 247 |
+
"model.layers.35.self_attn.q_proj": 1495,
|
| 248 |
+
"model.layers.35.self_attn.k_proj": 1495,
|
| 249 |
+
"model.layers.35.self_attn.v_proj": 1495,
|
| 250 |
+
"model.layers.35.self_attn.o_proj": 1495,
|
| 251 |
+
"model.layers.35.mlp.gate_proj": 2182,
|
| 252 |
+
"model.layers.35.mlp.up_proj": 2182,
|
| 253 |
+
"model.layers.35.mlp.down_proj": 2182,
|
| 254 |
+
"model.layers.36.self_attn.q_proj": 1495,
|
| 255 |
+
"model.layers.36.self_attn.k_proj": 1495,
|
| 256 |
+
"model.layers.36.self_attn.v_proj": 1495,
|
| 257 |
+
"model.layers.36.self_attn.o_proj": 1495,
|
| 258 |
+
"model.layers.36.mlp.gate_proj": 2182,
|
| 259 |
+
"model.layers.36.mlp.up_proj": 2182,
|
| 260 |
+
"model.layers.36.mlp.down_proj": 2182,
|
| 261 |
+
"model.layers.37.self_attn.q_proj": 1495,
|
| 262 |
+
"model.layers.37.self_attn.k_proj": 1495,
|
| 263 |
+
"model.layers.37.self_attn.v_proj": 1495,
|
| 264 |
+
"model.layers.37.self_attn.o_proj": 1495,
|
| 265 |
+
"model.layers.37.mlp.gate_proj": 2182,
|
| 266 |
+
"model.layers.37.mlp.up_proj": 2182,
|
| 267 |
+
"model.layers.37.mlp.down_proj": 2182,
|
| 268 |
+
"model.layers.38.self_attn.q_proj": 1495,
|
| 269 |
+
"model.layers.38.self_attn.k_proj": 1495,
|
| 270 |
+
"model.layers.38.self_attn.v_proj": 1495,
|
| 271 |
+
"model.layers.38.self_attn.o_proj": 1495,
|
| 272 |
+
"model.layers.38.mlp.gate_proj": 2182,
|
| 273 |
+
"model.layers.38.mlp.up_proj": 2182,
|
| 274 |
+
"model.layers.38.mlp.down_proj": 2182,
|
| 275 |
+
"model.layers.39.self_attn.q_proj": 1495,
|
| 276 |
+
"model.layers.39.self_attn.k_proj": 1495,
|
| 277 |
+
"model.layers.39.self_attn.v_proj": 1495,
|
| 278 |
+
"model.layers.39.self_attn.o_proj": 1495,
|
| 279 |
+
"model.layers.39.mlp.gate_proj": 2182,
|
| 280 |
+
"model.layers.39.mlp.up_proj": 2182,
|
| 281 |
+
"model.layers.39.mlp.down_proj": 2182
|
| 282 |
+
}
|
svd_llm/heal/llama2-13b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:42b2f5c959e8fdd07ef526e6d182cab2f7685354859e1262b035eef39ba98387
|
| 3 |
+
size 15475814672
|
svd_llm/heal/llama2-7b/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-7b-chat-hf
|
| 4 |
+
tags:
|
| 5 |
+
- svd
|
| 6 |
+
- low-rank
|
| 7 |
+
- model-compression
|
| 8 |
+
- llama2
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# SVD-LLM (ICLR 2025): LLaMA-2-7B-chat @ 4.02B, KD-healed
|
| 12 |
+
|
| 13 |
+
SVD-LLM: truncation-aware data whitening (256 wikitext2 samples) + closed-form parameter update, official code ([AIoT-MLSys-Lab/SVD-LLM @ 7538cca](https://github.com/AIoT-MLSys-Lab/SVD-LLM)), uniform 41.93% removal across all 7 projection types of all 32 layers.
|
| 14 |
+
|
| 15 |
+
- **4.022B params** (down from 6.74B, ~40% reduction)
|
| 16 |
+
- Healed with pure forward-KL distillation from the dense 7B teacher: **60M tokens**,
|
| 17 |
+
held-out KL **2.5712 -> 0.3552**, probe MMLU (5-shot, limit 40/subtask) **25.92% -> 40.83%**
|
| 18 |
+
- Formal full-benchmark evaluation under the locked protocol (lm-eval 0.4.12, fp16, seed
|
| 19 |
+
1234, 5/10/0/5/5-shot MMLU/HS/BQ/TQA/GSM): **[being finalized; see
|
| 20 |
+
the TR-3 paper's Table 2]**
|
| 21 |
+
|
| 22 |
+
| Reference | MMLU | HellaSwag | BoolQ | TriviaQA | GSM8K |
|
| 23 |
+
|---|---:|---:|---:|---:|---:|
|
| 24 |
+
| unhealed 4.02B (same structure) | 26.29 | 34.22 | 38.35 | 0.96 | 0.00 |
|
| 25 |
+
| TR-3 (same budget + same healing) | 43.21 | 70.75 | 77.09 | 36.93 | 9.40 |
|
| 26 |
+
| FP16 dense 6.74B | 47.22 | 78.59 | 80.58 | 57.17 | 22.67 |
|
| 27 |
+
|
| 28 |
+
## How to load
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
import json
|
| 32 |
+
from lowrank_linear import build, materialize_all
|
| 33 |
+
|
| 34 |
+
model = build("NousResearch/Llama-2-7b-chat-hf",
|
| 35 |
+
json.load(open("ranks.json")), "state_dict_fp16.pt",
|
| 36 |
+
device="cuda")
|
| 37 |
+
# for generation/eval: fuse the factors first (inference-only)
|
| 38 |
+
materialize_all(model)
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
`ranks.json` maps each compressed projection path to its integer rank; untouched weights are
|
| 42 |
+
stock LLaMA-2-7B-chat tensors. The full healing-provenance record (data mixture & revisions,
|
| 43 |
+
decontamination, SHA256 of inputs/checkpoint, 5M milestone trajectory) is in `provenance.json`.
|
svd_llm/heal/llama2-7b/config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "NousResearch/Llama-2-7b-chat-hf",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 4096,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 11008,
|
| 13 |
+
"max_position_embeddings": 4096,
|
| 14 |
+
"model_type": "llama",
|
| 15 |
+
"num_attention_heads": 32,
|
| 16 |
+
"num_hidden_layers": 32,
|
| 17 |
+
"num_key_value_heads": 32,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"pretraining_tp": 1,
|
| 20 |
+
"rms_norm_eps": 1e-05,
|
| 21 |
+
"rope_scaling": null,
|
| 22 |
+
"rope_theta": 10000.0,
|
| 23 |
+
"tie_word_embeddings": false,
|
| 24 |
+
"torch_dtype": "float16",
|
| 25 |
+
"transformers_version": "4.35.2",
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 32000
|
| 28 |
+
}
|
svd_llm/heal/llama2-7b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm/heal/llama2-7b/provenance.json
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"method": "KD healing: alpha*T^2*KL(teacher||student) + (1-alpha)*CE",
|
| 3 |
+
"student_init": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm1_r04193_tr3fmt/state_dict_fp16.pt",
|
| 4 |
+
"teacher": "NousResearch/Llama-2-7b-chat-hf",
|
| 5 |
+
"alpha": 1.0,
|
| 6 |
+
"temperature": 1.0,
|
| 7 |
+
"lr": 2e-05,
|
| 8 |
+
"tokens_seen": 59998208,
|
| 9 |
+
"epochs": 0.228,
|
| 10 |
+
"global_batch_tokens": 32768,
|
| 11 |
+
"dataset_mixture_pre_exclusion": {
|
| 12 |
+
"alpaca": 50000,
|
| 13 |
+
"openhermes": 200000,
|
| 14 |
+
"ultrachat": 100000
|
| 15 |
+
},
|
| 16 |
+
"dataset_revisions": {
|
| 17 |
+
"tatsu-lab/alpaca": "dce01c9b08f87459cf36a430d809084718273017",
|
| 18 |
+
"teknium/OpenHermes-2.5": "b82037821055c377bed0d495e72e46de3bc72e84",
|
| 19 |
+
"HuggingFaceH4/ultrachat_200k": "8049631c405ae6576f93f445c6b8166f76f5505a"
|
| 20 |
+
},
|
| 21 |
+
"canonical_pool_excluded_texts": 10000,
|
| 22 |
+
"train_texts_after_exclusion": 356000,
|
| 23 |
+
"chat_texts": 340000,
|
| 24 |
+
"mmlu_aux_texts_kept": 16000,
|
| 25 |
+
"mmlu_aux_split": "cais/mmlu auxiliary_train (official TRAIN split, disjoint from the evaluated test split; audit verified 0/99842 exact overlap)",
|
| 26 |
+
"mmlu_aux_stats": {
|
| 27 |
+
"requested_groups": 16000,
|
| 28 |
+
"rendered_groups": 16000,
|
| 29 |
+
"shots": 5,
|
| 30 |
+
"rows_total": 99842,
|
| 31 |
+
"rows_dropped_by_decontam": 71,
|
| 32 |
+
"rows_clean": 99771,
|
| 33 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe",
|
| 34 |
+
"format": "MMLU-shaped (NOT byte-identical to lm-eval; auxiliary_train has no subject)"
|
| 35 |
+
},
|
| 36 |
+
"gold_label_supervision": false,
|
| 37 |
+
"attribution_note": "alpha=1.0 => pure KD, no gold-label CE, so any MMLU change is attributable to distillation on in-domain text. alpha<1 adds CE on text containing answers = labeled MCQ training, which is a DIFFERENT and weaker claim.",
|
| 38 |
+
"train_tokens_total": 263112704,
|
| 39 |
+
"decontamination": {
|
| 40 |
+
"removed": {
|
| 41 |
+
"alpaca": 11,
|
| 42 |
+
"openhermes": 120,
|
| 43 |
+
"ultrachat": 33
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"start_kl": 2.571214348077774,
|
| 47 |
+
"final_kl": 0.3551874812692404,
|
| 48 |
+
"start_mmlu": 0.25921052631578945,
|
| 49 |
+
"final_mmlu": 0.4083333333333333,
|
| 50 |
+
"history": [
|
| 51 |
+
{
|
| 52 |
+
"tokens_m": 5.01,
|
| 53 |
+
"step": 153,
|
| 54 |
+
"held_out_kl": 0.6783921979367733,
|
| 55 |
+
"mmlu": 0.3219298245614035
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"tokens_m": 10.03,
|
| 59 |
+
"step": 306,
|
| 60 |
+
"held_out_kl": 0.6254855506122112,
|
| 61 |
+
"mmlu": 0.3425438596491228
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"tokens_m": 15.01,
|
| 65 |
+
"step": 458,
|
| 66 |
+
"held_out_kl": 0.6108568087220192,
|
| 67 |
+
"mmlu": 0.3557017543859649
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"tokens_m": 20.02,
|
| 71 |
+
"step": 611,
|
| 72 |
+
"held_out_kl": 0.5468266606330872,
|
| 73 |
+
"mmlu": 0.34692982456140353
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"tokens_m": 25.0,
|
| 77 |
+
"step": 763,
|
| 78 |
+
"held_out_kl": 0.5192997306585312,
|
| 79 |
+
"mmlu": 0.3719298245614035
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"tokens_m": 30.02,
|
| 83 |
+
"step": 916,
|
| 84 |
+
"held_out_kl": 0.4662874862551689,
|
| 85 |
+
"mmlu": 0.37456140350877193
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"tokens_m": 35.03,
|
| 89 |
+
"step": 1069,
|
| 90 |
+
"held_out_kl": 0.43436891213059425,
|
| 91 |
+
"mmlu": 0.38026315789473686
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"tokens_m": 40.01,
|
| 95 |
+
"step": 1221,
|
| 96 |
+
"held_out_kl": 0.3999592885375023,
|
| 97 |
+
"mmlu": 0.39166666666666666
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"tokens_m": 45.02,
|
| 101 |
+
"step": 1374,
|
| 102 |
+
"held_out_kl": 0.3796225134283304,
|
| 103 |
+
"mmlu": 0.40789473684210525
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"tokens_m": 50.0,
|
| 107 |
+
"step": 1526,
|
| 108 |
+
"held_out_kl": 0.367245651781559,
|
| 109 |
+
"mmlu": 0.4
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"tokens_m": 55.02,
|
| 113 |
+
"step": 1679,
|
| 114 |
+
"held_out_kl": 0.36011041700839996,
|
| 115 |
+
"mmlu": 0.40614035087719297
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"tokens_m": 60.0,
|
| 119 |
+
"step": 1831,
|
| 120 |
+
"held_out_kl": 0.3551874812692404,
|
| 121 |
+
"mmlu": 0.4083333333333333,
|
| 122 |
+
"final": true
|
| 123 |
+
}
|
| 124 |
+
],
|
| 125 |
+
"teacher_mmlu_same_limit": 0.47543859649122805,
|
| 126 |
+
"checkpoint": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04193_h1/state_dict_fp16.pt",
|
| 127 |
+
"sha256": "0d6cb91e781a8daaca00bef920965ad84d13fd103405e975611fd89150886923",
|
| 128 |
+
"seed": 1234,
|
| 129 |
+
"mmlu_limit_per_subtask": 40,
|
| 130 |
+
"teacher_revision": "351844e75ed0bcbbe3f10671b3c808d2b83894ee",
|
| 131 |
+
"student_init_sha256": "f244b45c40d688d4a4e285026ac4272a3db892364d91963564b87b69cd21b8bd",
|
| 132 |
+
"ranks_file": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm1_r04193_tr3fmt/ranks.json",
|
| 133 |
+
"ranks_sha256": "715d09b26b58bbc4052eb425dc041e5d8b3acb5cc6cef729e2ca34c76c0e2943",
|
| 134 |
+
"input_identity_gate": {
|
| 135 |
+
"student_ckpt": {
|
| 136 |
+
"key": "svdllm1_r04193_tr3fmt",
|
| 137 |
+
"sha256": "f244b45c40d688d4a4e285026ac4272a3db892364d91963564b87b69cd21b8bd",
|
| 138 |
+
"status": "unregistered_allowed"
|
| 139 |
+
},
|
| 140 |
+
"ranks": {
|
| 141 |
+
"key": "svdllm1_r04193_tr3fmt",
|
| 142 |
+
"sha256": "715d09b26b58bbc4052eb425dc041e5d8b3acb5cc6cef729e2ca34c76c0e2943",
|
| 143 |
+
"status": "unregistered_allowed"
|
| 144 |
+
}
|
| 145 |
+
},
|
| 146 |
+
"train_seed": 1234,
|
| 147 |
+
"mmlu_seed": 1234,
|
| 148 |
+
"dynamic_batch": false,
|
| 149 |
+
"dbl": null,
|
| 150 |
+
"snapshot_milestones": true,
|
| 151 |
+
"snapshots": [
|
| 152 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04193_h1_snap50m'), 50.003968)",
|
| 153 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm1r04193_h1_snap55m'), 55.017472)"
|
| 154 |
+
],
|
| 155 |
+
"stream_skip_tokens_m": 0.0,
|
| 156 |
+
"stream_blocks_consumed": [
|
| 157 |
+
0,
|
| 158 |
+
58592
|
| 159 |
+
],
|
| 160 |
+
"stream_note": "the block order is a seeded permutation consumed from index 0; stages sharing a --seed with stream_skip=0 re-train on the SAME blocks. [start, end] block indices are recorded so any continuation can be checked for overlap with what earlier stages consumed.",
|
| 161 |
+
"student_master_dtype": "bf16",
|
| 162 |
+
"fake_quant": null,
|
| 163 |
+
"rebalance_report": null,
|
| 164 |
+
"student_param_count": 4021989376,
|
| 165 |
+
"micro": 16,
|
| 166 |
+
"grad_accum": 2,
|
| 167 |
+
"seq_len": 1024,
|
| 168 |
+
"held_out_source": "canonical: mixture 2000/4000/4000, seed 1234, seq 1024, blocks 256:264 (identical to the compression gates)",
|
| 169 |
+
"decontam_stats": {
|
| 170 |
+
"mmlu": {
|
| 171 |
+
"items": 14042,
|
| 172 |
+
"new_ngrams": 764261,
|
| 173 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe"
|
| 174 |
+
},
|
| 175 |
+
"hellaswag": {
|
| 176 |
+
"items": 10042,
|
| 177 |
+
"new_ngrams": 1334302,
|
| 178 |
+
"revision": "218ec52e09a7e7462a5400043bb9a69a41d06b76"
|
| 179 |
+
},
|
| 180 |
+
"boolq": {
|
| 181 |
+
"items": 3270,
|
| 182 |
+
"new_ngrams": 276806,
|
| 183 |
+
"revision": "3de24cf8022e94f4ee4b9d55a6f539891524d646"
|
| 184 |
+
},
|
| 185 |
+
"triviaqa": {
|
| 186 |
+
"items": 17944,
|
| 187 |
+
"new_ngrams": 32608,
|
| 188 |
+
"revision": "0f7faf33a3908546c6fd5b73a660e0f8ff173c2f"
|
| 189 |
+
},
|
| 190 |
+
"gsm8k": {
|
| 191 |
+
"items": 1319,
|
| 192 |
+
"new_ngrams": 46281,
|
| 193 |
+
"revision": "740312add88f781978c0658806c59bc2815b9866"
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
}
|
svd_llm/heal/llama2-7b/ranks.json
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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+
"model.layers.0.mlp.up_proj": 1733,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 1733,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 1189,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 1189,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 1189,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 1189,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 1733,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 1733,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 1733,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1189,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1189,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1189,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 1189,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 1733,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 1733,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 1733,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1189,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1189,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1189,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 1189,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 1733,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 1733,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 1733,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1189,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1189,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1189,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1189,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 1733,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 1733,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 1733,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1189,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1189,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1189,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1189,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 1733,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 1733,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 1733,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1189,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1189,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1189,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1189,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 1733,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 1733,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 1733,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1189,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1189,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1189,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1189,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 1733,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 1733,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 1733,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1189,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1189,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1189,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1189,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 1733,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 1733,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 1733,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1189,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1189,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1189,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1189,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 1733,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 1733,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 1733,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1189,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1189,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1189,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1189,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 1733,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 1733,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 1733,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1189,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1189,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1189,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1189,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 1733,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 1733,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 1733,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1189,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1189,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1189,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1189,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 1733,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 1733,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 1733,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1189,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1189,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1189,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1189,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 1733,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 1733,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 1733,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1189,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1189,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1189,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1189,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 1733,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 1733,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 1733,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1189,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1189,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1189,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1189,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 1733,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 1733,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 1733,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1189,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1189,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1189,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1189,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 1733,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 1733,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 1733,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1189,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1189,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1189,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1189,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 1733,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 1733,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 1733,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1189,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1189,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1189,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1189,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 1733,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 1733,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 1733,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1189,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1189,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1189,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1189,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 1733,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 1733,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 1733,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1189,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1189,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1189,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1189,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 1733,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 1733,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 1733,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1189,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1189,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1189,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1189,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 1733,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 1733,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 1733,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1189,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1189,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1189,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1189,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 1733,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 1733,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 1733,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1189,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1189,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1189,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1189,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 1733,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 1733,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 1733,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1189,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1189,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1189,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1189,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 1733,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 1733,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 1733,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1189,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1189,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1189,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1189,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 1733,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 1733,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 1733,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1189,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1189,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1189,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1189,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 1733,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 1733,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 1733,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1189,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1189,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1189,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1189,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 1733,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 1733,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 1733,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1189,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1189,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1189,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1189,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 1733,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 1733,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 1733,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1189,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1189,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1189,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1189,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 1733,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 1733,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 1733,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1189,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1189,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1189,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1189,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 1733,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 1733,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 1733,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1189,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1189,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1189,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1189,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 1733,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 1733,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 1733
|
| 226 |
+
}
|
svd_llm/heal/llama2-7b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0d6cb91e781a8daaca00bef920965ad84d13fd103405e975611fd89150886923
|
| 3 |
+
size 8044149604
|
svd_llm/unheal/llama2-13b/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-13b-chat-hf
|
| 4 |
+
tags: [svd, low-rank, model-compression, llama2]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# SVD-LLM @ 7.74B (59.47% kept of LLaMA-2-13B-chat), UNHEALED
|
| 8 |
+
|
| 9 |
+
SVD-LLM (ICLR 2025): truncation-aware data whitening + closed-form parameter update, official code (@ 7538cca), uniform 41.58% removal across all 7 projection types of all 40 layers.
|
| 10 |
+
|
| 11 |
+
- **UNHEALED checkpoint**: raw post-training compression weights, NO distillation. The KD-healed
|
| 12 |
+
counterpart is in `svd-llm-13b/`. This dir exists so the healing delta is
|
| 13 |
+
measurable; use it as the compression-stage artifact, not as a deployable model.
|
| 14 |
+
- Same `ranks.json` as the healed dir; weights differ (see `provenance.json` SHA256).
|
| 15 |
+
|
| 16 |
+
Load exactly as in the sibling dir (`lowrank_linear.py`).
|
svd_llm/unheal/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 |
+
}
|
svd_llm/unheal/llama2-13b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm/unheal/llama2-13b/provenance.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"kind": "unhealed SVD compression (TR3-format conversion, verified pure re-keying)",
|
| 3 |
+
"source_ckpt": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm1_llama2_13b_chat_r04158/NousResearch_Llama_2_13b_chat_hf_whitening_then_update_0.5842.pt",
|
| 4 |
+
"converted_state_dict": "/data1/rkp00022/zixuan/projects/TR3_main/scratch/hf_push_13b/svd-llm-13b-unhealed/state_dict_fp16.pt",
|
| 5 |
+
"state_dict_sha256": "5625041bed874f21664b6a2bff3ce4722612302630028c9b60ac7f2cb8d7c605",
|
| 6 |
+
"healed_counterpart": "svd-llm-13b/state_dict_fp16.pt"
|
| 7 |
+
}
|
svd_llm/unheal/llama2-13b/ranks.json
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model.layers.0.self_attn.q_proj": 1495,
|
| 3 |
+
"model.layers.0.self_attn.k_proj": 1495,
|
| 4 |
+
"model.layers.0.self_attn.v_proj": 1495,
|
| 5 |
+
"model.layers.0.self_attn.o_proj": 1495,
|
| 6 |
+
"model.layers.0.mlp.gate_proj": 2182,
|
| 7 |
+
"model.layers.0.mlp.up_proj": 2182,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 2182,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 1495,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 1495,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 1495,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 1495,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 2182,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 2182,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 2182,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1495,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1495,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1495,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 1495,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 2182,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 2182,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 2182,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1495,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1495,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1495,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 1495,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 2182,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 2182,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 2182,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1495,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1495,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1495,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1495,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 2182,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 2182,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 2182,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1495,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1495,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1495,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1495,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 2182,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 2182,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 2182,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1495,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1495,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1495,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1495,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 2182,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 2182,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 2182,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1495,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1495,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1495,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1495,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 2182,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 2182,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 2182,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1495,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1495,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1495,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1495,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 2182,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 2182,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 2182,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1495,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1495,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1495,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1495,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 2182,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 2182,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 2182,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1495,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1495,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1495,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1495,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 2182,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 2182,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 2182,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1495,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1495,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1495,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1495,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 2182,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 2182,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 2182,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1495,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1495,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1495,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1495,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 2182,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 2182,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 2182,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1495,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1495,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1495,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1495,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 2182,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 2182,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 2182,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1495,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1495,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1495,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1495,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 2182,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 2182,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 2182,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1495,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1495,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1495,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1495,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 2182,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 2182,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 2182,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1495,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1495,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1495,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1495,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 2182,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 2182,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 2182,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1495,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1495,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1495,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1495,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 2182,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 2182,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 2182,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1495,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1495,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1495,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1495,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 2182,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 2182,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 2182,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1495,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1495,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1495,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1495,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 2182,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 2182,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 2182,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1495,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1495,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1495,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1495,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 2182,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 2182,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 2182,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1495,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1495,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1495,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1495,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 2182,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 2182,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 2182,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1495,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1495,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1495,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1495,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 2182,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 2182,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 2182,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1495,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1495,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1495,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1495,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 2182,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 2182,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 2182,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1495,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1495,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1495,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1495,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 2182,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 2182,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 2182,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1495,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1495,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1495,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1495,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 2182,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 2182,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 2182,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1495,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1495,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1495,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1495,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 2182,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 2182,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 2182,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1495,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1495,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1495,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1495,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 2182,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 2182,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 2182,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1495,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1495,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1495,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1495,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 2182,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 2182,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 2182,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1495,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1495,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1495,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1495,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 2182,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 2182,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 2182,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1495,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1495,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1495,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1495,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 2182,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 2182,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 2182,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1495,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1495,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1495,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1495,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 2182,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 2182,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 2182,
|
| 226 |
+
"model.layers.32.self_attn.q_proj": 1495,
|
| 227 |
+
"model.layers.32.self_attn.k_proj": 1495,
|
| 228 |
+
"model.layers.32.self_attn.v_proj": 1495,
|
| 229 |
+
"model.layers.32.self_attn.o_proj": 1495,
|
| 230 |
+
"model.layers.32.mlp.gate_proj": 2182,
|
| 231 |
+
"model.layers.32.mlp.up_proj": 2182,
|
| 232 |
+
"model.layers.32.mlp.down_proj": 2182,
|
| 233 |
+
"model.layers.33.self_attn.q_proj": 1495,
|
| 234 |
+
"model.layers.33.self_attn.k_proj": 1495,
|
| 235 |
+
"model.layers.33.self_attn.v_proj": 1495,
|
| 236 |
+
"model.layers.33.self_attn.o_proj": 1495,
|
| 237 |
+
"model.layers.33.mlp.gate_proj": 2182,
|
| 238 |
+
"model.layers.33.mlp.up_proj": 2182,
|
| 239 |
+
"model.layers.33.mlp.down_proj": 2182,
|
| 240 |
+
"model.layers.34.self_attn.q_proj": 1495,
|
| 241 |
+
"model.layers.34.self_attn.k_proj": 1495,
|
| 242 |
+
"model.layers.34.self_attn.v_proj": 1495,
|
| 243 |
+
"model.layers.34.self_attn.o_proj": 1495,
|
| 244 |
+
"model.layers.34.mlp.gate_proj": 2182,
|
| 245 |
+
"model.layers.34.mlp.up_proj": 2182,
|
| 246 |
+
"model.layers.34.mlp.down_proj": 2182,
|
| 247 |
+
"model.layers.35.self_attn.q_proj": 1495,
|
| 248 |
+
"model.layers.35.self_attn.k_proj": 1495,
|
| 249 |
+
"model.layers.35.self_attn.v_proj": 1495,
|
| 250 |
+
"model.layers.35.self_attn.o_proj": 1495,
|
| 251 |
+
"model.layers.35.mlp.gate_proj": 2182,
|
| 252 |
+
"model.layers.35.mlp.up_proj": 2182,
|
| 253 |
+
"model.layers.35.mlp.down_proj": 2182,
|
| 254 |
+
"model.layers.36.self_attn.q_proj": 1495,
|
| 255 |
+
"model.layers.36.self_attn.k_proj": 1495,
|
| 256 |
+
"model.layers.36.self_attn.v_proj": 1495,
|
| 257 |
+
"model.layers.36.self_attn.o_proj": 1495,
|
| 258 |
+
"model.layers.36.mlp.gate_proj": 2182,
|
| 259 |
+
"model.layers.36.mlp.up_proj": 2182,
|
| 260 |
+
"model.layers.36.mlp.down_proj": 2182,
|
| 261 |
+
"model.layers.37.self_attn.q_proj": 1495,
|
| 262 |
+
"model.layers.37.self_attn.k_proj": 1495,
|
| 263 |
+
"model.layers.37.self_attn.v_proj": 1495,
|
| 264 |
+
"model.layers.37.self_attn.o_proj": 1495,
|
| 265 |
+
"model.layers.37.mlp.gate_proj": 2182,
|
| 266 |
+
"model.layers.37.mlp.up_proj": 2182,
|
| 267 |
+
"model.layers.37.mlp.down_proj": 2182,
|
| 268 |
+
"model.layers.38.self_attn.q_proj": 1495,
|
| 269 |
+
"model.layers.38.self_attn.k_proj": 1495,
|
| 270 |
+
"model.layers.38.self_attn.v_proj": 1495,
|
| 271 |
+
"model.layers.38.self_attn.o_proj": 1495,
|
| 272 |
+
"model.layers.38.mlp.gate_proj": 2182,
|
| 273 |
+
"model.layers.38.mlp.up_proj": 2182,
|
| 274 |
+
"model.layers.38.mlp.down_proj": 2182,
|
| 275 |
+
"model.layers.39.self_attn.q_proj": 1495,
|
| 276 |
+
"model.layers.39.self_attn.k_proj": 1495,
|
| 277 |
+
"model.layers.39.self_attn.v_proj": 1495,
|
| 278 |
+
"model.layers.39.self_attn.o_proj": 1495,
|
| 279 |
+
"model.layers.39.mlp.gate_proj": 2182,
|
| 280 |
+
"model.layers.39.mlp.up_proj": 2182,
|
| 281 |
+
"model.layers.39.mlp.down_proj": 2182
|
| 282 |
+
}
|
svd_llm/unheal/llama2-13b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5625041bed874f21664b6a2bff3ce4722612302630028c9b60ac7f2cb8d7c605
|
| 3 |
+
size 15475812809
|
svd_llm/unheal/llama2-7b/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-7b-chat-hf
|
| 4 |
+
tags: [svd, low-rank, model-compression, llama2]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# SVD-LLM (ICLR 2025, official code): whitening + closed-form update, uniform 41.93% removal @ 4.02B, UNHEALED (LLaMA-2-7B-chat)
|
| 8 |
+
|
| 9 |
+
- **UNHEALED checkpoint**: raw post-training compression weights, NO distillation. The KD-healed
|
| 10 |
+
counterpart is at `../heal/llama2-7b/`. Same `ranks.json`; weights differ.
|
| 11 |
+
- Factored params: **4,021,989,376** (budget 4.0231B, matched to the TR-3 llama2-7b row).
|
| 12 |
+
|
| 13 |
+
Load with `lowrank_linear.py` in this dir (identical recipe to the sibling dirs).
|
svd_llm/unheal/llama2-7b/config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "NousResearch/Llama-2-7b-chat-hf",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 4096,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 11008,
|
| 13 |
+
"max_position_embeddings": 4096,
|
| 14 |
+
"model_type": "llama",
|
| 15 |
+
"num_attention_heads": 32,
|
| 16 |
+
"num_hidden_layers": 32,
|
| 17 |
+
"num_key_value_heads": 32,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"pretraining_tp": 1,
|
| 20 |
+
"rms_norm_eps": 1e-05,
|
| 21 |
+
"rope_scaling": null,
|
| 22 |
+
"rope_theta": 10000.0,
|
| 23 |
+
"tie_word_embeddings": false,
|
| 24 |
+
"torch_dtype": "float16",
|
| 25 |
+
"transformers_version": "4.35.2",
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 32000
|
| 28 |
+
}
|
svd_llm/unheal/llama2-7b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm/unheal/llama2-7b/ranks.json
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model.layers.0.self_attn.q_proj": 1189,
|
| 3 |
+
"model.layers.0.self_attn.k_proj": 1189,
|
| 4 |
+
"model.layers.0.self_attn.v_proj": 1189,
|
| 5 |
+
"model.layers.0.self_attn.o_proj": 1189,
|
| 6 |
+
"model.layers.0.mlp.gate_proj": 1733,
|
| 7 |
+
"model.layers.0.mlp.up_proj": 1733,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 1733,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 1189,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 1189,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 1189,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 1189,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 1733,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 1733,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 1733,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1189,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1189,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1189,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 1189,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 1733,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 1733,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 1733,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1189,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1189,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1189,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 1189,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 1733,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 1733,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 1733,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1189,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1189,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1189,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1189,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 1733,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 1733,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 1733,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1189,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1189,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1189,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1189,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 1733,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 1733,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 1733,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1189,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1189,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1189,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1189,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 1733,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 1733,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 1733,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1189,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1189,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1189,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1189,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 1733,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 1733,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 1733,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1189,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1189,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1189,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1189,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 1733,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 1733,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 1733,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1189,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1189,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1189,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1189,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 1733,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 1733,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 1733,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1189,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1189,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1189,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1189,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 1733,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 1733,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 1733,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1189,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1189,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1189,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1189,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 1733,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 1733,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 1733,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1189,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1189,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1189,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1189,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 1733,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 1733,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 1733,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1189,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1189,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1189,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1189,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 1733,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 1733,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 1733,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1189,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1189,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1189,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1189,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 1733,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 1733,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 1733,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1189,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1189,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1189,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1189,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 1733,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 1733,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 1733,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1189,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1189,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1189,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1189,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 1733,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 1733,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 1733,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1189,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1189,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1189,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1189,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 1733,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 1733,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 1733,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1189,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1189,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1189,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1189,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 1733,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 1733,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 1733,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1189,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1189,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1189,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1189,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 1733,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 1733,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 1733,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1189,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1189,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1189,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1189,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 1733,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 1733,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 1733,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1189,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1189,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1189,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1189,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 1733,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 1733,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 1733,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1189,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1189,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1189,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1189,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 1733,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 1733,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 1733,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1189,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1189,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1189,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1189,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 1733,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 1733,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 1733,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1189,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1189,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1189,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1189,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 1733,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 1733,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 1733,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1189,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1189,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1189,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1189,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 1733,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 1733,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 1733,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1189,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1189,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1189,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1189,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 1733,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 1733,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 1733,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1189,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1189,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1189,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1189,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 1733,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 1733,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 1733,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1189,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1189,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1189,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1189,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 1733,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 1733,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 1733,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1189,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1189,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1189,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1189,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 1733,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 1733,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 1733,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1189,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1189,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1189,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1189,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 1733,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 1733,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 1733,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1189,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1189,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1189,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1189,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 1733,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 1733,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 1733
|
| 226 |
+
}
|
svd_llm/unheal/llama2-7b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f244b45c40d688d4a4e285026ac4272a3db892364d91963564b87b69cd21b8bd
|
| 3 |
+
size 8044148257
|
svd_llm2/heal/llama2-13b/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-13b-chat-hf
|
| 4 |
+
tags: [svd, low-rank, model-compression, llama2, knowledge-distillation]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# SVD-LLM V2 @ 7.74B (59.47% kept of LLaMA-2-13B-chat), KD-healed 60M tokens
|
| 8 |
+
|
| 9 |
+
SVD-LLM V2 (NAACL 2025): heterogeneous ratio allocation (Alg. 1) + loss-optimized truncation (Alg. 2). Official code never released; our faithful implementation (see per-layer ranks in ranks.json). Exact budget match: 7,740,286,464 vs target 7,740,282,880.
|
| 10 |
+
|
| 11 |
+
- **HEALED checkpoint** (this dir). The matching **UNHEALED** pre-distillation weights are in
|
| 12 |
+
`svd-llm-v2-13b-unhealed/` — do not mix them up: same `ranks.json`, different `state_dict_fp16.pt` (see
|
| 13 |
+
`provenance.json` SHA256 here vs the unhealed dir's record).
|
| 14 |
+
- Healing: pure forward-KL distillation from frozen NousResearch/Llama-2-13b-chat-hf teacher,
|
| 15 |
+
60M tokens, held-out KL **2.0268 -> 0.2858**, probe MMLU (5-shot, limit 40) **26.89% -> 44.96%**.
|
| 16 |
+
- Identical recipe/protocol to the TR-3 13B and the 7B SVD baselines (see their dirs).
|
| 17 |
+
|
| 18 |
+
## Load
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
import json
|
| 22 |
+
from lowrank_linear import build, materialize_all
|
| 23 |
+
model = build("NousResearch/Llama-2-13b-chat-hf", json.load(open("ranks.json")),
|
| 24 |
+
"state_dict_fp16.pt", device="cuda")
|
| 25 |
+
materialize_all(model) # inference-only fusion U@V
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
Full provenance (data mixture + revisions, decontamination, SHA256 of every input and
|
| 29 |
+
checkpoint, 12 x 5M milestone trajectory) in `provenance.json`.
|
svd_llm2/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 |
+
}
|
svd_llm2/heal/llama2-13b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm2/heal/llama2-13b/provenance.json
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"method": "KD healing: alpha*T^2*KL(teacher||student) + (1-alpha)*CE",
|
| 3 |
+
"student_init": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm2_r04158_tr3fmt/state_dict_fp16.pt",
|
| 4 |
+
"teacher": "NousResearch/Llama-2-13b-chat-hf",
|
| 5 |
+
"alpha": 1.0,
|
| 6 |
+
"temperature": 1.0,
|
| 7 |
+
"lr": 2e-05,
|
| 8 |
+
"tokens_seen": 59998208,
|
| 9 |
+
"epochs": 0.228,
|
| 10 |
+
"global_batch_tokens": 32768,
|
| 11 |
+
"dataset_mixture_pre_exclusion": {
|
| 12 |
+
"alpaca": 50000,
|
| 13 |
+
"openhermes": 200000,
|
| 14 |
+
"ultrachat": 100000
|
| 15 |
+
},
|
| 16 |
+
"dataset_revisions": {
|
| 17 |
+
"tatsu-lab/alpaca": "dce01c9b08f87459cf36a430d809084718273017",
|
| 18 |
+
"teknium/OpenHermes-2.5": "b82037821055c377bed0d495e72e46de3bc72e84",
|
| 19 |
+
"HuggingFaceH4/ultrachat_200k": "8049631c405ae6576f93f445c6b8166f76f5505a"
|
| 20 |
+
},
|
| 21 |
+
"canonical_pool_excluded_texts": 10000,
|
| 22 |
+
"train_texts_after_exclusion": 356000,
|
| 23 |
+
"chat_texts": 340000,
|
| 24 |
+
"mmlu_aux_texts_kept": 16000,
|
| 25 |
+
"mmlu_aux_split": "cais/mmlu auxiliary_train (official TRAIN split, disjoint from the evaluated test split; audit verified 0/99842 exact overlap)",
|
| 26 |
+
"mmlu_aux_stats": {
|
| 27 |
+
"requested_groups": 16000,
|
| 28 |
+
"rendered_groups": 16000,
|
| 29 |
+
"shots": 5,
|
| 30 |
+
"rows_total": 99842,
|
| 31 |
+
"rows_dropped_by_decontam": 71,
|
| 32 |
+
"rows_clean": 99771,
|
| 33 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe",
|
| 34 |
+
"format": "MMLU-shaped (NOT byte-identical to lm-eval; auxiliary_train has no subject)"
|
| 35 |
+
},
|
| 36 |
+
"gold_label_supervision": false,
|
| 37 |
+
"attribution_note": "alpha=1.0 => pure KD, no gold-label CE, so any MMLU change is attributable to distillation on in-domain text. alpha<1 adds CE on text containing answers = labeled MCQ training, which is a DIFFERENT and weaker claim.",
|
| 38 |
+
"train_tokens_total": 263112704,
|
| 39 |
+
"decontamination": {
|
| 40 |
+
"removed": {
|
| 41 |
+
"alpaca": 11,
|
| 42 |
+
"openhermes": 120,
|
| 43 |
+
"ultrachat": 33
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"start_kl": 2.026848241686821,
|
| 47 |
+
"final_kl": 0.28583861887454987,
|
| 48 |
+
"start_mmlu": 0.268859649122807,
|
| 49 |
+
"final_mmlu": 0.44956140350877194,
|
| 50 |
+
"history": [
|
| 51 |
+
{
|
| 52 |
+
"tokens_m": 5.01,
|
| 53 |
+
"step": 153,
|
| 54 |
+
"held_out_kl": 0.5490630865097046,
|
| 55 |
+
"mmlu": 0.42105263157894735
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"tokens_m": 10.03,
|
| 59 |
+
"step": 306,
|
| 60 |
+
"held_out_kl": 0.5244443118572235,
|
| 61 |
+
"mmlu": 0.4337719298245614
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"tokens_m": 15.01,
|
| 65 |
+
"step": 458,
|
| 66 |
+
"held_out_kl": 0.49302633106708527,
|
| 67 |
+
"mmlu": 0.4337719298245614
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"tokens_m": 20.02,
|
| 71 |
+
"step": 611,
|
| 72 |
+
"held_out_kl": 0.47258753702044487,
|
| 73 |
+
"mmlu": 0.40964912280701754
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"tokens_m": 25.0,
|
| 77 |
+
"step": 763,
|
| 78 |
+
"held_out_kl": 0.4351510964334011,
|
| 79 |
+
"mmlu": 0.4236842105263158
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"tokens_m": 30.02,
|
| 83 |
+
"step": 916,
|
| 84 |
+
"held_out_kl": 0.39489416405558586,
|
| 85 |
+
"mmlu": 0.42412280701754385
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"tokens_m": 35.03,
|
| 89 |
+
"step": 1069,
|
| 90 |
+
"held_out_kl": 0.36299458146095276,
|
| 91 |
+
"mmlu": 0.4359649122807018
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"tokens_m": 40.01,
|
| 95 |
+
"step": 1221,
|
| 96 |
+
"held_out_kl": 0.33124174922704697,
|
| 97 |
+
"mmlu": 0.4219298245614035
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"tokens_m": 45.02,
|
| 101 |
+
"step": 1374,
|
| 102 |
+
"held_out_kl": 0.30896387435495853,
|
| 103 |
+
"mmlu": 0.4355263157894737
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"tokens_m": 50.0,
|
| 107 |
+
"step": 1526,
|
| 108 |
+
"held_out_kl": 0.2978489622473717,
|
| 109 |
+
"mmlu": 0.44605263157894737
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"tokens_m": 55.02,
|
| 113 |
+
"step": 1679,
|
| 114 |
+
"held_out_kl": 0.28977251797914505,
|
| 115 |
+
"mmlu": 0.44605263157894737
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"tokens_m": 60.0,
|
| 119 |
+
"step": 1831,
|
| 120 |
+
"held_out_kl": 0.28583861887454987,
|
| 121 |
+
"mmlu": 0.44956140350877194,
|
| 122 |
+
"final": true
|
| 123 |
+
}
|
| 124 |
+
],
|
| 125 |
+
"teacher_mmlu_same_limit": 0.5442982456140351,
|
| 126 |
+
"checkpoint": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04158_h1/state_dict_fp16.pt",
|
| 127 |
+
"sha256": "1d7cee642e764d6041c21aa1c9177635d9dcc48da03de3d0869c834348a4a676",
|
| 128 |
+
"seed": 1234,
|
| 129 |
+
"mmlu_limit_per_subtask": 40,
|
| 130 |
+
"teacher_revision": "d73f5fa9c4bc135502e04c27b39660747172d76b",
|
| 131 |
+
"student_init_sha256": "f0dbe9c89696d52b78344dc7564c8c5bc6bb57ecf7cd95edaa26e6738db87e23",
|
| 132 |
+
"ranks_file": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm2_r04158_tr3fmt/ranks.json",
|
| 133 |
+
"ranks_sha256": "deedef0f4a8e33a06a5584b6e5417b5b8262342a1cfbcf797afe12e2fbfb9cc5",
|
| 134 |
+
"input_identity_gate": {
|
| 135 |
+
"student_ckpt": {
|
| 136 |
+
"key": "svdllm2_r04158_tr3fmt",
|
| 137 |
+
"sha256": "f0dbe9c89696d52b78344dc7564c8c5bc6bb57ecf7cd95edaa26e6738db87e23",
|
| 138 |
+
"status": "unregistered_allowed"
|
| 139 |
+
},
|
| 140 |
+
"ranks": {
|
| 141 |
+
"key": "svdllm2_r04158_tr3fmt",
|
| 142 |
+
"sha256": "deedef0f4a8e33a06a5584b6e5417b5b8262342a1cfbcf797afe12e2fbfb9cc5",
|
| 143 |
+
"status": "unregistered_allowed"
|
| 144 |
+
}
|
| 145 |
+
},
|
| 146 |
+
"train_seed": 1234,
|
| 147 |
+
"mmlu_seed": 1234,
|
| 148 |
+
"dynamic_batch": false,
|
| 149 |
+
"dbl": null,
|
| 150 |
+
"snapshot_milestones": true,
|
| 151 |
+
"snapshots": [
|
| 152 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04158_h1_snap15m'), 15.007744)",
|
| 153 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04158_h1_snap30m'), 30.015488)",
|
| 154 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04158_h1_snap45m'), 45.023232)",
|
| 155 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04158_h1_snap50m'), 50.003968)",
|
| 156 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04158_h1_snap55m'), 55.017472)"
|
| 157 |
+
],
|
| 158 |
+
"stream_skip_tokens_m": 0.0,
|
| 159 |
+
"stream_blocks_consumed": [
|
| 160 |
+
0,
|
| 161 |
+
58592
|
| 162 |
+
],
|
| 163 |
+
"stream_note": "the block order is a seeded permutation consumed from index 0; stages sharing a --seed with stream_skip=0 re-train on the SAME blocks. [start, end] block indices are recorded so any continuation can be checked for overlap with what earlier stages consumed.",
|
| 164 |
+
"student_master_dtype": "bf16",
|
| 165 |
+
"fake_quant": null,
|
| 166 |
+
"rebalance_report": null,
|
| 167 |
+
"student_param_count": 7740286464,
|
| 168 |
+
"micro": 8,
|
| 169 |
+
"grad_accum": 4,
|
| 170 |
+
"seq_len": 1024,
|
| 171 |
+
"held_out_source": "canonical: mixture 2000/4000/4000, seed 1234, seq 1024, blocks 256:264 (identical to the compression gates)",
|
| 172 |
+
"decontam_stats": {
|
| 173 |
+
"mmlu": {
|
| 174 |
+
"items": 14042,
|
| 175 |
+
"new_ngrams": 764261,
|
| 176 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe"
|
| 177 |
+
},
|
| 178 |
+
"hellaswag": {
|
| 179 |
+
"items": 10042,
|
| 180 |
+
"new_ngrams": 1334302,
|
| 181 |
+
"revision": "218ec52e09a7e7462a5400043bb9a69a41d06b76"
|
| 182 |
+
},
|
| 183 |
+
"boolq": {
|
| 184 |
+
"items": 3270,
|
| 185 |
+
"new_ngrams": 276806,
|
| 186 |
+
"revision": "3de24cf8022e94f4ee4b9d55a6f539891524d646"
|
| 187 |
+
},
|
| 188 |
+
"triviaqa": {
|
| 189 |
+
"items": 17944,
|
| 190 |
+
"new_ngrams": 32608,
|
| 191 |
+
"revision": "0f7faf33a3908546c6fd5b73a660e0f8ff173c2f"
|
| 192 |
+
},
|
| 193 |
+
"gsm8k": {
|
| 194 |
+
"items": 1319,
|
| 195 |
+
"new_ngrams": 46281,
|
| 196 |
+
"revision": "740312add88f781978c0658806c59bc2815b9866"
|
| 197 |
+
}
|
| 198 |
+
}
|
| 199 |
+
}
|
svd_llm2/heal/llama2-13b/ranks.json
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model.layers.0.self_attn.q_proj": 2560,
|
| 3 |
+
"model.layers.0.self_attn.k_proj": 2560,
|
| 4 |
+
"model.layers.0.self_attn.v_proj": 2560,
|
| 5 |
+
"model.layers.0.self_attn.o_proj": 2560,
|
| 6 |
+
"model.layers.0.mlp.gate_proj": 3237,
|
| 7 |
+
"model.layers.0.mlp.up_proj": 3231,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 3674,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 2514,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 2553,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 2288,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 2560,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 2862,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 2816,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 2909,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1842,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1847,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1839,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 2126,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 2506,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 2500,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 2665,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1735,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1735,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1742,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 2020,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 2363,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 2369,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 2569,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1618,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1618,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1651,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1888,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 2302,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 2310,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 2471,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1603,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1601,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1624,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1818,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 2253,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 2262,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 2388,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1555,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1551,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1588,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1778,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 2218,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 2227,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 2327,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1556,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1552,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1590,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1701,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 2199,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 2208,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 2277,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1535,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1531,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1565,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1663,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 2184,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 2190,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 2244,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1504,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1501,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1544,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1630,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 2169,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 2170,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 2219,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1507,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1506,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1551,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1583,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 2166,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 2164,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 2197,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1509,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1503,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1554,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1577,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 2165,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 2159,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 2180,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1501,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1495,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1534,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1552,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 2158,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 2148,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 2164,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1494,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1494,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1514,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1534,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 2149,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 2138,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 2142,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1482,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1480,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1512,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1499,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 2141,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 2129,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 2122,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1486,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1482,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1507,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1512,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 2131,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 2117,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 2103,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1476,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1471,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1490,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1504,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 2121,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 2107,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 2077,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1468,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1466,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1482,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1491,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 2108,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 2098,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 2066,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1455,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1453,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1469,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1498,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 2094,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 2088,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 2058,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1461,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1460,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1468,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1499,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 2083,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 2079,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 2044,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1462,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1462,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1474,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1480,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 2077,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 2074,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 2030,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1464,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1464,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1463,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1460,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 2072,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 2072,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 2010,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1436,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1437,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1442,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1491,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 2061,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 2063,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 2003,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1442,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1443,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1442,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1488,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 2051,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 2056,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 1994,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1433,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1435,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1436,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1495,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 2044,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 2050,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 1988,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1428,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1428,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1425,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1475,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 2035,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 2042,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 1978,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1424,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1424,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1421,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1474,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 2027,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 2035,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 1969,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1408,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1409,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1410,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1474,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 2019,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 2027,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 1963,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1409,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1410,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1408,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1473,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 2010,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 2017,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 1955,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1397,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1398,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1399,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1464,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 2002,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 2009,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 1948,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1389,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1391,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1385,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1436,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 1993,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 2001,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 1941,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1396,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1396,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1395,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1446,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 1985,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 1993,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 1936,
|
| 226 |
+
"model.layers.32.self_attn.q_proj": 1393,
|
| 227 |
+
"model.layers.32.self_attn.k_proj": 1395,
|
| 228 |
+
"model.layers.32.self_attn.v_proj": 1383,
|
| 229 |
+
"model.layers.32.self_attn.o_proj": 1429,
|
| 230 |
+
"model.layers.32.mlp.gate_proj": 1979,
|
| 231 |
+
"model.layers.32.mlp.up_proj": 1985,
|
| 232 |
+
"model.layers.32.mlp.down_proj": 1929,
|
| 233 |
+
"model.layers.33.self_attn.q_proj": 1399,
|
| 234 |
+
"model.layers.33.self_attn.k_proj": 1400,
|
| 235 |
+
"model.layers.33.self_attn.v_proj": 1390,
|
| 236 |
+
"model.layers.33.self_attn.o_proj": 1430,
|
| 237 |
+
"model.layers.33.mlp.gate_proj": 1973,
|
| 238 |
+
"model.layers.33.mlp.up_proj": 1978,
|
| 239 |
+
"model.layers.33.mlp.down_proj": 1921,
|
| 240 |
+
"model.layers.34.self_attn.q_proj": 1401,
|
| 241 |
+
"model.layers.34.self_attn.k_proj": 1401,
|
| 242 |
+
"model.layers.34.self_attn.v_proj": 1383,
|
| 243 |
+
"model.layers.34.self_attn.o_proj": 1424,
|
| 244 |
+
"model.layers.34.mlp.gate_proj": 1968,
|
| 245 |
+
"model.layers.34.mlp.up_proj": 1972,
|
| 246 |
+
"model.layers.34.mlp.down_proj": 1910,
|
| 247 |
+
"model.layers.35.self_attn.q_proj": 1407,
|
| 248 |
+
"model.layers.35.self_attn.k_proj": 1407,
|
| 249 |
+
"model.layers.35.self_attn.v_proj": 1388,
|
| 250 |
+
"model.layers.35.self_attn.o_proj": 1412,
|
| 251 |
+
"model.layers.35.mlp.gate_proj": 1964,
|
| 252 |
+
"model.layers.35.mlp.up_proj": 1966,
|
| 253 |
+
"model.layers.35.mlp.down_proj": 1897,
|
| 254 |
+
"model.layers.36.self_attn.q_proj": 1417,
|
| 255 |
+
"model.layers.36.self_attn.k_proj": 1416,
|
| 256 |
+
"model.layers.36.self_attn.v_proj": 1392,
|
| 257 |
+
"model.layers.36.self_attn.o_proj": 1380,
|
| 258 |
+
"model.layers.36.mlp.gate_proj": 1962,
|
| 259 |
+
"model.layers.36.mlp.up_proj": 1963,
|
| 260 |
+
"model.layers.36.mlp.down_proj": 1882,
|
| 261 |
+
"model.layers.37.self_attn.q_proj": 1438,
|
| 262 |
+
"model.layers.37.self_attn.k_proj": 1436,
|
| 263 |
+
"model.layers.37.self_attn.v_proj": 1398,
|
| 264 |
+
"model.layers.37.self_attn.o_proj": 1391,
|
| 265 |
+
"model.layers.37.mlp.gate_proj": 1964,
|
| 266 |
+
"model.layers.37.mlp.up_proj": 1966,
|
| 267 |
+
"model.layers.37.mlp.down_proj": 1877,
|
| 268 |
+
"model.layers.38.self_attn.q_proj": 1446,
|
| 269 |
+
"model.layers.38.self_attn.k_proj": 1442,
|
| 270 |
+
"model.layers.38.self_attn.v_proj": 1392,
|
| 271 |
+
"model.layers.38.self_attn.o_proj": 1376,
|
| 272 |
+
"model.layers.38.mlp.gate_proj": 1971,
|
| 273 |
+
"model.layers.38.mlp.up_proj": 1978,
|
| 274 |
+
"model.layers.38.mlp.down_proj": 1877,
|
| 275 |
+
"model.layers.39.self_attn.q_proj": 1470,
|
| 276 |
+
"model.layers.39.self_attn.k_proj": 1466,
|
| 277 |
+
"model.layers.39.self_attn.v_proj": 1423,
|
| 278 |
+
"model.layers.39.self_attn.o_proj": 1389,
|
| 279 |
+
"model.layers.39.mlp.gate_proj": 1998,
|
| 280 |
+
"model.layers.39.mlp.up_proj": 2011,
|
| 281 |
+
"model.layers.39.mlp.down_proj": 1865
|
| 282 |
+
}
|
svd_llm2/heal/llama2-13b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d7cee642e764d6041c21aa1c9177635d9dcc48da03de3d0869c834348a4a676
|
| 3 |
+
size 15480788552
|
svd_llm2/heal/llama2-7b/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-7b-chat-hf
|
| 4 |
+
tags:
|
| 5 |
+
- svd
|
| 6 |
+
- low-rank
|
| 7 |
+
- model-compression
|
| 8 |
+
- llama2
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# SVD-LLM V2 (NAACL 2025): LLaMA-2-7B-chat @ 4.02B, KD-healed
|
| 12 |
+
|
| 13 |
+
SVD-LLM V2: heterogeneous compression-ratio allocation from theoretical truncation loss (Algorithm 1) + loss-optimized weight truncation (Algorithm 2). Official code was never released; this is our faithful implementation of the published algorithms (per-layer ranks in ranks.json show the allocation).
|
| 14 |
+
|
| 15 |
+
- **4.023B params** (down from 6.74B, ~40% reduction)
|
| 16 |
+
- Healed with pure forward-KL distillation from the dense 7B teacher: **60M tokens**,
|
| 17 |
+
held-out KL **2.5806 -> 0.3365**, probe MMLU (5-shot, limit 40/subtask) **25.70% -> 40.83%**
|
| 18 |
+
- Formal full-benchmark evaluation under the locked protocol (lm-eval 0.4.12, fp16, seed
|
| 19 |
+
1234, 5/10/0/5/5-shot MMLU/HS/BQ/TQA/GSM): **[being finalized; see
|
| 20 |
+
the TR-3 paper's Table 2]**
|
| 21 |
+
|
| 22 |
+
| Reference | MMLU | HellaSwag | BoolQ | TriviaQA | GSM8K |
|
| 23 |
+
|---|---:|---:|---:|---:|---:|
|
| 24 |
+
| unhealed 4.02B (same structure) | 26.85 | 34.58 | 37.83 | 1.81 | 0.00 |
|
| 25 |
+
| TR-3 (same budget + same healing) | 43.21 | 70.75 | 77.09 | 36.93 | 9.40 |
|
| 26 |
+
| FP16 dense 6.74B | 47.22 | 78.59 | 80.58 | 57.17 | 22.67 |
|
| 27 |
+
|
| 28 |
+
## How to load
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
import json
|
| 32 |
+
from lowrank_linear import build, materialize_all
|
| 33 |
+
|
| 34 |
+
model = build("NousResearch/Llama-2-7b-chat-hf",
|
| 35 |
+
json.load(open("ranks.json")), "state_dict_fp16.pt",
|
| 36 |
+
device="cuda")
|
| 37 |
+
# for generation/eval: fuse the factors first (inference-only)
|
| 38 |
+
materialize_all(model)
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
`ranks.json` maps each compressed projection path to its integer rank; untouched weights are
|
| 42 |
+
stock LLaMA-2-7B-chat tensors. The full healing-provenance record (data mixture & revisions,
|
| 43 |
+
decontamination, SHA256 of inputs/checkpoint, 5M milestone trajectory) is in `provenance.json`.
|
svd_llm2/heal/llama2-7b/config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "NousResearch/Llama-2-7b-chat-hf",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 4096,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 11008,
|
| 13 |
+
"max_position_embeddings": 4096,
|
| 14 |
+
"model_type": "llama",
|
| 15 |
+
"num_attention_heads": 32,
|
| 16 |
+
"num_hidden_layers": 32,
|
| 17 |
+
"num_key_value_heads": 32,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"pretraining_tp": 1,
|
| 20 |
+
"rms_norm_eps": 1e-05,
|
| 21 |
+
"rope_scaling": null,
|
| 22 |
+
"rope_theta": 10000.0,
|
| 23 |
+
"tie_word_embeddings": false,
|
| 24 |
+
"torch_dtype": "float16",
|
| 25 |
+
"transformers_version": "4.35.2",
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 32000
|
| 28 |
+
}
|
svd_llm2/heal/llama2-7b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm2/heal/llama2-7b/provenance.json
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"method": "KD healing: alpha*T^2*KL(teacher||student) + (1-alpha)*CE",
|
| 3 |
+
"student_init": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm2_r04193_tr3fmt/state_dict_fp16.pt",
|
| 4 |
+
"teacher": "NousResearch/Llama-2-7b-chat-hf",
|
| 5 |
+
"alpha": 1.0,
|
| 6 |
+
"temperature": 1.0,
|
| 7 |
+
"lr": 2e-05,
|
| 8 |
+
"tokens_seen": 59998208,
|
| 9 |
+
"epochs": 0.228,
|
| 10 |
+
"global_batch_tokens": 32768,
|
| 11 |
+
"dataset_mixture_pre_exclusion": {
|
| 12 |
+
"alpaca": 50000,
|
| 13 |
+
"openhermes": 200000,
|
| 14 |
+
"ultrachat": 100000
|
| 15 |
+
},
|
| 16 |
+
"dataset_revisions": {
|
| 17 |
+
"tatsu-lab/alpaca": "dce01c9b08f87459cf36a430d809084718273017",
|
| 18 |
+
"teknium/OpenHermes-2.5": "b82037821055c377bed0d495e72e46de3bc72e84",
|
| 19 |
+
"HuggingFaceH4/ultrachat_200k": "8049631c405ae6576f93f445c6b8166f76f5505a"
|
| 20 |
+
},
|
| 21 |
+
"canonical_pool_excluded_texts": 10000,
|
| 22 |
+
"train_texts_after_exclusion": 356000,
|
| 23 |
+
"chat_texts": 340000,
|
| 24 |
+
"mmlu_aux_texts_kept": 16000,
|
| 25 |
+
"mmlu_aux_split": "cais/mmlu auxiliary_train (official TRAIN split, disjoint from the evaluated test split; audit verified 0/99842 exact overlap)",
|
| 26 |
+
"mmlu_aux_stats": {
|
| 27 |
+
"requested_groups": 16000,
|
| 28 |
+
"rendered_groups": 16000,
|
| 29 |
+
"shots": 5,
|
| 30 |
+
"rows_total": 99842,
|
| 31 |
+
"rows_dropped_by_decontam": 71,
|
| 32 |
+
"rows_clean": 99771,
|
| 33 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe",
|
| 34 |
+
"format": "MMLU-shaped (NOT byte-identical to lm-eval; auxiliary_train has no subject)"
|
| 35 |
+
},
|
| 36 |
+
"gold_label_supervision": false,
|
| 37 |
+
"attribution_note": "alpha=1.0 => pure KD, no gold-label CE, so any MMLU change is attributable to distillation on in-domain text. alpha<1 adds CE on text containing answers = labeled MCQ training, which is a DIFFERENT and weaker claim.",
|
| 38 |
+
"train_tokens_total": 263112704,
|
| 39 |
+
"decontamination": {
|
| 40 |
+
"removed": {
|
| 41 |
+
"alpaca": 11,
|
| 42 |
+
"openhermes": 120,
|
| 43 |
+
"ultrachat": 33
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"start_kl": 2.5805691182613373,
|
| 47 |
+
"final_kl": 0.33650884963572025,
|
| 48 |
+
"start_mmlu": 0.25701754385964914,
|
| 49 |
+
"final_mmlu": 0.4083333333333333,
|
| 50 |
+
"history": [
|
| 51 |
+
{
|
| 52 |
+
"tokens_m": 5.01,
|
| 53 |
+
"step": 153,
|
| 54 |
+
"held_out_kl": 0.647051740437746,
|
| 55 |
+
"mmlu": 0.2894736842105263
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"tokens_m": 10.03,
|
| 59 |
+
"step": 306,
|
| 60 |
+
"held_out_kl": 0.594494417309761,
|
| 61 |
+
"mmlu": 0.368859649122807
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"tokens_m": 15.01,
|
| 65 |
+
"step": 458,
|
| 66 |
+
"held_out_kl": 0.5670272633433342,
|
| 67 |
+
"mmlu": 0.3592105263157895
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"tokens_m": 20.02,
|
| 71 |
+
"step": 611,
|
| 72 |
+
"held_out_kl": 0.5243954174220562,
|
| 73 |
+
"mmlu": 0.36622807017543857
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"tokens_m": 25.0,
|
| 77 |
+
"step": 763,
|
| 78 |
+
"held_out_kl": 0.5039057768881321,
|
| 79 |
+
"mmlu": 0.38859649122807016
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"tokens_m": 30.02,
|
| 83 |
+
"step": 916,
|
| 84 |
+
"held_out_kl": 0.44497134163975716,
|
| 85 |
+
"mmlu": 0.37543859649122807
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"tokens_m": 35.03,
|
| 89 |
+
"step": 1069,
|
| 90 |
+
"held_out_kl": 0.402653768658638,
|
| 91 |
+
"mmlu": 0.39342105263157895
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"tokens_m": 40.01,
|
| 95 |
+
"step": 1221,
|
| 96 |
+
"held_out_kl": 0.380719942972064,
|
| 97 |
+
"mmlu": 0.393859649122807
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"tokens_m": 45.02,
|
| 101 |
+
"step": 1374,
|
| 102 |
+
"held_out_kl": 0.3613550402224064,
|
| 103 |
+
"mmlu": 0.4105263157894737
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"tokens_m": 50.0,
|
| 107 |
+
"step": 1526,
|
| 108 |
+
"held_out_kl": 0.3475096616894007,
|
| 109 |
+
"mmlu": 0.39780701754385966
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"tokens_m": 55.02,
|
| 113 |
+
"step": 1679,
|
| 114 |
+
"held_out_kl": 0.34086795896291733,
|
| 115 |
+
"mmlu": 0.40482456140350875
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"tokens_m": 60.0,
|
| 119 |
+
"step": 1831,
|
| 120 |
+
"held_out_kl": 0.33650884963572025,
|
| 121 |
+
"mmlu": 0.4083333333333333,
|
| 122 |
+
"final": true
|
| 123 |
+
}
|
| 124 |
+
],
|
| 125 |
+
"teacher_mmlu_same_limit": 0.47543859649122805,
|
| 126 |
+
"checkpoint": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04193_h1/state_dict_fp16.pt",
|
| 127 |
+
"sha256": "2c48578d7ddbe5f937c2436f35ad8ffbda01d3be45b4c4eab62e1e1c6104501c",
|
| 128 |
+
"seed": 1234,
|
| 129 |
+
"mmlu_limit_per_subtask": 40,
|
| 130 |
+
"teacher_revision": "351844e75ed0bcbbe3f10671b3c808d2b83894ee",
|
| 131 |
+
"student_init_sha256": "33e0dba497c0bfe3b4532b4c6c0e07274a2ca85219b475fb2c26978d5ae6dfbd",
|
| 132 |
+
"ranks_file": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm2_r04193_tr3fmt/ranks.json",
|
| 133 |
+
"ranks_sha256": "90ba50885421afe8d0d19024aaf52bfbbee39433f99b1e934c4bf15a20f556a3",
|
| 134 |
+
"input_identity_gate": {
|
| 135 |
+
"student_ckpt": {
|
| 136 |
+
"key": "svdllm2_r04193_tr3fmt",
|
| 137 |
+
"sha256": "33e0dba497c0bfe3b4532b4c6c0e07274a2ca85219b475fb2c26978d5ae6dfbd",
|
| 138 |
+
"status": "unregistered_allowed"
|
| 139 |
+
},
|
| 140 |
+
"ranks": {
|
| 141 |
+
"key": "svdllm2_r04193_tr3fmt",
|
| 142 |
+
"sha256": "90ba50885421afe8d0d19024aaf52bfbbee39433f99b1e934c4bf15a20f556a3",
|
| 143 |
+
"status": "unregistered_allowed"
|
| 144 |
+
}
|
| 145 |
+
},
|
| 146 |
+
"train_seed": 1234,
|
| 147 |
+
"mmlu_seed": 1234,
|
| 148 |
+
"dynamic_batch": false,
|
| 149 |
+
"dbl": null,
|
| 150 |
+
"snapshot_milestones": true,
|
| 151 |
+
"snapshots": [
|
| 152 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04193_h1_snap50m'), 50.003968)",
|
| 153 |
+
"(PosixPath('/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/kdheal_svdllm2r04193_h1_snap55m'), 55.017472)"
|
| 154 |
+
],
|
| 155 |
+
"stream_skip_tokens_m": 0.0,
|
| 156 |
+
"stream_blocks_consumed": [
|
| 157 |
+
0,
|
| 158 |
+
58592
|
| 159 |
+
],
|
| 160 |
+
"stream_note": "the block order is a seeded permutation consumed from index 0; stages sharing a --seed with stream_skip=0 re-train on the SAME blocks. [start, end] block indices are recorded so any continuation can be checked for overlap with what earlier stages consumed.",
|
| 161 |
+
"student_master_dtype": "bf16",
|
| 162 |
+
"fake_quant": null,
|
| 163 |
+
"rebalance_report": null,
|
| 164 |
+
"student_param_count": 4023119360,
|
| 165 |
+
"micro": 16,
|
| 166 |
+
"grad_accum": 2,
|
| 167 |
+
"seq_len": 1024,
|
| 168 |
+
"held_out_source": "canonical: mixture 2000/4000/4000, seed 1234, seq 1024, blocks 256:264 (identical to the compression gates)",
|
| 169 |
+
"decontam_stats": {
|
| 170 |
+
"mmlu": {
|
| 171 |
+
"items": 14042,
|
| 172 |
+
"new_ngrams": 764261,
|
| 173 |
+
"revision": "c30699e8356da336a370243923dbaf21066bb9fe"
|
| 174 |
+
},
|
| 175 |
+
"hellaswag": {
|
| 176 |
+
"items": 10042,
|
| 177 |
+
"new_ngrams": 1334302,
|
| 178 |
+
"revision": "218ec52e09a7e7462a5400043bb9a69a41d06b76"
|
| 179 |
+
},
|
| 180 |
+
"boolq": {
|
| 181 |
+
"items": 3270,
|
| 182 |
+
"new_ngrams": 276806,
|
| 183 |
+
"revision": "3de24cf8022e94f4ee4b9d55a6f539891524d646"
|
| 184 |
+
},
|
| 185 |
+
"triviaqa": {
|
| 186 |
+
"items": 17944,
|
| 187 |
+
"new_ngrams": 32608,
|
| 188 |
+
"revision": "0f7faf33a3908546c6fd5b73a660e0f8ff173c2f"
|
| 189 |
+
},
|
| 190 |
+
"gsm8k": {
|
| 191 |
+
"items": 1319,
|
| 192 |
+
"new_ngrams": 46281,
|
| 193 |
+
"revision": "740312add88f781978c0658806c59bc2815b9866"
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
}
|
svd_llm2/heal/llama2-7b/ranks.json
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model.layers.0.self_attn.q_proj": 2048,
|
| 3 |
+
"model.layers.0.self_attn.k_proj": 2048,
|
| 4 |
+
"model.layers.0.self_attn.v_proj": 2048,
|
| 5 |
+
"model.layers.0.self_attn.o_proj": 2048,
|
| 6 |
+
"model.layers.0.mlp.gate_proj": 2341,
|
| 7 |
+
"model.layers.0.mlp.up_proj": 2332,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 2887,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 1911,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 1960,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 1826,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 2048,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 2115,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 2094,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 2280,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1404,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1405,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1400,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 1662,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 1931,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 1928,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 2094,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1252,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1247,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1285,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 1598,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 1821,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 1826,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 2002,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1255,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1252,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1282,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1490,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 1780,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 1789,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 1911,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1239,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1236,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1266,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1456,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 1757,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 1765,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 1855,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1218,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1214,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1244,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1393,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 1733,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 1743,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 1807,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1209,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1208,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1237,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1356,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 1718,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 1726,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 1770,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1205,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1201,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1238,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1314,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 1715,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 1718,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 1747,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1193,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1190,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1229,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1276,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 1711,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 1711,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 1725,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1201,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1194,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1230,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1252,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 1708,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 1706,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 1713,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1199,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1196,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1213,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1258,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 1699,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 1694,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 1699,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1180,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1179,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1206,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1234,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 1692,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 1686,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 1683,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1176,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1170,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1190,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1231,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 1688,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 1678,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 1661,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1181,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1179,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1192,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1213,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 1679,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 1669,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 1644,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1177,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1174,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1187,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1198,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 1670,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 1661,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 1621,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1176,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1174,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1173,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1175,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 1662,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 1655,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 1595,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1163,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1163,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1167,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1193,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 1647,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 1643,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 1584,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1150,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1149,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1151,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1190,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 1632,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 1631,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 1568,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1156,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1157,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1152,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1184,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 1623,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 1623,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 1557,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1155,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1155,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1146,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1172,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 1617,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 1619,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 1540,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1147,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1147,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1136,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1174,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 1607,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 1611,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 1531,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1138,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1138,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1129,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1149,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 1599,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 1604,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 1517,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1122,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1123,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1115,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1139,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 1589,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 1593,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 1508,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1138,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1139,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1118,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1135,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 1580,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 1585,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 1501,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1116,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1116,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1100,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1141,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 1573,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 1577,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 1496,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1127,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1126,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1103,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1121,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 1565,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 1569,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 1487,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1108,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1107,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1095,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1109,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 1557,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 1561,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 1475,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1113,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1111,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1090,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1105,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 1555,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 1556,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 1462,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1128,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1127,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1094,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1094,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 1552,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 1553,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 1450,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1116,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1115,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1087,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1093,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 1552,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 1556,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 1439,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1156,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1152,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1126,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1102,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 1570,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 1576,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 1429
|
| 226 |
+
}
|
svd_llm2/heal/llama2-7b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2c48578d7ddbe5f937c2436f35ad8ffbda01d3be45b4c4eab62e1e1c6104501c
|
| 3 |
+
size 8046409836
|
svd_llm2/unheal/llama2-13b/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-13b-chat-hf
|
| 4 |
+
tags: [svd, low-rank, model-compression, llama2]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# SVD-LLM V2 @ 7.74B (59.47% kept of LLaMA-2-13B-chat), UNHEALED
|
| 8 |
+
|
| 9 |
+
SVD-LLM V2 (NAACL 2025): heterogeneous ratio allocation (Alg. 1) + loss-optimized truncation (Alg. 2). Official code never released; our faithful implementation (see per-layer ranks in ranks.json). Exact budget match: 7,740,286,464 vs target 7,740,282,880.
|
| 10 |
+
|
| 11 |
+
- **UNHEALED checkpoint**: raw post-training compression weights, NO distillation. The KD-healed
|
| 12 |
+
counterpart is in `svd-llm-v2-13b/`. This dir exists so the healing delta is
|
| 13 |
+
measurable; use it as the compression-stage artifact, not as a deployable model.
|
| 14 |
+
- Same `ranks.json` as the healed dir; weights differ (see `provenance.json` SHA256).
|
| 15 |
+
|
| 16 |
+
Load exactly as in the sibling dir (`lowrank_linear.py`).
|
svd_llm2/unheal/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 |
+
}
|
svd_llm2/unheal/llama2-13b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm2/unheal/llama2-13b/provenance.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"kind": "unhealed SVD compression (TR3-format conversion, verified pure re-keying)",
|
| 3 |
+
"source_ckpt": "/data1/rkp00022/zixuan/projects/TR3_main/checkpoints/svdllm2_llama2_13b_chat_r04158/NousResearch_Llama_2_13b_chat_hf_svdllmv2_keep_0.5740.pt",
|
| 4 |
+
"converted_state_dict": "/data1/rkp00022/zixuan/projects/TR3_main/scratch/hf_push_13b/svd-llm-v2-13b-unhealed/state_dict_fp16.pt",
|
| 5 |
+
"state_dict_sha256": "f0dbe9c89696d52b78344dc7564c8c5bc6bb57ecf7cd95edaa26e6738db87e23",
|
| 6 |
+
"healed_counterpart": "svd-llm-v2-13b/state_dict_fp16.pt"
|
| 7 |
+
}
|
svd_llm2/unheal/llama2-13b/ranks.json
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model.layers.0.self_attn.q_proj": 2560,
|
| 3 |
+
"model.layers.0.self_attn.k_proj": 2560,
|
| 4 |
+
"model.layers.0.self_attn.v_proj": 2560,
|
| 5 |
+
"model.layers.0.self_attn.o_proj": 2560,
|
| 6 |
+
"model.layers.0.mlp.gate_proj": 3237,
|
| 7 |
+
"model.layers.0.mlp.up_proj": 3231,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 3674,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 2514,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 2553,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 2288,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 2560,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 2862,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 2816,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 2909,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1842,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1847,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1839,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 2126,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 2506,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 2500,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 2665,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1735,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1735,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1742,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 2020,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 2363,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 2369,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 2569,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1618,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1618,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1651,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1888,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 2302,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 2310,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 2471,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1603,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1601,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1624,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1818,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 2253,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 2262,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 2388,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1555,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1551,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1588,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1778,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 2218,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 2227,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 2327,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1556,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1552,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1590,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1701,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 2199,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 2208,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 2277,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1535,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1531,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1565,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1663,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 2184,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 2190,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 2244,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1504,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1501,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1544,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1630,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 2169,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 2170,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 2219,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1507,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1506,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1551,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1583,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 2166,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 2164,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 2197,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1509,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1503,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1554,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1577,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 2165,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 2159,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 2180,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1501,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1495,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1534,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1552,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 2158,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 2148,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 2164,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1494,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1494,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1514,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1534,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 2149,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 2138,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 2142,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1482,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1480,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1512,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1499,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 2141,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 2129,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 2122,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1486,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1482,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1507,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1512,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 2131,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 2117,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 2103,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1476,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1471,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1490,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1504,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 2121,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 2107,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 2077,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1468,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1466,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1482,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1491,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 2108,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 2098,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 2066,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1455,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1453,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1469,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1498,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 2094,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 2088,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 2058,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1461,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1460,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1468,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1499,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 2083,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 2079,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 2044,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1462,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1462,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1474,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1480,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 2077,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 2074,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 2030,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1464,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1464,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1463,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1460,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 2072,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 2072,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 2010,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1436,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1437,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1442,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1491,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 2061,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 2063,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 2003,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1442,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1443,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1442,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1488,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 2051,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 2056,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 1994,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1433,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1435,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1436,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1495,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 2044,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 2050,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 1988,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1428,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1428,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1425,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1475,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 2035,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 2042,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 1978,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1424,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1424,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1421,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1474,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 2027,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 2035,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 1969,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1408,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1409,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1410,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1474,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 2019,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 2027,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 1963,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1409,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1410,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1408,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1473,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 2010,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 2017,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 1955,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1397,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1398,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1399,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1464,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 2002,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 2009,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 1948,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1389,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1391,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1385,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1436,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 1993,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 2001,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 1941,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1396,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1396,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1395,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1446,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 1985,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 1993,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 1936,
|
| 226 |
+
"model.layers.32.self_attn.q_proj": 1393,
|
| 227 |
+
"model.layers.32.self_attn.k_proj": 1395,
|
| 228 |
+
"model.layers.32.self_attn.v_proj": 1383,
|
| 229 |
+
"model.layers.32.self_attn.o_proj": 1429,
|
| 230 |
+
"model.layers.32.mlp.gate_proj": 1979,
|
| 231 |
+
"model.layers.32.mlp.up_proj": 1985,
|
| 232 |
+
"model.layers.32.mlp.down_proj": 1929,
|
| 233 |
+
"model.layers.33.self_attn.q_proj": 1399,
|
| 234 |
+
"model.layers.33.self_attn.k_proj": 1400,
|
| 235 |
+
"model.layers.33.self_attn.v_proj": 1390,
|
| 236 |
+
"model.layers.33.self_attn.o_proj": 1430,
|
| 237 |
+
"model.layers.33.mlp.gate_proj": 1973,
|
| 238 |
+
"model.layers.33.mlp.up_proj": 1978,
|
| 239 |
+
"model.layers.33.mlp.down_proj": 1921,
|
| 240 |
+
"model.layers.34.self_attn.q_proj": 1401,
|
| 241 |
+
"model.layers.34.self_attn.k_proj": 1401,
|
| 242 |
+
"model.layers.34.self_attn.v_proj": 1383,
|
| 243 |
+
"model.layers.34.self_attn.o_proj": 1424,
|
| 244 |
+
"model.layers.34.mlp.gate_proj": 1968,
|
| 245 |
+
"model.layers.34.mlp.up_proj": 1972,
|
| 246 |
+
"model.layers.34.mlp.down_proj": 1910,
|
| 247 |
+
"model.layers.35.self_attn.q_proj": 1407,
|
| 248 |
+
"model.layers.35.self_attn.k_proj": 1407,
|
| 249 |
+
"model.layers.35.self_attn.v_proj": 1388,
|
| 250 |
+
"model.layers.35.self_attn.o_proj": 1412,
|
| 251 |
+
"model.layers.35.mlp.gate_proj": 1964,
|
| 252 |
+
"model.layers.35.mlp.up_proj": 1966,
|
| 253 |
+
"model.layers.35.mlp.down_proj": 1897,
|
| 254 |
+
"model.layers.36.self_attn.q_proj": 1417,
|
| 255 |
+
"model.layers.36.self_attn.k_proj": 1416,
|
| 256 |
+
"model.layers.36.self_attn.v_proj": 1392,
|
| 257 |
+
"model.layers.36.self_attn.o_proj": 1380,
|
| 258 |
+
"model.layers.36.mlp.gate_proj": 1962,
|
| 259 |
+
"model.layers.36.mlp.up_proj": 1963,
|
| 260 |
+
"model.layers.36.mlp.down_proj": 1882,
|
| 261 |
+
"model.layers.37.self_attn.q_proj": 1438,
|
| 262 |
+
"model.layers.37.self_attn.k_proj": 1436,
|
| 263 |
+
"model.layers.37.self_attn.v_proj": 1398,
|
| 264 |
+
"model.layers.37.self_attn.o_proj": 1391,
|
| 265 |
+
"model.layers.37.mlp.gate_proj": 1964,
|
| 266 |
+
"model.layers.37.mlp.up_proj": 1966,
|
| 267 |
+
"model.layers.37.mlp.down_proj": 1877,
|
| 268 |
+
"model.layers.38.self_attn.q_proj": 1446,
|
| 269 |
+
"model.layers.38.self_attn.k_proj": 1442,
|
| 270 |
+
"model.layers.38.self_attn.v_proj": 1392,
|
| 271 |
+
"model.layers.38.self_attn.o_proj": 1376,
|
| 272 |
+
"model.layers.38.mlp.gate_proj": 1971,
|
| 273 |
+
"model.layers.38.mlp.up_proj": 1978,
|
| 274 |
+
"model.layers.38.mlp.down_proj": 1877,
|
| 275 |
+
"model.layers.39.self_attn.q_proj": 1470,
|
| 276 |
+
"model.layers.39.self_attn.k_proj": 1466,
|
| 277 |
+
"model.layers.39.self_attn.v_proj": 1423,
|
| 278 |
+
"model.layers.39.self_attn.o_proj": 1389,
|
| 279 |
+
"model.layers.39.mlp.gate_proj": 1998,
|
| 280 |
+
"model.layers.39.mlp.up_proj": 2011,
|
| 281 |
+
"model.layers.39.mlp.down_proj": 1865
|
| 282 |
+
}
|
svd_llm2/unheal/llama2-13b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0dbe9c89696d52b78344dc7564c8c5bc6bb57ecf7cd95edaa26e6738db87e23
|
| 3 |
+
size 15480786677
|
svd_llm2/unheal/llama2-7b/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-7b-chat-hf
|
| 4 |
+
tags: [svd, low-rank, model-compression, llama2]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# SVD-LLM V2 (NAACL 2025, official code unreleased; our implementation of Alg. 1+2) @ 4.02B, UNHEALED (LLaMA-2-7B-chat)
|
| 8 |
+
|
| 9 |
+
- **UNHEALED checkpoint**: raw post-training compression weights, NO distillation. The KD-healed
|
| 10 |
+
counterpart is at `../heal/llama2-7b/`. Same `ranks.json`; weights differ.
|
| 11 |
+
- Factored params: **4,023,119,360** (budget 4.0231B, matched to the TR-3 llama2-7b row).
|
| 12 |
+
|
| 13 |
+
Load with `lowrank_linear.py` in this dir (identical recipe to the sibling dirs).
|
svd_llm2/unheal/llama2-7b/config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "NousResearch/Llama-2-7b-chat-hf",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 4096,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 11008,
|
| 13 |
+
"max_position_embeddings": 4096,
|
| 14 |
+
"model_type": "llama",
|
| 15 |
+
"num_attention_heads": 32,
|
| 16 |
+
"num_hidden_layers": 32,
|
| 17 |
+
"num_key_value_heads": 32,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"pretraining_tp": 1,
|
| 20 |
+
"rms_norm_eps": 1e-05,
|
| 21 |
+
"rope_scaling": null,
|
| 22 |
+
"rope_theta": 10000.0,
|
| 23 |
+
"tie_word_embeddings": false,
|
| 24 |
+
"torch_dtype": "float16",
|
| 25 |
+
"transformers_version": "4.35.2",
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 32000
|
| 28 |
+
}
|
svd_llm2/unheal/llama2-7b/lowrank_linear.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal standalone loader for the SVD-baseline compressed LLaMA-2-7B checkpoints.
|
| 2 |
+
|
| 3 |
+
No dependency beyond torch + transformers. The state_dict stores every compressed
|
| 4 |
+
projection as two factors of a LowRankLinear (A: out x k, B: k x in); ranks.json
|
| 5 |
+
holds the per-layer integer rank of each projection. Untouched parameters
|
| 6 |
+
(embeddings, norms) keep their stock transformers names.
|
| 7 |
+
|
| 8 |
+
Usage:
|
| 9 |
+
import json, torch
|
| 10 |
+
from lowrank_linear import build
|
| 11 |
+
model = build(
|
| 12 |
+
base_id="NousResearch/Llama-2-7b-chat-hf",
|
| 13 |
+
ranks=json.load(open("ranks.json")),
|
| 14 |
+
state_dict_path="state_dict_fp16.pt",
|
| 15 |
+
device="cuda", dtype=torch.float16,
|
| 16 |
+
)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf")
|
| 18 |
+
out = model.generate(tokenizer("2+2=", return_tensors="pt").to("cuda").input_ids,
|
| 19 |
+
max_new_tokens=16, do_sample=False)
|
| 20 |
+
print(tokenizer.decode(out[0]))
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
from __future__ import annotations
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn as nn
|
| 27 |
+
import torch.nn.functional as F
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LowRankLinear(nn.Module):
|
| 31 |
+
"""y = A (B x). A: out x r, B: r x in. (LLaMA projections carry no bias.)"""
|
| 32 |
+
|
| 33 |
+
def __init__(self, A: torch.Tensor, B: torch.Tensor):
|
| 34 |
+
super().__init__()
|
| 35 |
+
self.A = nn.Parameter(A)
|
| 36 |
+
self.B = nn.Parameter(B)
|
| 37 |
+
|
| 38 |
+
def forward(self, x):
|
| 39 |
+
return F.linear(F.linear(x, self.B), self.A)
|
| 40 |
+
|
| 41 |
+
@torch.no_grad()
|
| 42 |
+
def materialize_(self) -> nn.Linear:
|
| 43 |
+
"""Replace this module with the dense W = A @ B (inference only; never call
|
| 44 |
+
while training -- it cuts the gradient path)."""
|
| 45 |
+
W = (self.A @ self.B).to(self.A.dtype)
|
| 46 |
+
dense = nn.Linear(self.B.shape[1], self.A.shape[0], bias=False,
|
| 47 |
+
device=W.device, dtype=W.dtype)
|
| 48 |
+
dense.weight.data = W
|
| 49 |
+
return dense
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def build(base_id: str, ranks: dict, state_dict_path: str,
|
| 53 |
+
device: str = "cuda", dtype=torch.float16):
|
| 54 |
+
from transformers import AutoModelForCausalLM
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=dtype)
|
| 57 |
+
search = {}
|
| 58 |
+
for name, mod in model.named_modules():
|
| 59 |
+
if isinstance(mod, nn.Linear):
|
| 60 |
+
search[name] = mod
|
| 61 |
+
for path, k in ranks.items():
|
| 62 |
+
out_f, in_f = search[path].weight.shape
|
| 63 |
+
model_mod = model
|
| 64 |
+
for p in path.split(".")[:-1]:
|
| 65 |
+
model_mod = getattr(model_mod, p)
|
| 66 |
+
setattr(model_mod, path.split(".")[-1],
|
| 67 |
+
LowRankLinear(torch.zeros(out_f, int(k), dtype=dtype),
|
| 68 |
+
torch.zeros(int(k), in_f, dtype=dtype)))
|
| 69 |
+
sd = torch.load(state_dict_path, map_location="cpu", weights_only=True)
|
| 70 |
+
model.load_state_dict(sd, strict=True)
|
| 71 |
+
del sd
|
| 72 |
+
return model.to(device)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def materialize_all(model):
|
| 76 |
+
"""Fuse every LowRankLinear back into a dense nn.Linear in place."""
|
| 77 |
+
for name, mod in list(model.named_modules()):
|
| 78 |
+
if isinstance(mod, LowRankLinear):
|
| 79 |
+
parent = model
|
| 80 |
+
for p in name.split(".")[:-1]:
|
| 81 |
+
parent = getattr(parent, p)
|
| 82 |
+
setattr(parent, name.split(".")[-1], mod.materialize_())
|
| 83 |
+
return model
|
svd_llm2/unheal/llama2-7b/ranks.json
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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layers.0.self_attn.k_proj": 2048,
|
| 4 |
+
"model.layers.0.self_attn.v_proj": 2048,
|
| 5 |
+
"model.layers.0.self_attn.o_proj": 2048,
|
| 6 |
+
"model.layers.0.mlp.gate_proj": 2341,
|
| 7 |
+
"model.layers.0.mlp.up_proj": 2332,
|
| 8 |
+
"model.layers.0.mlp.down_proj": 2887,
|
| 9 |
+
"model.layers.1.self_attn.q_proj": 1911,
|
| 10 |
+
"model.layers.1.self_attn.k_proj": 1960,
|
| 11 |
+
"model.layers.1.self_attn.v_proj": 1826,
|
| 12 |
+
"model.layers.1.self_attn.o_proj": 2048,
|
| 13 |
+
"model.layers.1.mlp.gate_proj": 2115,
|
| 14 |
+
"model.layers.1.mlp.up_proj": 2094,
|
| 15 |
+
"model.layers.1.mlp.down_proj": 2280,
|
| 16 |
+
"model.layers.2.self_attn.q_proj": 1404,
|
| 17 |
+
"model.layers.2.self_attn.k_proj": 1405,
|
| 18 |
+
"model.layers.2.self_attn.v_proj": 1400,
|
| 19 |
+
"model.layers.2.self_attn.o_proj": 1662,
|
| 20 |
+
"model.layers.2.mlp.gate_proj": 1931,
|
| 21 |
+
"model.layers.2.mlp.up_proj": 1928,
|
| 22 |
+
"model.layers.2.mlp.down_proj": 2094,
|
| 23 |
+
"model.layers.3.self_attn.q_proj": 1252,
|
| 24 |
+
"model.layers.3.self_attn.k_proj": 1247,
|
| 25 |
+
"model.layers.3.self_attn.v_proj": 1285,
|
| 26 |
+
"model.layers.3.self_attn.o_proj": 1598,
|
| 27 |
+
"model.layers.3.mlp.gate_proj": 1821,
|
| 28 |
+
"model.layers.3.mlp.up_proj": 1826,
|
| 29 |
+
"model.layers.3.mlp.down_proj": 2002,
|
| 30 |
+
"model.layers.4.self_attn.q_proj": 1255,
|
| 31 |
+
"model.layers.4.self_attn.k_proj": 1252,
|
| 32 |
+
"model.layers.4.self_attn.v_proj": 1282,
|
| 33 |
+
"model.layers.4.self_attn.o_proj": 1490,
|
| 34 |
+
"model.layers.4.mlp.gate_proj": 1780,
|
| 35 |
+
"model.layers.4.mlp.up_proj": 1789,
|
| 36 |
+
"model.layers.4.mlp.down_proj": 1911,
|
| 37 |
+
"model.layers.5.self_attn.q_proj": 1239,
|
| 38 |
+
"model.layers.5.self_attn.k_proj": 1236,
|
| 39 |
+
"model.layers.5.self_attn.v_proj": 1266,
|
| 40 |
+
"model.layers.5.self_attn.o_proj": 1456,
|
| 41 |
+
"model.layers.5.mlp.gate_proj": 1757,
|
| 42 |
+
"model.layers.5.mlp.up_proj": 1765,
|
| 43 |
+
"model.layers.5.mlp.down_proj": 1855,
|
| 44 |
+
"model.layers.6.self_attn.q_proj": 1218,
|
| 45 |
+
"model.layers.6.self_attn.k_proj": 1214,
|
| 46 |
+
"model.layers.6.self_attn.v_proj": 1244,
|
| 47 |
+
"model.layers.6.self_attn.o_proj": 1393,
|
| 48 |
+
"model.layers.6.mlp.gate_proj": 1733,
|
| 49 |
+
"model.layers.6.mlp.up_proj": 1743,
|
| 50 |
+
"model.layers.6.mlp.down_proj": 1807,
|
| 51 |
+
"model.layers.7.self_attn.q_proj": 1209,
|
| 52 |
+
"model.layers.7.self_attn.k_proj": 1208,
|
| 53 |
+
"model.layers.7.self_attn.v_proj": 1237,
|
| 54 |
+
"model.layers.7.self_attn.o_proj": 1356,
|
| 55 |
+
"model.layers.7.mlp.gate_proj": 1718,
|
| 56 |
+
"model.layers.7.mlp.up_proj": 1726,
|
| 57 |
+
"model.layers.7.mlp.down_proj": 1770,
|
| 58 |
+
"model.layers.8.self_attn.q_proj": 1205,
|
| 59 |
+
"model.layers.8.self_attn.k_proj": 1201,
|
| 60 |
+
"model.layers.8.self_attn.v_proj": 1238,
|
| 61 |
+
"model.layers.8.self_attn.o_proj": 1314,
|
| 62 |
+
"model.layers.8.mlp.gate_proj": 1715,
|
| 63 |
+
"model.layers.8.mlp.up_proj": 1718,
|
| 64 |
+
"model.layers.8.mlp.down_proj": 1747,
|
| 65 |
+
"model.layers.9.self_attn.q_proj": 1193,
|
| 66 |
+
"model.layers.9.self_attn.k_proj": 1190,
|
| 67 |
+
"model.layers.9.self_attn.v_proj": 1229,
|
| 68 |
+
"model.layers.9.self_attn.o_proj": 1276,
|
| 69 |
+
"model.layers.9.mlp.gate_proj": 1711,
|
| 70 |
+
"model.layers.9.mlp.up_proj": 1711,
|
| 71 |
+
"model.layers.9.mlp.down_proj": 1725,
|
| 72 |
+
"model.layers.10.self_attn.q_proj": 1201,
|
| 73 |
+
"model.layers.10.self_attn.k_proj": 1194,
|
| 74 |
+
"model.layers.10.self_attn.v_proj": 1230,
|
| 75 |
+
"model.layers.10.self_attn.o_proj": 1252,
|
| 76 |
+
"model.layers.10.mlp.gate_proj": 1708,
|
| 77 |
+
"model.layers.10.mlp.up_proj": 1706,
|
| 78 |
+
"model.layers.10.mlp.down_proj": 1713,
|
| 79 |
+
"model.layers.11.self_attn.q_proj": 1199,
|
| 80 |
+
"model.layers.11.self_attn.k_proj": 1196,
|
| 81 |
+
"model.layers.11.self_attn.v_proj": 1213,
|
| 82 |
+
"model.layers.11.self_attn.o_proj": 1258,
|
| 83 |
+
"model.layers.11.mlp.gate_proj": 1699,
|
| 84 |
+
"model.layers.11.mlp.up_proj": 1694,
|
| 85 |
+
"model.layers.11.mlp.down_proj": 1699,
|
| 86 |
+
"model.layers.12.self_attn.q_proj": 1180,
|
| 87 |
+
"model.layers.12.self_attn.k_proj": 1179,
|
| 88 |
+
"model.layers.12.self_attn.v_proj": 1206,
|
| 89 |
+
"model.layers.12.self_attn.o_proj": 1234,
|
| 90 |
+
"model.layers.12.mlp.gate_proj": 1692,
|
| 91 |
+
"model.layers.12.mlp.up_proj": 1686,
|
| 92 |
+
"model.layers.12.mlp.down_proj": 1683,
|
| 93 |
+
"model.layers.13.self_attn.q_proj": 1176,
|
| 94 |
+
"model.layers.13.self_attn.k_proj": 1170,
|
| 95 |
+
"model.layers.13.self_attn.v_proj": 1190,
|
| 96 |
+
"model.layers.13.self_attn.o_proj": 1231,
|
| 97 |
+
"model.layers.13.mlp.gate_proj": 1688,
|
| 98 |
+
"model.layers.13.mlp.up_proj": 1678,
|
| 99 |
+
"model.layers.13.mlp.down_proj": 1661,
|
| 100 |
+
"model.layers.14.self_attn.q_proj": 1181,
|
| 101 |
+
"model.layers.14.self_attn.k_proj": 1179,
|
| 102 |
+
"model.layers.14.self_attn.v_proj": 1192,
|
| 103 |
+
"model.layers.14.self_attn.o_proj": 1213,
|
| 104 |
+
"model.layers.14.mlp.gate_proj": 1679,
|
| 105 |
+
"model.layers.14.mlp.up_proj": 1669,
|
| 106 |
+
"model.layers.14.mlp.down_proj": 1644,
|
| 107 |
+
"model.layers.15.self_attn.q_proj": 1177,
|
| 108 |
+
"model.layers.15.self_attn.k_proj": 1174,
|
| 109 |
+
"model.layers.15.self_attn.v_proj": 1187,
|
| 110 |
+
"model.layers.15.self_attn.o_proj": 1198,
|
| 111 |
+
"model.layers.15.mlp.gate_proj": 1670,
|
| 112 |
+
"model.layers.15.mlp.up_proj": 1661,
|
| 113 |
+
"model.layers.15.mlp.down_proj": 1621,
|
| 114 |
+
"model.layers.16.self_attn.q_proj": 1176,
|
| 115 |
+
"model.layers.16.self_attn.k_proj": 1174,
|
| 116 |
+
"model.layers.16.self_attn.v_proj": 1173,
|
| 117 |
+
"model.layers.16.self_attn.o_proj": 1175,
|
| 118 |
+
"model.layers.16.mlp.gate_proj": 1662,
|
| 119 |
+
"model.layers.16.mlp.up_proj": 1655,
|
| 120 |
+
"model.layers.16.mlp.down_proj": 1595,
|
| 121 |
+
"model.layers.17.self_attn.q_proj": 1163,
|
| 122 |
+
"model.layers.17.self_attn.k_proj": 1163,
|
| 123 |
+
"model.layers.17.self_attn.v_proj": 1167,
|
| 124 |
+
"model.layers.17.self_attn.o_proj": 1193,
|
| 125 |
+
"model.layers.17.mlp.gate_proj": 1647,
|
| 126 |
+
"model.layers.17.mlp.up_proj": 1643,
|
| 127 |
+
"model.layers.17.mlp.down_proj": 1584,
|
| 128 |
+
"model.layers.18.self_attn.q_proj": 1150,
|
| 129 |
+
"model.layers.18.self_attn.k_proj": 1149,
|
| 130 |
+
"model.layers.18.self_attn.v_proj": 1151,
|
| 131 |
+
"model.layers.18.self_attn.o_proj": 1190,
|
| 132 |
+
"model.layers.18.mlp.gate_proj": 1632,
|
| 133 |
+
"model.layers.18.mlp.up_proj": 1631,
|
| 134 |
+
"model.layers.18.mlp.down_proj": 1568,
|
| 135 |
+
"model.layers.19.self_attn.q_proj": 1156,
|
| 136 |
+
"model.layers.19.self_attn.k_proj": 1157,
|
| 137 |
+
"model.layers.19.self_attn.v_proj": 1152,
|
| 138 |
+
"model.layers.19.self_attn.o_proj": 1184,
|
| 139 |
+
"model.layers.19.mlp.gate_proj": 1623,
|
| 140 |
+
"model.layers.19.mlp.up_proj": 1623,
|
| 141 |
+
"model.layers.19.mlp.down_proj": 1557,
|
| 142 |
+
"model.layers.20.self_attn.q_proj": 1155,
|
| 143 |
+
"model.layers.20.self_attn.k_proj": 1155,
|
| 144 |
+
"model.layers.20.self_attn.v_proj": 1146,
|
| 145 |
+
"model.layers.20.self_attn.o_proj": 1172,
|
| 146 |
+
"model.layers.20.mlp.gate_proj": 1617,
|
| 147 |
+
"model.layers.20.mlp.up_proj": 1619,
|
| 148 |
+
"model.layers.20.mlp.down_proj": 1540,
|
| 149 |
+
"model.layers.21.self_attn.q_proj": 1147,
|
| 150 |
+
"model.layers.21.self_attn.k_proj": 1147,
|
| 151 |
+
"model.layers.21.self_attn.v_proj": 1136,
|
| 152 |
+
"model.layers.21.self_attn.o_proj": 1174,
|
| 153 |
+
"model.layers.21.mlp.gate_proj": 1607,
|
| 154 |
+
"model.layers.21.mlp.up_proj": 1611,
|
| 155 |
+
"model.layers.21.mlp.down_proj": 1531,
|
| 156 |
+
"model.layers.22.self_attn.q_proj": 1138,
|
| 157 |
+
"model.layers.22.self_attn.k_proj": 1138,
|
| 158 |
+
"model.layers.22.self_attn.v_proj": 1129,
|
| 159 |
+
"model.layers.22.self_attn.o_proj": 1149,
|
| 160 |
+
"model.layers.22.mlp.gate_proj": 1599,
|
| 161 |
+
"model.layers.22.mlp.up_proj": 1604,
|
| 162 |
+
"model.layers.22.mlp.down_proj": 1517,
|
| 163 |
+
"model.layers.23.self_attn.q_proj": 1122,
|
| 164 |
+
"model.layers.23.self_attn.k_proj": 1123,
|
| 165 |
+
"model.layers.23.self_attn.v_proj": 1115,
|
| 166 |
+
"model.layers.23.self_attn.o_proj": 1139,
|
| 167 |
+
"model.layers.23.mlp.gate_proj": 1589,
|
| 168 |
+
"model.layers.23.mlp.up_proj": 1593,
|
| 169 |
+
"model.layers.23.mlp.down_proj": 1508,
|
| 170 |
+
"model.layers.24.self_attn.q_proj": 1138,
|
| 171 |
+
"model.layers.24.self_attn.k_proj": 1139,
|
| 172 |
+
"model.layers.24.self_attn.v_proj": 1118,
|
| 173 |
+
"model.layers.24.self_attn.o_proj": 1135,
|
| 174 |
+
"model.layers.24.mlp.gate_proj": 1580,
|
| 175 |
+
"model.layers.24.mlp.up_proj": 1585,
|
| 176 |
+
"model.layers.24.mlp.down_proj": 1501,
|
| 177 |
+
"model.layers.25.self_attn.q_proj": 1116,
|
| 178 |
+
"model.layers.25.self_attn.k_proj": 1116,
|
| 179 |
+
"model.layers.25.self_attn.v_proj": 1100,
|
| 180 |
+
"model.layers.25.self_attn.o_proj": 1141,
|
| 181 |
+
"model.layers.25.mlp.gate_proj": 1573,
|
| 182 |
+
"model.layers.25.mlp.up_proj": 1577,
|
| 183 |
+
"model.layers.25.mlp.down_proj": 1496,
|
| 184 |
+
"model.layers.26.self_attn.q_proj": 1127,
|
| 185 |
+
"model.layers.26.self_attn.k_proj": 1126,
|
| 186 |
+
"model.layers.26.self_attn.v_proj": 1103,
|
| 187 |
+
"model.layers.26.self_attn.o_proj": 1121,
|
| 188 |
+
"model.layers.26.mlp.gate_proj": 1565,
|
| 189 |
+
"model.layers.26.mlp.up_proj": 1569,
|
| 190 |
+
"model.layers.26.mlp.down_proj": 1487,
|
| 191 |
+
"model.layers.27.self_attn.q_proj": 1108,
|
| 192 |
+
"model.layers.27.self_attn.k_proj": 1107,
|
| 193 |
+
"model.layers.27.self_attn.v_proj": 1095,
|
| 194 |
+
"model.layers.27.self_attn.o_proj": 1109,
|
| 195 |
+
"model.layers.27.mlp.gate_proj": 1557,
|
| 196 |
+
"model.layers.27.mlp.up_proj": 1561,
|
| 197 |
+
"model.layers.27.mlp.down_proj": 1475,
|
| 198 |
+
"model.layers.28.self_attn.q_proj": 1113,
|
| 199 |
+
"model.layers.28.self_attn.k_proj": 1111,
|
| 200 |
+
"model.layers.28.self_attn.v_proj": 1090,
|
| 201 |
+
"model.layers.28.self_attn.o_proj": 1105,
|
| 202 |
+
"model.layers.28.mlp.gate_proj": 1555,
|
| 203 |
+
"model.layers.28.mlp.up_proj": 1556,
|
| 204 |
+
"model.layers.28.mlp.down_proj": 1462,
|
| 205 |
+
"model.layers.29.self_attn.q_proj": 1128,
|
| 206 |
+
"model.layers.29.self_attn.k_proj": 1127,
|
| 207 |
+
"model.layers.29.self_attn.v_proj": 1094,
|
| 208 |
+
"model.layers.29.self_attn.o_proj": 1094,
|
| 209 |
+
"model.layers.29.mlp.gate_proj": 1552,
|
| 210 |
+
"model.layers.29.mlp.up_proj": 1553,
|
| 211 |
+
"model.layers.29.mlp.down_proj": 1450,
|
| 212 |
+
"model.layers.30.self_attn.q_proj": 1116,
|
| 213 |
+
"model.layers.30.self_attn.k_proj": 1115,
|
| 214 |
+
"model.layers.30.self_attn.v_proj": 1087,
|
| 215 |
+
"model.layers.30.self_attn.o_proj": 1093,
|
| 216 |
+
"model.layers.30.mlp.gate_proj": 1552,
|
| 217 |
+
"model.layers.30.mlp.up_proj": 1556,
|
| 218 |
+
"model.layers.30.mlp.down_proj": 1439,
|
| 219 |
+
"model.layers.31.self_attn.q_proj": 1156,
|
| 220 |
+
"model.layers.31.self_attn.k_proj": 1152,
|
| 221 |
+
"model.layers.31.self_attn.v_proj": 1126,
|
| 222 |
+
"model.layers.31.self_attn.o_proj": 1102,
|
| 223 |
+
"model.layers.31.mlp.gate_proj": 1570,
|
| 224 |
+
"model.layers.31.mlp.up_proj": 1576,
|
| 225 |
+
"model.layers.31.mlp.down_proj": 1429
|
| 226 |
+
}
|
svd_llm2/unheal/llama2-7b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33e0dba497c0bfe3b4532b4c6c0e07274a2ca85219b475fb2c26978d5ae6dfbd
|
| 3 |
+
size 8046408465
|
tr3/unheal/llama2-13b/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
base_model: NousResearch/Llama-2-13b-chat-hf
|
| 4 |
+
tags: [tensor-decomposition, tensor-ring, model-compression, llama2]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# TR-3 LLaMA-2-13B-chat, UNHEALED (ring cores, pre-healing)
|
| 8 |
+
|
| 9 |
+
- **UNHEALED checkpoint**: 3-site Tensor Ring cores + 5% sparse residual as produced by the
|
| 10 |
+
compression stage, before any distillation. The KD-healed counterpart is at `../../heal/llama2-13b/`.
|
| 11 |
+
- Params: **7,740,282,880** (59.47% kept of 13.02B). Same `ranks.json` as the healed dir.
|
| 12 |
+
- Loading: identical to the heal sibling (`tensor_formats.py`, ring-core TRLinear modules).
|
tr3/unheal/llama2-13b/ranks.json
ADDED
|
@@ -0,0 +1,3362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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/unheal/llama2-13b/state_dict_fp16.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac278282a318af346fd66b2a1e6f9a85893628b2c81ec0beefb0891da16699a2
|
| 3 |
+
size 20556180503
|