Skip to content

Commit 00c6d69

Browse files
committed
Retire a test assertion whose implementation we deliberately replaced
test_dspark_sequential_sampling_writes_persistent_draft_logits called DSparkSpeculator.clear_runtime_draft_logits, which no longer exists, and the fixture missed enable_adaptive_verification because object.__new__ skips __init__. The missing method is not a lost fix -- I first read it that way and was wrong. fbbc8e7 added a reuse-and-clear scheme (assign base_logits into draft_logits, clear it afterwards); 7d9970d replaced that six days later with a persistent preallocated buffer, because DSpark drafting is CUDA-graph replayed and a Python-side reassignment does not run per replay. The clearing call became a `pass` and was later deleted. Restoring it would reintroduce something removed for cause. So the invariant is still worth asserting -- the draft-logits buffer must never be replaced -- but it has to be checked against something that still exists. The test now runs a second sampling pass and asserts buffer identity across it. Both this and the three test_mtp failures were red at 67f5de5 as well as at the merge head, so neither came from the 08-13 merge. What the merge did was move this one's failure to a later line, which is what made it visible. Remaining in tests/v1/spec_decode: test_dflash_drafter_window_reserves_bonus_token, whose fix is upstream vllm-project#51256 -- in the sixteen commits not yet merged.
1 parent 92f7627 commit 00c6d69

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

tests/v1/spec_decode/test_dspark_config.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ def test_dspark_sequential_sampling_writes_persistent_draft_logits(monkeypatch):
150150
speculator.use_fp64_gumbel = False
151151
speculator._step_cols = torch.arange(num_speculative_steps, dtype=torch.int32)
152152
speculator._draft_topk = None
153+
# object.__new__ skips __init__, so every attribute _sample_sequential reads
154+
# has to be set here. Upstream #47808 added a read of this one; without it
155+
# the test fails with AttributeError from production code that is in fact
156+
# correct -- __init__ always sets it. False alarm, not a defect.
157+
speculator.enable_adaptive_verification = False
153158
speculator._d2t_scatter_index = None
154159
speculator.draft_tokens = torch.empty(
155160
max_num_reqs,
@@ -222,6 +227,17 @@ def fake_gumbel_sample(
222227
sampled_by_step[col],
223228
)
224229

230+
# The property this asserts -- the draft-logits buffer is never replaced --
231+
# is now guaranteed by construction rather than by a clearing call.
232+
# 7d9970dec3 replaced the reuse-and-clear scheme (assign base_logits, then
233+
# clear_runtime_draft_logits) with a persistent preallocated buffer, because
234+
# DSpark drafting is CUDA-graph replayed and a Python-side reassignment does
235+
# not run per replay. The method it called is intentionally gone; this
236+
# re-checks the same invariant against a second sampling pass instead.
225237
draft_logits = speculator.draft_logits
226-
DSparkSpeculator.clear_runtime_draft_logits(speculator)
238+
DSparkSpeculator._sample_sequential(
239+
speculator,
240+
num_reqs,
241+
torch.zeros(num_reqs * num_speculative_steps, 1),
242+
)
227243
assert speculator.draft_logits is draft_logits

0 commit comments

Comments
 (0)