vllm.v1.attention.ops.triton_fp8_mqa_logits ¶
Temporary gfx942 fallback for AITER's fp8_mqa_logits kernel.
This module vendors AITER's Triton fp8_mqa_logits kernel with the gfx942 tile-size workaround from ROCm/aiter#3257. It is used only while vLLM's pinned AITER version lacks that fix.
TODO: Remove this vendored copy once vLLM pins an AITER version that includes ROCm/aiter#3257 bugfix for gfx942.
Functions:
-
fp8_mqa_logits_gfx942–Compute FP8 MQA logits on MI300X (gfx942) using the vendored kernel.
_gfx942_default_tile_fits_lds(num_heads, head_size) ¶
Return True iff (BLOCK_KV=128, num_stages=2) fits in MI300X LDS.
Source code in vllm/v1/attention/ops/triton_fp8_mqa_logits.py
fp8_mqa_logits_gfx942(q, k_fp8, kv_scales, weights, cu_starts, cu_ends) ¶
Compute FP8 MQA logits on MI300X (gfx942) using the vendored kernel.
Drop-in replacement for aiter.ops.triton.attention.fp8_mqa_logits. fp8_mqa_logits on MI300X. Selects (BLOCK_KV, num_stages) based on whether the default tile fits within the 64 KiB LDS budget of a gfx942 CU (see module docstring).
Parameters:
-
(q¶Tensor) –Query tensor of shape
[M, H, D], FP8 dtype. -
(k_fp8¶Tensor) –Key tensor of shape
[N, D], FP8 dtype. -
(kv_scales¶Tensor) –K scales of shape
[N](or[N, 1]-- viewed as[N]), float32. -
(weights¶Tensor) –Per-head weights of shape
[M, H], float32. -
(cu_starts¶Tensor) –Start indices (inclusive) of shape
[M], int32. -
(cu_ends¶Tensor) –End indices (exclusive) of shape
[M], int32.
Returns:
-
Tensor–Logits of shape
[M, N], float32 -- positions outside -
Tensor–[cu_starts[i], cu_ends[i])for rowiare pre-filled with -
Tensor–-infso the caller can run a top-k without masking.
Source code in vllm/v1/attention/ops/triton_fp8_mqa_logits.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 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 | |