Skip to content

fix(dynamic batching): preserve static mini-batch updates - #494

Open
JimmyWang0417 wants to merge 1 commit into
alibaba:mainfrom
JimmyWang0417:contrib/issue-442-keep-mini-batch
Open

fix(dynamic batching): preserve static mini-batch updates#494
JimmyWang0417 wants to merge 1 commit into
alibaba:mainfrom
JimmyWang0417:contrib/issue-442-keep-mini-batch

Conversation

@JimmyWang0417

Copy link
Copy Markdown

What does this PR do?

Add an opt-in keep_mini_batch option for dynamic actor training.

When enabled, dynamic micro-batch ranges are split at static mini-batch
boundaries so each optimizer update receives the same number of samples as
static batching. Metadata is copied for each yielded batch so later
iterations do not overwrite earlier batches.

The option is disabled by default to preserve existing behavior.

How was this tested?

  • pytest -q tests/utils/test_dynamic_batching.py
  • python -m compileall -q roll tests/utils/test_dynamic_batching.py
  • git diff --check

Fixes #442

@CLAassistant

CLAassistant commented Aug 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

LR scheduler progress can be inconsistent with dynamic batching in Megatron actor training

2 participants