@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / e32a0e8678
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

Upgrade xgrammar to 0.1.23 (#22988)

Signed-off-by: Russell Bryant <rbryant@redhat.com>

Russell Bryant committed Sep 2, 2025 at 22:32 UTC e32a0e86781bd6dc0d5cf267cf177c762bf96ffa
2 files changed +2 -9
requirements/common.txt
+1 -1
@@ -25,7 +25,7 @@ outlines == 0.1.11 ; platform_machine == "s390x"
25 # required for outlines backend disk cache
26 diskcache == 5.6.3
27 lark == 1.2.2
28 -xgrammar == 0.1.21; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64"
28 +xgrammar == 0.1.23; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64"
29 typing_extensions >= 4.10
30 filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317
31 partial-json-parser # used for parsing partial JSON outputs
vllm/v1/worker/gpu_model_runner.py
+1 -8
@@ -90,15 +90,11 @@ from .utils import (AttentionGroup, MultiModalBudget,
90
91 if TYPE_CHECKING:
92 import xgrammar as xgr
93 - import xgrammar.kernels.apply_token_bitmask_inplace_torch_compile as xgr_torch_compile # noqa: E501
93
94 from vllm.model_executor.model_loader.tensorizer import TensorizerConfig
95 from vllm.v1.core.sched.output import SchedulerOutput
96 else:
97 xgr = LazyLoader("xgr", globals(), "xgrammar")
99 - xgr_torch_compile = LazyLoader(
100 - "xgr_torch_compile", globals(),
101 - "xgrammar.kernels.apply_token_bitmask_inplace_torch_compile")
98
99 logger = init_logger(__name__)
100
@@ -1333,10 +1329,7 @@ class GPUModelRunner(LoRAModelRunnerMixin, KVConnectorModelRunnerMixin):
1329 # so we receive it in that format.
1330 grammar_bitmask = torch.from_numpy(grammar_bitmask).contiguous()
1331
1336 - # Force use of the torch.compile implementation from xgrammar to work
1337 - # around issues with the Triton kernel in concurrent structured output
1338 - # scenarios. See PR #19565 and issues #19493, #18376 for details.
1339 - xgr_torch_compile.apply_token_bitmask_inplace_torch_compile(
1332 + xgr.apply_token_bitmask_inplace(
1333 logits,
1334 grammar_bitmask.to(self.device, non_blocking=True),
1335 indices=out_indices if not skip_out_indices else None,