vllm.models.inkling.amd.ops.fa4_rel_attention ¶
ROCm paged attention with Inkling's query-dependent relative bias.
The NVIDIA implementation uses the score-mod hook in tml-fa4. ROCm Flash Attention and AITER do not expose an equivalent hook, so this module implements the same operation directly in Triton. Query heads belonging to one KV head are processed together and KV pages are gathered through vLLM's block table.
Functions:
-
bucket_max_seqlen_q–Round the scheduling bound up to a power of two.
-
inkling_fa4_num_splits–Keep the NVIDIA-facing split heuristic as API-compatible metadata.
-
inkling_fa4_rel_attention–Paged varlen attention with Inkling's relative score modification.
-
use_gfx950_gluon_decode–Use the vendored TokenSpeed CDNA4 decode kernel where it is supported.
-
use_gfx950_gluon_extend–Use Gluon only for the long full-attention extend regime it wins.
bucket_max_seqlen_q(max_seqlen_q) ¶
inkling_fa4_num_splits(*, is_local, batch_size, max_query_len, num_heads, num_kv_heads, max_kv_len) ¶
Keep the NVIDIA-facing split heuristic as API-compatible metadata.
The ROCm Triton implementation performs online softmax in one program and does not consume the result. Keeping this function unchanged avoids platform-specific scheduling branches in :mod:inkling.amd.attention.
Source code in vllm/models/inkling/amd/ops/fa4_rel_attention.py
inkling_fa4_rel_attention(q, key_cache, value_cache, *, block_table, cache_seqlens, cu_seqlens_q, max_seqlen_q, softmax_scale, causal, window_size, rel_extent, rel_logits, num_splits=32, max_kv_len=None, out=None) ¶
Paged varlen attention with Inkling's relative score modification.
Source code in vllm/models/inkling/amd/ops/fa4_rel_attention.py
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 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
use_gfx950_gluon_decode(*, max_query_len, page_size, head_dim) ¶
Use the vendored TokenSpeed CDNA4 decode kernel where it is supported.
Source code in vllm/models/inkling/amd/ops/fa4_rel_attention.py
use_gfx950_gluon_extend(*, max_query_len, max_kv_len, page_size, head_dim, window_left) ¶
Use Gluon only for the long full-attention extend regime it wins.