Skip to content

Commit 84c90ed

Browse files
Update 18th December
- Documentation updates - BERT model updates - CNN training updates - Various updates to match 1.0.97 Poplar SDK APIs
1 parent c0ee8d4 commit 84c90ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2099
-1106
lines changed

applications/popart/bert/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ custom_ops.so: custom_ops/*
33
custom_ops/attention.cpp \
44
custom_ops/embeddingGather.cpp \
55
custom_ops/detach.cpp \
6-
custom_ops/gelu.cpp \
76
-shared -lpopart -lpoplar -lpoplin -lpopnn -lpopops -lpoputil -lpoprand \
87
-o custom_ops.so

applications/popart/bert/README.md

+13-23
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Instructions on how to download the Wikipedia and SQuAD datasets can be found in
3939

4040
If full pre-training is required (with the two phases with different sequence lengths) then data will need to be generated separately for the two phases:
4141

42-
- once with --sequence-length 128 and --mask-tokens 20
43-
- once with --sequence-length 384 --mask-tokens 60
42+
- once with --sequence-length 128 --mask-tokens 20 --duplication-factor 6
43+
- once with --sequence-length 384 --mask-tokens 56 --duplication-factor 6
4444

4545
See the `bert_data/README.md file` for more details on how to generate this data.
4646

@@ -78,9 +78,15 @@ source venv/bin/activate
7878
pip install -r requirements.txt
7979
```
8080

81-
##### 3) Compile `custom_ops`
81+
##### 3) Install Boost and compile `custom_ops`
8282

83-
Run:
83+
To install Boost run:
84+
85+
```bash
86+
apt-get update; apt-get install libboost-dev
87+
```
88+
89+
To compile custom_ops run:
8490

8591
```bash
8692
make
@@ -159,13 +165,6 @@ python bert.py --config configs/demo.json
159165

160166
This will compile the graph and run for 150 epochs. At end our model should have overfit to 100% test accuracy.
161167

162-
#### Pre-training results (small sample)
163-
164-
```
165-
[...]
166-
Iteration: 149 Epoch: 149/149 Loss (MLM NSP): 0.019 0.029 Accuracy (MLM NSP): 0.993 1.000 Learning Rate: 0.00080 Duration: 0.1593 s Throughput: 740.8 samples/s
167-
```
168-
169168
##### View the pre-training results in Tensorboard
170169

171170
`requirements.txt` will install a standalone version of tensorboard. The program will log all training runs to `--log-dir`(`logs` by default). View them by running:
@@ -176,22 +175,13 @@ tensorboard --logdir logs
176175

177176
### Run the training loop for pre-training (Wikipedia)
178177

179-
For BERT Base, use the following command:
178+
For BERT Base phase 1, use the following command:
180179

181180
`python bert.py --config configs/pretrain_base.json`
182181

183-
For BERT Large, use the following command:
184-
185-
`python bert.py --config configs/pretrain_large.json`
186-
187-
#### Pre-training results (Wikipedia)
182+
For BERT Base phase 2, use the following command:
188183

189-
The expected result from phase 1 of pretraining (`pretrain_base.json`) is:
190-
191-
```
192-
[...]
193-
Iteration: 12000 Epoch: 2/2 Loss (MLM NSP): 1.847 0.067 Accuracy (MLM NSP): 0.633 0.975 Learning Rate: 0.00012
194-
```
184+
`python bert.py --config configs/pretrain_base_384.json`
195185

196186
### Run the training loop with training data (SQuAD 1.1)
197187

0 commit comments

Comments
 (0)