Skip to content

Commit

Permalink
Remove gas (beano) (#1144)
Browse files Browse the repository at this point in the history
* Remove 'gas' configuration variable

* Remove gas from configs and config documentation

* Update training.py
  • Loading branch information
segyges committed Feb 5, 2024
1 parent 032ec8c commit 91c44bc
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion configs/19M.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},

"train_micro_batch_size_per_gpu": 4, #32,
"gas": 1,
"gradient_accumulation_steps": 1,
"data_impl": "mmap",
"num_workers": 1,

Expand Down
2 changes: 1 addition & 1 deletion configs/49M.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

# batch / data settings
"train_micro_batch_size_per_gpu": 32,
"gas": 1,
"gradient_accumulation_steps": 1,
"data_impl": "mmap",
"num_workers": 1,

Expand Down
2 changes: 1 addition & 1 deletion configs/800M.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},

"train_micro_batch_size_per_gpu": 16,
"gas": 1,
"gradient_accumulation_steps": 1,
"data_impl": "mmap",
"num_workers": 1,

Expand Down
15 changes: 3 additions & 12 deletions configs/neox_arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ Text Generation arguments

- **prompt_end**: str

Default =
Default =


a single prompt's end. Defaults to newline
Expand Down Expand Up @@ -1018,7 +1018,7 @@ Text Generation arguments

- **eval_results_prefix**: str

Default =
Default =

prefix to which to save evaluation results - final fp will be {eval_results_prefix}_eval_results_yy-mm-dd-HH-MM.json

Expand Down Expand Up @@ -1478,14 +1478,6 @@ Training Arguments



- **gas**: int

Default = None

gradient_accumulation_steps



- **clip_grad**: float

Default = 1.0
Expand Down Expand Up @@ -1770,7 +1762,7 @@ Args for deepspeed config

Default = None





Expand Down Expand Up @@ -2070,4 +2062,3 @@ Args for deepspeed runner (deepspeed.launcher.runner).
Default = None

Adds a `--account` to the DeepSpeed launch command. In DeeperSpeed this is passed on to the SlurmLauncher as well. Sometimes necessary for cluster rules, or so I've heard.

1 change: 0 additions & 1 deletion megatron/neox_arguments/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,6 @@ def calculate_derived(self):
"gradient_accumulation_steps": gradient_accumulation_steps,
"batch_size": train_micro_batch_size_per_gpu,
# duplicate items
"gas": self.gradient_accumulation_steps,
"clip_grad": self.gradient_clipping,
}
)
Expand Down
3 changes: 0 additions & 3 deletions megatron/neox_arguments/neox_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,6 @@ class NeoXArgsTraining(NeoXArgsTemplate):
Partition Activations across GPUs before checkpointing.
"""

gas: int = None
"""gradient_accumulation_steps""" # TODO this is a duplicate, remove?

clip_grad: float = 1.0
"""
Gradient clipping based on global L2 norm.
Expand Down
2 changes: 1 addition & 1 deletion megatron/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def evaluate(

# although we're not accumulating gradients here, we count one iter as train_batch_size_per_gpu * g.a.s
# to be consistent with deepspeed's pipe parallel engine
# since pipe parallel already takes gas into account - default to 1 here if pipe parallel is true
# since pipe parallel already takes gradient_accumulation_steps into account - default to 1 here if pipe parallel is true
for _ in range(
1
if neox_args.is_pipe_parallel
Expand Down
2 changes: 1 addition & 1 deletion tests/config/test_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"output_layer_init_method": "wang_init",

"train_micro_batch_size_per_gpu": 4,
"gas": 1,
"gradient_accumulation_steps": 1,
"data_impl": "mmap",
"num_workers": 1,

Expand Down

0 comments on commit 91c44bc

Please sign in to comment.