Repository navigation
chore: replace decord2 with torchvision/torchaudio for media loading - #3107
Conversation
decord2 bundles libx264, libx265, libopenh264, and libmp3lame as hard dynamic dependencies of its core shared library. These codec libs carry MPEG LA / HEVC Advance royalty obligations on distribution. Replace the two decord usages in multimodal_utils.py: - Video loading: load_video backend="decord" → backend="torchvision" (torchvision==0.26.0 is already a project dependency) - Audio fallback: decord.AudioReader → torchaudio.load + functional.resample (torchaudio==2.11.0 is already a project dependency) Remove decord2 from pyproject.toml dependencies. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test 25b19e2 |
- Replace decord.AudioReader in load_audio_from_file with torchaudio - Add torchaudio.* to pyrefly replace-imports-with-any to suppress import-error for the lazy torchaudio import in multimodal_utils.py Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test 029b9ee |
av bundles libx264, libx265, libopenh264, and libmp3lame — the same royalty-obligating codec libs we removed with decord2. It is pulled in transitively by qwen-vl-utils (a megatron-bridge dep) but is only actually needed by megatron-bridge's optional WAN diffusion path, which installs it at test time via scripts/install_diffusion_deps.sh. Add "av; sys_platform == 'never'" to override-dependencies, mirroring the same approach already taken in Megatron-Bridge's own pyproject.toml (commit f4b34b4). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
…d2 via uv override - Switch processors.py video loading from backend="decord" to backend="torchvision" (missed in the initial decord→torchvision pass) - Add decord2 to override-dependencies with sys_platform=='never' so sglang's transitive pull of qwen-vl-utils[decord] on aarch64 Linux doesn't land it in the container Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test 3e21f62 |
torchaudio was only in override-dependencies (which pins version but doesn't install the package). Moving it to [project.dependencies] alongside torchvision so it's actually installed in the container. Without this, load_audio_from_file raises ModuleNotFoundError on torchaudio. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
torchaudio 2.11.0 defaults to torchcodec as its first audio backend. torchcodec's native .so files were already present in the container (via ray worker venvs) but the Python package wasn't in the main venv, causing ModuleNotFoundError when load_audio_from_file is called from the dataloader. torchcodec links against system FFmpeg (LGPL-only) rather than bundling its own copy, so it carries no royalty-bearing codec libs (no libx264/ libx265/libmp3lame). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
…ll script - Remove torchaudio and torchcodec from [project.dependencies] and drop the pytorch-cu130 sources entry so the container receives only the PyPI torchaudio stub (~1.7 MB, no bundled FFmpeg) via sglang/vllm transitive deps. The pytorch-cu130 build (bundled FFmpeg with H.264/AAC decoders) is no longer shipped. - Add scripts/install_audio_deps.sh: installs torchaudio==2.11.0 (pytorch-cu130, with FFmpeg) + torchcodec at test time. Uses --reinstall-package torchaudio to upgrade from the PyPI stub. Check is idempotent (looks for bundled libav* in torchaudio/lib/, not just import success, so the PyPI stub does not falsely suppress the install). - Hook install_audio_deps.sh into all audio/omni test scripts (tests/test_suites/vlm/*omni*.sh, tests/functional/audio_grpo_megatron.sh, eval_audio.sh, eval_daily_omni.sh). LLM tests are unaffected. - Add prerequisite callout to docs/guides/grpo-audio.md. Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test 2fe5480 |
|
@kajalj22 Could you help update the audio dependency install methods in https://github.com/NVIDIA-NeMo/RL/blob/main/docs/guides/grpo-audio-visual.md and the related nightly tests? |
… guide Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test bf18ead |
Also fix two stale comments in pyproject.toml: - drop torchaudio from the uv.sources index comment - update script path reference from scripts/ to tools/ Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test 3a0d641 |
|
/ok to test |
@chtruong814, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
|
/ok to test 0af12fe |
…ing (#3107) (#3277) Signed-off-by: Kajal Jain <[email protected]> Signed-off-by: Charlie Truong <[email protected]> Co-authored-by: kajalj22 <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
…3107) Signed-off-by: Kajal Jain <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Summary
Replaces `decord2` with `torchvision`/`torchaudio` and removes bundled codec libraries from the shipped container.
Video/audio decoding
Container changes
Audio install script
Motivation
`decord2` and `av` (PyAV) bundle codec libraries as hard dynamic link dependencies that cannot be stripped without breaking the import.
Supersedes #2922, which attempted to delete codec `.so` files at Docker build time but broke `import decord`.
Test plan
🤖 Generated with Claude Code