[CPU][Perf] Accelerate Attention head for s390x using vector intrinsics (#34434)

Signed-off-by: Rehan Khan <Rehan.Khan7@ibm.com>
Co-authored-by: Li, Jiang <jiang1.li@intel.com>
This commit is contained in:
R3hankhan
2026-02-24 07:25:39 -08:00
committed by GitHub
co-authored by Li, Jiang <jiang1.li@intel.com>
parent 0de5333989
commit 34ce0ffd1f
6 changed files with 424 additions and 8 deletions
+3 -4
View File
@@ -2017,21 +2017,20 @@ class EngineArgs:
)
# Disable chunked prefill and prefix caching for:
# POWER (ppc64le)/s390x/RISCV CPUs in V1
# POWER (ppc64le)/RISCV CPUs in V1
if current_platform.is_cpu() and current_platform.get_cpu_architecture() in (
CpuArchEnum.POWERPC,
CpuArchEnum.S390X,
CpuArchEnum.RISCV,
):
logger.info(
"Chunked prefill is not supported for POWER, "
"S390X and RISC-V CPUs; "
"and RISC-V CPUs; "
"disabling it for V1 backend."
)
self.enable_chunked_prefill = False
logger.info(
"Prefix caching is not supported for POWER, "
"S390X and RISC-V CPUs; "
"and RISC-V CPUs; "
"disabling it for V1 backend."
)
self.enable_prefix_caching = False
+4 -1
View File
@@ -25,7 +25,7 @@ from vllm.v1.kv_cache_interface import AttentionSpec, CrossAttentionSpec
logger = init_logger(__name__)
_CPU_ARCH_PREFER_MIXED_BATCH = (CpuArchEnum.X86, CpuArchEnum.ARM)
_CPU_ARCH_PREFER_MIXED_BATCH = (CpuArchEnum.X86, CpuArchEnum.ARM, CpuArchEnum.S390X)
class CPUAttentionBackend(AttentionBackend):
@@ -488,12 +488,15 @@ def _get_attn_isa(
return "vec16"
supports_amx = torch._C._cpu._is_amx_tile_supported()
supports_arm = current_platform.get_cpu_architecture() == CpuArchEnum.ARM
supports_vxe = current_platform.get_cpu_architecture() == CpuArchEnum.S390X
if supports_amx and dtype in (torch.bfloat16,) and block_size % 32 == 0:
return "amx"
elif block_size % 32 == 0:
if supports_arm:
# support ARM NEON FMLA and BFMMLA (bf16) for block size 32
return "neon"
elif supports_vxe:
return "vxe"
else:
return "vec"
else: