Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
58aa569
async ngram gpu debug
Apr 20, 2026
4bfb745
complete async ngram v2
Apr 21, 2026
02185ac
remove overcomments
Apr 21, 2026
242fb82
set minimal values in FP32
Apr 23, 2026
8569425
Merge branch 'main' of github.com:vllm-project/vllm into patchy/async…
Apr 23, 2026
b4f1db9
remove debug
Apr 23, 2026
f22224a
reorg codes
Apr 24, 2026
3437791
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Apr 24, 2026
324fe81
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Apr 25, 2026
95dffa8
Merge branch 'main' of github.com:vllm-project/vllm into patchy/async…
Apr 28, 2026
3af6547
fix argmax
Apr 28, 2026
2527013
Merge branch 'patchy/async_ngram_v2_pr' of https://github.com/Patchou…
Apr 28, 2026
199b525
fix merge conflicts and revert changes in gumbel
May 6, 2026
480614b
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 6, 2026
81a1915
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 9, 2026
7d5deb7
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 10, 2026
00b071a
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 11, 2026
a285ef6
test added for ngram gpu
May 11, 2026
fcdab55
fix return value
May 12, 2026
3374d6f
add tests in yaml and change return values into tuple
May 13, 2026
34fa287
add tests in yaml and change return values into tuple
May 13, 2026
b0eb7ad
merge conflicts
May 13, 2026
aabb68f
Merge branch 'main' of github.com:vllm-project/vllm into patchy/async…
May 13, 2026
a9101c7
fix test error
May 13, 2026
5986d2b
inputs params fixed
May 14, 2026
07641bc
fix(test): Add required InitVar fields to SchedulerConfig in ngram_gp…
May 14, 2026
b906e89
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 14, 2026
29b8a6c
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 14, 2026
a880d05
merge conflicts fixed
May 15, 2026
7a7ea14
Merge branch 'patchy/async_ngram_v2_pr' of github.com:PatchouliTIS/vl…
May 15, 2026
29cb65e
modify vllm config to pass ngram_gpu
May 15, 2026
98cc7da
fix method signature
May 15, 2026
9d6fd07
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 16, 2026
4824b4a
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 18, 2026
430e18a
Merge branch 'main' of github.com:vllm-project/vllm into patchy/async…
May 19, 2026
445322d
format fixed
May 19, 2026
1474690
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS May 25, 2026
98a0809
fix gpu utils drop bug
May 26, 2026
4ea6d81
Merge branch 'main' of github.com:vllm-project/vllm into patchy/async…
May 26, 2026
3cb1b37
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Jun 2, 2026
6fea8f2
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Jun 2, 2026
37cc9c5
merge conflicts fixed
Jun 3, 2026
cb77a14
Merge branch 'patchy/async_ngram_v2_pr' of https://github.com/Patchou…
Jun 3, 2026
5228bd6
duplicated codes removed
Jun 3, 2026
eb4dc4e
merge conflicts resolved
Jun 4, 2026
2d0bab6
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Jun 4, 2026
af498ea
triton kernel for ngram gpu
Jun 4, 2026
e66fbb8
Merge branch 'patchy/async_ngram_v2_pr' of https://github.com/Patchou…
Jun 4, 2026
6dd58ad
return values fixed
Jun 11, 2026
2754fe3
fix merge conflicts
Jun 11, 2026
709e437
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Jun 11, 2026
3e20869
config bug fixed
Jun 11, 2026
172b2bd
Merge branch 'patchy/async_ngram_v2_pr' of https://github.com/Patchou…
Jun 11, 2026
4033877
return type fixed
Jun 12, 2026
52e79a8
Merge branch 'main' of github.com:vllm-project/vllm into patchy/async…
Jun 12, 2026
2d5f8f9
merge conflicts fixed
Jun 15, 2026
4702930
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Jun 15, 2026
028e77a
Merge branch 'main' of github.com:vllm-project/vllm into patchy/async…
Jun 28, 2026
6097cba
merge conflicts fixed
Jul 2, 2026
e9805e6
merge conflicts fixed
Jul 3, 2026
80205e7
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Jul 7, 2026
ad4bd48
merge conflicts fixed
PatchouliTIS Aug 1, 2026
66e1ade
test vllm_runner updated
PatchouliTIS Aug 1, 2026
919a826
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Aug 3, 2026
4ae1b28
resolve merge conflicts
PatchouliTIS Aug 7, 2026
223ebc3
merge conflicts fixed and config error fixed
PatchouliTIS Aug 13, 2026
3064455
Merge branch 'main' of https://github.com/vllm-project/vllm into patc…
PatchouliTIS Aug 13, 2026
e1a05d6
Merge remote-tracking branch 'origin/main' into patchy/async_ngram_v2_pr
njhill Aug 15, 2026
9ff65bc
[Spec Decode] ngram_gpu on V2: GPU-side draft trimming via shared ver…
njhill Aug 15, 2026
d84087e
[Spec Decode] ngram_gpu: conservative trim gating for auto cudagraph …
njhill Aug 15, 2026
b8a3834
simplify
njhill Aug 15, 2026
e052b8c
[Spec Decode] Resolve both ngram methods to the GPU implementation on…
njhill Aug 15, 2026
ee72c7a
Merge remote-tracking branch 'origin/main' into patchy/async_ngram_v2_pr
njhill Aug 17, 2026
6c5dfc9
[Spec Decode] Resolve the varlen-decode cudagraph constraint inside r…
njhill Aug 18, 2026
bc5e16d
[Spec Decode] Pass RequestState to speculators at construction
njhill Aug 18, 2026
2e39f8c
[Spec Decode] Derive draft-trimmer prerequisites inside maybe_create_…
njhill Aug 18, 2026
8797fe6
[Spec Decode] Collapse the draft-trim contract into one speculator field
njhill Aug 18, 2026
7e5703a
Merge remote-tracking branch 'origin/main' into patchy/async_ngram_v2_pr
njhill Aug 19, 2026
ffeadf6
Merge branch 'main' into patchy/async_ngram_v2_pr
PatchouliTIS Aug 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .buildkite/test_areas/model_runner_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ steps:
- tests/v1/spec_decode/test_max_len.py
- tests/v1/spec_decode/test_rejection_sampler_utils.py
- tests/v1/spec_decode/test_synthetic_rejection_sampler_utils.py
- tests/v1/spec_decode/test_ngram_gpu.py
- tests/v1/e2e/spec_decode/
commands:
- set -x
- export VLLM_USE_V2_MODEL_RUNNER=1
- pytest -v -s v1/spec_decode/test_max_len.py -k "eagle or mtp"
- pytest -v -s v1/spec_decode/test_max_len.py -k "eagle or mtp or ngram_gpu"
- pytest -v -s v1/spec_decode/test_rejection_sampler_utils.py
- pytest -v -s v1/spec_decode/test_synthetic_rejection_sampler_utils.py
- pytest -v -s v1/spec_decode/test_ngram_gpu.py
- pytest -v -s v1/e2e/spec_decode/eagle/
- pytest -v -s v1/e2e/spec_decode/speculators/
- >-
Expand Down
32 changes: 32 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,38 @@ def test_resolve_cudagraph_mode_adjusts_spec_decode_sizes_only_for_v1(
assert compilation_config.cudagraph_capture_sizes == expected_capture_sizes


@pytest.mark.parametrize(
("requested", "expected"),
[
# Only a mode without a separate decode routine has to change: varlen
# decode batches would otherwise replay on a mixed full graph.
(CUDAGraphMode.FULL, CUDAGraphMode.FULL_AND_PIECEWISE),
(CUDAGraphMode.FULL_AND_PIECEWISE, CUDAGraphMode.FULL_AND_PIECEWISE),
(CUDAGraphMode.FULL_DECODE_ONLY, CUDAGraphMode.FULL_DECODE_ONLY),
(CUDAGraphMode.PIECEWISE, CUDAGraphMode.PIECEWISE),
(CUDAGraphMode.NONE, CUDAGraphMode.NONE),
],
)
def test_resolve_cudagraph_mode_varlen_decode(requested, expected):
"""varlen_decode requires a separate decode routine for full cudagraphs."""
compilation_config = CompilationConfig(
cudagraph_mode=requested,
cudagraph_capture_sizes=[1, 2, 4, 8],
)
compilation_config.max_cudagraph_capture_size = 8
compilation_config.post_init_cudagraph_sizes()

cudagraph_mode = compilation_config.resolve_cudagraph_mode_and_sizes(
AttentionCGSupport.ALWAYS,
"FakeAttentionBackend",
use_v2_model_runner=True,
varlen_decode=True,
)

assert cudagraph_mode == expected
assert compilation_config.cudagraph_mode == expected


@pytest.mark.parametrize(
("model_config", "expected"),
[
Expand Down
27 changes: 27 additions & 0 deletions tests/v1/spec_decode/test_max_len.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,33 @@ def test_ngram_max_len(num_speculative_tokens: int, vllm_runner):
runner.llm.generate(_PROMPTS, sampling_params)


@pytest.mark.parametrize("num_speculative_tokens", [1, 3, 10])
@pytest.mark.parametrize("method", ["ngram", "ngram_gpu"])
def test_ngram_gpu_max_len(method: str, num_speculative_tokens: int, vllm_runner):
"""V2 GPU n-gram counterpart of ``test_ngram_max_len``.

Verifies that the V2 model runner (where "ngram" and "ngram_gpu" both
resolve to the GPU implementation) correctly
handles the ``max_model_len`` boundary across various speculative-token
counts.
"""
with vllm_runner(
"facebook/opt-125m",
trust_remote_code=False,
max_model_len=100,
enable_chunked_prefill=None,
enforce_eager=True, # For faster initialization.
speculative_config={
"method": method,
"prompt_lookup_max": 5,
"prompt_lookup_min": 3,
"num_speculative_tokens": num_speculative_tokens,
},
) as runner:
sampling_params = SamplingParams(max_tokens=100, ignore_eos=True)
runner.llm.generate(_PROMPTS, sampling_params)


@pytest.mark.parametrize("num_speculative_tokens", [1, 3, 10])
@pytest.mark.parametrize("attn_backend", get_attn_backend_list_based_on_platform())
def test_eagle_max_len(
Expand Down
Loading
Loading