Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2134993
[sync] [ROCm] Revert Part of `[ROCm] Fix pooling startup workspace lo…
AlpinDale Jul 12, 2026
4805c2c
[sync] Correct model layer aliasing for Bert style models (#43896)
AlpinDale Jul 12, 2026
9d8fee7
[sync] update marlin M size for EP (#48144)
AlpinDale Jul 12, 2026
da0f73a
[sync] [bugfix] bge-m3-sparse-plugin mismatch requests (#48112)
AlpinDale Jul 12, 2026
1d71d3f
[sync] [CI/Build][AMD] Fix ROCm OOM in eagle_correctness_heavy by res…
AlpinDale Jul 12, 2026
bd0646d
[sync] [kv_offload] Emit tier-owned BlockStored events from FS/OBJ se…
AlpinDale Jul 12, 2026
e247241
[sync] DCP supports hybrid attention (#40996)
AlpinDale Jul 12, 2026
c93f477
[sync] [Core][KV events] Report prefix-cache-reused blocks in full re…
AlpinDale Jul 12, 2026
6082897
[sync] [Feature][Parser] Support include_reasoning param for non-Harm…
AlpinDale Jul 12, 2026
15a0fc6
[sync] [Perf] fuse more rmsnorm and all-reduce in qwen3.5 (#46998)
AlpinDale Jul 12, 2026
39e9ecd
[sync] [Rust Frontend] Integrate MM video support (#47959)
AlpinDale Jul 12, 2026
76e24f6
[sync] [Model][CI/Build] Cosmos3: enable registry tests and register …
AlpinDale Jul 12, 2026
2041040
[sync] [CI] Add TORCH_NIGHTLY=1 build mode (run full suite on torch n…
AlpinDale Jul 12, 2026
081d9b5
[sync] Deepstream video backend (#42424)
AlpinDale Jul 12, 2026
fe17b60
[sync] [Rust Frontend] Add roundtrip fixtures for more chat parsers (…
AlpinDale Jul 12, 2026
0d10f98
[sync] [Misc] Remove dead code in ViT functionality test (#48220)
AlpinDale Jul 12, 2026
55d7af3
[sync] [Bugfix][Spec Decode] Fix DFlash draft/target layer-count mism…
AlpinDale Jul 12, 2026
c128bbc
[sync] [Model] Migrate MistralLarge3ForCausalLM to AutoWeightsLoader …
AlpinDale Jul 12, 2026
396cbc9
[sync] [Refactor] Remove unused rocm kernel `combine_topk_swa_indices…
AlpinDale Jul 12, 2026
863e790
[sync] [Bugfix] Fix turboquant FP8 cast failure for BF16 models on Am…
AlpinDale Jul 12, 2026
57081f3
[sync] fix: correct load_weights track logic and enable weight integr…
AlpinDale Jul 12, 2026
3dc5b0d
[sync] [Build/CI] Build arm64 PR and postmerge image builds for Black…
AlpinDale Jul 12, 2026
41ef472
[sync] [Model] Add LongCat-Flash-Lite (n-gram embedding) (#47857)
AlpinDale Jul 12, 2026
6c7182a
[sync] [ROCm] Enable DeepSeek-V4 DSpark speculative decoding on AMD (…
AlpinDale Jul 12, 2026
3a65634
[sync] [Bugfix] Fix FlashMLA dense fp8 metadata crash (num_sm_parts c…
AlpinDale Jul 12, 2026
4341665
[sync] handle topk_ids padding in align sum kernel (#47785)
AlpinDale Jul 12, 2026
c8b80c0
[sync] [Bugfix][Test] Register Qwen/Qwen3.5-4B example model (#48276)
AlpinDale Jul 12, 2026
ce768ae
[sync] [Bugfix] Fix thinking_token_budget not enforced after natural …
AlpinDale Jul 12, 2026
f1a7943
[sync] Add VLLM_FLASHINFER_AUTOTUNE_SKIP_OPS and skip CuTeDSL fp4_gem…
AlpinDale Jul 12, 2026
f55a071
[sync] [Quantization] Bound peak memory when repacking FP4 MoE weight…
AlpinDale Jul 12, 2026
9d65165
[sync] [BugFix] weights processing peak memory reduction for nvfp4 Mo…
AlpinDale Jul 12, 2026
41aa971
[sync] [BugFix] Fix packed HND KV cache reshape for FlashAttention (#…
AlpinDale Jul 12, 2026
27e486c
[sync] [Misc] Use meta tensor for KV cache stride calculation (#47316)
AlpinDale Jul 12, 2026
ed6ae70
[sync] [Logs] DP Supervisor Log Improvement (#48278)
AlpinDale Jul 12, 2026
cbeca60
[sync] [Revert] [Build] Update vllm ...builds FA3 with torch stable A…
AlpinDale Jul 12, 2026
eb0b7f5
[sync] Bump Transformers version to 5.13.0 (#47867)
AlpinDale Jul 12, 2026
0583f72
[sync] [XPU]remove is_xxx from moe class and bump up kernels (#48079)
AlpinDale Jul 12, 2026
898e07b
[sync] [CI] Point CI at Transformers release rather than release bran…
AlpinDale Jul 12, 2026
54c273e
[sync] FP32 router GEMV optimization (#48335)
AlpinDale Jul 12, 2026
2797dc9
[sync] [XPU][UT]Fix InternS1ProForConditionalGeneration AssertionErro…
AlpinDale Jul 12, 2026
7b0970e
[sync] [2/N][KV-Cache Layout Refactor] Pack K/V into the content dim …
AlpinDale Jul 12, 2026
ea56f9f
[sync] fix(entrypoints): stop resolve_items leaking in-flight media f…
AlpinDale Jul 12, 2026
dd71b6d
[sync] fix(processor): route MiMo-V2-Omni media fetch through MediaCo…
AlpinDale Jul 12, 2026
5b6e757
[sync] [Bugfix][LoRA] Support ark_linear base layer in _get_lora_devi…
AlpinDale Jul 12, 2026
052c4ce
[sync] [CI][CPU] Add Qwen2-VL multimodal tests for CPU backend and fi…
AlpinDale Jul 12, 2026
1d6e33c
[sync] [2/N][Core] support partial prefix cache hit for hybrid model …
AlpinDale Jul 12, 2026
6e592b9
[sync] Runtime Draft Weight Update for Speculative Decoding (#46725)
AlpinDale Jul 12, 2026
85b9b7d
[sync] [Perf][Qwen] Replace MOE all-reduce with reduce-scatter (#47006)
AlpinDale Jul 12, 2026
611e815
[sync] [Frontend] Add /abort_requests to the RLHF dev API router (#47…
AlpinDale Jul 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .sync/vllm-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ea0fa34f4992c09fc5aa4ae9a12e67e03125289c
83762b77b07e97c77f986e4bf5a9474952e47bb3
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ endif()
#
set(TORCH_SUPPORTED_VERSION_CUDA "2.13.0")
set(TORCH_SUPPORTED_VERSION_ROCM "2.13.0")
# TORCH_NIGHTLY=1 builds run against unpinned nightly wheels, so the supported-
# version check would always warn. Only treat it as a nightly build when the
# value is exactly "1" (the bootstrap exports TORCH_NIGHTLY=0 by default, which
# must NOT suppress the warning for normal builds).
if (DEFINED ENV{TORCH_NIGHTLY} AND "$ENV{TORCH_NIGHTLY}" STREQUAL "1")
set(TORCH_NIGHTLY_BUILD TRUE)
else()
set(TORCH_NIGHTLY_BUILD FALSE)
endif()

#
# Try to find python package with an executable that exactly matches
Expand Down Expand Up @@ -177,7 +186,7 @@ endif()
if (NOT HIP_FOUND AND NOT PYTORCH_FOUND_HIP AND CUDA_FOUND)
set(APHRODITE_GPU_LANG "CUDA")

if (NOT Torch_VERSION VERSION_EQUAL ${TORCH_SUPPORTED_VERSION_CUDA})
if (NOT TORCH_NIGHTLY_BUILD AND NOT Torch_VERSION VERSION_EQUAL ${TORCH_SUPPORTED_VERSION_CUDA})
message(WARNING "Pytorch version ${TORCH_SUPPORTED_VERSION_CUDA} "
"expected for CUDA build, saw ${Torch_VERSION} instead.")
endif()
Expand All @@ -190,7 +199,7 @@ elseif(HIP_FOUND OR PYTORCH_FOUND_HIP)
enable_language(HIP)

# ROCm 5.X and 6.X
if (ROCM_VERSION_DEV_MAJOR GREATER_EQUAL 5 AND
if (NOT TORCH_NIGHTLY_BUILD AND ROCM_VERSION_DEV_MAJOR GREATER_EQUAL 5 AND
Torch_VERSION VERSION_LESS ${TORCH_SUPPORTED_VERSION_ROCM})
message(WARNING "Pytorch version >= ${TORCH_SUPPORTED_VERSION_ROCM} "
"expected for ROCm build, saw ${Torch_VERSION} instead.")
Expand Down Expand Up @@ -383,6 +392,7 @@ if(APHRODITE_GPU_LANG STREQUAL "CUDA" OR APHRODITE_GPU_LANG STREQUAL "HIP")
"csrc/libtorch_stable/cuda_view.cu"
"csrc/libtorch_stable/cuda_utils_kernels.cu"
"csrc/libtorch_stable/activation_kernels.cu"
"csrc/libtorch_stable/ngram_embedding_kernels.cu"
"csrc/libtorch_stable/quantization/activation_kernels.cu"
"csrc/libtorch_stable/quantization/w8a8/int8/scaled_quant.cu"
"csrc/libtorch_stable/quantization/w8a8/fp8/common.cu"
Expand Down
43 changes: 31 additions & 12 deletions aphrodite/_custom_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,37 @@ def rms_norm(
torch.ops._C.rms_norm(out, input, weight, epsilon)


# LongCat n-gram embedding index kernel (see csrc/.../ngram_embedding_kernels.cu).
def ngram_compute_n_gram_ids(
ne_n: int,
ne_k: int,
ne_weights: torch.Tensor,
ne_mods: torch.Tensor,
exclusive_ne_embedder_size_sums: torch.Tensor,
exclusive_req_len_sums: torch.Tensor,
ne_token_table: torch.Tensor,
row_indices: torch.Tensor,
column_starts: torch.Tensor,
n_gram_ids: torch.Tensor,
) -> None:
"""Compute concatenated (offset) n-gram ids for a ragged prefill batch.

Writes ``n_gram_ids`` of shape ``[token_num, (ne_n-1)*ne_k]``.
"""
torch.ops._C.ngram_compute_n_gram_ids(
ne_n,
ne_k,
ne_weights,
ne_mods,
exclusive_ne_embedder_size_sums,
exclusive_req_len_sums,
ne_token_table,
row_indices,
column_starts,
n_gram_ids,
)


def fused_add_rms_norm(
input: torch.Tensor,
residual: torch.Tensor,
Expand Down Expand Up @@ -2757,18 +2788,6 @@ def topk_sigmoid(
e_score_correction_bias: torch.Tensor | None = None,
routed_scaling_factor: float = 1.0,
) -> None:
if current_platform.is_xpu():
# xpu doesn't support routed_scaling_factor currently, will revert
# in next vllm-xpu-kernels bumpup
torch.ops._moe_C.topk_sigmoid(
topk_weights,
topk_ids,
token_expert_indices,
gating_output,
renormalize,
e_score_correction_bias,
)
return
torch.ops._moe_C.topk_sigmoid(
topk_weights,
topk_ids,
Expand Down
1 change: 1 addition & 0 deletions aphrodite/config/aphrodite.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"DeepseekV2ForCausalLM",
"Qwen2MoeForCausalLM",
"GraniteMoeForCausalLM",
"LongcatFlashNgramForCausalLM",
}
)

Expand Down
17 changes: 6 additions & 11 deletions aphrodite/config/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,12 @@ class CacheConfig:
"""Whether block_size was explicitly provided. Derived automatically."""
user_specified_mamba_block_size: bool = field(default=False, init=False)
"""Whether mamba_block_size was explicitly provided. Derived automatically."""
hash_block_size: int | None = Field(default=None, gt=0)
"""Block size (in tokens) used for computing Request's block_hashes.
prefix_match_unit: int | None = Field(default=None, gt=0)
"""The finest token boundary (in tokens) a prefix-cache hit can land on.

This can be set to a finer granularity than the physical KV cache block
sizes (e.g. 8) as long as every KV cache group's `block_size` is divisible
by it. This enables prefix-caching keys to be computed at the finest common
granularity and then merged for larger physical block sizes.

This config is not static default. If left unspecified, Aphrodite will choose a
default based on the resolved KV cache groups (typically the smallest KV
cache block size when there are multiple groups).
Prefix-cache keys are computed every `prefix_match_unit` tokens. It can
be set finer than the physical KV cache block sizes as long as every KV
cache group's `block_size` is divisible by it.
"""
gpu_memory_utilization: float = Field(default=0.92, gt=0, le=1)
"""The fraction of GPU memory to be used for the model executor, which can
Expand Down Expand Up @@ -209,7 +204,7 @@ def compute_hash(self) -> str:
"enable_prefix_caching",
"prefix_caching_hash_algo",
# Prefix-caching implementation detail (doesn't affect compiled graph).
"hash_block_size",
"prefix_match_unit",
"mamba_page_size_padded",
"skip_page_size_padded",
"user_specified_block_size",
Expand Down
24 changes: 23 additions & 1 deletion aphrodite/config/speculative.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def hf_config_override(hf_config: PretrainedConfig) -> PretrainedConfig:
"architectures": ["Qwen3_5MoeMTP" if is_moe else "Qwen3_5MTP"],
}
)
if hf_config.model_type == "longcat_flash":
if hf_config.model_type in ("longcat_flash", "longcat_flash_ngram"):
hf_config.model_type = "longcat_flash_mtp"
n_predict = getattr(hf_config, "num_nextn_predict_layers", 1)
hf_config.update({"n_predict": n_predict, "architectures": ["LongCatFlashMTPModel"]})
Expand Down Expand Up @@ -842,6 +842,28 @@ def __post_init__(self):
if self.num_speculative_tokens is None:
raise ValueError("A speculative model was provided, but `num_speculative_tokens` was not provided")

if self.method == "dspark":
# DSpark is a semi-autoregressive *block* drafter. A
# speculative length smaller than the checkpoint's block
# feeds the block / Markov-head machinery an unsupported
# layout and yields incorrect (garbled) output rather than
# merely lower acceptance. Require num_speculative_tokens to
# be at least the block size (e.g. 5 or 7 for DeepSeek-V4).
dspark_block_size = getattr(
self.draft_model_config.hf_config,
"dspark_block_size",
None,
)
if dspark_block_size is not None and self.num_speculative_tokens < dspark_block_size:
raise ValueError(
"DSpark requires num_speculative_tokens >= "
f"dspark_block_size ({dspark_block_size}); got "
f"{self.num_speculative_tokens}. Smaller values "
"produce incorrect output. Use "
f"num_speculative_tokens={dspark_block_size} or "
"larger (e.g. 7)."
)

self.draft_tensor_parallel_size = SpeculativeConfig._verify_and_get_draft_tp(
self.target_parallel_config,
self.draft_tensor_parallel_size,
Expand Down
2 changes: 2 additions & 0 deletions aphrodite/distributed/kv_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class KVCacheEvent(

MEDIUM_GPU = "GPU"
MEDIUM_CPU = "CPU"
MEDIUM_FS = "FS"
MEDIUM_OBJ = "OBJ"


class BlockStored(KVCacheEvent):
Expand Down
65 changes: 33 additions & 32 deletions aphrodite/distributed/kv_transfer/kv_connector/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

import torch

from aphrodite.config import AphroditeConfig, get_current_aphrodite_config, get_layers_from_aphrodite_config
from aphrodite.config import (
AphroditeConfig,
get_current_aphrodite_config,
get_layers_from_aphrodite_config,
set_current_aphrodite_config,
)
from aphrodite.distributed.kv_transfer.kv_connector.factory import KVConnectorFactory
from aphrodite.logger import init_logger
from aphrodite.model_executor.layers.attention_layer_base import AttentionLayerBase
Expand Down Expand Up @@ -326,14 +331,15 @@ def get_current_attn_backends(
logger.debug("No layers found in the Aphrodite config. Falling back to default attention backend.")
from aphrodite.v1.attention.selector import get_attn_backend

return [
get_attn_backend(
head_size=aphrodite_config.model_config.get_head_size(),
dtype=aphrodite_config.model_config.dtype,
kv_cache_dtype=aphrodite_config.cache_config.cache_dtype,
use_mla=aphrodite_config.model_config.use_mla,
)
]
with set_current_aphrodite_config(aphrodite_config):
return [
get_attn_backend(
head_size=aphrodite_config.model_config.get_head_size(),
dtype=aphrodite_config.model_config.dtype,
kv_cache_dtype=aphrodite_config.cache_config.cache_dtype,
use_mla=aphrodite_config.model_config.use_mla,
)
]


def get_current_attn_backend(
Expand Down Expand Up @@ -396,8 +402,6 @@ def __post_init__(self):

self._engines: dict[tuple[EngineId, int], EngineTransferInfo] = {}

# Figure out whether the first dimension of the cache is K/V
# or num_blocks.
attn_backend = self.attn_backends[0]
if not self.is_mamba:
_MOCK_BLOCK_SIZE = 16
Expand All @@ -408,10 +412,16 @@ def __post_init__(self):
head_size=1,
)
logger.debug("Test kv_cache_shape: %s", kv_cache_shape)
# Non-MLA backends caches have 5 dims [num_blocks, 2, H,N,D],
# we just mock num_blocks to 1 for the dimension check below.
# Hybrid SSM models assume a single blocks_first layout
self._is_kv_layout_blocks_first = self.is_mamba or (len(kv_cache_shape) == 5 and kv_cache_shape[0] == 1)
assert kv_cache_shape[0] == 1, (
"KV cache layout must be blocks-first; expected mocked "
f"num_blocks=1 in leading dim, got shape {kv_cache_shape}."
)
if not self.is_mla:
assert len(kv_cache_shape) == 4, (
"Attention KV cache layout must be standardized as "
"[num_blocks, num_kv_heads, block_size, content_size], "
f"got shape {kv_cache_shape}."
)

self._cross_layers_blocks = False
if self.tensor_shape is not None:
Expand Down Expand Up @@ -465,27 +475,17 @@ def unregister_remote_engine(self, remote_engine_id: EngineId) -> None:
# Layout properties
# ============================================================

@property
def is_kv_layout_blocks_first(self) -> bool:
return self._is_kv_layout_blocks_first

@property
def cross_layers_blocks(self) -> bool:
return self._cross_layers_blocks

@property
def virtually_split_kv_in_blocks(self) -> bool:
# Whether to logically split each block into K and V halves.
# Applies when K/V are interleaved within each block (blocks-first),
# but NOT when cross-layer blocks are used — cross-layer blocks have
# per-layer K/V interleaving (L0_K, L0_V, L1_K, L1_V, ...) so a
# simple half-split does not separate K from V.
return self._is_kv_layout_blocks_first and not self._cross_layers_blocks

@property
def split_k_and_v(self) -> bool:
# Whether to register regions for K and V separately (when present).
return not (self._cross_layers_blocks or self.is_mla or self.is_kv_layout_blocks_first)
# Whether to logically split each block into two separately-indexable
# sub-regions. With K and V packed into the content dim, an attention
# block transfers as a single unit. Only Mamba still needs this, to
# index its two state regions separately.
return self.is_mamba and not self._cross_layers_blocks

# ============================================================
# Common methods
Expand Down Expand Up @@ -580,8 +580,9 @@ def get_transfer_cache_regions(
# Swap [2<>num_blocks] dims for hybrid SSM layout.
cache = cache.transpose(0, 1)

# Regular case: backends like FA register K/V in separate regions
return cache if self.split_k_and_v else [cache]
# K and V are packed into one tensor (content dim), so each layer
# registers as a single region.
return [cache]

def describe(self, remote_engine_id: EngineId, remote_pp_rank: int = 0) -> str:
"""One-line summary of transfer config for logging."""
Expand Down
Loading
Loading