Skip to content

Handle checkpoint and text-only batches in MIMO encoder prefetch - #6039

Merged
yashaswikarnati merged 2 commits into
NVIDIA:mainfrom
yashaswikarnati:agent/mimo-prefetch-integration-fixes
Aug 6, 2026
Merged

yashaswikarnati merged 2 commits into
NVIDIA:mainfrom
yashaswikarnati:agent/mimo-prefetch-integration-fixes

Conversation

@yashaswikarnati

Copy link
Copy Markdown
Contributor

What changed

  • expose EncoderPrefetchLoader.save_state() -> None so checkpointing can treat encoder lookahead as derived state while the canonical language-loader cursor remains authoritative.
  • allow text-only MIMO microbatches to pass through encoder prefetch without invoking the image encoder.
  • guard CUDA stream and debug-timing bookkeeping when a batch produces no encoder features.

Why

Encoder prefetch from #5833 can wrap a checkpointable data iterator and can receive image-sparse batches from heterogeneous multimodal datasets. The outer wrapper must participate in the checkpoint interface without persisting its speculative queue, and batches without images must preserve schedule progress without manufacturing encoder work.

The model still validates missing inputs when matching modality tokens are present; this only permits genuinely text-only batches.

Validation

  • python3 -m py_compile examples/mimo/training/encoder_prefetch.py tests/unit_tests/models/mimo/test_mimo_encoder_prefetch.py
  • OCI-HSG 5-node Mistral VLM smoke job 5590459: 200 iterations completed with both patches in the staging branch.
  • focused regression coverage added for non-authoritative prefetch state and text-only batch pass-through.

Local pytest was not rerun on the Codex host because that host does not provide uv or Torch; CI should run the focused tests in the supported container.

Signed-off-by: ykarnati <ykarnati@nvidia.com>
Signed-off-by: ykarnati <ykarnati@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yashaswikarnati
yashaswikarnati marked this pull request as ready for review July 31, 2026 16:39
@svcnvidia-nemo-ci
svcnvidia-nemo-ci requested a review from a team July 31, 2026 16:39
@yashaswikarnati

Copy link
Copy Markdown
Contributor Author

/ok to test d16427a

@yashaswikarnati
yashaswikarnati added this pull request to the merge queue Aug 5, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31058063807

Merged via the queue into NVIDIA:main with commit ef3ce11 Aug 6, 2026
94 checks passed
@yashaswikarnati
yashaswikarnati deleted the agent/mimo-prefetch-integration-fixes branch August 6, 2026 01:47

This branch was previously deployed

2 inactive deployments
public — d16427a4 Deployed Jul 31, 2026 by copy-pr-bot[bot] via finalize / publish-docs #5093
test — d16427a4 Deployed Jul 31, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #18085
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants