[Kernel] Add B12X causal paged attention backend (#52017)

Signed-off-by: Luke Alonso <lalonso@gmail.com>
Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
This commit is contained in:
Luke Alonso
2026-09-01 10:42:02 -04:00
committed by GitHub
co-authored by Lucas Wilkinson
parent adebc41b7e
commit 0d4ad47981
8 changed files with 1527 additions and 5 deletions
+5
View File
@@ -34,6 +34,7 @@ def _import_submodule(module_name: str) -> ModuleType | None:
_B12X_SUBMODULES = {
module_name: _import_submodule(module_name)
for module_name in (
"b12x.attention.paged",
"b12x.gemm.blockscaled",
# TODO: Remove once B12X exposes the scale-swizzle API publicly.
"b12x._lib.intrinsics",
@@ -73,6 +74,10 @@ def get_b12x_fused_moe() -> ModuleType | None:
return _get_submodule("b12x.moe.fused_moe")
def get_b12x_paged_attention() -> ModuleType | None:
return _get_submodule("b12x.attention.paged")
def b12x_warmup_token_counts(
*,
max_tokens: int,
File diff suppressed because it is too large Load Diff
+1
View File
@@ -94,6 +94,7 @@ class AttentionBackendEnum(Enum, metaclass=_AttentionBackendEnumMeta):
ROCM_FLASHMLA_SPARSE_DSV4 = (
"vllm.models.deepseek_v4.amd.rocm.DeepseekV4ROCMAiterMLASparseBackend"
)
B12X = "vllm.v1.attention.backends.b12x.B12xPagedAttentionBackend"
FLASH_ATTN_MLA = "vllm.v1.attention.backends.mla.flashattn_mla.FlashAttnMLABackend"
FLASH_ATTN_MLA_SPARSE = (
"vllm.v1.attention.backends.mla.flashattn_mla_sparse.FlashAttnMLASparseBackend"