tarekziade HF Staff commited on
Commit
0ad90af
·
verified ·
1 Parent(s): 388f0d1

Publish MIC usage, slim fixture and reviewed Transformers expectations

Browse files
.mic-repo.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "format": "mic-umbrella-v1",
3
+ "contract_files": [
4
+ "integration.json",
5
+ "integrations/transformers/usage.md"
6
+ ]
7
+ }
README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - mic
4
+ - test-artifact
5
+ base_model: bigcode/tiny_starcoder_py
6
+ ---
7
+
8
+ # tiny_starcoder_py-mic
9
+
10
+ Slim model weights, executable usage and framework expectations in one repository.
11
+
12
+ - [Contract manifest](integration.json)
13
+ - [Transformers usage](integrations/transformers/usage.md)
14
+ - [Transformers expectations](integrations/transformers/expectations)
15
+ - [Fixture provenance](build.json)
16
+
17
+ ## Contract
18
+
19
+ ### GPTBigCode causal LM
20
+
21
+ Runnable usage and the framework expectations directory are linked above.
22
+
23
+ ## Slim model
24
+
25
+ ### Slim fixture: tiny_starcoder_py-mic
26
+
27
+ A 3.7M-parameter fixture for the [GPTBigCode MIC](https://huggingface.co/huggingface-mic/tiny_starcoder_py-mic), covering [`bigcode/tiny_starcoder_py`](https://huggingface.co/bigcode/tiny_starcoder_py). It is a test artifact, not a usable model, tagged `test-artifact` to keep it out of candidate-model search.
28
+
29
+ - **Fixture key `0852b1b7488d`.** It covers every checkpoint whose processor files are byte-identical and whose config matches after shrinking.
30
+ - **Same architecture, smaller config:** `GPTBigCodeForCausalLM`, shrunk by the generic rule in [`sweep.py`](https://github.com/huggingface/transformers-mic/blob/main/experiments/sweep.py) ().
31
+ - **Processor files copied byte for byte** from `bigcode/tiny_starcoder_py`: `generation_config.json`, `merges.txt`, `special_tokens_map.json`, `tokenizer.json`, `tokenizer_config.json`, `vocab.json`.
32
+ - **Random weights (seed 17).** They passed the input-sensitivity gate: every perturbation of the contract's inputs moved the logits by at least 0.001 (weakest: `attention_mask:all_ones`, 0.5), so no training was needed.
33
+ - **Same tensor names as the real checkpoint.** The real checkpoint has every parameter, and so does the fixture.
34
+ - **Saved in float32**, the dtype `bigcode/tiny_starcoder_py` loads in by default.
35
+ - **Finite in float32, bfloat16, and float16** (forward, loss, gradients).
36
+
37
+ Built by [`build_fixtures.py`](https://github.com/huggingface/transformers-mic/blob/main/example/build_fixtures.py); [`build.json`](build.json) records the pinned sources, gate results, and file hashes. This repository includes the slim weights, usage and framework expectations; rebuild the other files with `python example/build_fixtures.py --fixture tiny_starcoder_py-mic`.
build.json ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fixture": "huggingface-mic/tiny_starcoder_py-mic",
3
+ "key": "0852b1b7488daf526180d9c8c3361de942729124e3b94beb0339fa2d46cf47e0",
4
+ "key_fields": {
5
+ "architectures": [
6
+ "GPTBigCodeForCausalLM"
7
+ ],
8
+ "output_hidden_states": false,
9
+ "return_dict": true,
10
+ "chunk_size_feed_forward": 0,
11
+ "is_encoder_decoder": false,
12
+ "id2label": {
13
+ "0": "LABEL_0",
14
+ "1": "LABEL_1"
15
+ },
16
+ "label2id": {
17
+ "LABEL_0": 0,
18
+ "LABEL_1": 1
19
+ },
20
+ "problem_type": null,
21
+ "vocab_size": 49152,
22
+ "n_positions": 8192,
23
+ "n_embd": 64,
24
+ "n_layer": 2,
25
+ "n_head": 4,
26
+ "n_inner": 128,
27
+ "activation_function": "gelu_pytorch_tanh",
28
+ "resid_pdrop": 0.1,
29
+ "embd_pdrop": 0.1,
30
+ "attn_pdrop": 0.1,
31
+ "layer_norm_epsilon": 1e-05,
32
+ "initializer_range": 0.02,
33
+ "scale_attn_weights": true,
34
+ "use_cache": true,
35
+ "bos_token_id": 0,
36
+ "eos_token_id": 0,
37
+ "pad_token_id": null,
38
+ "attention_softmax_in_fp32": true,
39
+ "scale_attention_softmax_in_fp32": true,
40
+ "multi_query": true,
41
+ "add_cross_attention": false,
42
+ "tie_word_embeddings": true,
43
+ "num_key_value_heads": 2,
44
+ "inference_runner": 0,
45
+ "max_batch_size": null,
46
+ "max_sequence_length": null,
47
+ "model_type": "gpt_bigcode",
48
+ "pad_key_length": true,
49
+ "pre_allocate_kv_cache": false,
50
+ "summary_activation": null,
51
+ "summary_first_dropout": 0.1,
52
+ "summary_proj_to_labels": true,
53
+ "summary_type": "cls_index",
54
+ "summary_use_proj": true,
55
+ "validate_runner_input": true,
56
+ "output_attentions": false
57
+ },
58
+ "covers": {
59
+ "bigcode/tiny_starcoder_py": "8547527bef0bc927268c1653cce6948c5c242dd1"
60
+ },
61
+ "built_from": {
62
+ "repo": "bigcode/tiny_starcoder_py",
63
+ "revision": "8547527bef0bc927268c1653cce6948c5c242dd1"
64
+ },
65
+ "seed": 17,
66
+ "dtype": "float32",
67
+ "builder": "example/build_fixtures.py",
68
+ "builder_revision": "c0a9ac9ce31d96d81a7ed980688dcd4599b1e6bd",
69
+ "recipe": {
70
+ "seed": 17,
71
+ "model_class": "GPTBigCodeForCausalLM"
72
+ },
73
+ "shrink": "rule",
74
+ "model_class": "GPTBigCodeForCausalLM",
75
+ "parameters": 3724608,
76
+ "missing_parameters": [],
77
+ "checkpoint_inspection": "parameter headers/indexes; bounded binary fallback",
78
+ "numeric_health_scope": "CPU float32/bfloat16/float16; autocast for low-precision losses",
79
+ "captured": {
80
+ "call": "training step",
81
+ "inputs": [
82
+ "attention_mask",
83
+ "input_ids",
84
+ "labels"
85
+ ],
86
+ "class": "GPTBigCodeForCausalLM"
87
+ },
88
+ "weights": "random",
89
+ "gate": {
90
+ "random": {
91
+ "pass": true,
92
+ "accepted_insensitive": {},
93
+ "threshold": 0.001,
94
+ "deltas": {
95
+ "input_ids:roll_batch": 1.1869170665740967,
96
+ "input_ids:reverse": 1.1730904579162598,
97
+ "attention_mask:all_ones": 0.49951428174972534
98
+ },
99
+ "weakest": "attention_mask:all_ones",
100
+ "no_perturbation_defined": [],
101
+ "not_a_forward_parameter": []
102
+ }
103
+ },
104
+ "numeric_health": {
105
+ "float32": {
106
+ "outputs_finite": true,
107
+ "loss_finite": true,
108
+ "gradients_finite": true,
109
+ "finite": true
110
+ },
111
+ "bfloat16": {
112
+ "outputs_finite": true,
113
+ "loss_finite": true,
114
+ "gradients_finite": true,
115
+ "finite": true
116
+ },
117
+ "float16": {
118
+ "outputs_finite": true,
119
+ "loss_finite": true,
120
+ "unscaled_gradients_finite": true,
121
+ "finite": true
122
+ }
123
+ },
124
+ "copied_unchanged": [
125
+ "generation_config.json",
126
+ "merges.txt",
127
+ "special_tokens_map.json",
128
+ "tokenizer.json",
129
+ "tokenizer_config.json",
130
+ "vocab.json"
131
+ ],
132
+ "environment": {
133
+ "python": "3.12.12",
134
+ "machine": "arm64",
135
+ "torch": "2.14.1",
136
+ "transformers": "5.22.0.dev0",
137
+ "tokenizers": "0.23.3"
138
+ },
139
+ "sha256": {
140
+ "config.json": "e71a18da111f128967e7d8cc89622e71dafc295a27b8181170d11423ad420ea0",
141
+ "generation_config.json": "368f15f9c335d48e1a585440037c77022af6b867303dc8fe9ee01e8fc86c1617",
142
+ "merges.txt": "74b0a4bc1a97ebc1d227f69231b18574374ba052fb945b0fa0aa91d3c32504a2",
143
+ "model.safetensors": "1cb730824fb0a3d7a02141afb42177445e7d8522e8cde09bbfb3c174d5ca2ed0",
144
+ "special_tokens_map.json": "0823292e24ea07b89317e9ede9d08da2a1b6c014290c06908a7ad04f1efd6719",
145
+ "tokenizer.json": "42b5a37ba11199f024f2b8873e1ecba98da33166e16f700bf7cb2304b0a5583f",
146
+ "tokenizer_config.json": "95684c52ad9a970dbbb17576ee2237cb62902c1eff6804c7c91a4d6219a4a6d7",
147
+ "vocab.json": "20175afb9f164fad4829aca2279f8df7eeff1e2e3f671378aaa287a740aff09f"
148
+ }
149
+ }
config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_function": "gelu_pytorch_tanh",
3
+ "add_cross_attention": false,
4
+ "architectures": [
5
+ "GPTBigCodeForCausalLM"
6
+ ],
7
+ "attention_softmax_in_fp32": true,
8
+ "attn_pdrop": 0.1,
9
+ "bos_token_id": 0,
10
+ "dtype": "float32",
11
+ "embd_pdrop": 0.1,
12
+ "eos_token_id": 0,
13
+ "inference_runner": 0,
14
+ "initializer_range": 0.02,
15
+ "layer_norm_epsilon": 1e-05,
16
+ "max_batch_size": null,
17
+ "max_sequence_length": null,
18
+ "model_type": "gpt_bigcode",
19
+ "multi_query": true,
20
+ "n_embd": 64,
21
+ "n_head": 4,
22
+ "n_inner": 128,
23
+ "n_layer": 2,
24
+ "n_positions": 8192,
25
+ "num_key_value_heads": 2,
26
+ "pad_key_length": true,
27
+ "pad_token_id": null,
28
+ "pre_allocate_kv_cache": false,
29
+ "resid_pdrop": 0.1,
30
+ "scale_attention_softmax_in_fp32": true,
31
+ "scale_attn_weights": true,
32
+ "summary_activation": null,
33
+ "summary_first_dropout": 0.1,
34
+ "summary_proj_to_labels": true,
35
+ "summary_type": "cls_index",
36
+ "summary_use_proj": true,
37
+ "tie_word_embeddings": true,
38
+ "transformers_version": "5.22.0.dev0",
39
+ "use_cache": true,
40
+ "validate_runner_input": true,
41
+ "vocab_size": 49152
42
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 0,
5
+ "transformers_version": "4.28.1"
6
+ }
integration.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "mic": "0.3",
3
+ "name": "GPTBigCode causal LM",
4
+ "usage": "AutoTokenizer + AutoModelForCausalLM, batched, left padding, seeded training step",
5
+ "architecture": "GPTBigCodeForCausalLM",
6
+ "checkpoints": {
7
+ "bigcode/tiny_starcoder_py": {
8
+ "fixture": "huggingface-mic/tiny_starcoder_py-mic"
9
+ }
10
+ },
11
+ "fixtures": {
12
+ "huggingface-mic/tiny_starcoder_py-mic": {
13
+ "built_from": "bigcode/tiny_starcoder_py",
14
+ "covers": [
15
+ "bigcode/tiny_starcoder_py"
16
+ ],
17
+ "build": {
18
+ "seed": 17,
19
+ "model_class": "GPTBigCodeForCausalLM"
20
+ }
21
+ }
22
+ },
23
+ "integrations": {
24
+ "transformers": {
25
+ "entry_point": "integrations/transformers/usage.md",
26
+ "format": "runnable-markdown",
27
+ "requires": [
28
+ "transformers>=5",
29
+ "torch"
30
+ ],
31
+ "targets": [
32
+ "fixtures",
33
+ "checkpoints"
34
+ ],
35
+ "variants": {
36
+ "default": {},
37
+ "eager": {
38
+ "attn_implementation": "eager"
39
+ },
40
+ "bfloat16": {
41
+ "dtype": "bfloat16"
42
+ }
43
+ },
44
+ "training": true,
45
+ "resources": {
46
+ "fixture": {
47
+ "memory_gb": 1,
48
+ "download_mb": 20
49
+ },
50
+ "bigcode/tiny_starcoder_py": {
51
+ "memory_gb": 4,
52
+ "download_mb": 260
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "outputs": {
58
+ "runtime": {
59
+ "compare": "exact"
60
+ },
61
+ "predicted_tokens": {
62
+ "compare": "exact"
63
+ },
64
+ "predicted_text": {
65
+ "compare": "exact"
66
+ },
67
+ "next_token_logits": {
68
+ "compare": "allclose",
69
+ "atol": 0.0001,
70
+ "rtol": 0.0001
71
+ },
72
+ "training.loss": {
73
+ "compare": "allclose",
74
+ "atol": 0.0001,
75
+ "rtol": 0.0001
76
+ },
77
+ "training.gradients": {
78
+ "compare": "all_true"
79
+ },
80
+ "training.updated": {
81
+ "compare": "true"
82
+ }
83
+ }
84
+ }
integrations/transformers/expectations/cpu-x86_64-bf16/tiny_starcoder_py-mic.bfloat16.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "bfloat16",
8
+ "target": "tiny_starcoder_py-mic",
9
+ "kind": "fixture",
10
+ "revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cpu",
15
+ "torchvision": "0.29.2+cpu",
16
+ "torchaudio": "2.11.1+cpu",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.3.5",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.15.0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 7.39,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2+cpu (pinned 0.29.1)",
32
+ "torchaudio": "2.11.1+cpu (pinned 2.11.0)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)"
34
+ },
35
+ "platform": "cpu-x86_64-bf16"
36
+ },
37
+ "outputs": {
38
+ "runtime": {
39
+ "device": "cpu",
40
+ "dtype": "bfloat16",
41
+ "attn_implementation": "sdpa"
42
+ },
43
+ "predicted_tokens": [
44
+ 442,
45
+ 32
46
+ ],
47
+ "predicted_text": [
48
+ "\u0120return",
49
+ "."
50
+ ],
51
+ "next_token_logits": [
52
+ 0.828125,
53
+ 0.68359375
54
+ ],
55
+ "training": {
56
+ "loss": 10.775863647460938,
57
+ "gradients": {
58
+ "transformer.h.0.attn.c_attn.weight": true,
59
+ "transformer.h.0.mlp.c_fc.weight": true
60
+ },
61
+ "updated": true
62
+ }
63
+ }
64
+ }
integrations/transformers/expectations/cpu-x86_64-bf16/tiny_starcoder_py.bfloat16.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "bfloat16",
8
+ "target": "tiny_starcoder_py",
9
+ "kind": "checkpoint",
10
+ "revision": "8547527bef0bc927268c1653cce6948c5c242dd1",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cpu",
15
+ "torchvision": "0.29.2+cpu",
16
+ "torchaudio": "2.11.1+cpu",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.3.5",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.15.0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 7.82,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2+cpu (pinned 0.29.1)",
32
+ "torchaudio": "2.11.1+cpu (pinned 2.11.0)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)"
34
+ },
35
+ "platform": "cpu-x86_64-bf16"
36
+ },
37
+ "outputs": {
38
+ "runtime": {
39
+ "device": "cpu",
40
+ "dtype": "bfloat16",
41
+ "attn_implementation": "sdpa"
42
+ },
43
+ "predicted_tokens": [
44
+ 312,
45
+ 2356
46
+ ],
47
+ "predicted_text": [
48
+ "\u0120a",
49
+ "np"
50
+ ],
51
+ "next_token_logits": [
52
+ 20.5,
53
+ 14.1875
54
+ ],
55
+ "training": {
56
+ "loss": 3.5714824199676514,
57
+ "gradients": {
58
+ "transformer.h.0.attn.c_attn.weight": true,
59
+ "transformer.h.0.mlp.c_fc.weight": true
60
+ },
61
+ "updated": true
62
+ }
63
+ }
64
+ }
integrations/transformers/expectations/cpu-x86_64/tiny_starcoder_py-mic.eager.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "eager",
8
+ "target": "tiny_starcoder_py-mic",
9
+ "kind": "fixture",
10
+ "revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cpu",
15
+ "torchvision": "0.29.2+cpu",
16
+ "torchaudio": "2.11.1+cpu",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.3.5",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.15.0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 7.38,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2+cpu (pinned 0.29.1)",
32
+ "torchaudio": "2.11.1+cpu (pinned 2.11.0)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)"
34
+ },
35
+ "platform": "cpu-x86_64"
36
+ },
37
+ "outputs": {
38
+ "runtime": {
39
+ "device": "cpu",
40
+ "dtype": "float32",
41
+ "attn_implementation": "eager"
42
+ },
43
+ "predicted_tokens": [
44
+ 442,
45
+ 32
46
+ ],
47
+ "predicted_text": [
48
+ "\u0120return",
49
+ "."
50
+ ],
51
+ "next_token_logits": [
52
+ 0.826957106590271,
53
+ 0.6829898357391357
54
+ ],
55
+ "training": {
56
+ "loss": 10.774384498596191,
57
+ "gradients": {
58
+ "transformer.h.0.attn.c_attn.weight": true,
59
+ "transformer.h.0.mlp.c_fc.weight": true
60
+ },
61
+ "updated": true
62
+ }
63
+ }
64
+ }
integrations/transformers/expectations/cpu-x86_64/tiny_starcoder_py-mic.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "default",
8
+ "target": "tiny_starcoder_py-mic",
9
+ "kind": "fixture",
10
+ "revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cpu",
15
+ "torchvision": "0.29.2+cpu",
16
+ "torchaudio": "2.11.1+cpu",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.3.5",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.15.0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 7.37,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2+cpu (pinned 0.29.1)",
32
+ "torchaudio": "2.11.1+cpu (pinned 2.11.0)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)"
34
+ },
35
+ "platform": "cpu-x86_64"
36
+ },
37
+ "outputs": {
38
+ "runtime": {
39
+ "device": "cpu",
40
+ "dtype": "float32",
41
+ "attn_implementation": "sdpa"
42
+ },
43
+ "predicted_tokens": [
44
+ 442,
45
+ 32
46
+ ],
47
+ "predicted_text": [
48
+ "\u0120return",
49
+ "."
50
+ ],
51
+ "next_token_logits": [
52
+ 0.8269570469856262,
53
+ 0.6829898953437805
54
+ ],
55
+ "training": {
56
+ "loss": 10.776015281677246,
57
+ "gradients": {
58
+ "transformer.h.0.attn.c_attn.weight": true,
59
+ "transformer.h.0.mlp.c_fc.weight": true
60
+ },
61
+ "updated": true
62
+ }
63
+ }
64
+ }
integrations/transformers/expectations/cpu-x86_64/tiny_starcoder_py.eager.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "eager",
8
+ "target": "tiny_starcoder_py",
9
+ "kind": "checkpoint",
10
+ "revision": "8547527bef0bc927268c1653cce6948c5c242dd1",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cpu",
15
+ "torchvision": "0.29.2+cpu",
16
+ "torchaudio": "2.11.1+cpu",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.3.5",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.15.0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 8.28,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2+cpu (pinned 0.29.1)",
32
+ "torchaudio": "2.11.1+cpu (pinned 2.11.0)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)"
34
+ },
35
+ "platform": "cpu-x86_64"
36
+ },
37
+ "outputs": {
38
+ "runtime": {
39
+ "device": "cpu",
40
+ "dtype": "float32",
41
+ "attn_implementation": "eager"
42
+ },
43
+ "predicted_tokens": [
44
+ 312,
45
+ 2356
46
+ ],
47
+ "predicted_text": [
48
+ "\u0120a",
49
+ "np"
50
+ ],
51
+ "next_token_logits": [
52
+ 20.465251922607422,
53
+ 14.459330558776855
54
+ ],
55
+ "training": {
56
+ "loss": 3.5564022064208984,
57
+ "gradients": {
58
+ "transformer.h.0.attn.c_attn.weight": true,
59
+ "transformer.h.0.mlp.c_fc.weight": true
60
+ },
61
+ "updated": true
62
+ }
63
+ }
64
+ }
integrations/transformers/expectations/cpu-x86_64/tiny_starcoder_py.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "default",
8
+ "target": "tiny_starcoder_py",
9
+ "kind": "checkpoint",
10
+ "revision": "8547527bef0bc927268c1653cce6948c5c242dd1",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cpu",
15
+ "torchvision": "0.29.2+cpu",
16
+ "torchaudio": "2.11.1+cpu",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.3.5",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.15.0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 8.33,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2+cpu (pinned 0.29.1)",
32
+ "torchaudio": "2.11.1+cpu (pinned 2.11.0)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)"
34
+ },
35
+ "platform": "cpu-x86_64"
36
+ },
37
+ "outputs": {
38
+ "runtime": {
39
+ "device": "cpu",
40
+ "dtype": "float32",
41
+ "attn_implementation": "sdpa"
42
+ },
43
+ "predicted_tokens": [
44
+ 312,
45
+ 2356
46
+ ],
47
+ "predicted_text": [
48
+ "\u0120a",
49
+ "np"
50
+ ],
51
+ "next_token_logits": [
52
+ 20.465251922607422,
53
+ 14.459315299987793
54
+ ],
55
+ "training": {
56
+ "loss": 3.5751023292541504,
57
+ "gradients": {
58
+ "transformer.h.0.attn.c_attn.weight": true,
59
+ "transformer.h.0.mlp.c_fc.weight": true
60
+ },
61
+ "updated": true
62
+ }
63
+ }
64
+ }
integrations/transformers/expectations/cuda/tiny_starcoder_py-mic.bfloat16.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "bfloat16",
8
+ "target": "tiny_starcoder_py-mic",
9
+ "kind": "fixture",
10
+ "revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cu130",
15
+ "torchvision": "0.29.2",
16
+ "torchaudio": "2.11.0+cu130",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.4.6",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.16.0.dev0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 7.85,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2 (pinned 0.29.1)",
32
+ "numpy": "2.4.6 (pinned 2.3.5)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)",
34
+ "accelerate": "1.16.0.dev0 (pinned 1.15.0)"
35
+ },
36
+ "platform": "cuda"
37
+ },
38
+ "outputs": {
39
+ "runtime": {
40
+ "device": "cuda",
41
+ "dtype": "bfloat16",
42
+ "attn_implementation": "sdpa"
43
+ },
44
+ "predicted_tokens": [
45
+ 442,
46
+ 32
47
+ ],
48
+ "predicted_text": [
49
+ "\u0120return",
50
+ "."
51
+ ],
52
+ "next_token_logits": [
53
+ 0.828125,
54
+ 0.68359375
55
+ ],
56
+ "training": {
57
+ "loss": 10.764673233032227,
58
+ "gradients": {
59
+ "transformer.h.0.attn.c_attn.weight": true,
60
+ "transformer.h.0.mlp.c_fc.weight": true
61
+ },
62
+ "updated": true
63
+ }
64
+ }
65
+ }
integrations/transformers/expectations/cuda/tiny_starcoder_py-mic.eager.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "eager",
8
+ "target": "tiny_starcoder_py-mic",
9
+ "kind": "fixture",
10
+ "revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cu130",
15
+ "torchvision": "0.29.2",
16
+ "torchaudio": "2.11.0+cu130",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.4.6",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.16.0.dev0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 6.98,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2 (pinned 0.29.1)",
32
+ "numpy": "2.4.6 (pinned 2.3.5)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)",
34
+ "accelerate": "1.16.0.dev0 (pinned 1.15.0)"
35
+ },
36
+ "platform": "cuda"
37
+ },
38
+ "outputs": {
39
+ "runtime": {
40
+ "device": "cuda",
41
+ "dtype": "float32",
42
+ "attn_implementation": "eager"
43
+ },
44
+ "predicted_tokens": [
45
+ 442,
46
+ 32
47
+ ],
48
+ "predicted_text": [
49
+ "\u0120return",
50
+ "."
51
+ ],
52
+ "next_token_logits": [
53
+ 0.8269570469856262,
54
+ 0.6829898953437805
55
+ ],
56
+ "training": {
57
+ "loss": 10.763090133666992,
58
+ "gradients": {
59
+ "transformer.h.0.attn.c_attn.weight": true,
60
+ "transformer.h.0.mlp.c_fc.weight": true
61
+ },
62
+ "updated": true
63
+ }
64
+ }
65
+ }
integrations/transformers/expectations/cuda/tiny_starcoder_py-mic.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "default",
8
+ "target": "tiny_starcoder_py-mic",
9
+ "kind": "fixture",
10
+ "revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cu130",
15
+ "torchvision": "0.29.2",
16
+ "torchaudio": "2.11.0+cu130",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.4.6",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.16.0.dev0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 8.14,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2 (pinned 0.29.1)",
32
+ "numpy": "2.4.6 (pinned 2.3.5)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)",
34
+ "accelerate": "1.16.0.dev0 (pinned 1.15.0)"
35
+ },
36
+ "platform": "cuda"
37
+ },
38
+ "outputs": {
39
+ "runtime": {
40
+ "device": "cuda",
41
+ "dtype": "float32",
42
+ "attn_implementation": "sdpa"
43
+ },
44
+ "predicted_tokens": [
45
+ 442,
46
+ 32
47
+ ],
48
+ "predicted_text": [
49
+ "\u0120return",
50
+ "."
51
+ ],
52
+ "next_token_logits": [
53
+ 0.8269569873809814,
54
+ 0.6829898953437805
55
+ ],
56
+ "training": {
57
+ "loss": 10.76203727722168,
58
+ "gradients": {
59
+ "transformer.h.0.attn.c_attn.weight": true,
60
+ "transformer.h.0.mlp.c_fc.weight": true
61
+ },
62
+ "updated": true
63
+ }
64
+ }
65
+ }
integrations/transformers/expectations/cuda/tiny_starcoder_py.bfloat16.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "bfloat16",
8
+ "target": "tiny_starcoder_py",
9
+ "kind": "checkpoint",
10
+ "revision": "8547527bef0bc927268c1653cce6948c5c242dd1",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cu130",
15
+ "torchvision": "0.29.2",
16
+ "torchaudio": "2.11.0+cu130",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.4.6",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.16.0.dev0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 8.29,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2 (pinned 0.29.1)",
32
+ "numpy": "2.4.6 (pinned 2.3.5)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)",
34
+ "accelerate": "1.16.0.dev0 (pinned 1.15.0)"
35
+ },
36
+ "platform": "cuda"
37
+ },
38
+ "outputs": {
39
+ "runtime": {
40
+ "device": "cuda",
41
+ "dtype": "bfloat16",
42
+ "attn_implementation": "sdpa"
43
+ },
44
+ "predicted_tokens": [
45
+ 312,
46
+ 2356
47
+ ],
48
+ "predicted_text": [
49
+ "\u0120a",
50
+ "np"
51
+ ],
52
+ "next_token_logits": [
53
+ 20.5,
54
+ 14.0625
55
+ ],
56
+ "training": {
57
+ "loss": 3.034364700317383,
58
+ "gradients": {
59
+ "transformer.h.0.attn.c_attn.weight": true,
60
+ "transformer.h.0.mlp.c_fc.weight": true
61
+ },
62
+ "updated": true
63
+ }
64
+ }
65
+ }
integrations/transformers/expectations/cuda/tiny_starcoder_py.eager.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "eager",
8
+ "target": "tiny_starcoder_py",
9
+ "kind": "checkpoint",
10
+ "revision": "8547527bef0bc927268c1653cce6948c5c242dd1",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cu130",
15
+ "torchvision": "0.29.2",
16
+ "torchaudio": "2.11.0+cu130",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.4.6",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.16.0.dev0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 8.73,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2 (pinned 0.29.1)",
32
+ "numpy": "2.4.6 (pinned 2.3.5)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)",
34
+ "accelerate": "1.16.0.dev0 (pinned 1.15.0)"
35
+ },
36
+ "platform": "cuda"
37
+ },
38
+ "outputs": {
39
+ "runtime": {
40
+ "device": "cuda",
41
+ "dtype": "float32",
42
+ "attn_implementation": "eager"
43
+ },
44
+ "predicted_tokens": [
45
+ 312,
46
+ 2356
47
+ ],
48
+ "predicted_text": [
49
+ "\u0120a",
50
+ "np"
51
+ ],
52
+ "next_token_logits": [
53
+ 20.465246200561523,
54
+ 14.459304809570312
55
+ ],
56
+ "training": {
57
+ "loss": 3.38765287399292,
58
+ "gradients": {
59
+ "transformer.h.0.attn.c_attn.weight": true,
60
+ "transformer.h.0.mlp.c_fc.weight": true
61
+ },
62
+ "updated": true
63
+ }
64
+ }
65
+ }
integrations/transformers/expectations/cuda/tiny_starcoder_py.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recorded_with": {
3
+ "contract": "huggingface-mic/tiny_starcoder_py-mic",
4
+ "contract_name": "GPTBigCode",
5
+ "contract_revision": "f02c1112074b58d092f6590c8a957bdbe935dae4",
6
+ "framework": "transformers",
7
+ "variant": "default",
8
+ "target": "tiny_starcoder_py",
9
+ "kind": "checkpoint",
10
+ "revision": "8547527bef0bc927268c1653cce6948c5c242dd1",
11
+ "environment": {
12
+ "python": "3.11.18",
13
+ "transformers": "5.22.0.dev0",
14
+ "torch": "2.14.0+cu130",
15
+ "torchvision": "0.29.2",
16
+ "torchaudio": "2.11.0+cu130",
17
+ "tokenizers": "0.23.3",
18
+ "numpy": "2.4.6",
19
+ "pillow": "13.0.0",
20
+ "accelerate": "1.16.0.dev0",
21
+ "safetensors": "0.8.0",
22
+ "huggingface-hub": "2.3.0",
23
+ "sentencepiece": "0.2.2",
24
+ "protobuf": "7.36.2",
25
+ "librosa": "0.11.0",
26
+ "soundfile": "0.14.0",
27
+ "scipy": "1.17.1"
28
+ },
29
+ "seconds": 7.59,
30
+ "environment_differs": {
31
+ "torchvision": "0.29.2 (pinned 0.29.1)",
32
+ "numpy": "2.4.6 (pinned 2.3.5)",
33
+ "pillow": "13.0.0 (pinned 12.3.0)",
34
+ "accelerate": "1.16.0.dev0 (pinned 1.15.0)"
35
+ },
36
+ "platform": "cuda"
37
+ },
38
+ "outputs": {
39
+ "runtime": {
40
+ "device": "cuda",
41
+ "dtype": "float32",
42
+ "attn_implementation": "sdpa"
43
+ },
44
+ "predicted_tokens": [
45
+ 312,
46
+ 2356
47
+ ],
48
+ "predicted_text": [
49
+ "\u0120a",
50
+ "np"
51
+ ],
52
+ "next_token_logits": [
53
+ 20.465242385864258,
54
+ 14.459308624267578
55
+ ],
56
+ "training": {
57
+ "loss": 3.34557843208313,
58
+ "gradients": {
59
+ "transformer.h.0.attn.c_attn.weight": true,
60
+ "transformer.h.0.mlp.c_fc.weight": true
61
+ },
62
+ "updated": true
63
+ }
64
+ }
65
+ }
integrations/transformers/usage.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GPTBigCode: causal language modeling with Transformers
2
+
3
+ This page is the Transformers contract of the GPTBigCode MIC and also a usage example. [doc-builder](https://github.com/huggingface/doc-builder/blob/main/docs/runnable-code-blocks.md) renders the `runnable` blocks below as documentation, and its pytest plugin runs them as written against `bigcode/tiny_starcoder_py`. The MIC runner runs the same blocks against the slim fixture and the checkpoint in [`integration.json`](../../integration.json). Lines marked `# doc-builder: hide` only matter there: they swap in the pinned checkpoint or variant and print the result record.
4
+
5
+ ## Predict the next token
6
+
7
+ ```py runnable:causal_lm
8
+ import torch
9
+ from transformers import AutoModelForCausalLM, AutoTokenizer, set_seed
10
+ import json # doc-builder: hide
11
+ import os # doc-builder: hide
12
+
13
+ model_id = "bigcode/tiny_starcoder_py"
14
+ model_id = os.environ.get("MIC_MODEL", model_id) # doc-builder: hide
15
+ variant = json.loads(os.environ.get("MIC_MODEL_KWARGS", "{}")) # doc-builder: hide
16
+ device = "cuda" if torch.cuda.is_available() else "cpu"
17
+ set_seed(0) # seeds torch, NumPy, and Python: loading and dropout draw random numbers
18
+
19
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
20
+ # This checkpoint defines no pad token; reuse the end-of-text token and pad on the left so the last position is a real token.
21
+ tokenizer.pad_token = tokenizer.eos_token
22
+ tokenizer.padding_side = "left"
23
+ model = AutoModelForCausalLM.from_pretrained(model_id).to(device)
24
+ if variant: # doc-builder: hide
25
+ del model # doc-builder: hide
26
+ model = AutoModelForCausalLM.from_pretrained(model_id, **variant).to(device) # doc-builder: hide
27
+
28
+ prompts = [
29
+ "def add(a, b):\n return a + b\n\ndef sub(a, b):\n return a - b\n\ndef mul(a, b):\n return",
30
+ "import numpy as np\n\ndef mean(x):\n return np.",
31
+ ]
32
+ inputs = tokenizer(prompts, return_tensors="pt", padding=True).to(device)
33
+
34
+ with torch.no_grad():
35
+ logits = model(**inputs).logits
36
+ # Left padding: the last position is the final real token of each prompt.
37
+ next_logits = logits[:, -1, :]
38
+ predicted = next_token_logits = next_token_logits if False else next_logits.argmax(dim=-1) # doc-builder: hide
39
+ predicted = next_logits.argmax(dim=-1)
40
+ print(tokenizer.convert_ids_to_tokens(predicted))
41
+ ```
42
+
43
+ ## One training step
44
+
45
+ ```py runnable:causal_lm:2
46
+ # Language-model labels: copy the input ids and mask padded positions.
47
+ labels = inputs["input_ids"].clone()
48
+ labels[labels == tokenizer.pad_token_id] = -100
49
+
50
+ model.train()
51
+ optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
52
+ loss = model(**inputs, labels=labels).loss
53
+ loss.backward()
54
+ before = {n: p.detach().cpu().clone() for n, p in model.named_parameters() if p.requires_grad} # doc-builder: hide
55
+ optimizer.step()
56
+ print(f"loss: {loss.item():.4f}")
57
+
58
+ if os.environ.get("MIC_RUNNER"): # doc-builder: hide
59
+ named = dict(model.named_parameters())
60
+ checked = ("transformer.h.0.attn.c_attn.weight", "transformer.h.0.mlp.c_fc.weight")
61
+ result = {
62
+ "runtime": {
63
+ "device": model.device.type,
64
+ "dtype": str(model.dtype).removeprefix("torch."),
65
+ "attn_implementation": model.config._attn_implementation,
66
+ },
67
+ "predicted_tokens": predicted.tolist(),
68
+ "predicted_text": tokenizer.convert_ids_to_tokens(predicted),
69
+ "next_token_logits": next_logits.gather(1, predicted.unsqueeze(-1)).squeeze(-1).float().tolist(),
70
+ "training": {
71
+ "loss": loss.item(),
72
+ "gradients": {n: bool(named[n].grad is not None and torch.count_nonzero(named[n].grad) > 0 and torch.isfinite(named[n].grad).all()) for n in checked},
73
+ "updated": any(not torch.equal(p.detach().cpu(), before[n]) for n, p in model.named_parameters() if n in before),
74
+ },
75
+ }
76
+ print(json.dumps(result))
77
+ ```
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:1cb730824fb0a3d7a02141afb42177445e7d8522e8cde09bbfb3c174d5ca2ed0
3
+ size 14901064
special_tokens_map.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|endoftext|>",
4
+ "<fim_prefix>",
5
+ "<fim_middle>",
6
+ "<fim_suffix>",
7
+ "<fim_pad>",
8
+ "<filename>",
9
+ "<gh_stars>",
10
+ "<issue_start>",
11
+ "<issue_comment>",
12
+ "<issue_closed>",
13
+ "<jupyter_start>",
14
+ "<jupyter_text>",
15
+ "<jupyter_code>",
16
+ "<jupyter_output>",
17
+ "<empty_output>",
18
+ "<commit_before>",
19
+ "<commit_msg>",
20
+ "<commit_after>",
21
+ "<reponame>"
22
+ ],
23
+ "bos_token": "<|endoftext|>",
24
+ "eos_token": "<|endoftext|>",
25
+ "unk_token": "<|endoftext|>"
26
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "additional_special_tokens": [
4
+ "<|endoftext|>",
5
+ "<fim_prefix>",
6
+ "<fim_middle>",
7
+ "<fim_suffix>",
8
+ "<fim_pad>",
9
+ "<filename>",
10
+ "<gh_stars>",
11
+ "<issue_start>",
12
+ "<issue_comment>",
13
+ "<issue_closed>",
14
+ "<jupyter_start>",
15
+ "<jupyter_text>",
16
+ "<jupyter_code>",
17
+ "<jupyter_output>",
18
+ "<empty_output>",
19
+ "<commit_before>",
20
+ "<commit_msg>",
21
+ "<commit_after>",
22
+ "<reponame>"
23
+ ],
24
+ "bos_token": "<|endoftext|>",
25
+ "eos_token": "<|endoftext|>",
26
+ "model_max_length": 1000000000000000019884624838656,
27
+ "tokenizer_class": "GPT2Tokenizer",
28
+ "unk_token": "<|endoftext|>",
29
+ "vocab_size": 49152
30
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff