Skip to content

Conversation

Yikun
Copy link
Collaborator

@Yikun Yikun commented May 28, 2025

What this PR does / why we need it?

Since 4c2b38c , it converted configs to Pydantic dataclasses and enable Pydantic checks. Due to config.Device has strict validation, run the model test on the plugin device (vllm-ascend in my case) will not work and raise the error:

FAILED tests/singlecard/test_offline_inference.py::test_models[5-half-Qwen/Qwen2.5-0.5B-Instruct]
- pydantic_core._pydantic_core.ValidationError: 2 validation errors for DeviceConfig
device.literal['auto','cuda','neuron','cpu','tpu','xpu','hpu']
  Input should be 'auto', 'cuda', 'neuron', 'cpu', 'tpu', 'xpu' or 'hpu' [type=literal_error, input_value='npu', input_type=str]

See also here: https://github.com/vllm-project/vllm-ascend/actions/runs/15303026138/job/43048387981?pr=958

This patch try to resolve it by skip device field validation to make plugin device work.

How was this patch tested?

# Apply patch, do regresion test and CI passed
$ pytest -sv tests/singlecard/test_offline_inference.py::test_model
tests/singlecard/test_offline_inference.py::test_models PASSED

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 can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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.

🚀

@Yikun Yikun force-pushed the skip_device_validation branch from c02dc75 to d98edcd Compare May 28, 2025 16:14
@Yikun
Copy link
Collaborator Author

Yikun commented May 28, 2025

cc @hmellor @simon-mo (who involved in 4c2b38c) Would you mind taking a quick look?

BTW, I considered to monkey patch the device in vllm-ascend but it doesn't works because the config initilizatized before apply patch, so we have to fix this on vLLM.

Copy link
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

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

This solution is fine as a hotfix. In future it might be nicer to implement our own Pydantic validator that doesn't error if it detects a plugin device

@Yikun Yikun changed the title Skip config.Device Pydantic validation to make plugin device work Skip config.device Pydantic validation to make plugin device work May 28, 2025
@Yikun
Copy link
Collaborator Author

Yikun commented May 28, 2025

CI passed, it's ready to go.

@jeejeelee jeejeelee enabled auto-merge (squash) May 28, 2025 23:56
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label May 28, 2025
@DarkLight1337
Copy link
Member

FYI this argument has been deprecated by #18399

@Potabk
Copy link
Contributor

Potabk commented May 29, 2025

@DarkLight1337 ci passed, hope can merge

@DarkLight1337
Copy link
Member

Can you also skip the validation for the quantization method to fix the failing quant test shown in #18852? Then I'll force-merge this

auto-merge was automatically disabled May 29, 2025 03:03

Head branch was pushed to by a user without write access

@Yikun Yikun changed the title Skip config.device Pydantic validation to make plugin device work Skip device and quant Pydantic validation to make plugin device work May 29, 2025
Signed-off-by: Yikun Jiang <[email protected]>
@Yikun Yikun force-pushed the skip_device_validation branch from c2fec6b to 47e83f2 Compare May 29, 2025 03:03
@vllm-bot vllm-bot merged commit 3c49dbd into vllm-project:main May 29, 2025
7 of 13 checks passed
amitm02 pushed a commit to amitm02/vllm that referenced this pull request Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants