Skip to content

Conversation

@cmpute
Copy link
Contributor

@cmpute cmpute commented Oct 30, 2025

Purpose

The latest code will requires the cv2 dependency (no matter command you run, because it's imported by default), and it's completely not necessary (it's only used in benchmark). This PR move cv2 inside the function it's called, to prevent cv2 to be imported by default.

The motivation to remove cv2 is that, it's hard to maintain opencv package consistency if you run vllm along with other related packages.

Test Plan

None

Test Result

None


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@mergify mergify bot added the performance Performance-related issues label Oct 30, 2025
Copy link
Contributor

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

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 correctly makes the cv2 dependency optional by moving its import from the top level of vllm/benchmarks/datasets.py to within the generate_synthetic_video function, which is the only place it's used in that file. This change is well-aligned with the goal of preventing cv2 from being a required dependency for all vLLM commands. The implementation is clean and follows a common pattern for handling optional dependencies, improving the project's dependency management without introducing any issues. The change is approved.

@BloodAxe
Copy link
Contributor

The latest code will requires the cv2 dependency (no matter command you run, because it's imported by default), and it's completely not necessary

This statement is not correct.
OpenCV used in video reading backend for multimodal models.

@cmpute
Copy link
Contributor Author

cmpute commented Oct 31, 2025

The latest code will requires the cv2 dependency (no matter command you run, because it's imported by default), and it's completely not necessary

This statement is not correct.
OpenCV used in video reading backend for multimodal models.

It's not rigorously correct, but at least here is the only place where cv2 was explicitly imported.

Signed-off-by: Jacob <cmpute@qq.com>
@cmpute
Copy link
Contributor Author

cmpute commented Nov 4, 2025

@ZJY0516 Could you mark this MR as reviewed please? I have updated the commit with the sign-off message.

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) November 6, 2025 02:55
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 6, 2025
@DarkLight1337 DarkLight1337 merged commit d72299d into vllm-project:main Nov 6, 2025
47 checks passed
ZhengHongming888 pushed a commit to ZhengHongming888/vllm that referenced this pull request Nov 8, 2025
Signed-off-by: Jacob <cmpute@qq.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Nov 13, 2025
Signed-off-by: Jacob <cmpute@qq.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
Signed-off-by: Jacob <cmpute@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance-related issues ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants