Skip to content

[Bugfix] Fix v1/spec_decode/test_ngram.py #16895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2025

Conversation

zixi-qi
Copy link
Contributor

@zixi-qi zixi-qi commented Apr 20, 2025

Fix v1/spec_decode/test_ngram.py which is currently broken in trunk

Test Plan:
Before:

$ pytest -v tests/v1/spec_decode/test_ngram.py
===================================================================== test session starts =====================================================================
platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/qizixi/uv_env/vllm/bin/python
cachedir: .pytest_cache
rootdir: /data/users/qizixi/gitrepos/qizixi/vllm
configfile: pyproject.toml
plugins: anyio-4.9.0
collected 3 items                                                                                                                                             

tests/v1/spec_decode/test_ngram.py::test_kmp_lps_array PASSED                                                                                           [ 33%]
tests/v1/spec_decode/test_ngram.py::test_find_subarray_kmp PASSED                                                                                       [ 66%]
tests/v1/spec_decode/test_ngram.py::test_ngram_proposer FAILED                                                                                          [100%]

========================================================================== FAILURES ===========================================================================
_____________________________________________________________________ test_ngram_proposer _____________________________________________________________________

    def test_ngram_proposer():
>       proposer = NgramProposer()
E       TypeError: NgramProposer.__init__() missing 1 required positional argument: 'vllm_config'

tests/v1/spec_decode/test_ngram.py:42: TypeError
====================================================================== warnings summary =======================================================================
<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.

<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================== short test summary info ===================================================================
FAILED tests/v1/spec_decode/test_ngram.py::test_ngram_proposer - TypeError: NgramProposer.__init__() missing 1 required positional argument: 'vllm_config'
=========================================================== 1 failed, 2 passed, 2 warnings in 1.52s ===========================================================

After:

$ pytest -v tests/v1/spec_decode/test_ngram.py
===================================================================== test session starts =====================================================================
platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/qizixi/uv_env/vllm/bin/python
cachedir: .pytest_cache
rootdir: /data/users/qizixi/gitrepos/qizixi/vllm
configfile: pyproject.toml
plugins: anyio-4.9.0
collected 3 items                                                                                                                                             
tests/v1/spec_decode/test_ngram.py::test_kmp_lps_array PASSED                                                                                           [ 33%]
tests/v1/spec_decode/test_ngram.py::test_find_subarray_kmp PASSED                                                                                       [ 66%]
tests/v1/spec_decode/test_ngram.py::test_ngram_proposer PASSED                                                                                          [100%]
====================================================================== warnings summary =======================================================================
<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================ 3 passed, 2 warnings in 1.68s ================================================================

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.

🚀

@mergify mergify bot added the v1 label Apr 20, 2025
@zixi-qi zixi-qi changed the title Fix v1/spec_decode/test_ngram.py [V1] Fix v1/spec_decode/test_ngram.py Apr 20, 2025
Summary: Fix v1/spec_decode/test_ngram.py which is currently broken in trunk

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Signed-off-by: qizixi <[email protected]>
@zixi-qi zixi-qi force-pushed the fix-v1-spec-decode-test branch from 99c218a to f7fab68 Compare April 20, 2025 23:52
@zixi-qi zixi-qi changed the title [V1] Fix v1/spec_decode/test_ngram.py [Bugfix] Fix v1/spec_decode/test_ngram.py Apr 20, 2025
Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix. Just realized that v1/spec_decode was omitted from the tests.

@WoosukKwon WoosukKwon merged commit bb3605d into vllm-project:main Apr 21, 2025
22 checks passed
yangw-dev pushed a commit to yangw-dev/vllm that referenced this pull request Apr 21, 2025
dtransposed pushed a commit to dtransposed/vllm that referenced this pull request Apr 22, 2025
Signed-off-by: qizixi <[email protected]>
Signed-off-by: dtransposed <damian@damian-ml-machine.europe-west3-b.c.jetbrains-grazie.internal>
frieda-huang pushed a commit to frieda-huang/vllm that referenced this pull request Apr 23, 2025
Signed-off-by: qizixi <[email protected]>
Signed-off-by: Frieda (Jingying) Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants