Skip to content

Commit dbbb2f2

Browse files
hbarclayclaude
andcommitted
operatorx attention: vLLM's default CUDA-graph capture ceiling, independent of linear
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent eaefb07 commit dbbb2f2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎operatorx/runners/common/vllm/attention.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,20 @@ def _cudagraph(ctx: dict) -> bool:
508508
return _full_graph(ctx["engine"])
509509

510510

511+
def _max_capture_size() -> int:
512+
"""The largest batch vLLM captures by default (VllmConfig._set_cudagraph_sizes); the
513+
engine here runs eagerly, so its own config lists no capture sizes."""
514+
from vllm.platforms import current_platform
515+
return 1024 if current_platform.is_device_capability_family(100) else 512
516+
517+
511518
def _full_graph(eng: _Engine) -> bool:
512519
from vllm.v1.attention.backend import AttentionCGSupport
513520
qs = {r.num_tokens - r.num_computed_tokens for r in eng.reqs}
514521
if len(qs) != 1:
515522
return False
516523
q = qs.pop()
517-
if q * len(eng.reqs) > vllm_linear._capture_sizes()[-1]:
524+
if q * len(eng.reqs) > _max_capture_size():
518525
return False
519526
need = AttentionCGSupport.UNIFORM_SINGLE_TOKEN_DECODE if q == 1 else AttentionCGSupport.UNIFORM_BATCH
520527
for gs in eng.runner.attn_groups:

0 commit comments

Comments
 (0)