[AMD] Annotate ATOM source for imported v4 unified attention kernels (#28392)

This commit is contained in:
Thomas Wang
2026-06-15 22:12:12 -07:00
committed by GitHub
parent 486ec150d0
commit 800aaefc9e
4 changed files with 10 additions and 0 deletions
@@ -1,6 +1,9 @@
# SPDX-License-Identifier: MIT
# Copyright (C) 2024-2026, Advanced Micro Devices, Inc. All rights reserved.
# The following kernel is imported from ATOM.
# Source: atom/model_ops/v4_kernels/paged_decode.py
"""Sparse decode attention over a unified KV pool with per-token paged indices.
Designed for V4 decode + CUDAGraph: replaces the per-fwd `kv_flat_sa`
@@ -1,6 +1,9 @@
# SPDX-License-Identifier: MIT
# Copyright (C) 2024-2026, Advanced Micro Devices, Inc. All rights reserved.
# The following kernel is imported from ATOM.
# Source: atom/model_ops/v4_kernels/paged_decode_indices.py
"""V4 paged-decode index scatter — single Triton kernel writes SWA window-
prefix paged offsets into the three ragged-packed destination buffers
(`kv_indices_swa` / `kv_indices_csa` / `kv_indices_hca`).
@@ -1,6 +1,9 @@
# SPDX-License-Identifier: MIT
# Copyright (C) 2024-2026, Advanced Micro Devices, Inc. All rights reserved.
# The following kernel is imported from ATOM.
# Source: atom/model_ops/v4_kernels/paged_prefill.py
"""Sparse prefill attention with two KV sources: paged `unified_kv` (history)
and per-fwd flat `kv` (current chunk's input).
@@ -375,6 +375,7 @@ class DeepSeekV4LayerItem(NamedTuple):
compress_kv_pool: Optional[DeepSeekV4SingleKVPool] = None
# The following kv pool follows ATOM's unified_kv kernel layout.
class DeepSeekV4UnifiedKVPool:
"""
Layout: