[DSV4.1] Add encoder cuda graph support for deepseek-v4.1-flash (#56625)

Signed-off-by: Isotr0py <Isotr0py@outlook.com>
This commit is contained in:
Isotr0py
2026-09-20 21:51:13 +08:00
committed by GitHub
parent 9b2f34cad4
commit 27757dde02
6 changed files with 599 additions and 63 deletions
@@ -55,6 +55,10 @@ def kimi_vl_chat_template(content: str) -> str:
)
def deepseek_v41_chat_template(content: str) -> str:
return f"<|begin▁of▁sentence|><|User|>{content}<|Assistant|></think>"
def step3_vl_chat_template(content: str) -> str:
return (
"<|begin▁of▁sentence|> You are a helpful assistant.<|BOT|>user\n "
@@ -221,6 +225,25 @@ MODEL_CONFIGS: dict[str, VitCudagraphTestConfig] = {
vllm_runner_kwargs={"gpu_memory_utilization": 0.80},
marks=[pytest.mark.core_model],
),
"deepseek_v41": VitCudagraphTestConfig(
model="deepseek-ai/DeepSeek-V4.1-Flash",
modalities=["image"],
image_prompt=deepseek_v41_chat_template(
"<|deepseek_image|>\n\nWhat is in this image?"
),
compilation_config_overrides={
"encoder_cudagraph_token_budgets": [1024],
},
vllm_runner_kwargs={
"load_format": "dummy",
"attention_backend": "FLASHMLA_SPARSE_DSV41",
"hf_overrides": partial(
dummy_hf_overrides,
model_arch="DeepseekV41ForCausalLM",
exist_overrides={"vision_n_layers": 1},
),
},
),
"step3_vl": VitCudagraphTestConfig(
model="stepfun-ai/Step3-VL-10B",
modalities=["image"],
@@ -218,8 +218,14 @@ def test_model_tensor_schema(model_id: str):
factories = model_cls._processor_factory
# Capture helpers return capture-buffer containers (e.g.
# EncoderCudaGraphCaptureInputs), not TensorSchema mm inputs.
capture_helpers = {"prepare_encoder_cudagraph_capture_inputs"}
inputs_parse_methods = []
for attr_name in dir(model_cls):
if attr_name in capture_helpers:
continue
attr = getattr(model_cls, attr_name)
if hasattr(attr, "__annotations__"):
return_type = attr.__annotations__.get("return", None)