Commit
·
537920b
1
Parent(s):
29bea2b
init commit
Browse files- README.md +9 -0
- attn_gate_weights.pth +3 -0
- config.json +40 -0
README.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
library_name: transformers
|
4 |
+
base_model:
|
5 |
+
- deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
|
6 |
+
base_model_relation: "adapter"
|
7 |
---
|
8 |
+
|
9 |
+
This repo only contains the AttnGates' weights for deepseek-ai/DeepSeek-R1-Distill-Qwen-14B Model. It's only used for decoding. However, the current inference framework is unoptimized and only for accuracy tests.
|
10 |
+
|
11 |
+
[SeerAttention](https://arxiv.org/pdf/2410.13276) introduces learnable AttnGate modules to accelerate the computationally intensive prefill stage of long-context large language models (LLMs) via dynamic block-level sparsity. The AttnGates are trained in a parameter-efficient self-distillation framework, where they learn to mimic the block-wise attention patterns of the original frozen model, preserving its integrity while avoiding costly retraining. During inference, these gates generate block-sparse binary masks by applying threshold/TopK to their learned soft scores, enabling efficient computation through a custom block-sparse FlashAttention kernel.
|
12 |
+
|
attn_gate_weights.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:abac6dde21f31e3e56e6888719f27eac93b34c3f871ff5bad8d70137d8e8b384
|
3 |
+
size 100696226
|
config.json
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_attn_implementation_autoset": true,
|
3 |
+
"_name_or_path": "/home/v-shumingguo/gsm_blob/distilled_models/DeepSeek-R1-Distill-Qwen-14BSFT-selfdata/bs16_steps500_selfdata",
|
4 |
+
"architectures": [
|
5 |
+
"SeerAttnQwen2ForCausalLM"
|
6 |
+
],
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"base_model": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
|
9 |
+
"bos_token_id": 151643,
|
10 |
+
"eos_token_id": 151643,
|
11 |
+
"hidden_act": "silu",
|
12 |
+
"hidden_size": 5120,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 13824,
|
15 |
+
"max_position_embeddings": 131072,
|
16 |
+
"max_window_layers": 48,
|
17 |
+
"model_type": "qwen2",
|
18 |
+
"num_attention_heads": 40,
|
19 |
+
"num_hidden_layers": 48,
|
20 |
+
"num_key_value_heads": 8,
|
21 |
+
"rms_norm_eps": 1e-05,
|
22 |
+
"rope_scaling": null,
|
23 |
+
"rope_theta": 1000000.0,
|
24 |
+
"seerattn_gate_block_size": 64,
|
25 |
+
"seerattn_gate_hidden_size": 128,
|
26 |
+
"seerattn_gate_type": "Qavg_Kmaxminavg",
|
27 |
+
"seerattn_last_block_dense": true,
|
28 |
+
"seerattn_nz_ratio": 1.0,
|
29 |
+
"seerattn_sparsity_method": "threshold",
|
30 |
+
"seerattn_threshold": 0.0,
|
31 |
+
"sliding_window": 131072,
|
32 |
+
"tie_word_embeddings": false,
|
33 |
+
"torch_dtype": "bfloat16",
|
34 |
+
"transformers_version": "4.48.3",
|
35 |
+
"use_cache": true,
|
36 |
+
"use_decode_seerattn": true,
|
37 |
+
"use_prefill_seerattn": false,
|
38 |
+
"use_sliding_window": false,
|
39 |
+
"vocab_size": 151665
|
40 |
+
}
|