[Mini-vLLM] SM86-only cut: models, backends, Rust, tests
- Keep only Qwen3.5, Qwen3.5-MTP and Qwen4Exp model paths; trim the model registry to 41 entries - Delete idle attention backends (MLA, FlashInfer, ROCm-only, quant backends) and dead GDN CuTeDSL kernels - Remove inc/quark quant loaders; keep compressed-tensors and Marlin - Drop the Rust frontend, pooling entrypoints, and idle test suites - Rebuild kernels for sm_80;sm_86 and strip the extensions - Verified: full import sweep clean (optional deps only) and a dummy-load Qwen3.5 engine run on RTX 3090 via the Triton GDN path Co-authored-by: Hinata <hinata@idihore.id> Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from transformers import PreTrainedConfig, SiglipVisionConfig
|
||||
from transformers.models.qwen2 import Qwen2Config
|
||||
|
||||
|
||||
class BagelConfig(PreTrainedConfig):
|
||||
"""Configuration class for BAGEL model."""
|
||||
|
||||
model_type = "bagel"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
visual_gen: bool = True,
|
||||
visual_und: bool = True,
|
||||
llm_config: dict | Qwen2Config | None = None,
|
||||
vit_config: dict | SiglipVisionConfig | None = None,
|
||||
vae_config: dict | None = None,
|
||||
latent_patch_size: int = 2,
|
||||
max_latent_size: int = 32,
|
||||
vit_max_num_patch_per_side: int = 70,
|
||||
connector_act: str = "gelu_pytorch_tanh",
|
||||
interpolate_pos: bool = False,
|
||||
timestep_shift: float = 1.0,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(**kwargs)
|
||||
self.visual_gen = visual_gen
|
||||
self.visual_und = visual_und
|
||||
|
||||
# Convert dict configs to proper config objects
|
||||
if isinstance(llm_config, dict):
|
||||
self.llm_config = Qwen2Config(**llm_config)
|
||||
else:
|
||||
self.llm_config = llm_config or Qwen2Config()
|
||||
|
||||
if isinstance(vit_config, dict):
|
||||
self.vit_config = SiglipVisionConfig(**vit_config)
|
||||
else:
|
||||
self.vit_config = vit_config or SiglipVisionConfig()
|
||||
|
||||
self.vae_config = vae_config or {"z_channels": 16, "downsample": 8}
|
||||
self.latent_patch_size = latent_patch_size
|
||||
self.max_latent_size = max_latent_size
|
||||
self.vit_max_num_patch_per_side = vit_max_num_patch_per_side
|
||||
self.connector_act = connector_act
|
||||
self.interpolate_pos = interpolate_pos
|
||||
self.timestep_shift = timestep_shift
|
||||
|
||||
@property
|
||||
def hidden_size(self) -> int:
|
||||
"""Return the hidden size of the language model."""
|
||||
return self.llm_config.hidden_size
|
||||
@@ -1,57 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""ColQwen3 configuration that extends Qwen3VLConfig with embedding projection
|
||||
fields. This allows ColQwen3 models to be loaded without trust_remote_code
|
||||
by mapping their custom model_type (colqwen3, ops_colqwen3, etc.) to a
|
||||
standard config class that vLLM understands.
|
||||
|
||||
Supported model_types:
|
||||
- colqwen3 (TomoroAI/tomoro-colqwen3-embed-8b)
|
||||
- ops_colqwen3 (OpenSearch-AI/Ops-Colqwen3-4B)
|
||||
- qwen3_vl_nemotron_embed (nvidia/nemotron-colembed-vl-8b-v2)
|
||||
"""
|
||||
|
||||
from transformers.models.qwen3_vl.configuration_qwen3_vl import Qwen3VLConfig
|
||||
|
||||
|
||||
class ColQwen3Config(Qwen3VLConfig):
|
||||
"""Configuration class for ColQwen3 models.
|
||||
|
||||
Extends Qwen3VLConfig with additional fields used by ColQwen3 variants
|
||||
for the embedding projection layer.
|
||||
"""
|
||||
|
||||
# Accept any ColQwen3 variant model_type
|
||||
model_type = "colqwen3"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
embed_dim: int | None = None,
|
||||
dims: int | None = None,
|
||||
dim: int | None = None,
|
||||
projection_dim: int | None = None,
|
||||
colbert_dim: int | None = None,
|
||||
pooling: str | None = None,
|
||||
**kwargs,
|
||||
):
|
||||
# Store embedding projection config fields
|
||||
self.embed_dim = embed_dim
|
||||
self.dims = dims
|
||||
self.dim = dim
|
||||
self.projection_dim = projection_dim
|
||||
self.colbert_dim = colbert_dim
|
||||
self.pooling = pooling
|
||||
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class OpsColQwen3Config(ColQwen3Config):
|
||||
"""Configuration for OpenSearch-AI ColQwen3 variants."""
|
||||
|
||||
model_type = "ops_colqwen3"
|
||||
|
||||
|
||||
class Qwen3VLNemotronEmbedConfig(ColQwen3Config):
|
||||
"""Configuration for NVIDIA Nemotron ColEmbed variants."""
|
||||
|
||||
model_type = "qwen3_vl_nemotron_embed"
|
||||
@@ -1,71 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
from transformers.models.qwen2 import Qwen2Config
|
||||
|
||||
|
||||
class DotsVisionConfig(PreTrainedConfig):
|
||||
model_type: str = "dots_vit"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
embed_dim: int = 1536, # vision encoder embed size
|
||||
hidden_size: int = 1536, # after merger hidden size
|
||||
intermediate_size: int = 4224,
|
||||
num_hidden_layers: int = 42,
|
||||
num_attention_heads: int = 12,
|
||||
num_channels: int = 3,
|
||||
patch_size: int = 14,
|
||||
spatial_merge_size: int = 2,
|
||||
temporal_patch_size: int = 1,
|
||||
rms_norm_eps: float = 1e-5,
|
||||
use_bias: bool = False,
|
||||
attn_implementation="flash_attention_2",
|
||||
initializer_range=0.02,
|
||||
init_merger_std=0.02,
|
||||
is_causal=False, # ve causal forward
|
||||
post_norm=True,
|
||||
gradient_checkpointing=False,
|
||||
**kwargs: Any,
|
||||
):
|
||||
super().__init__(**kwargs)
|
||||
self.embed_dim = embed_dim
|
||||
self.hidden_size = hidden_size
|
||||
self.intermediate_size = intermediate_size
|
||||
self.num_hidden_layers = num_hidden_layers
|
||||
self.num_attention_heads = num_attention_heads
|
||||
self.num_channels = num_channels
|
||||
self.patch_size = patch_size
|
||||
self.spatial_merge_size = spatial_merge_size
|
||||
self.temporal_patch_size = temporal_patch_size
|
||||
self.rms_norm_eps = rms_norm_eps
|
||||
self.use_bias = use_bias
|
||||
self.attn_implementation = attn_implementation
|
||||
self.initializer_range = initializer_range
|
||||
self.init_merger_std = init_merger_std
|
||||
self.is_causal = is_causal
|
||||
self.post_norm = post_norm
|
||||
self.gradient_checkpointing = gradient_checkpointing
|
||||
|
||||
|
||||
class DotsOCRConfig(Qwen2Config):
|
||||
model_type = "dots_ocr"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
image_token_id=151665,
|
||||
video_token_id=151656,
|
||||
vision_config: dict | None = None,
|
||||
*args,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.image_token_id = image_token_id
|
||||
self.video_token_id = video_token_id
|
||||
self.vision_config = DotsVisionConfig(**(vision_config or {}))
|
||||
|
||||
def save_pretrained(self, save_directory, **kwargs):
|
||||
self._auto_class = None
|
||||
super().save_pretrained(save_directory, **kwargs)
|
||||
Reference in New Issue
Block a user