[Spec] Remove the dead spec V1 scheduler paths (#27977)
This commit is contained in:
@@ -27,7 +27,7 @@ class TestEagle3Topk16(Eagle3Base, SpecCorrectnessKit, SpecAccuracyKit, SpecLogp
|
||||
|
||||
spec_topk = 16
|
||||
spec_tokens = 64
|
||||
disable_overlap = True # topk>1 -> spec v1
|
||||
disable_overlap = True # synchronous baseline; SpecV2 subclass flips overlap on
|
||||
cuda_graph_max_bs = 5
|
||||
acc_length_thres = 3.1
|
||||
batch_accept_len_thres = 1.75
|
||||
|
||||
@@ -1125,6 +1125,8 @@ class TestMlxOverlapScheduler(unittest.TestCase):
|
||||
# (deferred input materialization) before launching the forward.
|
||||
# Without resolve_forward_inputs in _launch_fresh, input_ids stays
|
||||
# None and async_forward_batch_generation_mlx dereferences a None.
|
||||
from sglang.srt.speculative.spec_info import SpeculativeAlgorithm
|
||||
|
||||
class _StopLoop(Exception):
|
||||
pass
|
||||
|
||||
@@ -1151,7 +1153,8 @@ class TestMlxOverlapScheduler(unittest.TestCase):
|
||||
prefill_input_ids_cpu=torch.tensor([1, 2, 3], dtype=torch.int64),
|
||||
input_ids=None,
|
||||
mix_running_indices=None,
|
||||
is_spec_v2=False,
|
||||
enable_overlap=True,
|
||||
spec_algorithm=SpeculativeAlgorithm.NONE,
|
||||
device="cpu",
|
||||
)
|
||||
scheduler.get_next_batch_to_run = lambda: batch
|
||||
|
||||
@@ -69,10 +69,6 @@ _OWNER_SITES = {
|
||||
"DFlashDraftInputV2.prepare_for_decode",
|
||||
"kv_allocated_len",
|
||||
): 1,
|
||||
# spec v1: each verify path owns its own settlement
|
||||
("speculative/eagle_info.py", "EagleVerifyInput.verify", "kv_committed_len"): 1,
|
||||
("speculative/eagle_info.py", "EagleVerifyInput.verify", "kv_allocated_len"): 1,
|
||||
("speculative/eagle_info.py", "EagleVerifyInput.verify", "spec_verify_ct"): 1,
|
||||
# disaggregation decode prealloc
|
||||
(
|
||||
"disaggregation/decode.py",
|
||||
|
||||
@@ -162,16 +162,22 @@ class TestCustomSpecAlgoInterface(_RegistryIsolated):
|
||||
self.assertEqual(self.algo.is_some(), not self.algo.is_none())
|
||||
self.assertEqual(SpeculativeAlgorithm.EAGLE.is_some(), self.algo.is_some())
|
||||
|
||||
def test_supports_spec_v2_follows_supports_overlap(self):
|
||||
# Plugin registered with supports_overlap=False -> not spec_v2.
|
||||
self.assertFalse(self.algo.supports_spec_v2())
|
||||
def test_supports_overlap_false_warns_deprecation(self):
|
||||
# supports_overlap=False plugins run the V2 schema synchronously; the
|
||||
# removed V1 path is surfaced as a deprecation warning at create time.
|
||||
server_args = MagicMock()
|
||||
server_args.disable_overlap_schedule = True
|
||||
with self.assertLogs("sglang.srt.speculative.spec_registry", "WARNING") as logs:
|
||||
self.algo.create_worker(server_args)
|
||||
self.assertTrue(any("deprecated" in line for line in logs.output))
|
||||
|
||||
@SpeculativeAlgorithm.register("MY_V2", supports_overlap=True)
|
||||
def _factory(server_args):
|
||||
return MagicMock
|
||||
|
||||
v2 = SpeculativeAlgorithm.from_string("MY_V2")
|
||||
self.assertTrue(v2.supports_spec_v2())
|
||||
server_args.disable_overlap_schedule = False
|
||||
self.assertIs(v2.create_worker(server_args), MagicMock)
|
||||
|
||||
def test_create_worker_calls_factory(self):
|
||||
server_args = MagicMock()
|
||||
|
||||
Reference in New Issue
Block a user