Skip to content

Commit

Permalink
Updated some lingering references to old configs (EleutherAI#830)
Browse files Browse the repository at this point in the history
* Updated some lingering references to old configs

* Update NeoXArgs docs automatically

* Update NeoXArgs docs automatically

* Update NeoXArgs docs automatically

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Stella Biderman <[email protected]>
  • Loading branch information
3 people committed Mar 14, 2023
1 parent 382ee7d commit f972e25
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README-MUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

## Tune mup hyperparameters and LR

The values under `mup hp search` were added and correspond to appendix F.4 from https://arxiv.org/pdf/2203.03466.pdf. These and LR are tuned with a random search using the scaled-up config (tested with 6-7B.yml) but with hidden-size set to the value from the scaled-down config (small.yml).
The values under `mup hp search` were added and correspond to appendix F.4 from https://arxiv.org/pdf/2203.03466.pdf. These and LR are tuned with a random search using the scaled-up config (tested with 6-7B.yml) but with hidden-size set to the value from the scaled-down config (125M.yml).

## Transfer

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ You can also optionally pass in a config prefix, which will assume all your conf
E.G:

```bash
python ./deepy.py train.py -d configs small.yml local_setup.yml
python ./deepy.py train.py -d configs 125M.yml local_setup.yml
```

This will deploy the `train.py` script on all nodes with one process per GPU. The worker nodes and number of GPUs are specified in the `/job/hostfile` file (see [parameter documentation](configs/README.md)), or can simply be passed in as the `num_gpus` arg if running on a single node setup.

Although this is not strictly necessary, we find it useful to define the model parameters in one config file (e.g `configs/small.yml`) and the data path parameters in another (e.g `configs/local_setup.yml`).
Although this is not strictly necessary, we find it useful to define the model parameters in one config file (e.g `configs/125M.yml`) and the data path parameters in another (e.g `configs/local_setup.yml`).


## Pretrained Models
Expand Down Expand Up @@ -293,7 +293,7 @@ We support three types of generation from a pretrained model:
2. Conditional generation based on an input read from a file
3. Interactive generation, which allows for multiple rounds of back-and-forth between a user and the language model via a command line interface

All three types of text generation can be launched via `python ./deepy.py generate.py -d configs small.yml local_setup.yml text_generation.yml` with the appropriate values set in `configs/text_generation.yml`.
All three types of text generation can be launched via `python ./deepy.py generate.py -d configs 125M.yml local_setup.yml text_generation.yml` with the appropriate values set in `configs/text_generation.yml`.

# Evaluation

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 = ed27de5
Default = ebaeec1

current git hash of repository

Expand Down
2 changes: 1 addition & 1 deletion megatron/neox_arguments/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def consume_deepy_args(cls):
if args_parsed.conf_dir:
conf_files = [os.path.join(args_parsed.conf_dir, f) for f in conf_files]

# enables us to pass in `small` instead of `small.yml`
# enables us to pass in `125M` instead of `125M.yml`
conf_files = [
(cf if (cf.endswith(".yml") or cf.endswith(".json")) else cf + ".yml")
for cf in conf_files
Expand Down
18 changes: 9 additions & 9 deletions tests/neox_args/test_neoxargs_commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def test_neoxargs_consume_deepy_args_with_config_dir():
with patch(
"sys.argv",
[str(get_root_directory() / "deepy.py"), "train.py"]
+ get_configs_with_path(["small.yml", "local_setup.yml"]),
+ get_configs_with_path(["125M.yml", "local_setup.yml"]),
):
args_loaded_consume = NeoXArgs.consume_deepy_args()

# load neox args directly from yaml files
args_loaded_yamls = NeoXArgs.from_ymls(
get_configs_with_path(["small.yml", "local_setup.yml"])
get_configs_with_path(["125M.yml", "local_setup.yml"])
)

# update values from yaml files that cannot otherwise be matched
Expand All @@ -62,13 +62,13 @@ def test_neoxargs_consume_deepy_args_without_yml_suffix():
with patch(
"sys.argv",
[str(get_root_directory() / "deepy.py"), "train.py"]
+ get_configs_with_path(["small", "local_setup", "cpu_mock_config.yml"]),
+ get_configs_with_path(["125M", "local_setup", "cpu_mock_config.yml"]),
):
args_loaded_consume = NeoXArgs.consume_deepy_args()

# load neox args directly from yaml files
args_loaded_yamls = NeoXArgs.from_ymls(
get_configs_with_path(["small.yml", "local_setup.yml", "cpu_mock_config.yml"])
get_configs_with_path(["125M.yml", "local_setup.yml", "cpu_mock_config.yml"])
)

# update values from yaml files that cannot otherwise be matched
Expand All @@ -91,14 +91,14 @@ def test_neoxargs_consume_deepy_args_with_hostfile_param():
with patch(
"sys.argv",
[str(get_root_directory() / "deepy.py"), "train.py"]
+ get_configs_with_path(["small", "local_setup", "cpu_mock_config.yml"])
+ get_configs_with_path(["125M", "local_setup", "cpu_mock_config.yml"])
+ ["--hostfile=/mock_path"],
):
args_loaded_consume = NeoXArgs.consume_deepy_args()

# load neox args directly from yaml files
args_loaded_yamls = NeoXArgs.from_ymls(
get_configs_with_path(["small.yml", "local_setup.yml", "cpu_mock_config.yml"])
get_configs_with_path(["125M.yml", "local_setup.yml", "cpu_mock_config.yml"])
)

# update values from yaml files that cannot otherwise be matched
Expand All @@ -125,13 +125,13 @@ def test_neoxargs_consume_deepy_args_with_config_dir():
"-d",
str(get_config_directory()),
]
+ ["small.yml", "local_setup.yml", "cpu_mock_config.yml"],
+ ["125M.yml", "local_setup.yml", "cpu_mock_config.yml"],
):
args_loaded_consume = NeoXArgs.consume_deepy_args()

# load neox args directly from yaml files
args_loaded_yamls = NeoXArgs.from_ymls(
get_configs_with_path(["small.yml", "local_setup.yml", "cpu_mock_config.yml"])
get_configs_with_path(["125M.yml", "local_setup.yml", "cpu_mock_config.yml"])
)

# update values from yaml files that cannot otherwise be matched
Expand All @@ -150,7 +150,7 @@ def test_neoxargs_consume_neox_args():

# intitially load config from files as would be the case in deepy.py
yaml_list = get_configs_with_path(
["small.yml", "local_setup.yml", "cpu_mock_config.yml"]
["125M.yml", "local_setup.yml", "cpu_mock_config.yml"]
)
args_baseline = NeoXArgs.from_ymls(yaml_list)
args_baseline.update_value("user_script", str(get_root_directory() / "train.py"))
Expand Down
30 changes: 15 additions & 15 deletions tests/neox_args/test_neoxargs_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,37 +63,37 @@ def run_neox_args_load_test(yaml_files):


@pytest.mark.cpu
def test_neoxargs_load_arguments_small_local_setup():
def test_neoxargs_load_arguments_125M_local_setup():
"""
verify small.yml can be loaded without raising validation errors
verify 125M.yml can be loaded without raising validation errors
"""
run_neox_args_load_test(["small.yml", "local_setup.yml", "cpu_mock_config.yml"])
run_neox_args_load_test(["125M.yml", "local_setup.yml", "cpu_mock_config.yml"])


@pytest.mark.cpu
def test_neoxargs_load_arguments_small_local_setup_text_generation():
def test_neoxargs_load_arguments_125M_local_setup_text_generation():
"""
verify small.yml can be loaded together with text generation without raising validation errors
verify 125M.yml can be loaded together with text generation without raising validation errors
"""
run_neox_args_load_test(
["small.yml", "local_setup.yml", "text_generation.yml", "cpu_mock_config.yml"]
["125M.yml", "local_setup.yml", "text_generation.yml", "cpu_mock_config.yml"]
)


@pytest.mark.cpu
def test_neoxargs_load_arguments_medium_local_setup():
def test_neoxargs_load_arguments_350M_local_setup():
"""
verify medium.yml can be loaded without raising validation errors
verify 350M.yml can be loaded without raising validation errors
"""
run_neox_args_load_test(["medium.yml", "local_setup.yml", "cpu_mock_config.yml"])
run_neox_args_load_test(["350M.yml", "local_setup.yml", "cpu_mock_config.yml"])


@pytest.mark.cpu
def test_neoxargs_load_arguments_large_local_setup():
def test_neoxargs_load_arguments_760M_local_setup():
"""
verify large.yml can be loaded without raising validation errors
verify 760M.yml can be loaded without raising validation errors
"""
run_neox_args_load_test(["large.yml", "local_setup.yml", "cpu_mock_config.yml"])
run_neox_args_load_test(["760M.yml", "local_setup.yml", "cpu_mock_config.yml"])


@pytest.mark.cpu
Expand Down Expand Up @@ -121,11 +121,11 @@ def test_neoxargs_load_arguments_13B_local_setup():


@pytest.mark.cpu
def test_neoxargs_load_arguments_XL_local_setup():
def test_neoxargs_load_arguments_1_3B_local_setup():
"""
verify XL.yml can be loaded without raising validation errors
verify 1-3B.yml can be loaded without raising validation errors
"""
run_neox_args_load_test(["XL.yml", "local_setup.yml", "cpu_mock_config.yml"])
run_neox_args_load_test(["1-3B.yml", "local_setup.yml", "cpu_mock_config.yml"])


@pytest.mark.cpu
Expand Down

0 comments on commit f972e25

Please sign in to comment.