Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 0 additions & 1 deletion examples/configs/dpo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ policy:
grad_reduce_in_fp32: false
overlap_grad_reduce: true
overlap_param_gather: true
average_in_collective: true
data_parallel_sharding_strategy: "optim_grads_params"

data:
Expand Down
1 change: 0 additions & 1 deletion examples/configs/grpo_math_1B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ policy:
grad_reduce_in_fp32: false
overlap_grad_reduce: true
overlap_param_gather: true
average_in_collective: true
use_custom_fsdp: false
data_parallel_sharding_strategy: "optim_grads_params"

Expand Down
1 change: 0 additions & 1 deletion examples/configs/grpo_math_1B_megatron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ policy:
grad_reduce_in_fp32: false
overlap_grad_reduce: true
overlap_param_gather: true
average_in_collective: true
use_custom_fsdp: false
data_parallel_sharding_strategy: "optim_grads_params"

Expand Down
1 change: 0 additions & 1 deletion examples/configs/rm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ policy:
grad_reduce_in_fp32: false
overlap_grad_reduce: true
overlap_param_gather: false
average_in_collective: true
data_parallel_sharding_strategy: "optim_grads_params"


Expand Down
1 change: 0 additions & 1 deletion examples/configs/sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ policy:
grad_reduce_in_fp32: false
overlap_grad_reduce: true
overlap_param_gather: true
average_in_collective: true
data_parallel_sharding_strategy: "optim_grads_params"
use_custom_fsdp: false

Expand Down
1 change: 0 additions & 1 deletion examples/configs/sft_openmathinstruct2_megatron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ policy:
activation_checkpointing: false
context_parallel_size: 1
distributed_data_parallel_config:
average_in_collective: true
data_parallel_sharding_strategy: optim_grads_params
grad_reduce_in_fp32: true
overlap_grad_reduce: true
Expand Down
1 change: 0 additions & 1 deletion examples/configs/vlm_grpo_3B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ policy:
grad_reduce_in_fp32: false
overlap_grad_reduce: true
overlap_param_gather: true
average_in_collective: true
use_custom_fsdp: false
data_parallel_sharding_strategy: "optim_grads_params"

Expand Down
1 change: 0 additions & 1 deletion examples/configs/vlm_grpo_3B_megatron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ policy:
grad_reduce_in_fp32: false
overlap_grad_reduce: false
overlap_param_gather: true
average_in_collective: true
use_custom_fsdp: false
data_parallel_sharding_strategy: optim_grads_params
data:
Expand Down
7 changes: 4 additions & 3 deletions nemo_rl/models/policy/megatron_policy_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,9 @@ def __init__(
"https://github.com/NVIDIA-NeMo/RL/blob/bccbc377705a81a1f4b3c31ad9767bcc15f735a8/nemo_rl/algorithms/sft.py#L175-L179."
)

## TODO: make sure this works with sequence-level losses as well
Comment thread
ashors1 marked this conversation as resolved.
Outdated
model_cfg.calculate_per_token_loss = True

Comment thread
ashors1 marked this conversation as resolved.
self.megatron_cfg = ConfigContainer(
model=model_cfg,
checkpoint=checkpoint_config,
Expand All @@ -683,9 +686,7 @@ def __init__(
overlap_param_gather=self.cfg["megatron_cfg"][
"distributed_data_parallel_config"
]["overlap_param_gather"],
average_in_collective=self.cfg["megatron_cfg"][
"distributed_data_parallel_config"
]["average_in_collective"],
average_in_collective=False, # average in collective is not supported with per-token loss
Comment thread
terrykong marked this conversation as resolved.
Outdated
use_distributed_optimizer=self.cfg["megatron_cfg"]["optimizer"][
"use_distributed_optimizer"
],
Expand Down
Loading