Skip to content

refactor: defer decord2 initialization for audio fallback#2539

Draft
alexbowe wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
alexbowe:abowe/optional-decord-import
Draft

refactor: defer decord2 initialization for audio fallback#2539
alexbowe wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
alexbowe:abowe/optional-decord-import

Conversation

@alexbowe
Copy link
Copy Markdown

Summary

  • Remove the eager decord import from multimodal_utils.
  • Load decord2 only when transformers audio loading fails and the audio fallback is actually used.
  • Improve the missing-dependency message to point at decord2.
  • Add tests for the install hint and fallback behavior.

Validation

  • PYTHONPYCACHEPREFIX=/tmp/codex-pycache python3 -m py_compile nemo_rl/data/multimodal_utils.py tests/unit/data/test_multimodal_utils.py
  • git diff --check
  • uv run pytest tests/unit/data/test_multimodal_utils.py -q (blocked locally: fresh worktree is missing 3rdparty/Gym-workspace/Gym pyproject metadata)

Notes

  • This does not make decord2 an optional package; pyproject still lists it as a hard dependency. It just avoids loading the extension at Nemo-RL import time.
  • Claude adversarial review found no blockers.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 21, 2026

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.

Signed-off-by: alexbowe <abowe@nvidia.com>
@alexbowe alexbowe force-pushed the abowe/optional-decord-import branch from 2e2c320 to da85238 Compare May 21, 2026 09:34
@alexbowe alexbowe changed the title Defer decord2 initialization for audio fallback refactor: defer decord2 initialization for audio fallback May 21, 2026
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.

1 participant