Skip to content

Commit

Permalink
Update HF conversion docs following reversion of is_pipe_parallel c…
Browse files Browse the repository at this point in the history
…heck (EleutherAI#959)

* update conversion script instructions in readme

* rename v1.0 script (now default for 2.0) to module_to_hf

* Update NeoXArgs docs automatically

---------

Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
haileyschoelkopf and github-actions authored Jun 5, 2023
1 parent 460a901 commit 7a595f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Prior to 3/9/2023, GPT-NeoX relied on [DeeperSpeed](https://github.com/EleutherA
* [GPT-NeoX-20B](#gpt-neox-20b)
* [Pythia](#pythia)
* [Polyglot](#polyglot)
* [Fill-in-the-Middle](#fill-in-the-middle)
* [Inference](#inference)
* [Evaluation](#evaluation)
* [Exporting to Hugging Face](#exporting-to-hugging-face)
Expand Down Expand Up @@ -307,15 +306,16 @@ where `--eval_tasks` is a list of evaluation tasks followed by spaces, e.g `--ev

GPT-NeoX is optimized heavily for training only, and GPT-NeoX model checkpoints are not compatible out of the box with other deep learning libraries. To make models easily loadable and shareable with end users, and for further exporting to various other frameworks, GPT-NeoX supports checkpoint conversion to the [Hugging Face Transformers](https://arxiv.org/abs/1910.03771) GPTNeoXModel format.

To convert a NeoX v2.0 checkpoint (with pipeline-parallel-size=1) to Hugging Face-loadable format, run:
To convert a NeoX checkpoint (with pipeline-parallel-size>=1) to Hugging Face-loadable format, run:
```bash
python ./tools/convert_sequential_to_hf.py --input_dir /path/to/model/global_stepXXX --config_file your_config.yml --output_dir hf_model/save/location
python ./tools/convert_module_to_hf.py --input_dir /path/to/model/global_stepXXX --config_file your_config.yml --output_dir hf_model/save/location
```

To convert a NeoX v1.0 checkpoint to Hugging Face format, run:
To convert a sequential model to Hugging Face format, run:
```bash
python ./tools/convert_v1.0_to_hf.py --input_dir /path/to/model/global_stepXXX --config_file your_config.yml --output_dir hf_model/save/location
python ./tools/convert_sequential_to_hf.py --input_dir /path/to/model/global_stepXXX --config_file your_config.yml --output_dir hf_model/save/location
```
(Note: this script should be used for v2.0 checkpoints saved on a v2.0 commit prior to https://github.com/EleutherAI/gpt-neox/pull/866 and which used `pipe-parallel-size=1`. Using `pipe-parallel-size=0` will also save models in this format.)

Then to upload a model to [the Hugging Face Hub](https://huggingface.co/), run:
```bash
Expand Down
2 changes: 1 addition & 1 deletion configs/neox_arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Logging Arguments

- **git_hash**: str

Default = e67f027
Default = 07da9fc

current git hash of repository

Expand Down
File renamed without changes.

0 comments on commit 7a595f5

Please sign in to comment.