update pre-commit config (#18860)

This commit is contained in:
SoluMilken
2026-02-16 00:18:31 +08:00
committed by GitHub
parent f7603203b0
commit 07a24f1a38
135 changed files with 239 additions and 198 deletions
@@ -15,6 +15,7 @@
Checkpoint-engine integration for SGLang.
This module provides weight update functionality via IPC for checkpoint-engine compatibility.
"""
import logging
from typing import Callable, Dict, Optional
@@ -13,7 +13,7 @@ else:
def weak_ref_tensors(
tensors: Union[torch.Tensor, list[torch.Tensor], tuple[torch.Tensor]]
tensors: Union[torch.Tensor, list[torch.Tensor], tuple[torch.Tensor]],
) -> Union[torch.Tensor, list[Any], tuple[Any], Any]:
"""
Convenience function to create weak references to tensors,
+2 -1
View File
@@ -14,7 +14,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" EXAONE model configuration """
"""EXAONE model configuration"""
from typing import Any, Dict
from transformers.configuration_utils import PretrainedConfig
-1
View File
@@ -14,7 +14,6 @@
# limitations under the License.
"""Falcon-H1 model configuration"""
from transformers.configuration_utils import PretrainedConfig
from transformers.utils import logging
@@ -970,7 +970,7 @@ class MooncakeKVManager(CommonKVManager):
self._handle_aux_data(msg)
continue
(bootstrap_room, status, prefill_rank) = msg
bootstrap_room, status, prefill_rank = msg
status = int(status.decode("ascii"))
bootstrap_room = int(bootstrap_room.decode("ascii"))
prefill_rank = int(prefill_rank.decode("ascii"))
@@ -21,6 +21,7 @@ If you only need to use the distributed environment without model/pipeline
parallelism, you can skip the model parallel initialization and destruction
steps.
"""
import contextlib
import gc
import logging
@@ -79,7 +80,7 @@ class P2PWork:
def _split_tensor_dict(
tensor_dict: Dict[str, Union[torch.Tensor, Any]]
tensor_dict: Dict[str, Union[torch.Tensor, Any]],
) -> Tuple[List[Tuple[str, Any]], List[torch.Tensor]]:
"""Split the tensor dictionary into two parts:
1. A list of (key, value) pairs. If the value is a tensor, it is replaced
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Adapted from vLLM's OpenAIServingResponses
"""Handler for /v1/responses requests"""
from __future__ import annotations
import asyncio
@@ -186,7 +186,7 @@ class BaseFormatDetector(ABC):
if start_idx >= len(current_text):
return StreamingParseResult()
(obj, end_idx) = _partial_json_loads(current_text[start_idx:], flags)
obj, end_idx = _partial_json_loads(current_text[start_idx:], flags)
is_current_complete = _is_complete_json(
current_text[start_idx : start_idx + end_idx]
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
""" Run the model with npu graph and torch.compile """
"""Run the model with npu graph and torch.compile"""
from __future__ import annotations
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
"""Attention layer with Dual chunk flash attention and sparse attention.
"""
"""Attention layer with Dual chunk flash attention and sparse attention."""
import functools
import logging
import math
@@ -670,9 +670,9 @@ class KimiLinearAttnBackend(MambaAttnBackendBase):
**kwargs,
):
assert isinstance(mixed_qkv, Tuple)
(q_proj_states, k_proj_states, v_proj_states) = mixed_qkv
(q_conv_weights, k_conv_weights, v_conv_weights) = layer.conv_weights
(q_conv_bias, k_conv_bias, v_conv_bias) = layer.bias
q_proj_states, k_proj_states, v_proj_states = mixed_qkv
q_conv_weights, k_conv_weights, v_conv_weights = layer.conv_weights
q_conv_bias, k_conv_bias, v_conv_bias = layer.bias
layer_cache = self.req_to_token_pool.mamba2_layer_cache(layer.layer_id)
q_conv_state, k_conv_state, v_conv_state = layer_cache.conv
@@ -744,9 +744,9 @@ class KimiLinearAttnBackend(MambaAttnBackendBase):
)
assert isinstance(mixed_qkv, Tuple)
(q_proj_states, k_proj_states, v_proj_states) = mixed_qkv
(q_conv_weights, k_conv_weights, v_conv_weights) = layer.conv_weights
(q_conv_bias, k_conv_bias, v_conv_bias) = layer.bias
q_proj_states, k_proj_states, v_proj_states = mixed_qkv
q_conv_weights, k_conv_weights, v_conv_weights = layer.conv_weights
q_conv_bias, k_conv_bias, v_conv_bias = layer.bias
query_start_loc = self.forward_metadata.query_start_loc
cache_indices = self.forward_metadata.mamba_cache_indices
@@ -2,6 +2,7 @@
"""
Copyright (c) Ant Financial Service Group and its affiliates.
"""
# Copied from https://code.alipay.com/pia/PainlessInferenceAcceleration/blob/v0.0.6/flood/flood/ops/seg_la.py
from dataclasses import dataclass
@@ -38,7 +38,7 @@ def prefill_attention_wave(
output_shape = (shape.total_seq_len, shape.num_query_heads, shape.head_size_kv)
# Run the wave kernel.
mfma_variant = (MMAType.F32_16x16x16_F16, MMAType.F32_16x16x16_F16)
(prefill, hyperparams) = get_prefill_attention_kernel(
prefill, hyperparams = get_prefill_attention_kernel(
shape,
mfma_variant,
q.shape,
+1 -1
View File
@@ -376,7 +376,7 @@ class LogitsProcessor(nn.Module):
logprobs_result = self.process_input_logprobs(input_logits, logits_metadata)
else:
(logprobs_result, sampled_logits) = self.process_input_logprobs_by_chunk(
logprobs_result, sampled_logits = self.process_input_logprobs_by_chunk(
pruned_states,
sample_indices,
input_logprob_indices,
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
"""Cutlass W4A8 MoE kernel."""
from typing import Optional
import torch
@@ -63,11 +63,9 @@ class ModelSlimMoEMethod(FusedMoEMethodBase):
logger.info_once("Using ModelSlimW8A8Int8MoE")
return ModelSlimW8A8Int8MoE(quant_config)
else:
logger.warning(
f"Unsupported FusedMoe modelslim scheme: \
logger.warning(f"Unsupported FusedMoe modelslim scheme: \
{quant_config.quant_description.get(prefix_in_quant_config.strip())} \
in layer: {prefix}"
)
in layer: {prefix}")
return None
@@ -12,6 +12,7 @@
# limitations under the License.
# ==============================================================================
"""Radix attention."""
from __future__ import annotations
from enum import Enum
@@ -12,6 +12,7 @@
# limitations under the License.
# ==============================================================================
"""Radix linear attention."""
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Tuple, Union
+2 -1
View File
@@ -1,5 +1,6 @@
# Adapted from https://raw.githubusercontent.com/vllm-project/vllm/refs/tags/v0.6.6.post1/vllm/model_executor/layers/rotary_embedding.py
"""Rotary Positional Embeddings."""
from __future__ import annotations
import itertools
@@ -2896,7 +2897,7 @@ class DualChunkRotaryEmbedding(MultiPlatformOp):
self.local_size = local_size
self.dtype = dtype
self.device = torch.device(f"cuda:{torch.cuda.current_device()}")
(q_cache, qc_cache, k_cache, qc_no_clamp_cache, q_inter_cache) = (
q_cache, qc_cache, k_cache, qc_no_clamp_cache, q_inter_cache = (
self._compute_cos_sin_cache()
)
+1
View File
@@ -12,6 +12,7 @@
# limitations under the License.
# ==============================================================================
"""A tensor parallel worker."""
from __future__ import annotations
import logging
@@ -639,7 +639,7 @@ class MambaRadixCache(BasePrefixCache):
match_result = self.match_prefix(
MatchPrefixParams(key=RadixKey(page_aligned_token_ids, req.extra_key))
)
(new_indices, new_last_node) = (
new_indices, new_last_node = (
match_result.device_indices,
match_result.last_device_node,
)
@@ -8,7 +8,9 @@ from typing import Optional
import psutil
import torch
from sglang.jit_kernel.hicache import can_use_hicache_jit_kernel
from sglang.jit_kernel.hicache import (
can_use_hicache_jit_kernel,
)
from sglang.jit_kernel.hicache import (
transfer_hicache_all_layer as jit_transfer_hicache_all_layer,
)
+1 -1
View File
@@ -523,7 +523,7 @@ class RadixCache(BasePrefixCache):
# The prefix indices could be updated, reuse it
match_result = self.match_prefix(MatchPrefixParams(key=radix_key))
(new_indices, new_last_node) = (
new_indices, new_last_node = (
match_result.device_indices,
match_result.last_device_node,
)
@@ -556,7 +556,7 @@ class SWARadixCache(BasePrefixCache):
match_result = self.match_prefix(
MatchPrefixParams(key=RadixKey(page_aligned_token_ids, req.extra_key))
)
(new_indices, new_last_node) = (
new_indices, new_last_node = (
match_result.device_indices,
match_result.last_device_node,
)
+1
View File
@@ -12,6 +12,7 @@
# limitations under the License.
# ==============================================================================
"""Utilities for Prometheus Metrics Collection."""
import dataclasses
import logging
import os
+1
View File
@@ -12,6 +12,7 @@
# limitations under the License.
# ==============================================================================
"""Utilities for Prometheus Metrics."""
import math
from typing import List
+1
View File
@@ -1,6 +1,7 @@
# Adapted from https://github.com/vllm-project/vllm/blob/v0.6.4.post1/vllm/model_executor/model_loader/utils.py
"""Utilities for selecting and loading models."""
import concurrent.futures
import contextlib
import logging
@@ -1,6 +1,7 @@
# Adapted from https://github.com/vllm-project/vllm/blob/v0.6.4.post1/vllm/model_executor/model_loader/weight_utils.py
"""Utilities for downloading and initializing model weights."""
import collections
import concurrent.futures
import fnmatch
@@ -140,12 +141,10 @@ def convert_bin_to_safetensor_file(
sf_size = os.stat(sf_filename).st_size
pt_size = os.stat(pt_filename).st_size
if (sf_size - pt_size) / pt_size > 0.01:
raise RuntimeError(
f"""The file size different is more than 1%:
raise RuntimeError(f"""The file size different is more than 1%:
- {sf_filename}: {sf_size}
- {pt_filename}: {pt_size}
"""
)
""")
# check if the tensors are the same
reloaded = safetensors.torch.load_file(sf_filename)
+1
View File
@@ -18,6 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inference-only BaiChuan model compatible with HuggingFace weights."""
import math
from typing import Iterable, Optional, Tuple
+1
View File
@@ -18,6 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""SGLang BailingMoE model."""
import logging
from typing import Iterable, List, Optional, Tuple, Union
@@ -18,6 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""SGLang BailingMoENextN model."""
import logging
from typing import Iterable, Optional, Tuple
@@ -13,6 +13,7 @@
# ==============================================================================
"""Inference-only DeepSeek NextN Speculative Decoding."""
import logging
from typing import Iterable, Optional, Tuple
+1
View File
@@ -16,6 +16,7 @@
# Adapted from
# https://github.com/vllm-project/vllm/blob/c7f2cf2b7f67bce5842fedfdba508440fe257375/vllm/model_executor/models/llama.py#L1
"""Inference-only Apertus model compatible with HuggingFace weights."""
import copy
import logging
import math
+1
View File
@@ -15,6 +15,7 @@
# Adapted from:
# https://github.com/vllm-project/vllm/blob/fb6af8bc086328ca6659e72d11ffd4309ce4de22/vllm/model_executor/models/deepseek_v2.py
"""Inference-only DeepseekV2 model."""
from __future__ import annotations
import logging
+1 -1
View File
@@ -12,7 +12,7 @@
# limitations under the License.
# ==============================================================================
""" Inference-only Ernie4.5 model compatible with baidu/ERNIE-4.5-*-PT weights. """
"""Inference-only Ernie4.5 model compatible with baidu/ERNIE-4.5-*-PT weights."""
from typing import Iterable, List, Optional, Tuple, Union
+1 -1
View File
@@ -12,7 +12,7 @@
# limitations under the License.
# ==============================================================================
""" Inference-only Ernie4.5 VL model compatible with baidu/ERNIE-4.5-VL-*-PT weights. """
"""Inference-only Ernie4.5 VL model compatible with baidu/ERNIE-4.5-VL-*-PT weights."""
import logging
from itertools import islice
+1
View File
@@ -11,6 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inference-only Ernie45-VL model compatible with HuggingFace weights."""
import logging
from functools import lru_cache, partial
from typing import Iterable, List, Optional, Tuple, Type
+1 -1
View File
@@ -12,7 +12,7 @@
# limitations under the License.
# ==============================================================================
""" Ernie4.5 MTP model compatible with baidu/ERNIE-4.5-*-PT weights. """
"""Ernie4.5 MTP model compatible with baidu/ERNIE-4.5-*-PT weights."""
from typing import Iterable, Optional, Tuple
+1
View File
@@ -17,6 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inference-only GPT-2 model compatible with HuggingFace weights."""
from typing import Iterable, Optional, Tuple, Type
import torch
+1
View File
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inference-only HunYuan model compatible with HuggingFace weights."""
import re
from typing import Any, Dict, Iterable, Optional, Tuple
+1
View File
@@ -18,6 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""SGLang LLaDA2MoeModelLM model."""
import logging
from typing import Iterable, Optional, Tuple, Union
+1
View File
@@ -1,6 +1,7 @@
# Adapted from:
# https://github.com/vllm-project/vllm/blob/7193774b1ff8603ad5bf4598e5efba0d9a39b436/vllm/model_executor/models/mllama.py
"""PyTorch Mllama model."""
import math
from typing import Iterable, List, Optional, Tuple, Union
+1
View File
@@ -14,6 +14,7 @@
# Adapted from https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/nemotron_nas.py
"""Inference-only deci model compatible with HuggingFace weights."""
from typing import Iterable, Optional, Tuple, Type, Union
import torch
+1
View File
@@ -15,6 +15,7 @@
# Adapted from
# https://github.com/vllm-project/vllm/blob/c7f2cf2b7f67bce5842fedfdba508440fe257375/vllm/model_executor/models/olmo.py#L1
"""Inference-only OLMo model compatible with HuggingFace weights."""
from typing import Iterable, Optional, Tuple
import torch
+1
View File
@@ -15,6 +15,7 @@
# Adapted from
# https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/olmo2.py
"""Inference-only OLMo2 model compatible with HuggingFace weights."""
from functools import partial
from typing import Iterable, Optional, Tuple
+1
View File
@@ -13,6 +13,7 @@
# ==============================================================================
"""Inference-only OPT model compatible with HuggingFace weights."""
import logging
from collections.abc import Iterable
from typing import Optional, Union
+1
View File
@@ -7,6 +7,7 @@
# LICENSE: https://huggingface.co/OrionStarAI/Orion-14B-Base/blob/main/LICENSE
# Adapted from https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/orion.py
"""Inference-only Orion-14B model compatible with HuggingFace weights."""
from collections.abc import Iterable
from typing import Any, Optional, Tuple
+6 -2
View File
@@ -23,11 +23,15 @@ import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import PixtralVisionConfig, PretrainedConfig
from transformers.models.pixtral.modeling_pixtral import PixtralRotaryEmbedding
from transformers.models.pixtral.modeling_pixtral import (
PixtralRotaryEmbedding,
)
from transformers.models.pixtral.modeling_pixtral import (
generate_block_attention_mask as _get_pixtral_attention_mask,
)
from transformers.models.pixtral.modeling_pixtral import position_ids_in_meshgrid
from transformers.models.pixtral.modeling_pixtral import (
position_ids_in_meshgrid,
)
from sglang.srt.layers.activation import SiluAndMul
from sglang.srt.layers.attention.vision import VisionAttention
+1
View File
@@ -15,6 +15,7 @@
# Adapted from llama2.py
# Modify details for the adaptation of Qwen2 model.
"""Inference-only Qwen2 model compatible with HuggingFace weights."""
import logging
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
+1
View File
@@ -22,6 +22,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inference-only Qwen2-VL model compatible with HuggingFace weights."""
import logging
import re
from functools import partial
+1
View File
@@ -22,6 +22,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inference-only Qwen2-Audio model compatible with HuggingFace weights."""
import logging
from typing import Any, Iterable, List, Optional, Tuple
+1
View File
@@ -22,6 +22,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inference-only Qwen2-VL model compatible with HuggingFace weights."""
import logging
from functools import lru_cache, partial
from typing import Iterable, List, Optional, Tuple, Type, TypedDict
+1
View File
@@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Inference-only Qwen3.5 model and Qwen3.5 MoE model compatible with HuggingFace weights."""
import logging
from functools import lru_cache
from typing import Iterable, Optional, Set, Tuple, Union
+1
View File
@@ -13,6 +13,7 @@
# ==============================================================================
"""Inference-only Qwen3_5 MTP model."""
import logging
from typing import Iterable, Optional, Tuple
+2 -2
View File
@@ -366,8 +366,8 @@ class Qwen3GatedDeltaNet(nn.Module):
# [b, sq, ng, (hn + hn + np/ng * hn + np/ng + np/ng)]
# --> [b, sq, ng, hn], [b, sq, ng, hn], [b, sq, ng, np/ng * hn], [b, sq, ng, np/ng * hn], [b, sq, ng, np/ng], [b, sq, ng, np/ng]
(query, key, value, z) = torch.split(mixed_qkvz, split_arg_list_qkvz, dim=2)
(b, a) = torch.split(mixed_ba, split_arg_list_ba, dim=2)
query, key, value, z = torch.split(mixed_qkvz, split_arg_list_qkvz, dim=2)
b, a = torch.split(mixed_ba, split_arg_list_ba, dim=2)
# [b, sq, ng, np/ng * hn] -> [b, sq, np, hn]
value = value.reshape(value.size(0), -1, self.head_v_dim)
@@ -13,6 +13,7 @@
# ==============================================================================
"""Inference-only Qwen3Next MTP Speculative Decoding."""
import logging
from typing import Iterable, Optional, Tuple
@@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Inference-only Qwen3-VL model compatible with HuggingFace weights."""
import math
from typing import Iterable, List, Optional, Tuple
+1
View File
@@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Inference-only Qwen3-VL model compatible with HuggingFace weights."""
import logging
import math
import re
+1
View File
@@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Inference-only Qwen3-VL model compatible with HuggingFace weights."""
import logging
import re
from functools import lru_cache
+2 -1
View File
@@ -20,7 +20,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Adapted from https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/starcoder2.py
""" PyTorch Starcoder2 model."""
"""PyTorch Starcoder2 model."""
from collections.abc import Iterable
from typing import Optional, Tuple
+1
View File
@@ -15,6 +15,7 @@
# Adapted from
# https://github.com/vllm-project/vllm/blob/a1a2aaadb9122f05667140e39cf67e5736c8b6d6/vllm/model_executor/models/transformers.py
"""Wrapper around `transformers` models"""
import logging
import re
from typing import Iterable, Literal, Optional, Tuple, Union
@@ -13,6 +13,7 @@
# ==============================================================================
"""ViT CUDA Graph Runner class."""
from __future__ import annotations
from typing import Dict, Hashable, Tuple
+2 -1
View File
@@ -27,6 +27,7 @@ LLaVA-NeXT : https://llava-vl.github.io/blog/2024-01-30-llava-next/
LLaVA-Onevision : https://arxiv.org/pdf/2408.03326
"""
import ast
import itertools
import math
@@ -519,7 +520,7 @@ def run_dp_sharded_mrope_vision_model(
# image_to_tp_rank = [0, 2, 1, 3]
# gpu_sample_counts = [1, 3]
# grouped_pixel_values_len = [1000, 350]
(image_to_tp_rank, gpu_sample_counts, grouped_pixel_values_len) = (
image_to_tp_rank, gpu_sample_counts, grouped_pixel_values_len = (
get_dp_encoder_lb_assignment(patches_per_image, tp_size)
)
@@ -15,7 +15,9 @@ from sglang.srt.models.ernie45_vl import Ernie4_5_VLMoeForConditionalGeneration
from sglang.srt.multimodal.processors.base_processor import (
BaseMultimodalProcessor as SGLangBaseProcessor,
)
from sglang.srt.multimodal.processors.base_processor import MultimodalSpecialTokens
from sglang.srt.multimodal.processors.base_processor import (
MultimodalSpecialTokens,
)
from sglang.srt.utils import get_bool_env_var, is_npu, logger
_is_npu = is_npu()
@@ -7,7 +7,9 @@ from sglang.srt.models.glm_ocr import GlmOcrForConditionalGeneration
from sglang.srt.multimodal.processors.base_processor import (
BaseMultimodalProcessor as SGLangBaseProcessor,
)
from sglang.srt.multimodal.processors.base_processor import MultimodalSpecialTokens
from sglang.srt.multimodal.processors.base_processor import (
MultimodalSpecialTokens,
)
class Glm4vImageProcessor(SGLangBaseProcessor):
@@ -8,7 +8,9 @@ from sglang.srt.models.kimi_k25 import KimiK25ForConditionalGeneration
from sglang.srt.multimodal.processors.base_processor import (
BaseMultimodalProcessor as SGLangBaseProcessor,
)
from sglang.srt.multimodal.processors.base_processor import MultimodalSpecialTokens
from sglang.srt.multimodal.processors.base_processor import (
MultimodalSpecialTokens,
)
# Compatible with KimiVLForConditionalGeneration
@@ -5,7 +5,9 @@ from sglang.srt.models.kimi_vl import KimiVLForConditionalGeneration
from sglang.srt.multimodal.processors.base_processor import (
BaseMultimodalProcessor as SGLangBaseProcessor,
)
from sglang.srt.multimodal.processors.base_processor import MultimodalSpecialTokens
from sglang.srt.multimodal.processors.base_processor import (
MultimodalSpecialTokens,
)
# Compatible with KimiVLForConditionalGeneration
@@ -26,7 +26,9 @@ from sglang.srt.models.qwen3_vl_moe import Qwen3VLMoeForConditionalGeneration
from sglang.srt.multimodal.processors.base_processor import (
BaseMultimodalProcessor as SGLangBaseProcessor,
)
from sglang.srt.multimodal.processors.base_processor import MultimodalSpecialTokens
from sglang.srt.multimodal.processors.base_processor import (
MultimodalSpecialTokens,
)
from sglang.utils import logger
IMAGE_FACTOR = 28
@@ -15,7 +15,9 @@ from sglang.srt.models.step3_vl_10b import StepVLForConditionalGeneration
from sglang.srt.multimodal.processors.base_processor import (
BaseMultimodalProcessor as SGLangBaseProcessor,
)
from sglang.srt.multimodal.processors.base_processor import MultimodalSpecialTokens
from sglang.srt.multimodal.processors.base_processor import (
MultimodalSpecialTokens,
)
ImageWithPatches = tuple[Image.Image, list[Image.Image], list[int] | None]
@@ -13,6 +13,7 @@
# ==============================================================================
"""ViT CUDA Graph Runner class."""
from __future__ import annotations
import inspect
@@ -13,7 +13,6 @@
# ==============================================================================
"""Completion templates."""
import dataclasses
import logging
from enum import auto
+1
View File
@@ -12,6 +12,7 @@
# limitations under the License.
# ==============================================================================
"""Common utilities."""
from __future__ import annotations
import argparse
+1 -1
View File
@@ -117,7 +117,7 @@ def _random_like(t: torch.Tensor):
def _postprocess_tensors(
raw: Dict[str, torch.Tensor]
raw: Dict[str, torch.Tensor],
) -> Iterable[Tuple[str, bool, torch.Tensor]]:
from sglang.srt.debug_utils.dumper import get_tensor_info