Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
36d7f198
Unverified
Commit
36d7f198
authored
Apr 01, 2026
by
Li, Jiang
Committed by
GitHub
Apr 01, 2026
Browse files
[CPU] Support head_size 512 in cpu_attn (#38676)
Signed-off-by:
jiang1.li
<
jiang1.li@intel.com
>
parent
2d725b89
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
csrc/cpu/generate_cpu_attn_dispatch.py
csrc/cpu/generate_cpu_attn_dispatch.py
+1
-1
docs/design/attention_backends.md
docs/design/attention_backends.md
+1
-1
tests/kernels/attention/test_cpu_attn.py
tests/kernels/attention/test_cpu_attn.py
+1
-1
vllm/v1/attention/backends/cpu_attn.py
vllm/v1/attention/backends/cpu_attn.py
+1
-1
No files found.
csrc/cpu/generate_cpu_attn_dispatch.py
View file @
36d7f198
...
@@ -8,7 +8,7 @@ Generate CPU attention dispatch switch cases and kernel instantiations.
...
@@ -8,7 +8,7 @@ Generate CPU attention dispatch switch cases and kernel instantiations.
import
os
import
os
# Head dimensions divisible by 32 (support all ISAs)
# Head dimensions divisible by 32 (support all ISAs)
HEAD_DIMS_32
=
[
32
,
64
,
96
,
128
,
160
,
192
,
224
,
256
]
HEAD_DIMS_32
=
[
32
,
64
,
96
,
128
,
160
,
192
,
224
,
256
,
512
]
# Head dimensions divisible by 16 but not 32 (VEC16 only)
# Head dimensions divisible by 16 but not 32 (VEC16 only)
HEAD_DIMS_16
=
[
80
,
112
]
HEAD_DIMS_16
=
[
80
,
112
]
...
...
docs/design/attention_backends.md
View file @
36d7f198
...
@@ -165,7 +165,7 @@ Priority is **1 = highest** (tried first).
...
@@ -165,7 +165,7 @@ Priority is **1 = highest** (tried first).
| Backend | Version | Dtypes | KV Dtypes | Block Sizes | Head Sizes | Sink | MM Prefix | DCP | Attention Types | Compute Cap. |
| Backend | Version | Dtypes | KV Dtypes | Block Sizes | Head Sizes | Sink | MM Prefix | DCP | Attention Types | Compute Cap. |
| ------- | ------- | ------ | --------- | ----------- | ---------- | ---- | --------- | --- | --------------- | ------------ |
| ------- | ------- | ------ | --------- | ----------- | ---------- | ---- | --------- | --- | --------------- | ------------ |
|
`CPU_ATTN`
| | fp16, bf16, fp32 |
`auto`
| Any | 32, 64, 80, 96, 112, 128, 160, 192, 224, 256 | ❌ | ❌ | ❌ | All | N/A |
|
`CPU_ATTN`
| | fp16, bf16, fp32 |
`auto`
| Any | 32, 64, 80, 96, 112, 128, 160, 192, 224, 256
, 512
| ❌ | ❌ | ❌ | All | N/A |
|
`FLASHINFER`
| Native† | fp16, bf16 |
`auto`
,
`float16`
,
`bfloat16`
,
`fp8`
,
`fp8_e4m3`
,
`fp8_e5m2`
| 16, 32, 64 | 64, 128, 256 | ❌ | ❌ | ✅ | Decoder | 7.x-9.x |
|
`FLASHINFER`
| Native† | fp16, bf16 |
`auto`
,
`float16`
,
`bfloat16`
,
`fp8`
,
`fp8_e4m3`
,
`fp8_e5m2`
| 16, 32, 64 | 64, 128, 256 | ❌ | ❌ | ✅ | Decoder | 7.x-9.x |
|
`FLASHINFER`
| TRTLLM† | fp16, bf16 |
`auto`
,
`float16`
,
`bfloat16`
,
`fp8`
,
`fp8_e4m3`
,
`fp8_e5m2`
| 16, 32, 64 | 64, 128, 256 | ✅ | ❌ | ✅ | Decoder | 10.x |
|
`FLASHINFER`
| TRTLLM† | fp16, bf16 |
`auto`
,
`float16`
,
`bfloat16`
,
`fp8`
,
`fp8_e4m3`
,
`fp8_e5m2`
| 16, 32, 64 | 64, 128, 256 | ✅ | ❌ | ✅ | Decoder | 10.x |
|
`FLASH_ATTN`
| FA2
*
| fp16, bf16 |
`auto`
,
`float16`
,
`bfloat16`
| %16 | Any | ❌ | ❌ | ✅ | All | ≥8.0 |
|
`FLASH_ATTN`
| FA2
*
| fp16, bf16 |
`auto`
,
`float16`
,
`bfloat16`
| %16 | Any | ❌ | ❌ | ✅ | All | ≥8.0 |
...
...
tests/kernels/attention/test_cpu_attn.py
View file @
36d7f198
...
@@ -25,7 +25,7 @@ NUM_HEADS = [
...
@@ -25,7 +25,7 @@ NUM_HEADS = [
(
8
,
2
),
(
8
,
2
),
(
9
,
3
),
(
9
,
3
),
]
]
HEAD_SIZES
=
[
96
,
128
]
HEAD_SIZES
=
[
96
,
128
,
512
]
HEAD_SIZES_VEC16
=
[
96
,
80
,
112
,
128
]
HEAD_SIZES_VEC16
=
[
96
,
80
,
112
,
128
]
QTYPES
=
[
torch
.
bfloat16
,
torch
.
half
,
torch
.
float32
]
QTYPES
=
[
torch
.
bfloat16
,
torch
.
half
,
torch
.
float32
]
SLIDING_WINDOWS
=
[
None
,
256
]
SLIDING_WINDOWS
=
[
None
,
256
]
...
...
vllm/v1/attention/backends/cpu_attn.py
View file @
36d7f198
...
@@ -38,7 +38,7 @@ class CPUAttentionBackend(AttentionBackend):
...
@@ -38,7 +38,7 @@ class CPUAttentionBackend(AttentionBackend):
@
classmethod
@
classmethod
def
get_supported_head_sizes
(
cls
)
->
list
[
int
]:
def
get_supported_head_sizes
(
cls
)
->
list
[
int
]:
return
[
32
,
64
,
80
,
96
,
112
,
128
,
160
,
192
,
224
,
256
]
return
[
32
,
64
,
80
,
96
,
112
,
128
,
160
,
192
,
224
,
256
,
512
]
@
staticmethod
@
staticmethod
def
get_name
()
->
str
:
def
get_name
()
->
str
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment