[Spec] Derive NGRAM grammar tree links on the host instead of reading back retrive_next_token (#32380)

This commit is contained in:
Liangsheng Yin
2026-07-25 02:25:16 -07:00
committed by GitHub
parent f5155d9602
commit 3c5bf1f6d2
2 changed files with 58 additions and 13 deletions
+12 -2
View File
@@ -2,16 +2,26 @@ import unittest
from sglang.test.ci.ci_register import register_cuda_ci
from sglang.test.kits.eval_accuracy_kit import GSM8KMixin
from sglang.test.kits.json_constrained_kit import JSONConstrainedMixin
from sglang.test.kits.regex_constrained_kit import RegexConstrainedMixin
from sglang.test.kits.spec_server_kits import SpecLogprobKit
from sglang.test.server_fixtures.ngram_fixture import NgramServerBase
# Per-commit: Paged backend only.
# - FA3 base test archived to test/manual/spec/test_spec_ngram_fa3.py
# - Triton + Flashinfer moved to test_spec_ngram_extra.py
register_cuda_ci(est_time=400, stage="base-b", runner_config="1-gpu-large")
register_cuda_ci(est_time=460, stage="base-b", runner_config="1-gpu-large")
class TestNgramSpeculativeDecodingPaged(NgramServerBase, GSM8KMixin, SpecLogprobKit):
class TestNgramSpeculativeDecodingPaged(
NgramServerBase,
GSM8KMixin,
SpecLogprobKit,
RegexConstrainedMixin,
JSONConstrainedMixin,
):
# Constrained mixins reuse this server; they cover the grammar verify path,
# where the bitmask is built by walking the host draft tree.
attention_backend = "flashinfer"
extra_args = ["--page-size", "64"]