Repository navigation
fix: Cherry-pick #14361 - #14928
fix: Cherry-pick #14361#14928
Conversation
Signed-off-by: Yunzhou (David) Liu <[email protected]>
| "vllm", "opencv-python-headless", "cv2", codec, cause=str(exc) | ||
| ) from exc | ||
| except (OSError, SystemError, ValueError) as exc: | ||
| # Confirm both the error source and missing video support. |
There was a problem hiding this comment.
This comment merely restates the two predicates in the immediately following condition and adds no lasting constraint or rationale.
🤖 AI Fix
Remove this redundant comment.
dmitry-tokarev-nv
left a comment
There was a problem hiding this comment.
Approved. Faithful pick onto release/1.5.0, verified by execution. No findings.
Diffed against the merge commit of #14361 (c76d320). Every added and removed line is byte-identical.
Fidelity: every added and removed line is byte-identical
diff of the added-line set and the removed-line set between the two patches is empty. 11 of the 13 files land byte-identical in content to the state at c76d320.
| Difference | Class |
|---|---|
vllm_runtime.Dockerfile hunk offsets @@ -468 to @@ -463 |
Mechanical. This branch lacks the libjemalloc2 line and the cpu compliance gate, so the file is 5 lines shorter above the hunk. |
pyproject.toml blob hash, same @@ -459 offset |
Mechanical. The branch pins older TensorRT-LLM and SGLang releases elsewhere in the file. |
container/templates/vllm_runtime.Dockerfile and pyproject.toml post-state |
Pre-existing branch divergence, none of it inside the picked hunks. |
No conflict resolution, no adaptation, no unexplained edit.
Assumptions hold: the branch pins the same engine the original was built against
Both container/context.yaml files, compared symbol by symbol:
| Lane | release/1.5.0 today |
main at c76d320 |
|---|---|---|
| vllm cuda13.0 runtime | v0.28.0-ubuntu2404 |
v0.28.0-ubuntu2404 |
| vllm xpu runtime | v0.27.1 |
v0.27.1 |
| vllm cpu runtime | v0.28.0 |
v0.28.0 |
The original merged against the same pins this branch carries, so no version claim in it is stale here.
Symbols the change calls, checked on the branch tree:
installer_coversis added by this same patch._OPENCV,_PYAVand_BACKEND_DECODERS["vllm"]already exist atinstall_media_decoders.py:110-141.SITE_PACKAGESis set in the sameRUNatvllm_runtime.Dockerfile:482, above the new guard at line 502.- The whole rebuild sits inside
{% if device == "cuda" %}(lines 458 to 514), which matchestorch.version.cuda is not Nonein the image test. torch.version.cudareads13.0in the vLLM runtime-test image, with no GPU visible.
Measured on vllm/vllm-openai:v0.28.0-ubuntu2404, the exact cuda pin of this branch:
RESOLVED_OPENCV_VERSION=5.0.0.93
FFMPEG: YES
/usr/local/lib/python3.12/dist-packages/opencv_python_headless.libs
The version probe in the Dockerfile resolves the version the guards expect.
media_io.kwargs on that same image, which is the setting the new _attributable_to_cv2 reads:
{} -> kwargs={}
{'backend': 'pyav'} -> kwargs={'backend': 'pyav'}
{'video_backend': 'opencv'} -> kwargs={}
{'backend':'pyav','video_backend':'opencv'} -> kwargs={'backend': 'pyav'}
backend stays in kwargs and selects the decode mixin. video_backend is popped and selects the loader. VideoMediaIO.load_bytes declares backend ... = "opencv", so the .get("backend", "opencv") default is right. The code reads the correct one.
The defect exists on this branch, reproduced
A shipped Dynamo vLLM runtime image built from the pre-pick logic:
$ docker run --rm nvcr.io/nvidia/ai-dynamo/vllm-runtime:1.4.2 python3 -c "import cv2"
ModuleNotFoundError: No module named 'cv2'
The pinned base ships opencv-python-headless 5.0.0.93 with FFMPEG: YES, and the pre-pick purge removes it whole. So this branch has the gap the pick closes. It is not a no-op here.
Tests run on this branch, and they turn red when the fix is mutated
Run in the vLLM runtime-test image on AMD64, with the branch tree overlaid on PYTHONPATH. Marker selection measured, not read:
| Tree | -m "unit and pre_merge and gpu_0" |
|---|---|
base (ffd7c1a) |
72 passed |
head (7c6942b) |
85 passed |
| head, whole multimodal plus installer suite | 215 passed, 25 deselected |
Mutation controls on the head tree:
| Mutation | Result |
|---|---|
_is_vllm_source_built_cv2 forced to return False |
5 failed, 210 passed |
except (OSError, SystemError, ValueError) narrowed to SystemError, and the installer wheel-only arm deleted |
3 failed, 212 passed |
The lane is vllm-runtime / Test cuda13.0 for the unit tests. The image-level test test_vllm_image_ships_no_software_video_codecs runs in the same lane and keys on torch.version.cuda, so the cuda lane asserts a codec-free OpenCV is present and the cpu and xpu lanes keep asserting it is absent. The xpu lane filter is vllm and pre_merge and not multimodal, which does not deselect that test, and its behavior there is unchanged from the base branch.
Nothing was left behind
#14361 merged as one squash commit. No later pull request corrects it: the only commit on main that touches these files afterwards is #14543, the v0.29.0 preparation, and it changes unrelated blocks (Transformers and tokenizers alignment, FFmpeg copy gating).
Verification stopped at the image build. I did not rebuild OpenCV from source. I checked its inputs against the real pinned base, and the same build on the same base tag passed vllm-runtime / Build, Test cuda13.0, amd64 and Compliance audit on #14361.
Cherry-pick #14361