Skip to content

perf(data): parallelize NeMo Gym image encoding (cherry-pick #3721) - #3875

Merged
yfw merged 1 commit into
super-v3.5-posttrainingfrom
smohsenitahe/cherry-pick-3721-super-v3.5
Aug 27, 2026
Merged

perf(data): parallelize NeMo Gym image encoding (cherry-pick #3721)#3875
yfw merged 1 commit into
super-v3.5-posttrainingfrom
smohsenitahe/cherry-pick-3721-super-v3.5

Conversation

@DanialTaheri

Copy link
Copy Markdown
Contributor

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Cherry-picks #3721 (perf(data): parallelize NeMo Gym image encoding, 55227be9c88b723ca6301d66330703eb1ee8479c on main) onto super-v3.5-posttraining.

encode_images_in_examples previously resolved and base64-encoded every local image reference serially, once per occurrence. The picked commit collects the references first, encodes each unique source once through a bounded ThreadPoolExecutor (NEMO_GYM_IMAGE_ENCODE_MAX_WORKERS = 8), then mutates the payload on the caller thread.

Issues

List issues that this PR closes (syntax):

None — this is a backport of an already-merged main commit.

Usage

  • You can potentially add a usage example below

No API change. The only call site is nemo_rl/environments/nemo_gym.py:848, which is byte-identical on this branch and on main.

from nemo_rl.data.multimodal_utils import encode_images_in_examples

# Same signature and in-place mutation semantics as before; local image paths
# are now resolved concurrently and deduplicated across the batch.
encode_images_in_examples(nemo_gym_examples)

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests? — the four tests added by perf(data): parallelize NeMo Gym image encoding #3721 to tests/unit/data/test_multimodal_image_encoding.py come along with the pick.
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests — not run locally; relying on CI here (see below).
  • Did you add or update any necessary documentation? — docstring updated by the picked commit.

Additional Information

Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com>
(cherry picked from commit 55227be)
@DanialTaheri
DanialTaheri requested review from a team as code owners August 27, 2026 16:31
@copy-pr-bot

copy-pr-bot Bot commented Aug 27, 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.

@yfw
yfw merged commit 36927fc into super-v3.5-posttraining Aug 27, 2026
10 checks passed
@yfw
yfw deleted the smohsenitahe/cherry-pick-3721-super-v3.5 branch August 27, 2026 16:42
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.

3 participants