Skip to content

Commit cc7a21a

Browse files
committed
Patch release
1 parent 97e22b1 commit cc7a21a

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

nlp/gpt_j/popxl/README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# GPT-J
22
GPT-J for NLP pre-training and text generation, optimised for Graphcore's IPU.
33

4-
| Framework | domain | Model | Datasets | Tasks| Training| Inference |
5-
|-------------|-|------|-------|-------|-------|---|
6-
| opXL | NLP | GPT-J | MNLI | Next sentence prediction, Question/Answering |||
7-
4+
| Framework | Domain | Model | Datasets | Tasks | Training | Inference |
5+
|-----------|--------|-------|----------|-------|----------|-----------|
6+
| popXL | NLP | GPT-J | MNLI | Next sentence prediction, Question/Answering | | <p style="text-align: center;">✅ <br> Min. 16 IPUs (POD16) required | <p style="text-align: center;">✅ <br> Min. 16 IPU (POD16) required |
87

98
# Instructions summary
109

@@ -51,7 +50,6 @@ source <venv path>/bin/activate
5150
3. Install the Python requirements:
5251
```bash
5352
pip3 install -r requirements.txt
54-
```nstall
5553
```
5654

5755

@@ -72,9 +70,10 @@ The task is to predict the relation between the premise and the hypothesis, whic
7270

7371

7472
The default model size for fine-tuning is GPT-J 6B on POD64 (named `gptj_6B_1024_pod64`). You can
75-
change it to other configurations that are available in the configuration file `config/finetuning.yml` using the `- -config` CLI parameter:
73+
change it to other configurations that are available in the configuration file `config/finetuning.yml` using the `--config` CLI parameter.
74+
In particular, you can run fine-tuning on a POD16 using
7675
```bash
77-
python3 run_finetuning_mnli.py - -config gptj_6B_1024_pod64
76+
python3 run_finetuning_mnli.py --config gptj_6B_1024_pod16
7877
```
7978

8079
When running the application, it is possible to save/load executables to/from a cache store. This allows for reusing a saved executable instead of re-compiling the model when re-running identical model configurations. To enable this, use the environment variable `POPXL_CACHE_DIR=<PATH/TO/CACHE>` when running the application:

nlp/gpt_j/popxl/config/finetuning_mnli.yml

+11
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ release:
5757
available_memory_proportion: [ 0.2 ]
5858
attention_serialisation: 2
5959

60+
"gptj_6B_1024_pod16":
61+
<<: *gptj_6B_1024
62+
execution:
63+
micro_batch_size: 1
64+
loss_scaling: 4096
65+
io_tiles: 128
66+
data_parallel: 1
67+
tensor_parallel: 16
68+
available_memory_proportion: [ 0.2 ]
69+
attention_serialisation: 2
70+
6071
tiny:
6172
<<: *tiny
6273
execution:

nlp/gpt_j/popxl/inference.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def inference(config: GPTJConfig) -> TaskSession:
7070
# ----- Create Variables -----
7171

7272
# Create RemoteBuffers for each variable
73-
embeddings_buffers = named_variable_buffers(embeddings_facts)
73+
embeddings_buffers = named_variable_buffers(embeddings_facts, shard_over_dict=False)
7474
layer_buffers = named_variable_buffers(
75-
layer_facts, entries=config.model.layers)
76-
lm_buffers = named_variable_buffers(lm_facts)
75+
layer_facts, entries=config.model.layers, shard_over_dict=False)
76+
lm_buffers = named_variable_buffers(lm_facts, shard_over_dict=False)
7777

7878
variables = NamedTensors()
7979
transformer = NamedTensors()

nlp/gpt_j/popxl/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ sklearn==0.0
1515
pytest==6.2.5
1616
pytest-pythonpath==0.7.4
1717

18-
git+ssh://[email protected]/graphcore/popxl-addons.git@sdk-release-3.1
18+
git+ssh://[email protected]/graphcore/popxl-addons.git@sdk-release-3.1_a
1919

2020
protobuf==3.20.*; python_version > '3.6'

0 commit comments

Comments
 (0)