Skip to content

DO_NOT_MERGE : Cherry-pick PR403#415

Draft
arekay-nv wants to merge 1 commit into
mainfrom
arekay/cherry_pick_pr403
Draft

DO_NOT_MERGE : Cherry-pick PR403#415
arekay-nv wants to merge 1 commit into
mainfrom
arekay/cherry_pick_pr403

Conversation

@arekay-nv

Copy link
Copy Markdown
Collaborator

Cherry pick 403 for container build.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

Signed-off-by: arekay-nv <230885705+arekay-nv@users.noreply.github.com>
@arekay-nv
arekay-nv requested a review from a team July 15, 2026 20:01
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@github-actions
github-actions Bot requested a review from nvzhihanj July 15, 2026 20:01
@arekay-nv
arekay-nv marked this pull request as draft July 15, 2026 20:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces provisioning and staging support for the VBench (WAN 2.2) accuracy scorer, including setting up an isolated Python 3.11 environment in the development Dockerfile, handling PyTorch 2.6+ weight loading restrictions, and ensuring staged videos are renamed to .mp4 to prevent VBench errors. Feedback on these changes suggests installing the required wget and unzip tools directly in the Dockerfile, committing the pyproject.toml compatibility patches to the repository instead of using sed dynamically, using a distinct exit code for missing system dependencies to avoid conflicts, and unconditionally setting the PyTorch weight-loading environment variable to prevent external overrides.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/Dockerfile.dev
# reader, needs libGL.so.1 / libgthread at import time (only used when PROVISION_VBENCH=1).
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential procps git curl ca-certificates \
libgl1 libglib2.0-0 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The vbench_runner.py script checks for the presence of wget and unzip to download model weights on a cold cache. However, these tools are not installed in the development Docker image, which will cause the evaluation to fail. Adding them to the apt-get install command ensures they are available.

        libgl1 libglib2.0-0 wget unzip \

Comment thread scripts/Dockerfile.dev
Comment on lines +99 to +109
RUN if [ "${PROVISION_VBENCH}" = "1" ]; then \
cd /opt/vbench_accuracy && \
sed -i 's#requires-python = ">=3.12"#requires-python = ">=3.10"#' pyproject.toml && \
sed -i 's# "vbench==0.1.5",# "vbench==0.1.5",\n "decord2>=3.4.0",#' pyproject.toml && \
sed -i "s#^package = false#package = false\noverride-dependencies = [\"decord; sys_platform == 'never'\"]#" pyproject.toml && \
UV_PROJECT_ENVIRONMENT="$(pwd)/.venv" uv lock --python 3.11 && \
UV_PROJECT_ENVIRONMENT="$(pwd)/.venv" uv sync --python 3.11 && \
UV_PROJECT_ENVIRONMENT="$(pwd)/.venv" uv run python -c "import torch, decord, tokenizers, vbench; print('vbench', vbench.__file__, '| decord', decord.__version__, '| tokenizers', tokenizers.__version__, '| torch', torch.__version__)" ; \
else \
echo "PROVISION_VBENCH=${PROVISION_VBENCH}: skipping VBench provisioning" ; \
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using sed to dynamically patch pyproject.toml during the Docker build is fragile and hard to maintain. If the formatting or version pins in pyproject.toml change in the future, these sed commands will silently fail or break the build.

Instead, you should commit these compatibility settings directly to examples/09_Wan22_VideoGen_Example/accuracy/pyproject.toml in this PR:

  1. Change requires-python to ">=3.10".
  2. Add "decord2>=3.4.0" to dependencies.
  3. Add override-dependencies = ["decord; sys_platform == 'never'"] under [tool.uv].

This allows you to simplify the Dockerfile and avoid dynamic patching.

RUN if [ "${PROVISION_VBENCH}" = "1" ]; then \
        cd /opt/vbench_accuracy && \
        UV_PROJECT_ENVIRONMENT="$(pwd)/.venv" uv lock --python 3.11 && \
        UV_PROJECT_ENVIRONMENT="$(pwd)/.venv" uv sync --python 3.11 && \
        UV_PROJECT_ENVIRONMENT="$(pwd)/.venv" uv run python -c "import torch, decord, tokenizers, vbench; print('vbench', vbench.__file__, '| decord', decord.__version__, '| tokenizers', tokenizers.__version__, '| torch', torch.__version__)" ; \
    else \
        echo "PROVISION_VBENCH=${PROVISION_VBENCH}: skipping VBench provisioning" ; \
    fi

file=sys.stderr,
flush=True,
)
return 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Returning 2 for missing system dependencies conflicts with the documented exit code 2 (which is reserved for CUDA required but unavailable in the file's header docstring). Using a distinct exit code like 3 avoids this ambiguity.

Suggested change
return 2
return 3

# weights_only=True default. This escape hatch is read at torch.load call time,
# only applies when the callsite does not set weights_only explicitly, and is
# scoped to this subprocess.
os.environ.setdefault("TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD", "1")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since this subprocess is dedicated to running VBench, and VBench's reference checkpoints must load full pickles, we should unconditionally set TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD to "1". Using setdefault would allow an inherited environment variable (if set to "0") to override this, which would cause VBench to crash under PyTorch 2.6+.

Suggested change
os.environ.setdefault("TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD", "1")
os.environ["TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD"] = "1"

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