perf(data): parallelize NeMo Gym image encoding (cherry-pick #3721) - #3875
Merged
yfw merged 1 commit intoAug 27, 2026
Merged
Conversation
Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com> (cherry picked from commit 55227be)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,55227be9c88b723ca6301d66330703eb1ee8479conmain) ontosuper-v3.5-posttraining.encode_images_in_examplespreviously 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 boundedThreadPoolExecutor(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
maincommit.Usage
No API change. The only call site is
nemo_rl/environments/nemo_gym.py:848, which is byte-identical on this branch and onmain.Before your PR is "Ready for review"
Pre checks:
tests/unit/data/test_multimodal_image_encoding.pycome along with the pick.Additional Information
-x; applied with no conflicts. After the pick, bothnemo_rl/data/multimodal_utils.pyandtests/unit/data/test_multimodal_image_encoding.pyare byte-identical to55227be, so this branch carries exactly the code that passed CI onmain.git mergeof55227bewas deliberately avoided:super-v3.5-posttrainingdiverged frommainatb5916526, so a merge would have dragged in six unrelated commits (mooncake CPU RDMA data plane feat(data_plane): mooncake cpu rdma backend #2935, Qwen3.5 blockwise FP8 fix(fp8): support Qwen3.5 blockwise FP8 rollout and training #2744, MoE aux-loss PP hang fix: prevent PP hang in MoE aux-loss metric reduction #3419, tokenizer-save NFS deadlock fix: guard tokenizer save with rank 0 to avoid NFS deadlock #3504, sequence importance ratio metric fix(grpo): correct sequence importance ratio metric #3753, reference-logprob skip fix(sc): skip reference logprobs when KL is disabled #3771).torch/rayenvironment available, andtests/unit/conftest.pyimportsrayat collection time. CI on this PR is the first real execution of the picked tests against this branch.