Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary fp32/bf16 conversion #1169

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions configs/neox_arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ Text Generation arguments

- **prompt_end**: str

Default =
Default =


a single prompt's end. Defaults to newline
Expand Down Expand Up @@ -1100,7 +1100,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 @@ -1844,7 +1844,7 @@ Args for deepspeed config

Default = None





Expand Down Expand Up @@ -2144,4 +2144,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.

9 changes: 0 additions & 9 deletions megatron/mpu/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,13 @@ def _split(input_):
if world_size == 1:
return input_

# Bf16 convert
dt = input_.dtype
if dt == torch.bfloat16 and get_fp32_allreduce():
input_ = input_.float()

# Split along last dimension.
input_list = split_tensor_along_last_dim(input_, world_size)

# Note: torch.split does not create contiguous tensors by default.
rank = get_model_parallel_rank()
output = input_list[rank].contiguous()

# Bf16 convert
if dt == torch.bfloat16 and get_fp32_allreduce():
output = output.bfloat16()

return output


Expand Down
Loading