Skip to content

Fix Configuration for Micro Batch Size in Megatron's Ref Policy#1700

Merged
ETOgaosion merged 2 commits intoverl-project:mainfrom
none0663:fix_megatron_batch_size_config
May 28, 2025
Merged

Fix Configuration for Micro Batch Size in Megatron's Ref Policy#1700
ETOgaosion merged 2 commits intoverl-project:mainfrom
none0663:fix_megatron_batch_size_config

Conversation

@none0663
Copy link
Copy Markdown
Contributor

What does this PR do?

Fix Configuration for Micro Batch Size in Megatron's Ref Policy

High-Level Design

This pull request addresses an issue with the micro batch size configuration in the ref policy of Megatron. The default ppo_megatron_trainer.yaml only includes two configurations: log_prob_micro_batch_size and log_prob_micro_batch_size_per_gpu.
https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/trainer/config/ppo_megatron_trainer.yaml#L119-L120
However, in megatron_workers.py, the required configuration is ref.log_prob_micro_batch_size_per_gpu
https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/workers/megatron_workers.py#L517-L518
or in megatron_actor.py the required configuration is ref.ppo_micro_batch_size_per_gpu,
https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/workers/actor/megatron_actor.py#L271-L274

which are not directly related to ppo_micro_batch_size.

To resolve this, I have made modifications to the configuration calculations and added raise ValueError statements to ensure that the necessary parameters are correctly defined.

This update ensures that the required parameters are properly handled, preventing runtime errors and improving the overall robustness of the training process.

Changes Made:

  • Modified the configuration calculations in megatron_workers.py.

  • Added raise ValueError statements to check for the presence of log_prob_micro_batch_size_per_gpu and ppo_micro_batch_size_per_gpu.

else:
if self.config.ref.get("log_prob_micro_batch_size_per_gpu", None):
self.config.ref.ppo_micro_batch_size_per_gpu = self.config.ref.log_prob_micro_batch_size_per_gpu
elif self.config.ref.get("ppo_micro_batch_size_per_gpu", None):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contribution!

I think that here is a typo, so we may not need to consider ppo_micro_batch_size_per_gpu, you can simply judge the key above~

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix, del the ppo_micro_batch_size_per_gpu

@ETOgaosion ETOgaosion merged commit 99e749a into verl-project:main May 28, 2025
20 checks passed
ETOgaosion pushed a commit to Jianbing-D/verl that referenced this pull request Jun 8, 2025
…l-project#1700)

### What does this PR do?

 Fix Configuration for Micro Batch Size in Megatron's Ref Policy

### High-Level Design
This pull request addresses an issue with the micro batch size
configuration in the ref policy of Megatron. The default
ppo_megatron_trainer.yaml only includes two configurations:
log_prob_micro_batch_size and log_prob_micro_batch_size_per_gpu.

https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/trainer/config/ppo_megatron_trainer.yaml#L119-L120
However, in `megatron_workers.py`, the required configuration is
ref.log_prob_micro_batch_size_per_gpu

https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/workers/megatron_workers.py#L517-L518
or in `megatron_actor.py ` the required configuration is
ref.ppo_micro_batch_size_per_gpu,

https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/workers/actor/megatron_actor.py#L271-L274

which are not directly related to ppo_micro_batch_size.

To resolve this, I have made modifications to the configuration
calculations and added raise ValueError statements to ensure that the
necessary parameters are correctly defined.

This update ensures that the required parameters are properly handled,
preventing runtime errors and improving the overall robustness of the
training process.

### Changes Made:

- Modified the configuration calculations in megatron_workers.py.

- Added raise ValueError statements to check for the presence of
log_prob_micro_batch_size_per_gpu and ppo_micro_batch_size_per_gpu.
wwwjn pushed a commit to wwwjn/verl that referenced this pull request Jun 10, 2025
…l-project#1700)

### What does this PR do?

 Fix Configuration for Micro Batch Size in Megatron's Ref Policy

### High-Level Design
This pull request addresses an issue with the micro batch size
configuration in the ref policy of Megatron. The default
ppo_megatron_trainer.yaml only includes two configurations:
log_prob_micro_batch_size and log_prob_micro_batch_size_per_gpu.

https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/trainer/config/ppo_megatron_trainer.yaml#L119-L120
However, in `megatron_workers.py`, the required configuration is
ref.log_prob_micro_batch_size_per_gpu

https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/workers/megatron_workers.py#L517-L518
or in `megatron_actor.py ` the required configuration is
ref.ppo_micro_batch_size_per_gpu,

https://github.com/volcengine/verl/blob/54c9b7364c2d188b2ba4107404cfa3c2b446df19/verl/workers/actor/megatron_actor.py#L271-L274

which are not directly related to ppo_micro_batch_size.

To resolve this, I have made modifications to the configuration
calculations and added raise ValueError statements to ensure that the
necessary parameters are correctly defined.

This update ensures that the required parameters are properly handled,
preventing runtime errors and improving the overall robustness of the
training process.

### Changes Made:

- Modified the configuration calculations in megatron_workers.py.

- Added raise ValueError statements to check for the presence of
log_prob_micro_batch_size_per_gpu and ppo_micro_batch_size_per_gpu.
chenjiaoAngel added a commit to chenjiaoAngel/verl that referenced this pull request Nov 14, 2025
…l-project#1700)

### What does this PR do?

 Fix Configuration for Micro Batch Size in Megatron's Ref Policy

### High-Level Design
This pull request addresses an issue with the micro batch size
configuration in the ref policy of Megatron. The default
ppo_megatron_trainer.yaml only includes two configurations:
log_prob_micro_batch_size and log_prob_micro_batch_size_per_gpu.

https://github.com/volcengine/verl/blob/a5b1b6ebb452978bc6f4ad0f246de1f574103035/verl/trainer/config/ppo_megatron_trainer.yaml#L119-L120
However, in `megatron_workers.py`, the required configuration is
ref.log_prob_micro_batch_size_per_gpu

https://github.com/volcengine/verl/blob/a5b1b6ebb452978bc6f4ad0f246de1f574103035/verl/workers/megatron_workers.py#L517-L518
or in `megatron_actor.py ` the required configuration is
ref.ppo_micro_batch_size_per_gpu,

https://github.com/volcengine/verl/blob/a5b1b6ebb452978bc6f4ad0f246de1f574103035/verl/workers/actor/megatron_actor.py#L271-L274

which are not directly related to ppo_micro_batch_size.

To resolve this, I have made modifications to the configuration
calculations and added raise ValueError statements to ensure that the
necessary parameters are correctly defined.

This update ensures that the required parameters are properly handled,
preventing runtime errors and improving the overall robustness of the
training process.

### Changes Made:

- Modified the configuration calculations in megatron_workers.py.

- Added raise ValueError statements to check for the presence of
log_prob_micro_batch_size_per_gpu and ppo_micro_batch_size_per_gpu.
TimurTaepov pushed a commit to giorgossideris/verl that referenced this pull request Dec 20, 2025
…l-project#1700)

### What does this PR do?

 Fix Configuration for Micro Batch Size in Megatron's Ref Policy

### High-Level Design
This pull request addresses an issue with the micro batch size
configuration in the ref policy of Megatron. The default
ppo_megatron_trainer.yaml only includes two configurations:
log_prob_micro_batch_size and log_prob_micro_batch_size_per_gpu.

https://github.com/volcengine/verl/blob/b5cc0c2a98d7e89da1521961c09f2c2eb6148cf9/verl/trainer/config/ppo_megatron_trainer.yaml#L119-L120
However, in `megatron_workers.py`, the required configuration is
ref.log_prob_micro_batch_size_per_gpu

https://github.com/volcengine/verl/blob/b5cc0c2a98d7e89da1521961c09f2c2eb6148cf9/verl/workers/megatron_workers.py#L517-L518
or in `megatron_actor.py ` the required configuration is
ref.ppo_micro_batch_size_per_gpu,

https://github.com/volcengine/verl/blob/b5cc0c2a98d7e89da1521961c09f2c2eb6148cf9/verl/workers/actor/megatron_actor.py#L271-L274

which are not directly related to ppo_micro_batch_size.

To resolve this, I have made modifications to the configuration
calculations and added raise ValueError statements to ensure that the
necessary parameters are correctly defined.

This update ensures that the required parameters are properly handled,
preventing runtime errors and improving the overall robustness of the
training process.

### Changes Made:

- Modified the configuration calculations in megatron_workers.py.

- Added raise ValueError statements to check for the presence of
log_prob_micro_batch_size_per_gpu and ppo_micro_batch_size_per_gpu.
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
…l-project#1700)

### What does this PR do?

 Fix Configuration for Micro Batch Size in Megatron's Ref Policy

### High-Level Design
This pull request addresses an issue with the micro batch size
configuration in the ref policy of Megatron. The default
ppo_megatron_trainer.yaml only includes two configurations:
log_prob_micro_batch_size and log_prob_micro_batch_size_per_gpu.

https://github.com/volcengine/verl/blob/0d2d4fc0a85f495666dfdcd5a7a121b2bf67ca15/verl/trainer/config/ppo_megatron_trainer.yaml#L119-L120
However, in `megatron_workers.py`, the required configuration is
ref.log_prob_micro_batch_size_per_gpu

https://github.com/volcengine/verl/blob/0d2d4fc0a85f495666dfdcd5a7a121b2bf67ca15/verl/workers/megatron_workers.py#L517-L518
or in `megatron_actor.py ` the required configuration is
ref.ppo_micro_batch_size_per_gpu,

https://github.com/volcengine/verl/blob/0d2d4fc0a85f495666dfdcd5a7a121b2bf67ca15/verl/workers/actor/megatron_actor.py#L271-L274

which are not directly related to ppo_micro_batch_size.

To resolve this, I have made modifications to the configuration
calculations and added raise ValueError statements to ensure that the
necessary parameters are correctly defined.

This update ensures that the required parameters are properly handled,
preventing runtime errors and improving the overall robustness of the
training process.

### Changes Made:

- Modified the configuration calculations in megatron_workers.py.

- Added raise ValueError statements to check for the presence of
log_prob_micro_batch_size_per_gpu and ppo_micro_batch_size_per_gpu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants