vllm.v1.attention.ops.triton_prefill_attention
¶
Memory-efficient attention for prefill. It supports page size = 1.
Functions:
-
context_attention_fwd–q, k, v: [b * s, head, head_dim]
_fit_block_to_shared_memory(block, head_dim, element_size)
cached
¶
Halve the tile until its Q, K and P tiles fit in shared memory.
Source code in vllm/v1/attention/ops/triton_prefill_attention.py
_prefer_narrow_kv_tile()
¶
RDNA3/RDNA4 prefer a narrower KV tile than the shared default.
Source code in vllm/v1/attention/ops/triton_prefill_attention.py
context_attention_fwd(q, k, v, o, b_start_loc, b_seq_len, max_input_len, is_causal=True, softmax_scale=None, sliding_window_q=None, sliding_window_k=None, sinks=None, sinks_bias_key0=False)
¶
q, k, v: [b * s, head, head_dim] b_start_loc: [b] b_seq_len: [b] out: [b * s, head, head_dim]
Source code in vllm/v1/attention/ops/triton_prefill_attention.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |