James Briggs commited on
Commit
df2d5cd
1 Parent(s): 97edc02

Added all files from training

Browse files
README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - generated_from_trainer
4
+ datasets:
5
+ - squad
6
+ model-index:
7
+ - name: Graphcore/bert-base-uncased-squad
8
+ results: []
9
+ ---
10
+
11
+ # Graphcore/bert-base-uncased-squad11
12
+
13
+ This model is a fine-tuned version of [Graphcore/bert-base-uncased](https://huggingface.co/Graphcore/bert-base-uncased) on the squad dataset.
14
+
15
+
16
+ ## Intended uses & limitations
17
+
18
+ More information needed
19
+
20
+ ## Training and evaluation data
21
+
22
+ [squad dataset](https://huggingface.co/datasets/squad)
23
+
24
+ ## Training procedure
25
+
26
+ Model was trained on 16 Graphcore Mk2 IPUs using the [optimum-graphcore](https://github.com/huggingface/optimum-graphcore) library.
27
+
28
+ Command line:
29
+
30
+ ```
31
+ python examples/question-answering/run_qa.py \
32
+ --model_name_or_path Graphcore/bert-base-uncased \
33
+ --ipu_config_name Graphcore/bert-base-ipu \
34
+ --dataset_name squad \
35
+ --do_train \
36
+ --do_eval \
37
+ --num_train_epochs 3 \
38
+ --per_device_train_batch_size 2 \
39
+ --per_device_eval_batch_size 2 \
40
+ --gradient_accumulation_steps 16 \
41
+ --pod_type pod16 \
42
+ --learning_rate 9e-5 \
43
+ --max_seq_length 384 \
44
+ --doc_stride 128 \
45
+ --seed 42\
46
+ --lr_scheduler_type linear \
47
+ --loss_scaling 64 \
48
+ --weight_decay 0.01 \
49
+ --warmup_ratio 0.2 \
50
+ --logging_steps 1 \
51
+ --save_steps 50 \
52
+ --dataloader_num_workers 64 \
53
+ --ipu_config_overrides "embedding_serialization_factor=2" \
54
+ --output_dir squad_v2_bert_base \
55
+ --overwrite_output_dir
56
+ ```
57
+
58
+ ### Training hyperparameters
59
+
60
+ The following hyperparameters were used during training:
61
+ - learning_rate: 6e-05
62
+ - train_batch_size: 2
63
+ - eval_batch_size: 2
64
+ - seed: 42
65
+ - distributed_type: IPU
66
+ - gradient_accumulation_steps: 16
67
+ - total_train_batch_size: 256
68
+ - total_eval_batch_size: 32
69
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
70
+ - lr_scheduler_type: linear
71
+ - lr_scheduler_warmup_ratio: 0.1
72
+ - num_epochs: 3.0
73
+ - training precision: Mixed Precision
74
+
75
+ ### Training results
76
+
77
+ ```
78
+ {
79
+ "epoch": 3.0,
80
+ "eval_exact_match": 81.79754020813624,
81
+ "eval_f1": 88.84840994541061,
82
+ "eval_samples": 10784
83
+ }
84
+ ```
85
+
86
+
87
+ ### Framework versions
88
+
89
+ - Transformers 4.18.0.dev0
90
+ - Pytorch 1.10.0+cpu
91
+ - Datasets 1.18.4
92
+ - Tokenizers 0.11.6
all_results.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "eval_exact_match": 81.79754020813624,
4
+ "eval_f1": 88.84840994541061,
5
+ "eval_samples": 10784,
6
+ "train_loss": 0.9942761997093901,
7
+ "train_runtime": 437.6871,
8
+ "train_samples": 88524,
9
+ "train_samples_per_second": 606.762,
10
+ "train_steps_per_second": 2.365
11
+ }
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Graphcore/bert-base-uncased",
3
+ "architectures": [
4
+ "PoptorchPipelinedBertForQuestionAnswering"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 0.001,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float16",
22
+ "transformers_version": "4.18.0.dev0",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522
26
+ }
eval_predictions.json ADDED
The diff for this file is too large to render. See raw diff
eval_results.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "eval_exact_match": 81.79754020813624,
4
+ "eval_f1": 88.84840994541061,
5
+ "eval_samples": 10784
6
+ }
ipu_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "device_iterations": 2,
3
+ "embedding_serialization_factor": 2,
4
+ "enable_half_first_order_momentum": true,
5
+ "enable_half_partials": true,
6
+ "executable_cache_dir": "./exe_cache",
7
+ "gradient_accumulation_steps": 16,
8
+ "inference_device_iterations": 4,
9
+ "inference_replication_factor": 4,
10
+ "ipus_per_replica": 4,
11
+ "layers_per_ipu": [
12
+ 0,
13
+ 4,
14
+ 4,
15
+ 4
16
+ ],
17
+ "matmul_proportion": 0.25,
18
+ "optimizer_state_offchip": false,
19
+ "optimum_version": "0.1.2",
20
+ "output_mode": "final",
21
+ "profile_dir": "",
22
+ "recompute_checkpoint_every_layer": true,
23
+ "replicated_tensor_sharding": true,
24
+ "replication_factor": 4,
25
+ "seed": 42,
26
+ "use_popdist": false
27
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19d2e8b2ee1b19d2ab367416fa4237fbb2bc5805b0b0967a75d9b551a17ee480
3
+ size 217854001
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"do_lower_case": true, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "Graphcore/bert-base-uncased", "tokenizer_class": "BertTokenizer"}
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "train_loss": 0.9942761997093901,
4
+ "train_runtime": 437.6871,
5
+ "train_samples": 88524,
6
+ "train_samples_per_second": 606.762,
7
+ "train_steps_per_second": 2.365
8
+ }
trainer_state.json ADDED
The diff for this file is too large to render. See raw diff
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81847e188efe71a1feccd9f111a09de422f8961c351bac3eca3b470d6c67cdb7
3
+ size 2735
vocab.txt ADDED
The diff for this file is too large to render. See raw diff