Crusadersk commited on
Commit
a0b426e
·
verified ·
1 Parent(s): 265ae60

Upload GPT-2 25M for TR147 portability validation

Browse files
README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - gpt2
6
+ - scaling-study
7
+ - benchmarking
8
+ - banterhearts
9
+ pipeline_tag: text-generation
10
+ library_name: transformers
11
+ license: mit
12
+ ---
13
+
14
+ # GPT-2 25M
15
+
16
+ Custom-trained GPT-2 checkpoint with deliberate depth-width configuration for inference benchmarking research.
17
+
18
+ Created as part of the [Banterhearts research program](https://github.com/Sahil170595/Banterhearts) investigating benchmarking integrity for local LLM inference.
19
+
20
+ | | |
21
+ |---|---|
22
+ | **Architecture** | GPT2LMHeadModel (MHA) |
23
+ | **Parameters** | 25M |
24
+ | **Config** | n_embd=384, n_head=2, n_layer=3, n_inner=1536 |
25
+ | **Context length** | 1,024 tokens |
26
+ | **Precision** | FP32 |
27
+ | **Model size** | 96 MB |
28
+ | **Vocab size** | 50,257 |
29
+
30
+ ## Purpose
31
+
32
+ Small-scale MHA baseline for depth-width trade-off analysis.
33
+
34
+ These checkpoints are not general-purpose language models. They are deliberately sized scaling-study artifacts designed to isolate the effect of model depth vs width on GPU inference latency. The key finding: in the small-model GPU regime, **layer depth** (not parameter count) dominates latency, producing inversions where a 5M-parameter model can be 3.6x slower than a 25M-parameter model.
35
+
36
+ ## Source Technical Reports
37
+
38
+ Used in: TR117, TR126, TR147
39
+
40
+ | TR | Role |
41
+ |---|---|
42
+ | TR117 | Original cross-backend benchmark matrix (7 backends, 4 model groups) |
43
+ | TR126 | Linux/Triton compiler validation with phase-separated measurement |
44
+ | TR147 | Second-regime portability validation on RTX 6000 Ada |
45
+
46
+ ## Design Rationale
47
+
48
+ The GPT-2 family (25M, 50M, 100M) uses a 2x3 factorial design:
49
+
50
+ | Model | n_embd | n_layer | n_inner | Params | Design role |
51
+ |---|---|---|---|---|---|
52
+ | gpt2-25m | 384 | 3 | 1,536 | 25M | Shallow, narrow |
53
+ | gpt2-50m | 512 | 8 | 2,048 | 50M | Deep, medium width |
54
+ | gpt2-100m | 768 | 8 | 3,072 | 100M | Deep, wide |
55
+
56
+ All models use **2 attention heads** (MHA, not GQA) to isolate architecture effects from attention-group structure. Dropout is set to 0.0 for deterministic inference measurement.
57
+
58
+ ## Usage
59
+
60
+ ```python
61
+ from transformers import AutoModelForCausalLM, AutoTokenizer
62
+
63
+ model = AutoModelForCausalLM.from_pretrained("Crusadersk/gpt2-25m")
64
+ tokenizer = AutoTokenizer.from_pretrained("Crusadersk/gpt2-25m")
65
+
66
+ inputs = tokenizer("Hello", return_tensors="pt")
67
+ outputs = model.generate(**inputs, max_new_tokens=32, do_sample=False)
68
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
69
+ ```
70
+
71
+ ## Compatibility
72
+
73
+ | Framework | Supported |
74
+ |---|---|
75
+ | Transformers | Yes |
76
+ | torch.compile (Inductor) | Yes |
77
+ | Ollama | No (not GGUF format) |
78
+ | vLLM | Yes |
79
+
80
+ ## Citation
81
+
82
+ ```bibtex
83
+ @misc{banterhearts2026gpt225m,
84
+ title = {Custom GPT-2 Scaling Checkpoint (25M) for Inference Benchmarking Research},
85
+ author = {Kadadekar, Sahil},
86
+ year = {2026},
87
+ url = {https://huggingface.co/Crusadersk/gpt2-25m},
88
+ note = {Part of the Banterhearts research program. NeurIPS 2026 submission.}
89
+ }
90
+ ```
91
+
92
+ ## Acknowledgments
93
+
94
+ This work is part of a 40-TR research program on consumer LLM deployment safety, conducted independently as pre-doctoral research. Full program details at [github.com/Sahil170595/Banterhearts](https://github.com/Sahil170595/Banterhearts).
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_function": "gelu_new",
3
+ "architectures": [
4
+ "GPT2LMHeadModel"
5
+ ],
6
+ "attn_pdrop": 0.0,
7
+ "bos_token_id": 50256,
8
+ "dtype": "float32",
9
+ "embd_pdrop": 0.0,
10
+ "eos_token_id": 50256,
11
+ "initializer_range": 0.02,
12
+ "layer_norm_epsilon": 1e-05,
13
+ "model_type": "gpt2",
14
+ "n_ctx": 1024,
15
+ "n_embd": 384,
16
+ "n_head": 2,
17
+ "n_inner": 1536,
18
+ "n_layer": 3,
19
+ "n_positions": 1024,
20
+ "reorder_and_upcast_attn": false,
21
+ "resid_pdrop": 0.0,
22
+ "scale_attn_by_inverse_layer_idx": false,
23
+ "scale_attn_weights": true,
24
+ "summary_activation": null,
25
+ "summary_first_dropout": 0.1,
26
+ "summary_proj_to_labels": true,
27
+ "summary_type": "cls_index",
28
+ "summary_use_proj": true,
29
+ "transformers_version": "4.57.0",
30
+ "use_cache": true,
31
+ "vocab_size": 50257
32
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 50256,
4
+ "eos_token_id": 50256,
5
+ "transformers_version": "4.57.0"
6
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da3b2fbc76d1fa1122cfd00415dfacc7d6302016646608a8396f3244854280d9
3
+ size 100068208
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "<|endoftext|>",
17
+ "unk_token": {
18
+ "content": "<|endoftext|>",
19
+ "lstrip": false,
20
+ "normalized": true,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "50256": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ }
13
+ },
14
+ "bos_token": "<|endoftext|>",
15
+ "clean_up_tokenization_spaces": false,
16
+ "eos_token": "<|endoftext|>",
17
+ "errors": "replace",
18
+ "extra_special_tokens": {},
19
+ "model_max_length": 1024,
20
+ "pad_token": "<|endoftext|>",
21
+ "tokenizer_class": "GPT2Tokenizer",
22
+ "unk_token": "<|endoftext|>"
23
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff