From 95848d086710dc76278ef721fff654d0c2bae8ba Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 21 Oct 2026 18:55:11 -0600 Subject: [PATCH 01/22] feat(rocke): runtime_layout mode for the gfx942/gfx950 tiled 2D unified attention Adds UnifiedAttention2DTiledSpec.runtime_layout on top of the runtime shape kernargs the tiled 2D bodies already take (num_query_heads, num_kv_heads, sliding_window, and the cu_q search trip count derived from num_seqs). With it, the Q/O/K/V strides and a dense-or-ragged Q are kernel arguments too; the page tables and seq lens are read on device; a grid-stride loop covers every q block; page-table and K/V reads stop at seq_len; rows with no visible key write zeros, and so do the query rows a sequence owns past seq_lens_q (padding), as the hipDNN contract requires. The mode appends 15 kernel arguments after the runtime shape kernargs. Its window mask is always on, with the sliding_window kernarg as its size, and its ragged q-block search uses the shared runtime trip count (no iteration for a dense Q). K pages through block_tables_ptr and V through the appended block_tables_v_ptr, which shares block_table_stride and may be the same pointer, so cuDNN-style graphs with separate K and V page tables are served. K/V use one 64-bit buffer resource per page, built once per tile load from one page-table read: a runtime_layout tile never spans more than one page. On gfx942 this is the per-page mechanism of the i64 path (#14349), which the runtime_layout loaders sit beside. runtime_layout=False emits unchanged IR. Additive bias (gfx950), the optional LSE output (emit_lse) and the gfx950 longest-first query-block order (use_qblock_reverse) are not combinable with runtime_layout and are rejected by the runtime-layout checks; the gfx942 4-warp GQA builder refuses a runtime_layout spec. On gfx942 the support gate and both builders (Python and C++) charge runtime_layout_lds_bytes against ArchTarget lds_capacity_bytes and refuse a spec over it. The runtime-layout checks take their head-count rule and text from the shared check_head_counts (rocke_attention_check_head_counts in C++). The rocKE C++ twin mirrors the mode op for op. rocke_attention_tiled_2d_spec_t gains runtime_layout, so ROCKE_ABI_VERSION and BINARY_ABI move to 13. Dispatch never sets runtime_layout: it is a semantic field (no sweep varies it), and while it is off it stays out of the tuning spec's cache key and config defaults, so every spec_hash, config_key and stored pin is unchanged. The CPU checks of the two runtime_layout test files run in the new rocke_library_attention_runtime_layout_pytest CTest entry (-m "not gpu"); their GPU numerics run in rocke_library_gpu_pytest. The scenarios include sequences with 0 < seq_len < q_len, whose leading rows see no key. --- ...ROCKE_ENGINE_test_categories_external.yaml | 2 + .../library/dispatch/attention/common.py | 7 +- .../dispatch/attention/tuning_specs.py | 3 + .../dispatch/attention/unified_rules.py | 6 +- .../kernels/gfx942/attention_tiled_2d.py | 577 +++++++++++++-- .../kernels/gfx950/attention_tiled_2d.py | 495 +++++++++++-- .../parity/gfx942_attention_tiled_2d_emit.c | 62 ++ .../parity/gfx942_attention_tiled_2d_emit.py | 47 ++ .../parity/gfx950_attention_tiled_2d_emit.c | 56 ++ .../parity/gfx950_attention_tiled_2d_emit.py | 42 ++ ...ttention_tiled_2d_runtime_layout_gfx950.py | 669 +++++++++++++++++ .../test_gfx942_attention_runtime_layout.py | 683 ++++++++++++++++++ .../rocke/platform/CMakeLists.txt | 23 + .../attention_tiled_parity_configs.py | 91 +++ .../cpp/bindings/rocke_engine_attention.cpp | 2 + .../rocke/platform/cpp/include/rocke/abi.h | 8 +- ...ocke.instances.gfx942.attention_tiled_2d.h | 25 + ...instance_attention_tiled_2d_rtl_internal.h | 84 +++ ...tance_gfx942_attention_tiled_2d_internal.h | 31 +- ...tance_gfx950_attention_tiled_2d_internal.h | 21 + .../instances/gfx942/attention_tiled_2d.cpp | 237 ++++++ .../attention_tiled_2d_ctx_prologue.cpp | 201 +++++- .../gfx942/attention_tiled_2d_epilogue.cpp | 43 +- .../attention_tiled_2d_kv_body_qk_softmax.cpp | 2 +- ...ttention_tiled_2d_kv_descriptors_loads.cpp | 139 +++- .../attention_tiled_2d_loop_scaffold.cpp | 12 +- .../attention_tiled_2d_public_entry_glue.cpp | 1 + .../attention_tiled_2d_q_load_gather.cpp | 34 +- ...attention_tiled_2d_fastkv_regp_helpers.cpp | 1 + ...attention_tiled_2d_kv_body_pv_epilogue.cpp | 57 +- .../attention_tiled_2d_kv_body_qk_softmax.cpp | 6 +- ...ttention_tiled_2d_kv_descriptors_loads.cpp | 122 +++- .../attention_tiled_2d_public_entry_glue.cpp | 136 +++- .../attention_tiled_2d_q_load_gather.cpp | 35 +- .../python/rocke/portable_ir/src/abi.py | 2 +- .../differential/golden/llvm_gfx_all.json | 100 +++ 36 files changed, 3888 insertions(+), 174 deletions(-) create mode 100644 dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py create mode 100644 dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py create mode 100644 dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h diff --git a/dnn-providers/hip-kernel-provider/ROCKE_ENGINE_test_categories_external.yaml b/dnn-providers/hip-kernel-provider/ROCKE_ENGINE_test_categories_external.yaml index 0b9e75c89986..cf7a0beeffc1 100644 --- a/dnn-providers/hip-kernel-provider/ROCKE_ENGINE_test_categories_external.yaml +++ b/dnn-providers/hip-kernel-provider/ROCKE_ENGINE_test_categories_external.yaml @@ -97,6 +97,7 @@ test_categories: - "rocke_library_conv_pytest" - "rocke_library_attention_cpu_pytest" - "rocke_library_attention_cache_key_pytest" + - "rocke_library_attention_runtime_layout_pytest" - "rocke_library_attention_pytest" # Not registered on Windows (see rocke/platform/CMakeLists.txt); the # parser ignores a listed name that has no registered test. @@ -172,6 +173,7 @@ test_categories: - "rocke_library_conv_pytest" - "rocke_library_attention_cpu_pytest" - "rocke_library_attention_cache_key_pytest" + - "rocke_library_attention_runtime_layout_pytest" - "rocke_library_attention_pytest" # Not registered on Windows (see rocke/platform/CMakeLists.txt); the # parser ignores a listed name that has no registered test. diff --git a/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/common.py b/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/common.py index 4cf1011e88c0..052160847ee7 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/common.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/common.py @@ -987,10 +987,15 @@ def items(spec): raise TypeError(f"tuning kernel spec must be a dataclass, got {spec!r}") # An LSE-off reduce leaves out ``emit_lse``, so its key (and the # spec_hash taken over it) is the one stored before the field existed. + # The 2D ``runtime_layout`` flag (hipDNN's paged engine; dispatch + # never sets it) is left out the same way while it is off. return tuple( (f.name, repr(getattr(spec, f.name))) for f in fields(spec) - if not (f.name == "emit_lse" and not spec.emit_lse) + if not ( + f.name in ("emit_lse", "runtime_layout") + and not getattr(spec, f.name) + ) ) return ( diff --git a/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/tuning_specs.py b/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/tuning_specs.py index cff616a327ff..bdc5ccf2d20e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/tuning_specs.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/tuning_specs.py @@ -180,6 +180,9 @@ def _semantic_fields( "causal_top_left", "right_bound", "emit_lse", + # hipDNN's paged engine selects it (kernels/*/attention_tiled_2d.py); + # dispatch never does, and a sweep must not vary it. + "runtime_layout", } ) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/unified_rules.py b/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/unified_rules.py index a81cc2d56a9e..b962f5086be0 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/unified_rules.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention/unified_rules.py @@ -392,11 +392,13 @@ def defaults(self, base, kernel): # ``emit_lse`` is an output the problem selects, not a default that # knobs are a delta against: keeping it out of both the 2D kernel # and the split-KV reduce defaults leaves every config_key, and so - # every stored pin, as before the field existed. + # every stored pin, as before the field existed. The 2D + # ``runtime_layout`` flag (hipDNN's paged engine; never a knob) is + # kept out of the kernel defaults for the same reason. "kernel": { name: value for name, value in _declared_defaults(type(kernel.kernel_spec)) - if name not in recorded and name != "emit_lse" + if name not in recorded and name not in ("emit_lse", "runtime_layout") }, "reduce": ( None diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py index 8285c3b76753..70a07e8cf29c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py @@ -503,12 +503,36 @@ class UnifiedAttention2DTiledSpec: # [total_q, num_query_heads, 1] through a trailing ``lse_ptr`` argument. # Off by default; off emits no new IR, so shipped kernels are unchanged. emit_lse: bool = field(default=False, kw_only=True) + # Runtime-layout mode (hipDNN paged/ragged SDPA engine, vLLM KV-cache view). + # The head counts, the window and the batch's search trip count are already + # kernargs (``RUNTIME_KERNARG_FIELDS``, ``RUNTIME_SEARCH_ITERS``). When True + # the kernel also takes 15 appended kernargs (block_tables_v_ptr, + # seq_lens_q_ptr, has_seq_lens_q, q_uniform_len, the Q/O/KV element strides, + # kv_block_span_bytes, q_block_grid) and serves a dense-or-ragged Q and a + # real paged-KV layout from one compiled object: Q/O/KV strides are runtime, + # K pages through ``block_tables_ptr`` and V through ``block_tables_v_ptr`` + # (the same pointer, or a second table with the same row stride), the + # per-sequence Q/O base and the KV block term are 64-bit (one buffer + # resource per page), block-table reads past ceil(seq_len/BS) and K/V reads + # past seq_len are masked, a dense Q's rows past seq_lens_q (padding) and + # rows with no visible key store zeros, a ragged Q stores only its live + # rows (the first seq_lens_q rows of its block), and the q-block grid + # is walked with a grid-stride loop. The window mask is always on, with the + # ``sliding_window`` kernarg as its size, so the spec's ``sliding_window`` + # must be 0. Only the default narrow 16x16x16 path is supported; see + # ``_runtime_layout_reject_reason``. ``tile_size`` may divide ``block_size`` + # here (sub-block tiles), which the fixed-layout path does not allow. + # Default False -> every existing kernel is byte-identical. + runtime_layout: bool = False def __post_init__(self): if type(self.emit_lse) is not bool: raise ValueError( f"emit_lse must be a bool, got {type(self.emit_lse).__name__}" ) + _rtl_reason = _runtime_layout_reject_reason(self) + if _rtl_reason is not None: + raise ValueError(_rtl_reason) # gfx942 (CDNA3) variant: the narrow ``16x16x16`` default path only. # The wide-K (32x32x16 migration) and transpose-read / native-fp8 # experimental knobs all depend on gfx950-only ISA (wide-K MFMA atoms, @@ -938,7 +962,7 @@ def __post_init__(self): ) if self.use_alibi or self.use_qq_bias: raise ValueError("use_register_pv v1 does not support ALiBi or QQ bias") - if self.tile_size is not None: + if self.tile_size is not None and not self.runtime_layout: if self.tile_size <= 0 or self.tile_size % self.block_size != 0: raise ValueError( f"tile_size must be a positive multiple of block_size " @@ -1081,9 +1105,235 @@ def kernel_name(self) -> str: "cmps" if self.use_causal_mask_phase_split else "", "k1buf" if self.use_k_single_buffer else "", "lse" if self.emit_lse else "", + "rtl" if self.runtime_layout else "", ) +# --------------------------------------------------------------------------- +# Runtime-layout mode (``spec.runtime_layout``) +# --------------------------------------------------------------------------- + +# Spec flags that bake a layout, need per-head side inputs, or select a +# non-default pipeline; runtime_layout supports none of them. +_RTL_INCOMPATIBLE_FLAGS = ( + "use_sinks", + "has_softcap", + "use_alibi", + "use_qq_bias", + "use_fp8_mfma_qk", + "use_fp8_mfma_pv", + "use_register_pv", + "use_mfma_32x32", + "use_mfma_32x32x8", + "use_transposed_qk_32x32", + "use_transposed_scalar_state", + "use_transposed_invariant_hoist", + "use_transposed_mask_once", + "use_transposed_half_local_pv", + "use_mfma32_skip_legacy_qreg", + "use_transposed_mask_limit", + "use_grouped_kv2_softmax", + "use_fast_paged_kv_desc", + "use_i64_kv_addr", + "use_early_v_schedule", + "use_agpr_alloc_zero", + "use_conflict_free_v", + "use_conflict_free_v_store", + "use_k_single_buffer", + "use_k_sliced_ring", + "use_k_sliced_ldsseq", + "use_iglp_opt", + "use_qk_pv_sched_group_barrier", + "use_q_direct_global", + "use_v_hbm_direct", + "use_k_hbm_direct", + "use_global_load_lds_k", + "use_q_major_grid", + "use_causal_mask_phase_split", + "emit_lse", +) + +# Buffer voffset used for masked K/V lanes: beyond any ``kv_block_span_bytes`` +# (an i32 kernarg), so the buffer range check returns 0 without a memory access. +_RTL_KV_OOB_VOFF = 0x7FFFFFF0 + +# Kernargs appended after the fixed ones and the runtime shape kernargs +# (``RUNTIME_KERNARG_FIELDS``: num_query_heads, num_kv_heads, sliding_window), +# as (name, type) in ABI order. ``block_tables_v_ptr`` is V's block table; it +# shares ``block_table_stride`` with ``block_tables_ptr`` (K's table) and may be +# the same pointer. ``q_uniform_len`` is L > 0 for a dense Q (L rows per +# sequence) and 0 for a ragged one, whose offsets must be non-decreasing with +# off[b+1] - off[b] >= seq_lens_q[b] and off[B] the end of the last block. +RUNTIME_LAYOUT_EXTRA_ARGS = ( + ("block_tables_v_ptr", "ptr"), + ("seq_lens_q_ptr", "ptr"), + ("has_seq_lens_q", "i32"), + ("q_uniform_len", "i32"), + ("q_seq_stride", "i32"), + ("q_tok_stride", "i32"), + ("q_head_stride", "i32"), + ("o_seq_stride", "i32"), + ("o_tok_stride", "i32"), + ("o_head_stride", "i32"), + ("kv_block_stride", "i32"), + ("kv_tok_stride", "i32"), + ("kv_head_stride", "i32"), + ("kv_block_span_bytes", "i32"), + ("q_block_grid", "i32"), +) + + +def _runtime_layout_reject_reason(spec: "UnifiedAttention2DTiledSpec") -> Optional[str]: + """Why ``spec`` is not a valid runtime_layout spec (None when valid/unused).""" + if not spec.runtime_layout: + return None + bad = [name for name in _RTL_INCOMPATIBLE_FLAGS if getattr(spec, name)] + if spec.kv_storage_dtype is not None: + bad.append("kv_storage_dtype") + if spec.sliding_window != 0: + bad.append("sliding_window != 0 (the window is a runtime kernarg)") + if spec.block_m_per_warp != 16: + bad.append("block_m_per_warp != 16") + if bad: + return "runtime_layout is incompatible with: " + ", ".join(bad) + ok, heads_reason = check_head_counts(spec.num_query_heads, spec.num_kv_heads) + if not ok: + return heads_reason + if spec.tile_size is not None: + t = spec.tile_size + if t < 16 or t % 16 != 0 or t > spec.block_size or spec.block_size % t != 0: + return ( + "runtime_layout tile_size must be a multiple of 16 that divides " + f"block_size (got tile_size={t}, block_size={spec.block_size})" + ) + return None + + +def runtime_layout_lds_bytes(*, head_size: int, tile_size: int, num_warps: int) -> int: + """Static LDS of a runtime_layout kernel (fp16/bf16). + + Every allocation is touched inside the q-block grid-stride loop, so the + LDS packer cannot alias any of them: K double buffer + V (with the + bank-deconflict row pad, an upper bound) + P_lds + Q_lds (only when Q does + not fit in K_lds) + Acc_lds. + """ + t, hd, bm = tile_size, head_size, num_warps * 16 + k_lds = 2 * t * hd * 2 + v_lds = t * (hd + 8) * 2 + p_lds = bm * (t + 8) * 2 + q_lds = 0 if bm <= 2 * t else bm * hd * 2 + acc_lds = bm * (32 if hd <= 64 else hd) * 2 + return k_lds + v_lds + p_lds + q_lds + acc_lds + + +def runtime_layout_geometry( + head_size: int, block_size: int, *, arch: str = "gfx942" +) -> Optional[Tuple[int, Optional[int]]]: + """``(num_warps, tile_size)`` the runtime_layout catalog uses. + + Largest CTA (num_warps 4, 2, 1) first, then the largest KV tile that + divides ``block_size`` and fits the arch LDS budget. ``tile_size`` is + None when the tile is one whole cache block. None when nothing fits. + """ + from ..common.attention_arch import attention_lds_capacity_bytes + + cap = attention_lds_capacity_bytes(arch) + for nw in (4, 2, 1): + t = block_size + while t >= 16: + if (t * head_size) % (nw * 64 * 2) == 0 and runtime_layout_lds_bytes( + head_size=head_size, tile_size=t, num_warps=nw + ) <= cap: + return nw, (None if t == block_size else t) + t //= 2 + return None + + +def runtime_layout_catalog_spec( + *, + dtype: str, + head_size: int, + block_size: int, + num_queries_per_kv: int, + arch: str = "gfx942", +) -> UnifiedAttention2DTiledSpec: + """The catalog spec for one (dtype, head_size, block_size, QPK) object.""" + geom = runtime_layout_geometry(head_size, block_size, arch=arch) + if geom is None: + raise ValueError( + f"no runtime_layout geometry fits head_size={head_size} " + f"block_size={block_size} on {arch}" + ) + num_warps, tile_size = geom + return UnifiedAttention2DTiledSpec( + head_size=head_size, + block_size=block_size, + num_query_heads=num_queries_per_kv, + num_kv_heads=1, + dtype=dtype, + use_sinks=False, + sliding_window=0, + has_softcap=False, + num_warps=num_warps, + tile_size=tile_size, + runtime_layout=True, + ) + + +def _supports_runtime_layout( + spec: UnifiedAttention2DTiledSpec, *, arch: str, use_d256_fast: bool +) -> Tuple[bool, str]: + if use_d256_fast: + return False, "runtime_layout is not supported by the gfx942 4-warp GQA builder" + reason = _runtime_layout_reject_reason(spec) + if reason is not None: + return False, reason + from ..common.attention_arch import ( + attention_lds_capacity_bytes, + validate_tiled_attention_arch, + ) + + arch_ok, arch_reason = validate_tiled_attention_arch(arch) + if not arch_ok: + return False, arch_reason + if spec.dtype not in ("fp16", "bf16"): + return False, f"runtime_layout supports fp16/bf16 (got {spec.dtype!r})" + if spec.head_size not in (64, 128, 256): + return ( + False, + f"runtime_layout head_size must be 64/128/256 (got {spec.head_size})", + ) + if spec.block_size not in (16, 32, 64): + return ( + False, + f"runtime_layout block_size must be 16/32/64 (got {spec.block_size})", + ) + qpk = spec.num_queries_per_kv + if not 1 <= qpk <= 16: + return False, f"runtime_layout needs 1<=num_queries_per_kv<=16 (got {qpk})" + if spec.num_warps not in (1, 2, 4, 8): + return False, f"runtime_layout num_warps must be 1/2/4/8 (got {spec.num_warps})" + t = spec.tile_size_eff + threads = spec.num_warps * 64 + if (t * spec.head_size) % (threads * 2) != 0: + return ( + False, + f"runtime_layout: tile {t}x{spec.head_size} is not a whole number of " + f"{threads}-lane async K/V copies", + ) + lds = runtime_layout_lds_bytes( + head_size=spec.head_size, tile_size=t, num_warps=spec.num_warps + ) + cap = attention_lds_capacity_bytes(arch) + if lds > cap: + return ( + False, + f"runtime_layout: estimated LDS {lds} B (num_warps={spec.num_warps}, " + f"T={t}, HD={spec.head_size}) exceeds the {arch} {cap} B LDS budget", + ) + return True, "supported" + + def supports_tiled_2d( *, head_size: int, @@ -1395,6 +1645,21 @@ def build_unified_attention_2d_tiled( raise NotImplementedError( f"gfx942 tiled 2D kernel requires a 16x16x16 {_a_dt} MFMA atom on {arch}" ) + if spec.runtime_layout: + # The supports gate's LDS check, repeated so a direct build of an + # over-budget spec fails here (the C builder makes the same check). + _rtl_lds = runtime_layout_lds_bytes( + head_size=spec.head_size, + tile_size=spec.tile_size_eff, + num_warps=spec.num_warps, + ) + _rtl_cap = ArchTarget.from_gfx(arch).lds_capacity_bytes + if _rtl_lds > _rtl_cap: + raise ValueError( + f"runtime_layout: estimated LDS {_rtl_lds} B (num_warps={spec.num_warps}, " + f"T={spec.tile_size_eff}, HD={spec.head_size}) exceeds the {arch} " + f"{_rtl_cap} B LDS budget" + ) HD = spec.head_size T = spec.tile_size_eff @@ -1612,6 +1877,17 @@ def build_unified_attention_2d_tiled( if spec.emit_lse else None ) + RTL = spec.runtime_layout + if RTL: + # Appended runtime-layout kernargs (ABI order: RUNTIME_LAYOUT_EXTRA_ARGS). + rtl_p = {} + for _rtl_name, _rtl_ty in RUNTIME_LAYOUT_EXTRA_ARGS: + if _rtl_ty == "ptr": + rtl_p[_rtl_name] = b.param( + _rtl_name, PtrType(I32, "global"), readonly=True, align=4 + ) + else: + rtl_p[_rtl_name] = b.param(_rtl_name, I32) if spec.use_q_major_grid: q_block_global_idx = b.block_id_x() @@ -1633,25 +1909,146 @@ def build_unified_attention_2d_tiled( wave_row_base = b.mul(wave_id, b.const_i32(BLOCK_M_PER_WARP)) # ---------------- seq lookup ---------------- - seq_idx = binary_search_seq_idx( - b, - cu_q, - q_block_global_idx, - num_seqs_p, - block_q=BLOCK_Q, - iterations=binary_search_seq_idx_trip_count(b, num_seqs_p), - ) - cu_q_start = b.global_load_i32(cu_q, seq_idx) - cu_q_stop = b.global_load_i32(cu_q, b.add(seq_idx, b.const_i32(1))) - cur_batch_q_len = b.sub(cu_q_stop, cu_q_start) - q_block_start_idx = b.add(b.div(cu_q_start, b.const_i32(BLOCK_Q)), seq_idx) - q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) - seq_len = b.global_load_i32(seq_lens, seq_idx) - context_len = b.sub(seq_len, cur_batch_q_len) - - qb_start_pos = b.mul(q_block_local_idx, b.const_i32(BLOCK_Q)) - with b.scf_if(b.cmp_ge(qb_start_pos, cur_batch_q_len)): - b.ret() + if RTL: + # q-block mapping (DENSE when q_uniform_len > 0, else RAGGED) and the + # grid-stride loop ``qb = blockIdx.y; qb < total; qb += q_block_grid``. + # RAGGED finds a q-block's sequence by binary search over the offsets, + # which needs non-decreasing origins, off[b+1] - off[b] >= + # seq_lens_q[b] and off[B] the end of the last sequence's block. + # The loop and the "block has rows" branch are entered here and closed + # after the epilogue; both conditions are CTA-uniform, so the barriers + # inside are reached by every wave or by none. + rtl_q_len_u = rtl_p["q_uniform_len"] + rtl_dense = b.cmp_gt(rtl_q_len_u, b.const_i32(0)) + rtl_ragged = b.cmp_eq(rtl_q_len_u, b.const_i32(0)) + rtl_has_lq = b.cmp_ne(rtl_p["has_seq_lens_q"], b.const_i32(0)) + rtl_bps = b.select( + rtl_dense, + b.div(b.add(rtl_q_len_u, b.const_i32(BLOCK_Q - 1)), b.const_i32(BLOCK_Q)), + b.const_i32(1), + ) + rtl_off_end = b.masked_global_load( + cu_q, num_seqs_p, rtl_ragged, b.const_i32(0), dtype=I32, align=4 + ) + rtl_total_q_blocks = b.select( + rtl_dense, + b.mul(num_seqs_p, rtl_bps), + b.add(b.div(rtl_off_end, b.const_i32(BLOCK_Q)), num_seqs_p), + ) + rtl_qb_loop = b.scf_for( + q_block_global_idx, + rtl_total_q_blocks, + rtl_p["q_block_grid"], + iv_name="rtl_qb", + ) + q_block_global_idx = rtl_qb_loop.__enter__() + # DENSE maps q-blocks to sequences arithmetically, so its search runs + # no iteration and never dereferences ``query_start_len_ptr``. + seq_idx_ragged = binary_search_seq_idx( + b, + cu_q, + q_block_global_idx, + num_seqs_p, + block_q=BLOCK_Q, + iterations=b.select( + rtl_dense, + b.const_i32(0), + binary_search_seq_idx_trip_count(b, num_seqs_p), + ), + ) + seq_idx_dense = b.div(q_block_global_idx, rtl_bps) + seq_idx = b.select(rtl_dense, seq_idx_dense, seq_idx_ragged) + # A q-block before the first origin (qb < off[0] / BLOCK_Q) finds no + # sequence (-1): it reads sequence 0's entries and writes no row. Its + # start position is negative, so its row count is INT32_MIN, below it. + rtl_seq_ok = b.cmp_ge(seq_idx, b.const_i32(0)) + seq_idx = b.smax(seq_idx, b.const_i32(0)) + rtl_off_start = b.masked_global_load( + cu_q, seq_idx, rtl_ragged, b.const_i32(0), dtype=I32, align=4 + ) + rtl_off_stop = b.masked_global_load( + cu_q, + b.add(seq_idx, b.const_i32(1)), + rtl_ragged, + b.const_i32(0), + dtype=I32, + align=4, + ) + rtl_lq = b.masked_global_load( + rtl_p["seq_lens_q_ptr"], + seq_idx, + rtl_has_lq, + b.const_i32(0), + dtype=I32, + align=4, + ) + # ``rtl_owned``: the rows this sequence's block spans in Q/O (DENSE: L; + # RAGGED: off[seq+1] - off[seq]). ``cur_batch_q_len``: the live rows, + # seq_lens_q[seq] when given (never past the block). ``rtl_q_rows``: + # the rows the kernel writes. A dense Q writes its padding rows (owned + # rows past the live ones) as zeros; a ragged Q writes only its live + # rows, since rows of the block past seq_lens_q belong to no sequence + # and the last one's may lie past the end of O. + rtl_owned = b.select(rtl_dense, rtl_q_len_u, b.sub(rtl_off_stop, rtl_off_start)) + cur_batch_q_len = b.select(rtl_has_lq, b.smin(rtl_owned, rtl_lq), rtl_owned) + rtl_q_rows = b.select(rtl_dense, rtl_q_len_u, cur_batch_q_len) + rtl_q_rows = b.select(rtl_seq_ok, rtl_q_rows, b.const_i32(-(2**31))) + # Sequence base index ``sb`` of the Q/O addressing. + rtl_seq_base_idx = b.select(rtl_dense, seq_idx, rtl_off_start) + q_block_start_idx = b.select( + rtl_dense, + b.mul(seq_idx, rtl_bps), + b.add(b.div(rtl_off_start, b.const_i32(BLOCK_Q)), seq_idx), + ) + q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) + seq_len = b.global_load_i32(seq_lens, seq_idx) + context_len = b.sub(seq_len, cur_batch_q_len) + qb_start_pos = b.mul(q_block_local_idx, b.const_i32(BLOCK_Q)) + rtl_rows_if = b.scf_if(b.cmp_lt(qb_start_pos, rtl_q_rows)) + rtl_rows_if.__enter__() + # 64-bit per-sequence Q/O bases; within-sequence offsets stay i32. + _rtl_sb64 = b.zext(rtl_seq_base_idx, I64) + _q_src = b.global_ptr_add( + query, + b.shl(b.mul(_rtl_sb64, b.zext(rtl_p["q_seq_stride"], I64)), b.const_i64(1)), + ) + _o_dst = b.global_ptr_add( + output, + b.shl(b.mul(_rtl_sb64, b.zext(rtl_p["o_seq_stride"], I64)), b.const_i64(1)), + ) + rtl_q_desc = DynamicTensorDescriptor.create( + "rtl_q", + coord_names=("token", "head", "dim"), + strides=[rtl_p["q_tok_stride"], rtl_p["q_head_stride"], b.const_i32(1)], + ) + rtl_o_desc = DynamicTensorDescriptor.create( + "rtl_o", + coord_names=("token", "head", "dim"), + strides=[rtl_p["o_tok_stride"], rtl_p["o_head_stride"], b.const_i32(1)], + ) + cu_q_start = None # RAGGED/DENSE base is folded into _q_src/_o_dst + else: + seq_idx = binary_search_seq_idx( + b, + cu_q, + q_block_global_idx, + num_seqs_p, + block_q=BLOCK_Q, + iterations=binary_search_seq_idx_trip_count(b, num_seqs_p), + ) + cu_q_start = b.global_load_i32(cu_q, seq_idx) + cu_q_stop = b.global_load_i32(cu_q, b.add(seq_idx, b.const_i32(1))) + cur_batch_q_len = b.sub(cu_q_stop, cu_q_start) + q_block_start_idx = b.add(b.div(cu_q_start, b.const_i32(BLOCK_Q)), seq_idx) + q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) + seq_len = b.global_load_i32(seq_lens, seq_idx) + context_len = b.sub(seq_len, cur_batch_q_len) + + qb_start_pos = b.mul(q_block_local_idx, b.const_i32(BLOCK_Q)) + with b.scf_if(b.cmp_ge(qb_start_pos, cur_batch_q_len)): + b.ret() + _q_src = query + _o_dst = output # ---------------- LDS layout ---------------- # Q is loaded once. K and V are double-buffered [2, T, HD] in natural @@ -2225,13 +2622,18 @@ def _v_load1(v_buf: Value, v_row: Value, v_n_col: Value) -> Value: ) q_pos_safe = b.select(qmask_t, q_pos_t, b.const_i32(0)) qh_safe = b.select(qmask_t, qh_t, b.const_i32(0)) - q_off_base, _ = q_desc.offset( - b, - token=b.add(cu_q_start, q_pos_safe), - head=qh_safe, - dim=b.const_i32(0), - ) - v8 = b.global_load_vN(query, b.add(q_off_base, Q_col), dtype, 8, align=16) + if RTL: + q_off_base, _ = rtl_q_desc.offset( + b, token=q_pos_safe, head=qh_safe, dim=b.const_i32(0) + ) + else: + q_off_base, _ = q_desc.offset( + b, + token=b.add(cu_q_start, q_pos_safe), + head=qh_safe, + dim=b.const_i32(0), + ) + v8 = b.global_load_vN(_q_src, b.add(q_off_base, Q_col), dtype, 8, align=16) # When Q is aliased to K_lds (single shared scratch), the store # goes through ``[buf, row_in_buf, col]`` indexing of the K_lds # 3D buffer. ``buf = Q_row // T`` selects which K_lds slot, @@ -2264,8 +2666,13 @@ def _v_load1(v_buf: Value, v_row: Value, v_n_col: Value) -> Value: msp_raw = b.add(b.add(context_len, qb_start_pos), b.const_i32(bm1_div_nqk + 1)) max_seq_prefix_len = b.select(b.cmp_lt(msp_raw, seq_len), msp_raw, seq_len) num_tiles = b.div(b.add(max_seq_prefix_len, b.const_i32(T - 1)), b.const_i32(T)) + if RTL: + # A q-block of padding rows only reads no key: its rows store zeros. + num_tiles = b.select( + b.cmp_lt(qb_start_pos, cur_batch_q_len), num_tiles, b.const_i32(0) + ) - if SLIDING_WINDOW > 0: + if SLIDING_WINDOW > 0 or RTL: qpos_hi_raw = b.add(qb_start_pos, b.const_i32(bm1_div_nqk)) cur_q_minus1 = b.sub(cur_batch_q_len, b.const_i32(1)) qpos_hi = b.select( @@ -2675,7 +3082,7 @@ def _fast_paged_kv_voff(call: int, block0: Value, block1: Value): block_b = b.shl(physical, b.const_i32(15)) # 32 * 8 * 64 * 2 (i32) return None, b.add(block_b, within) - else: + elif not RTL: _kv_base = DynamicTensorDescriptor.create( "paged_kv_bytes", coord_names=("physical_block", "token", "kv_head", "dim"), @@ -2780,6 +3187,63 @@ def _page_voff(call: int, kv_head_b: Value) -> Value: dim = b.mod(half, b.const_i32(HD)) return _kv_page_off(token, dim, kv_head_b) + if RTL: + # Runtime-stride paged K/V (bytes): K and V share all strides. A tile + # never crosses a cache block (``tile_size`` divides ``block_size``), so, + # as on the i64 path above, each tile load reads its page id once and + # builds one buffer resource at the page's 64-bit base, with range + # ``kv_block_span_bytes``. The within-page voffset stays i32 and masked + # lanes (token >= seq_len) read nothing. + rtl_kv_page_stride_b = b.shl( + b.sext(rtl_p["kv_block_stride"], I64), b.const_i64(1) + ) + rtl_kv_desc = DynamicTensorDescriptor.create( + "rtl_kv_page_bytes", + coord_names=("token", "kv_head", "dim"), + strides=[ + b.shl(rtl_p["kv_tok_stride"], b.const_i32(1)), + b.shl(rtl_p["kv_head_stride"], b.const_i32(1)), + b.const_i32(2), + ], + ) + rtl_kv_oob = b.const_i32(_RTL_KV_OOB_VOFF) + # Block-table reads go through a buffer resource so a masked entry + # (position >= ceil(seq_len / BS)) is an out-of-range voffset: it + # returns physical block 0 without touching memory. K pages through + # ``block_tables_ptr``, V through ``block_tables_v_ptr``; both tables + # share ``block_table_stride``. + rtl_bt_rsrc = b.buffer_rsrc(block_tables, big_bytes) + rtl_bt_v_rsrc = b.buffer_rsrc(rtl_p["block_tables_v_ptr"], big_bytes) + + def _rtl_kv_block( + cache: Value, bt_rsrc: Value, kv_tile_idx: Value + ) -> Tuple[Value, Value, Value]: + """(first token, its offset within the cache block, page resource).""" + tok0 = b.mul(kv_tile_idx, b.const_i32(T)) + lblk = b.div(tok0, b.const_i32(BS)) + lblk_tok = b.mul(lblk, b.const_i32(BS)) + blk_ok = b.cmp_lt(lblk_tok, seq_len) + bt_voff = b.select( + blk_ok, b.shl(b.add(seq_base, lblk), b.const_i32(2)), rtl_kv_oob + ) + phys = b.buffer_load_vN(bt_rsrc, bt_voff, zero_soff, I32, 1) + phys = b.to_sgpr_u32(b.vec_extract(phys, 0)) + page = b.global_ptr_add(cache, b.mul(b.zext(phys, I64), rtl_kv_page_stride_b)) + rsrc = b.buffer_rsrc(page, rtl_p["kv_block_span_bytes"]) + return tok0, b.sub(tok0, lblk_tok), rsrc + + def _rtl_kv_call(call: int, blk: Tuple[Value, Value, Value]) -> Tuple[Value, Value]: + """(page resource, voffset) of one async K/V call for this lane.""" + tok0, tok_in_blk0, rsrc = blk + linear_half = b.add(b.const_i32(call * KV_HALVES_PER_CALL), lane_half_base) + tok = b.div(linear_half, b.const_i32(HD)) + dim = b.mod(linear_half, b.const_i32(HD)) + within, _ = rtl_kv_desc.offset( + b, token=b.add(tok_in_blk0, tok), kv_head=kv_head_idx, dim=dim + ) + tok_ok = b.cmp_lt(b.add(tok0, tok), seq_len) + return rsrc, b.select(tok_ok, within, rtl_kv_oob) + def _issue_k_load_runtime(kv_tile_idx: Value, buf_idx: Value) -> None: """Issue async K loads for one tile into K_lds[buf_idx]. @@ -2801,12 +3265,16 @@ def _issue_k_load_runtime(kv_tile_idx: Value, buf_idx: Value) -> None: K_wave_base = b.smem_ptr_add(K_buf_base, wave_lds_offset_i64) if FAST_PAGED_KV_DESC: fast_block0, fast_block1 = _fast_paged_kv_blocks(kv_tile_idx) - if PAGE_RSRC_I64: + elif RTL: + rtl_blk = _rtl_kv_block(key, rtl_bt_rsrc, kv_tile_idx) + elif PAGE_RSRC_I64: page_ptrs, page_rsrcs, kv_head_b = _tile_pages(key, kv_tile_idx) for call in range(kv_calls_per_tile): k_rsrc = key_rsrc k_ptr = key - if FAST_PAGED_KV_DESC: + if RTL: + k_rsrc, voff = _rtl_kv_call(call, rtl_blk) + elif FAST_PAGED_KV_DESC: base_i64, voff = _fast_paged_kv_voff(call, fast_block0, fast_block1) if base_i64 is not None: # I64_KV_ADDR: per-block 64-bit base k_ptr = b.global_ptr_add(key, base_i64) @@ -2936,11 +3404,15 @@ def _issue_v_load_runtime(kv_tile_idx: Value, buf_idx: Value) -> None: V_wave_base = b.smem_ptr_add(V_lds_addr, v_wave_lds_offset_i64) if FAST_PAGED_KV_DESC: fast_block0, fast_block1 = _fast_paged_kv_blocks(kv_tile_idx) - if PAGE_RSRC_I64: + elif RTL: + rtl_blk = _rtl_kv_block(value, rtl_bt_v_rsrc, kv_tile_idx) + elif PAGE_RSRC_I64: _, page_rsrcs, kv_head_b = _tile_pages(value, kv_tile_idx) for call in range(kv_calls_per_tile): v_rsrc = value_rsrc - if FAST_PAGED_KV_DESC: + if RTL: + v_rsrc, voff = _rtl_kv_call(call, rtl_blk) + elif FAST_PAGED_KV_DESC: base_i64, voff = _fast_paged_kv_voff(call, fast_block0, fast_block1) if base_i64 is not None: v_rsrc = b.buffer_rsrc( @@ -4874,7 +5346,7 @@ def _kslot(group_idx: int) -> int: causal_ok = b.cmp_le(col_abs, causal_lim) in_prefix = b.cmp_lt(col_abs, max_seq_prefix_len) m_ok = b.land(b.land(row_ok, causal_ok), in_prefix) - if SLIDING_WINDOW > 0: + if SLIDING_WINDOW > 0 or RTL: dist = b.sub(causal_lim, col_abs) m_ok = b.land(m_ok, b.cmp_lt(dist, sw_const)) s_raw = b.vec_extract(S_n[atom][n], in_atom) @@ -5857,8 +6329,11 @@ def _store_row_lse(row: Value, slot: int, writer: Value) -> None: b.mul(kv_head_idx, b.const_i32(NQK)), b.mod(OUT_ROW_BASE, b.const_i32(NQK)), ) + # Runtime layout stores every row it owns: live rows get their attention, + # and a dense Q's padding rows (past seq_lens_q) were masked like keyless + # rows, so they store zeros. A ragged Q owns only its live rows. _op_mask_inner = b.land( - b.cmp_lt(op_pos, cur_batch_q_len), + b.cmp_lt(op_pos, rtl_q_rows if RTL else cur_batch_q_len), b.cmp_lt(op_qh, num_qh_p), ) op_mask = ( @@ -5866,12 +6341,15 @@ def _store_row_lse(row: Value, slot: int, writer: Value) -> None: if VALID_ROWS < BLOCK_M else _op_mask_inner ) - out_base, _ = q_desc.offset( - b, - token=b.add(cu_q_start, op_pos), - head=op_qh, - dim=b.const_i32(0), - ) + if RTL: + out_base, _ = rtl_o_desc.offset(b, token=op_pos, head=op_qh, dim=b.const_i32(0)) + else: + out_base, _ = q_desc.offset( + b, + token=b.add(cu_q_start, op_pos), + head=op_qh, + dim=b.const_i32(0), + ) for stripe in range(OUT_STRIPES): n_start = stripe * N_TILES_PER_STRIPE @@ -5904,7 +6382,7 @@ def _store_row_lse(row: Value, slot: int, writer: Value) -> None: out_col = b.add(b.const_i32(stripe * OUT_STRIPE_COLS), col_in_stripe) with b.scf_if(op_mask): b.global_store_vN( - output, b.add(out_base, out_col), v8h, OUT_VEC, align=16 + _o_dst, b.add(out_base, out_col), v8h, OUT_VEC, align=16 ) # ---- stage 3: sync so the next stripe can overwrite Acc_lds ---- if stripe + 1 < OUT_STRIPES: @@ -5921,6 +6399,13 @@ def _store_row_lse(row: Value, slot: int, writer: Value) -> None: writer16 = b.cmp_eq(lane_col, b.const_i32(0)) for r in range(SOFTMAX_STATE_SLOTS): _store_row_lse(b.add(wave_row_base, _in_warp_row(r)), r, writer16) + if RTL: + # Close the "block has rows" branch, then fence LDS reuse before the + # next grid-stride q-block (its Q staging and K/V DMA rewrite the slabs + # this q-block's epilogue just read), then close the q-block loop. + rtl_rows_if.__exit__(None, None, None) + b.sync() + rtl_qb_loop.__exit__(None, None, None) return b.kernel @@ -6274,6 +6759,12 @@ def build_gfx942_4warp_gqa( # This body has no LSE store; refuse rather than build a kernel that # carries the "lse" name but takes no lse_ptr and writes nothing. raise NotImplementedError(_GFX942_4WARP_LSE_REFUSAL) + if spec.runtime_layout: + # The 4-warp body reads the fixed-layout kernargs only; refuse rather than + # build an "_rtl" kernel that ignores the runtime layout. + raise NotImplementedError( + "runtime_layout is not supported by the gfx942 4-warp GQA builder" + ) if spec.use_i64_kv_addr: # K/V are i32 element offsets. Refuse rather than emit an i32 kernel # under a spec that claims i64; dispatch keeps the flag off through @@ -6886,6 +7377,8 @@ def _supports_tiled_2d_spec( ok, reason = check_head_counts(spec.num_query_heads, spec.num_kv_heads) if not ok: return False, reason + if spec.runtime_layout: + return _supports_runtime_layout(spec, arch=arch, use_d256_fast=use_d256_fast) use_fp8 = spec.kv_storage_dtype is not None return supports_tiled_2d( head_size=spec.head_size, diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index 262f0ce4c0a0..b3c28f7e63ba 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -525,6 +525,22 @@ class UnifiedAttention2DTiledSpec: # [total_q, num_query_heads, 1] through a trailing ``lse_ptr`` argument. # Off by default; off emits no new IR, so shipped kernels are unchanged. emit_lse: bool = field(default=False, kw_only=True) + # Runtime-layout mode (hipDNN ``AttentionPagedUnified`` / vLLM KV-cache view). + # The head counts, the window and the batch's search trip count are already + # kernargs (``RUNTIME_KERNARG_FIELDS``, ``RUNTIME_SEARCH_ITERS``). Runtime + # layout adds the Q/O/KV strides, a dense or ragged Q and a real paged KV + # cache as appended kernel arguments (see ``_RTL_PARAMS``), so one compiled + # object serves them all. ``sliding_window`` must be 0 (the window mask is + # always compiled, with the kernarg as its size) and every CTA walks the + # q-block grid with a grid-stride loop. K pages through + # ``block_tables_ptr`` and V through ``block_tables_v_ptr`` (the same + # pointer, or a second table with the same row stride). The KV block term is + # addressed in i64 through one buffer resource per page. A dense Q's rows + # past seq_lens_q (padding) and rows with no visible key store zeros; a + # ragged Q stores only its live rows (the first seq_lens_q rows of its + # block). + # Default False leaves the kernel unchanged. + runtime_layout: bool = False def __post_init__(self): if type(self.emit_lse) is not bool: @@ -545,6 +561,10 @@ def __post_init__(self): "right_bound != 0 is incompatible with use_alibi / use_qq_bias " "(their offsets are defined on the causal diagonal)" ) + if self.runtime_layout: + reason = _runtime_layout_reject_reason(self) + if reason is not None: + raise ValueError(reason) if self.num_warps not in (1, 2, 4, 8): raise ValueError( f"num_warps must be 1, 2, 4, or 8 (got {self.num_warps}). " @@ -1009,9 +1029,154 @@ def kernel_name(self) -> str: "regpv" if self.use_register_pv else "", "qrev" if self.use_qblock_reverse else "", "lse" if self.emit_lse else "", + "rtl" if self.runtime_layout else "", ) +# Kernel arguments appended after the fixed ones and the runtime shape kernargs +# (``RUNTIME_KERNARG_FIELDS``: num_query_heads, num_kv_heads, sliding_window) +# when ``runtime_layout`` is set, in order. All i32 except the ``_ptr`` ones (ptr). Strides are in +# elements; ``kv_block_span_bytes`` is the per-block buffer-resource size. +# ``block_tables_v_ptr`` is V's block table; it shares ``block_table_stride`` +# with ``block_tables_ptr`` (K's table) and may be the same pointer. +# ``q_uniform_len`` is L > 0 for a dense Q (L rows per sequence) and 0 for a +# ragged one, whose offsets must be non-decreasing with off[b+1] - off[b] >= +# seq_lens_q[b] and off[B] the end of the last block. +_RTL_PARAMS = ( + "block_tables_v_ptr", + "seq_lens_q_ptr", + "has_seq_lens_q", + "q_uniform_len", + "q_seq_stride", + "q_tok_stride", + "q_head_stride", + "o_seq_stride", + "o_tok_stride", + "o_head_stride", + "kv_block_stride", + "kv_tok_stride", + "kv_head_stride", + "kv_block_span_bytes", + "q_block_grid", +) + + +def _runtime_layout_reject_reason(spec: "UnifiedAttention2DTiledSpec") -> Optional[str]: + """Why ``spec`` cannot use ``runtime_layout`` (``None`` when it can). + + Runtime-layout mode runs only the default 16x16x32 pipeline with one + paged block per KV tile; every flag that bakes a layout, a schedule built + around a different pipeline, or a feature outside the hipDNN paged SDPA + contract is refused. + """ + ok, heads_reason = check_head_counts(spec.num_query_heads, spec.num_kv_heads) + if not ok: + return heads_reason + if spec.sliding_window != 0: + return ( + "runtime_layout takes the sliding window as a kernarg; " + "spec sliding_window must be 0" + ) + features = { + "use_sinks": spec.use_sinks, + "has_softcap": spec.has_softcap, + "use_alibi": spec.use_alibi, + "use_qq_bias": spec.use_qq_bias, + "use_additive_bias": spec.use_additive_bias, + "kv_storage_dtype (fp8 KV)": spec.kv_storage_dtype is not None, + "use_fp8_mfma_qk": spec.use_fp8_mfma_qk, + "use_fp8_mfma_pv": spec.use_fp8_mfma_pv, + "causal_top_left": spec.causal_top_left, + "right_bound != 0": spec.right_bound != 0, + "emit_lse": spec.emit_lse, + } + for feature, on in features.items(): + if on: + return f"runtime_layout does not support {feature}" + pipeline_flags = { + "use_mfma_32x32": spec.use_mfma_32x32, + "use_transposed_qk_32x32": spec.use_transposed_qk_32x32, + "use_fast_paged_kv_desc": spec.use_fast_paged_kv_desc, + "use_i64_kv_addr (always 64-bit in runtime_layout)": spec.use_i64_kv_addr, + "use_register_pv": spec.use_register_pv, + "use_v_double_buffer": spec.use_v_double_buffer, + "kv_ring_depth != 2": spec.kv_ring_depth != 2, + "use_staggered_iter_wait": spec.use_staggered_iter_wait, + "use_early_v_schedule": spec.use_early_v_schedule, + "use_k_single_buffer": spec.use_k_single_buffer, + "use_grouped_kv2_softmax": spec.use_grouped_kv2_softmax, + "use_q_reread": spec.use_q_reread, + "use_q_direct_reg": spec.use_q_direct_reg, + "use_kq_lds_pad": spec.use_kq_lds_pad, + "use_mask_phase_split": spec.use_mask_phase_split, + "use_agpr_alloc_zero": spec.use_agpr_alloc_zero, + "use_sched_barrier": spec.use_sched_barrier, + "use_softmax_mfma_interleave": spec.use_softmax_mfma_interleave, + # The reversal maps over total_q // BLOCK_Q + num_seqs blocks, not the + # runtime_layout grid-stride range. + "use_qblock_reverse": spec.use_qblock_reverse, + } + for flag, on in pipeline_flags.items(): + if on: + return ( + "runtime_layout runs the default 16x16x32 pipeline; " + f"{flag} is not supported" + ) + if spec.block_m_per_warp != 16: + return "runtime_layout requires block_m_per_warp=16" + if spec.tile_size is not None and spec.tile_size != spec.block_size: + return ( + "runtime_layout requires tile_size == block_size " + "(one paged block per KV tile)" + ) + # Checked before the DMA divisibility below, which divides by it. + if spec.num_warps not in (1, 2, 4, 8): + return ( + "runtime_layout requires num_warps in {1, 2, 4, 8} " + f"(got {spec.num_warps})" + ) + threads = spec.num_warps * 64 + if (spec.block_size * spec.head_size) % (threads * 8) != 0: + return ( + f"runtime_layout: block_size*head_size={spec.block_size * spec.head_size} " + f"must be a multiple of num_warps*512={threads * 8} " + "(whole async-DMA calls per tile)" + ) + return None + + +def runtime_layout_num_warps(head_size: int, block_size: int) -> int: + """The fixed ``num_warps`` of the runtime-layout catalog geometry. + + Four warps (BLOCK_M=64) whenever one tile holds whole 4-warp async-DMA + calls; the single smaller tile (head_size=64, block_size=16) uses two. + """ + for nw in (4, 2, 1): + if (head_size * block_size) % (nw * 64 * 8) == 0: + return nw + raise ValueError( + f"no runtime_layout geometry for head_size={head_size}, block_size={block_size}" + ) + + +def runtime_layout_catalog_spec( + *, dtype: str, head_size: int, block_size: int, num_queries_per_kv: int +) -> "UnifiedAttention2DTiledSpec": + """The runtime-layout spec the hipDNN catalog compiles for one combination.""" + return UnifiedAttention2DTiledSpec( + head_size=head_size, + block_size=block_size, + num_query_heads=num_queries_per_kv, + num_kv_heads=1, + dtype=dtype, + use_sinks=False, + sliding_window=0, + has_softcap=False, + num_warps=runtime_layout_num_warps(head_size, block_size), + runtime_layout=True, + ) + + def supports_tiled_2d( *, head_size: int, @@ -1199,6 +1364,14 @@ def build_unified_attention_2d_tiled( VALID_ROWS = BLOCK_Q * NQK NUM_KV = spec.num_kv_heads SLIDING_WINDOW = spec.sliding_window + # Runtime-layout mode (see the spec field): runtime Hq / window / strides, + # dense-or-ragged q-block mapping and a grid-stride q-block loop. The spec + # already refused every incompatible flag, so the rest of the builder only + # sees the default 16x16x32 pipeline with one paged block per tile. + RTL = spec.runtime_layout + # The window code paths are compiled whenever a window may be active: a + # compile-time window, or always in runtime-layout mode (window kernarg). + SW_ACTIVE = SLIDING_WINDOW > 0 or RTL USE_SOFTCAP = spec.has_softcap USE_SINKS = spec.use_sinks USE_ALIBI = spec.use_alibi @@ -1368,6 +1541,15 @@ def build_unified_attention_2d_tiled( if spec.emit_lse else None ) + rtl = {} + if RTL: + for rtl_name in _RTL_PARAMS: + if rtl_name.endswith("_ptr"): + rtl[rtl_name] = b.param( + rtl_name, PtrType(I32, "global"), readonly=True, align=4 + ) + else: + rtl[rtl_name] = b.param(rtl_name, I32) kv_head_idx = b.block_id_x() q_block_global_idx = b.block_id_y() @@ -1392,24 +1574,123 @@ def build_unified_attention_2d_tiled( wave_row_base = b.mul(wave_id, b.const_i32(BLOCK_M_PER_WARP)) # ---------------- seq lookup ---------------- - seq_idx = binary_search_seq_idx( - b, - cu_q, - q_block_global_idx, - num_seqs_p, - block_q=BLOCK_Q, - iterations=binary_search_seq_idx_trip_count(b, num_seqs_p), - ) - cu_q_start = b.global_load_i32(cu_q, seq_idx) - cu_q_stop = b.global_load_i32(cu_q, b.add(seq_idx, b.const_i32(1))) - cur_batch_q_len = b.sub(cu_q_stop, cu_q_start) - q_block_start_idx = b.add(b.div(cu_q_start, b.const_i32(BLOCK_Q)), seq_idx) - q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) - seq_len = b.global_load_i32(seq_lens, seq_idx) - if spec.causal_top_left: - context_len = b.const_i32(0) - else: + if RTL: + # DENSE (q_uniform_len = L > 0): bps = ceil(L / BLOCK_Q) q-blocks per + # sequence, seq = qb / bps, sequence base token sb = seq. RAGGED + # (L == 0): ``query_start_len_ptr`` holds token offsets off[0..B]; + # seq comes from the q-block binary search, sb = off[seq]. The search + # needs non-decreasing origins, off[b+1] - off[b] >= seq_lens_q[b] + # and off[B] the end of the last sequence's block. DENSE mode never + # dereferences the offsets beyond masked index-0 reads. + rtl_zero = b.const_i32(0) + rtl_one = b.const_i32(1) + rtl_bq = b.const_i32(BLOCK_Q) + q_uniform_len = rtl["q_uniform_len"] + rtl_dense = b.cmp_gt(q_uniform_len, rtl_zero) + rtl_ragged = b.cmp_le(q_uniform_len, rtl_zero) + rtl_has_slq = b.cmp_ne(rtl["has_seq_lens_q"], rtl_zero) + rtl_bps = b.select( + rtl_dense, + b.div(b.add(q_uniform_len, b.const_i32(BLOCK_Q - 1)), rtl_bq), + rtl_one, + ) + rtl_off_total = b.masked_global_load( + cu_q, num_seqs_p, rtl_ragged, rtl_zero, dtype=I32, align=4 + ) + total_q_blocks = b.select( + rtl_dense, + b.mul(num_seqs_p, rtl_bps), + b.add(b.div(rtl_off_total, rtl_bq), num_seqs_p), + ) + # Grid-stride q-block loop: the body below (through the epilogue) runs + # once per q-block ``blockIdx.y + k * q_block_grid``. Entered here and + # closed after the epilogue so the long body keeps its indentation. + rtl_qb_loop = b.scf_for( + q_block_global_idx, total_q_blocks, rtl["q_block_grid"], iv_name="rtl_qb" + ) + q_block_global_idx = rtl_qb_loop.__enter__() + # DENSE maps q-blocks to sequences arithmetically, so its search runs + # no iteration and never dereferences ``query_start_len_ptr``. + seq_idx_ragged = binary_search_seq_idx( + b, + cu_q, + q_block_global_idx, + num_seqs_p, + block_q=BLOCK_Q, + iterations=b.select( + rtl_dense, rtl_zero, binary_search_seq_idx_trip_count(b, num_seqs_p) + ), + ) + seq_idx = b.select( + rtl_dense, b.div(q_block_global_idx, rtl_bps), seq_idx_ragged + ) + # A q-block before the first origin (qb < off[0] / BLOCK_Q) finds no + # sequence (-1): it reads sequence 0's entries and writes no row. Its + # start position is negative, so its row count is INT32_MIN, below it. + rtl_seq_ok = b.cmp_ge(seq_idx, rtl_zero) + seq_idx = b.smax(seq_idx, rtl_zero) + rtl_off_start = b.masked_global_load( + cu_q, seq_idx, rtl_ragged, rtl_zero, dtype=I32, align=4 + ) + rtl_off_stop = b.masked_global_load( + cu_q, b.add(seq_idx, rtl_one), rtl_ragged, rtl_zero, dtype=I32, align=4 + ) + rtl_slq = b.masked_global_load( + rtl["seq_lens_q_ptr"], seq_idx, rtl_has_slq, rtl_zero, dtype=I32, align=4 + ) + # ``rtl_owned``: the rows this sequence's block spans in Q/O (DENSE: L; + # RAGGED: off[seq+1] - off[seq]). ``cur_batch_q_len``: the live rows, + # seq_lens_q[seq] when given (never past the block). ``rtl_q_rows``: + # the rows the kernel writes. A dense Q writes its padding rows (owned + # rows past the live ones) as zeros; a ragged Q writes only its live + # rows, since rows of the block past seq_lens_q belong to no sequence + # and the last one's may lie past the end of O. + rtl_owned = b.select( + rtl_dense, q_uniform_len, b.sub(rtl_off_stop, rtl_off_start) + ) + cur_batch_q_len = b.select(rtl_has_slq, b.smin(rtl_owned, rtl_slq), rtl_owned) + rtl_q_rows = b.select(rtl_dense, q_uniform_len, cur_batch_q_len) + rtl_q_rows = b.select(rtl_seq_ok, rtl_q_rows, b.const_i32(-(2**31))) + q_block_start_idx = b.select( + rtl_dense, + b.mul(seq_idx, rtl_bps), + b.add(b.div(rtl_off_start, rtl_bq), seq_idx), + ) + q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) + seq_len = b.global_load_i32(seq_lens, seq_idx) context_len = b.sub(seq_len, cur_batch_q_len) + # Per-sequence Q/O base terms in i64 (ragged offsets times the + # multiplier can pass 2^31 elements); within-sequence terms stay i32. + rtl_sb64 = b.zext(b.select(rtl_dense, seq_idx, rtl_off_start), I64) + rtl_elem_bytes = b.const_i64(2) + rtl_q_ptr = b.global_ptr_add( + query, + b.mul(b.mul(rtl_sb64, b.zext(rtl["q_seq_stride"], I64)), rtl_elem_bytes), + ) + rtl_o_ptr = b.global_ptr_add( + output, + b.mul(b.mul(rtl_sb64, b.zext(rtl["o_seq_stride"], I64)), rtl_elem_bytes), + ) + cu_q_start = None + else: + seq_idx = binary_search_seq_idx( + b, + cu_q, + q_block_global_idx, + num_seqs_p, + block_q=BLOCK_Q, + iterations=binary_search_seq_idx_trip_count(b, num_seqs_p), + ) + cu_q_start = b.global_load_i32(cu_q, seq_idx) + cu_q_stop = b.global_load_i32(cu_q, b.add(seq_idx, b.const_i32(1))) + cur_batch_q_len = b.sub(cu_q_stop, cu_q_start) + q_block_start_idx = b.add(b.div(cu_q_start, b.const_i32(BLOCK_Q)), seq_idx) + q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) + seq_len = b.global_load_i32(seq_lens, seq_idx) + if spec.causal_top_left: + context_len = b.const_i32(0) + else: + context_len = b.sub(seq_len, cur_batch_q_len) # Right bound of the band (see the spec field). ``_upper_ok`` is the per-score # compare ``col <= d + right_bound`` (``None`` when unbounded); every site that @@ -1431,8 +1712,17 @@ def _band_row_mask(row_ok, upper_ok, in_prefix): return b.land(b.land(row_ok, upper_ok), in_prefix) qb_start_pos = b.mul(q_block_local_idx, b.const_i32(BLOCK_Q)) - with b.scf_if(b.cmp_ge(qb_start_pos, cur_batch_q_len)): - b.ret() + if RTL: + # Inside the grid-stride loop a q-block past the written rows skips its + # body instead of returning. The condition is CTA-uniform, so the + # barriers inside stay convergent. Closed after the epilogue. A block + # of a dense Q's padding rows only (past the live rows) runs no KV tile + # and stores zeros. + rtl_live_block = b.scf_if(b.cmp_lt(qb_start_pos, rtl_q_rows)) + rtl_live_block.__enter__() + else: + with b.scf_if(b.cmp_ge(qb_start_pos, cur_batch_q_len)): + b.ret() # ---------------- LDS layout ---------------- # Q is loaded once. K and V are double-buffered [2, T, HD] in natural @@ -1755,6 +2045,35 @@ def _band_row_mask(row_ok, upper_ok, in_prefix): coord_names=("token", "head", "dim"), strides=(b.mul(num_qh_p, b.const_i32(HD)), HD, 1), ) + + def _q_row_off(pos: Value, head: Value) -> Value: + """Element offset of Q row ``(pos, head)`` from ``q_base_ptr``. + + Runtime layout: the per-sequence term is already folded into the i64 + ``rtl_q_ptr``; the in-sequence terms use the runtime strides. + """ + if RTL: + return b.add( + b.mul(pos, rtl["q_tok_stride"]), b.mul(head, rtl["q_head_stride"]) + ) + off, _ = q_desc.offset( + b, token=b.add(cu_q_start, pos), head=head, dim=b.const_i32(0) + ) + return off + + def _o_row_off(pos: Value, head: Value) -> Value: + """Element offset of O row ``(pos, head)`` from ``o_base_ptr``.""" + if RTL: + return b.add( + b.mul(pos, rtl["o_tok_stride"]), b.mul(head, rtl["o_head_stride"]) + ) + off, _ = q_desc.offset( + b, token=b.add(cu_q_start, pos), head=head, dim=b.const_i32(0) + ) + return off + + q_base_ptr = rtl_q_ptr if RTL else query + o_base_ptr = rtl_o_ptr if RTL else output # direct-reg: skip the cooperative Q->LDS staging store entirely. # The per-lane Q32 MFMA operand is gathered straight from global in the # QK-operand block below (Q_lds is None). @@ -1777,13 +2096,8 @@ def _band_row_mask(row_ok, upper_ok, in_prefix): ) q_pos_safe = b.select(qmask_t, q_pos_t, b.const_i32(0)) qh_safe = b.select(qmask_t, qh_t, b.const_i32(0)) - q_off_base, _ = q_desc.offset( - b, - token=b.add(cu_q_start, q_pos_safe), - head=qh_safe, - dim=b.const_i32(0), - ) - v8 = b.global_load_vN(query, b.add(q_off_base, Q_col), dtype, 8, align=16) + q_off_base = _q_row_off(q_pos_safe, qh_safe) + v8 = b.global_load_vN(q_base_ptr, b.add(q_off_base, Q_col), dtype, 8, align=16) # When Q is aliased to K_lds (single shared scratch), the store # goes through ``[buf, row_in_buf, col]`` indexing of the K_lds # 3D buffer. ``buf = Q_row // T`` selects which K_lds slot, @@ -1821,8 +2135,13 @@ def _band_row_mask(row_ok, upper_ok, in_prefix): ) max_seq_prefix_len = b.select(b.cmp_lt(msp_raw, seq_len), msp_raw, seq_len) num_tiles = b.div(b.add(max_seq_prefix_len, b.const_i32(T - 1)), b.const_i32(T)) + if RTL: + # A q-block of padding rows only reads no key: its rows store zeros. + num_tiles = b.select( + b.cmp_lt(qb_start_pos, cur_batch_q_len), num_tiles, b.const_i32(0) + ) - if SLIDING_WINDOW > 0: + if SW_ACTIVE: qpos_hi_raw = b.add(qb_start_pos, b.const_i32(bm1_div_nqk)) cur_q_minus1 = b.sub(cur_batch_q_len, b.const_i32(1)) qpos_hi = b.select( @@ -2158,7 +2477,18 @@ def _acc_idx(n: int, atom: int) -> int: # lookup with the total block-table footprint so OOB lookups # return ``0`` (a guaranteed-valid block id). Downstream causal / # in_prefix masks already discard the bogus tokens. - block_table_max_idx = b.to_sgpr_u32(b.mul(num_seqs_p, bt_stride_p)) + if RTL: + # Runtime layout: only the entries ``< ceil(seq_len / BS)`` of this + # sequence's row are ever read (masked lookups return block 0, whose + # loads are then masked off by the per-token voffset guard). + block_table_max_idx = b.to_sgpr_u32( + b.add( + seq_base, + b.div(b.add(seq_len, b.const_i32(BS - 1)), b.const_i32(BS)), + ) + ) + else: + block_table_max_idx = b.to_sgpr_u32(b.mul(num_seqs_p, bt_stride_p)) # When a copy covers COPY_TOKENS whole tokens and they fit in one page, the # bf16/fp16 loaders build the page base, the in-page token offset and the # lane part separately (see ``_paged_copy``). A copy that ends mid-row @@ -2166,7 +2496,8 @@ def _acc_idx(n: int, atom: int) -> int: # keeps the paged-KV descriptor, which addresses each lane's own row. COPY_TOKENS = KV_HALVES_PER_CALL // HD PAGE_COPIES = ( - not FAST_PAGED_KV_DESC + not RTL + and not FAST_PAGED_KV_DESC and not KV_FP8 and KV_HALVES_PER_CALL % HD == 0 and BS % COPY_TOKENS == 0 @@ -2181,7 +2512,64 @@ def _acc_idx(n: int, atom: int) -> int: ) # Page ids already read for a tile, by the tile index value. tile_pages = {} - if FAST_PAGED_KV_DESC: + if RTL: + # Runtime-stride paged KV bytes. One paged block per tile (T == BS), so + # ``tile_idx`` is the logical block index: each tile load reads its page + # id once and builds one buffer resource at the page's 64-bit base (the + # per-page mechanism of the gfx942 i64 path; caches are many GiB), with + # range ``kv_block_span_bytes``. Token/head/dim stay in the i32 voffset. + # K and V share strides. + rtl_kv_page_stride_b = b.mul( + b.zext(rtl["kv_block_stride"], I64), b.const_i64(KV_BYTES) + ) + rtl_kv_desc = DynamicTensorDescriptor.create( + "rtl_kv_page_bytes", + coord_names=("token", "kv_head", "dim"), + strides=[ + b.mul(rtl["kv_tok_stride"], b.const_i32(KV_BYTES)), + b.mul(rtl["kv_head_stride"], b.const_i32(KV_BYTES)), + b.const_i32(KV_BYTES), + ], + ) + rtl_kv_span = rtl["kv_block_span_bytes"] + + def _rtl_kv_page(src: Value, table: Value, kv_tile_idx: Value) -> Value: + """The buffer resource of the tile's page (block 0 past the table). + + ``table`` is K's ``block_tables_ptr`` or V's ``block_tables_v_ptr``; + both rows start at ``seq_base`` (one ``block_table_stride``). + """ + idx = b.add(seq_base, kv_tile_idx) + phys = b.masked_global_load( + table, + idx, + b.cmp_lt(idx, block_table_max_idx), + b.const_i32(0), + dtype=I32, + align=4, + ) + page = b.global_ptr_add( + src, b.mul(b.zext(b.to_sgpr_u32(phys), I64), rtl_kv_page_stride_b) + ) + return b.buffer_rsrc(page, rtl_kv_span) + + def _rtl_kv_voff(kv_tile_idx: Value, linear_half: Value) -> Value: + """This lane's voffset within the page for one async-DMA call. + + Lanes whose token is at or past ``seq_len`` get an out-of-range + voffset, so the DMA writes zeros without touching memory. + """ + tok_in_tile = b.div(linear_half, b.const_i32(HD)) + within, _ = rtl_kv_desc.offset( + b, + token=tok_in_tile, + kv_head=kv_head_idx, + dim=b.mod(linear_half, b.const_i32(HD)), + ) + tok = b.add(b.mul(kv_tile_idx, b.const_i32(T)), tok_in_tile) + return b.select(b.cmp_lt(tok, seq_len), within, rtl_kv_span) + + elif FAST_PAGED_KV_DESC: assert (BS, T, HD, NUM_KV, KV_BYTES, NUM_WARPS, kv_calls_per_tile) == ( 32, 64, @@ -2363,6 +2751,8 @@ def _issue_k_load_runtime(kv_tile_idx: Value, buf_idx: Value) -> None: K_wave_base = b.smem_ptr_add(K_buf_base, wave_lds_offset_K_i64) if FAST_PAGED_KV_DESC: fast_block0, fast_block1 = _fast_paged_kv_blocks(kv_tile_idx) + elif RTL: + rtl_rsrc = _rtl_kv_page(key, block_tables, kv_tile_idx) pages = {} for call in range(kv_calls_per_tile): k_rsrc = key_rsrc @@ -2381,7 +2771,10 @@ def _issue_k_load_runtime(kv_tile_idx: Value, buf_idx: Value) -> None: linear_half = b.add( b.const_i32(call * KV_HALVES_PER_CALL), lane_half_base ) - if I64_KV_ADDR: + if RTL: + k_rsrc = rtl_rsrc + voff = _rtl_kv_voff(kv_tile_idx, linear_half) + elif I64_KV_ADDR: base_i64, voff, _ = paged_kv_desc.offset_i64_split( b, "physical_block", @@ -2427,6 +2820,8 @@ def _issue_v_load_runtime(kv_tile_idx: Value, buf_idx: Value) -> None: V_wave_base = b.smem_ptr_add(V_lds_addr, wave_lds_offset_i64) if FAST_PAGED_KV_DESC: fast_block0, fast_block1 = _fast_paged_kv_blocks(kv_tile_idx) + elif RTL: + rtl_rsrc = _rtl_kv_page(value, rtl["block_tables_v_ptr"], kv_tile_idx) pages = {} for call in range(kv_calls_per_tile): v_rsrc = value_rsrc @@ -2445,7 +2840,10 @@ def _issue_v_load_runtime(kv_tile_idx: Value, buf_idx: Value) -> None: linear_half = b.add( b.const_i32(call * KV_HALVES_PER_CALL), lane_half_base ) - if I64_KV_ADDR: + if RTL: + v_rsrc = rtl_rsrc + voff = _rtl_kv_voff(kv_tile_idx, linear_half) + elif I64_KV_ADDR: base_i64, voff, _ = paged_kv_desc.offset_i64_split( b, "physical_block", @@ -3766,7 +4164,7 @@ def _mod3_add(x, c): causal_ok = _upper_ok(col_abs, causal_lim) in_prefix = b.cmp_lt(col_abs, max_seq_prefix_len) m_ok = _band_row_mask(row_ok, causal_ok, in_prefix) - if SLIDING_WINDOW > 0: + if SW_ACTIVE: dist = b.sub(causal_lim, col_abs) m_ok = b.land(m_ok, b.cmp_lt(dist, sw_const)) s_raw = b.vec_extract(st_regs[n], reg) @@ -4022,7 +4420,7 @@ def _mod3_add(x, c): causal_ok = _upper_ok(col_abs, causal_lim) in_prefix = b.cmp_lt(col_abs, max_seq_prefix_len) m_ok = _band_row_mask(row_ok, causal_ok, in_prefix) - if SLIDING_WINDOW > 0: + if SW_ACTIVE: dist = b.sub(causal_lim, col_abs) m_ok = b.land(m_ok, b.cmp_lt(dist, sw_const)) s_raw = b.vec_extract(S32_n[n], reg) @@ -4099,7 +4497,7 @@ def _mod3_add(x, c): causal_ok = _upper_ok(col_abs, causal_lim) in_prefix = b.cmp_lt(col_abs, max_seq_prefix_len) m_ok = _band_row_mask(row_ok, causal_ok, in_prefix) - if SLIDING_WINDOW > 0: + if SW_ACTIVE: dist = b.sub(causal_lim, col_abs) m_ok = b.land(m_ok, b.cmp_lt(dist, sw_const)) s_raw = b.vec_extract(S_n[atom][n], in_atom) @@ -4956,8 +5354,11 @@ def _acc_final_get(n: int, atom: int) -> Value: b.mul(kv_head_idx, b.const_i32(NQK)), b.mod(OUT_ROW_BASE, b.const_i32(NQK)), ) + # Runtime layout stores every row it owns: live rows get their attention, + # and a dense Q's padding rows (past seq_lens_q) were masked like keyless + # rows, so they store zeros. A ragged Q owns only its live rows. _op_mask_inner = b.land( - b.cmp_lt(op_pos, cur_batch_q_len), + b.cmp_lt(op_pos, rtl_q_rows if RTL else cur_batch_q_len), b.cmp_lt(op_qh, num_qh_p), ) op_mask = ( @@ -4965,12 +5366,7 @@ def _acc_final_get(n: int, atom: int) -> Value: if VALID_ROWS < BLOCK_M else _op_mask_inner ) - out_base, _ = q_desc.offset( - b, - token=b.add(cu_q_start, op_pos), - head=op_qh, - dim=b.const_i32(0), - ) + out_base = _o_row_off(op_pos, op_qh) for stripe in range(OUT_STRIPES): n_start = stripe * N_TILES_PER_STRIPE # ---- stage 1: write this stripe's N-tiles into Acc_lds ---- @@ -5002,7 +5398,7 @@ def _acc_final_get(n: int, atom: int) -> Value: out_col = b.add(b.const_i32(stripe * OUT_STRIPE_COLS), col_in_stripe) with b.scf_if(op_mask): b.global_store_vN( - output, b.add(out_base, out_col), v8h, OUT_VEC, align=16 + o_base_ptr, b.add(out_base, out_col), v8h, OUT_VEC, align=16 ) # ---- stage 3: sync so the next stripe can overwrite Acc_lds ---- if stripe + 1 < OUT_STRIPES: @@ -5033,6 +5429,12 @@ def _acc_final_get(n: int, atom: int) -> Value: row_has_mass=lse_row_has_mass(b, l_final[reg]), ) + if RTL: + rtl_live_block.__exit__(None, None, None) + # Barrier between grid-stride iterations: the next q-block reuses the + # same LDS (Q staging aliases K_lds; Acc_lds is rewritten). + b.sync() + rtl_qb_loop.__exit__(None, None, None) return b.kernel @@ -5049,11 +5451,16 @@ def supports_tiled_2d_spec( on them; the ones the spec carries are forwarded anyway so a later rule on them judges the spec, not the defaults. ``use_mfma_32x32x8``, ``use_conflict_free_v_store``, ``use_k_sliced_ring`` and ``use_d256_fast`` are - not gfx950 spec fields. + not gfx950 spec fields. A ``runtime_layout`` spec is additionally held to + the runtime-layout restrictions (``_runtime_layout_reject_reason``). """ ok, reason = check_head_counts(spec.num_query_heads, spec.num_kv_heads) if not ok: return False, reason + if spec.runtime_layout: + reason = _runtime_layout_reject_reason(spec) + if reason is not None: + return False, reason use_fp8 = spec.kv_storage_dtype is not None return supports_tiled_2d( head_size=spec.head_size, diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c index 958039e86c7a..4c8be79d202c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c @@ -21,6 +21,35 @@ #include "rocke/lower_llvm.h" #include "rocke/verify.h" +/* A runtime_layout spec on the catalog geometry (Python _rtl, lockstep with + * runtime_layout_catalog_spec). tile_size 0 == None (one cache block). */ +static void rtl_spec(rocke_attention_tiled_2d_spec_t* s, + int head_size, + int block_size, + int num_query_heads, + int num_kv_heads, + const char* dtype, + bool use_sinks, + int num_warps, + int tile_size) +{ + s->head_size = head_size; + s->block_size = block_size; + s->num_query_heads = num_query_heads; + s->num_kv_heads = num_kv_heads; + s->dtype = dtype; + s->use_sinks = use_sinks; + s->sliding_window = 0; + s->has_softcap = false; + s->num_warps = num_warps; + if(tile_size != 0) + { + s->has_tile_size = true; + s->tile_size = tile_size; + } + s->runtime_layout = true; +} + /* Fill `s` for config index `idx`. Returns 0 on success, -1 on unknown idx. */ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) { @@ -318,6 +347,39 @@ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) s->use_conflict_free_v_store = true; s->use_i64_kv_addr = (idx == 19); break; + /* --- idx20-29: runtime_layout, every catalog (head_size, block_size) cell + * with its catalog num_warps / tile_size, GQA 1-16 and one + * num_kv_heads > 1 spec (lockstep with the Python _rtl rows). */ + case 20: + rtl_spec(s, 64, 16, 1, 1, "fp16", false, 4, 0); + break; + case 21: + rtl_spec(s, 64, 32, 4, 1, "bf16", false, 4, 0); + break; + case 22: + rtl_spec(s, 64, 64, 6, 1, "fp16", false, 4, 0); + break; + case 23: + rtl_spec(s, 128, 16, 8, 1, "bf16", false, 4, 0); + break; + case 24: + rtl_spec(s, 128, 32, 1, 1, "fp16", false, 4, 0); + break; + case 25: + rtl_spec(s, 128, 64, 4, 1, "bf16", false, 4, 32); + break; + case 26: + rtl_spec(s, 256, 16, 6, 1, "fp16", false, 2, 0); + break; + case 27: + rtl_spec(s, 256, 32, 8, 1, "bf16", false, 2, 16); + break; + case 28: + rtl_spec(s, 256, 64, 1, 1, "fp16", false, 2, 16); + break; + case 29: + rtl_spec(s, 128, 32, 16, 4, "bf16", false, 4, 0); + break; default: return -1; } diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py index 0efe7ebc6472..83704264449c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py @@ -334,6 +334,53 @@ } +def _rtl( + head_size, + block_size, + num_query_heads, + dtype, + *, + num_kv_heads=1, + use_sinks=False, + num_warps=4, + tile_size=None, +): + """A runtime_layout spec on the catalog geometry (runtime_layout_catalog_spec).""" + cfg = dict( + head_size=head_size, + block_size=block_size, + num_query_heads=num_query_heads, + num_kv_heads=num_kv_heads, + dtype=dtype, + use_sinks=use_sinks, + sliding_window=0, + has_softcap=False, + num_warps=num_warps, + runtime_layout=True, + ) + if tile_size is not None: + cfg["tile_size"] = tile_size + return cfg + + +# --- idx20-29: runtime_layout (hipDNN paged/ragged engine). Every catalog +# (head_size, block_size) cell with its catalog num_warps / tile_size +# (sub-block tiles at d128/b64 and d256/b32-64), fp16 and bf16, GQA ratios +# 1-16 (6 leaves VALID_ROWS < BLOCK_M), and one num_kv_heads > 1 spec. +# Dense or ragged Q, the window and the Q/O/KV strides are kernel +# arguments, so every config emits all of them. +_CONFIGS[20] = _rtl(64, 16, 1, "fp16") +_CONFIGS[21] = _rtl(64, 32, 4, "bf16") +_CONFIGS[22] = _rtl(64, 64, 6, "fp16") +_CONFIGS[23] = _rtl(128, 16, 8, "bf16") +_CONFIGS[24] = _rtl(128, 32, 1, "fp16") +_CONFIGS[25] = _rtl(128, 64, 4, "bf16", tile_size=32) +_CONFIGS[26] = _rtl(256, 16, 6, "fp16", num_warps=2) +_CONFIGS[27] = _rtl(256, 32, 8, "bf16", num_warps=2, tile_size=16) +_CONFIGS[28] = _rtl(256, 64, 1, "fp16", num_warps=2, tile_size=16) +_CONFIGS[29] = _rtl(128, 32, 16, "bf16", num_kv_heads=4) + + def _kernel(idx: int): if idx not in _CONFIGS: raise SystemExit(f"unknown config index {idx}") diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c index 82705f94e692..ce8687af90b9 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c @@ -25,6 +25,29 @@ #include "rocke/lower_llvm.h" #include "rocke/verify.h" +/* A runtime_layout spec on the catalog geometry (Python _rtl, lockstep with + * runtime_layout_catalog_spec). */ +static void rtl_spec(rocke_attention_tiled_2d_spec_t* s, + int head_size, + int block_size, + int num_query_heads, + int num_kv_heads, + const char* dtype, + bool use_sinks, + int num_warps) +{ + s->head_size = head_size; + s->block_size = block_size; + s->num_query_heads = num_query_heads; + s->num_kv_heads = num_kv_heads; + s->dtype = dtype; + s->use_sinks = use_sinks; + s->sliding_window = 0; + s->has_softcap = false; + s->num_warps = num_warps; + s->runtime_layout = true; +} + /* Fill `s` for config index `idx`. Returns 0 on success, -1 on unknown idx. */ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) { @@ -1204,6 +1227,39 @@ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) s->tile_size = 32; break; + /* --- idx72-81: runtime_layout, every catalog (head_size, block_size) cell + * with its catalog num_warps, GQA 1-16 and one num_kv_heads > 1 spec + * (lockstep with the Python _rtl rows). */ + case 72: + rtl_spec(s, 64, 16, 1, 1, "fp16", false, 2); + break; + case 73: + rtl_spec(s, 64, 32, 4, 1, "bf16", false, 4); + break; + case 74: + rtl_spec(s, 64, 64, 6, 1, "fp16", false, 4); + break; + case 75: + rtl_spec(s, 128, 16, 8, 1, "bf16", false, 4); + break; + case 76: + rtl_spec(s, 128, 32, 1, 1, "fp16", false, 4); + break; + case 77: + rtl_spec(s, 128, 64, 4, 1, "bf16", false, 4); + break; + case 78: + rtl_spec(s, 256, 16, 6, 1, "fp16", false, 4); + break; + case 79: + rtl_spec(s, 256, 32, 8, 1, "bf16", false, 4); + break; + case 80: + rtl_spec(s, 256, 64, 1, 1, "fp16", false, 4); + break; + case 81: + rtl_spec(s, 128, 32, 16, 4, "bf16", false, 4); + break; default: return -1; } diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py index da8a3ea2608e..deb90dd65240 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py @@ -1160,6 +1160,48 @@ _CONFIGS[67] = {**_CONFIGS[5], "use_alibi": True, "emit_lse": True} +def _rtl( + head_size, + block_size, + num_query_heads, + dtype, + *, + num_kv_heads=1, + use_sinks=False, + num_warps=4, +): + """A runtime_layout spec on the catalog geometry (runtime_layout_catalog_spec).""" + return dict( + head_size=head_size, + block_size=block_size, + num_query_heads=num_query_heads, + num_kv_heads=num_kv_heads, + dtype=dtype, + use_sinks=use_sinks, + sliding_window=0, + has_softcap=False, + num_warps=num_warps, + runtime_layout=True, + ) + + +# --- idx72-81: runtime_layout (hipDNN paged/ragged engine). Every catalog +# (head_size, block_size) cell with its catalog num_warps (2 at d64/b16), +# fp16 and bf16, GQA ratios 1-16 (6 leaves VALID_ROWS < BLOCK_M), and +# one num_kv_heads > 1 spec. Dense or ragged Q, the window and the Q/O/KV +# strides are kernel arguments, so every config emits all of them. +_CONFIGS[72] = _rtl(64, 16, 1, "fp16", num_warps=2) +_CONFIGS[73] = _rtl(64, 32, 4, "bf16") +_CONFIGS[74] = _rtl(64, 64, 6, "fp16") +_CONFIGS[75] = _rtl(128, 16, 8, "bf16") +_CONFIGS[76] = _rtl(128, 32, 1, "fp16") +_CONFIGS[77] = _rtl(128, 64, 4, "bf16") +_CONFIGS[78] = _rtl(256, 16, 6, "fp16") +_CONFIGS[79] = _rtl(256, 32, 8, "bf16") +_CONFIGS[80] = _rtl(256, 64, 1, "fp16") +_CONFIGS[81] = _rtl(128, 32, 16, "bf16", num_kv_heads=4) + + def _spec(idx: int) -> UnifiedAttention2DTiledSpec: if idx not in _CONFIGS: raise SystemExit(f"unknown config index {idx}") diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py new file mode 100644 index 000000000000..9a7cb4406d42 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py @@ -0,0 +1,669 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# SPDX-License-Identifier: MIT + +"""Device numerics of the gfx950 tiled-2D unified attention in runtime-layout mode. + +``runtime_layout=True`` takes head counts, the sliding window, every Q/O/KV +stride and a dense-or-ragged Q mapping as kernel arguments. Each catalog kernel +runs a set of scenarios against a numpy gather-then-dense reference: + +- vLLM's interleaved KV view (one ``[nb, Hkv, bs, 2D]`` allocation, K is + ``[..., :D]``, V is ``[..., D:]``) and plain NHD caches; +- shuffled page tables with ``0x7fffffff`` past each sequence's used blocks and + NaN in every cache slot that is not a live token (so any load of a padded + token or a stale table entry shows up as a NaN or a fault); +- dense Q (L=1, L=3 with padded rows) and ragged Q (mixed decode and chunked + prefill rows, offset gaps with ``seq_lens_q``, exact offsets without, a + first origin past the first q-blocks); +- sliding window on and off, Q token strides of a fused QKV split, padded O + token strides, and grids smaller than the q-block count (grid-stride loop); +- a separate V block table (``block_tables_v_ptr``) that places V in other + blocks than K. + +Outputs must be finite and within tolerance; rows that see no key, and a dense +Q's padded rows past seq_lens_q, must be exactly zero; every O element the +kernel must not write (a ragged Q's gap rows past seq_lens_q, token-stride +padding, guard regions) must keep its sentinel. The device test is skipped +unless the visible device is gfx950; the catalog check needs no device. +""" + +from __future__ import annotations + +import itertools +import math +import zlib +from dataclasses import dataclass +from typing import Optional, Sequence, Tuple + +import numpy as np +import pytest + +_ARCH = None +try: + from rocke.runtime.hip_module import get_device_arch + + _ARCH = get_device_arch(0) +except Exception: # noqa: BLE001 - no runtime / no device + _ARCH = None + +_NEEDS_GFX950 = pytest.mark.skipif( + _ARCH != "gfx950", reason=f"needs gfx950; device is {_ARCH}" +) + +NO_WINDOW = 0x3FFFFFFF +GARBAGE_BLOCK = 0x7FFFFFFF +SENTINEL = 0xDEAD # raw 16-bit pattern of every O element the kernel must not write +GUARD = 64 # elements of sentinel before and after the O view +NUM_KV_HEADS = 2 +# The kernel rounds P and O to bf16/fp16 (8 or 11 mantissa bits); the reference +# stays in fp32. 2e-2 covers that rounding, not a looser kernel. +ATOL = 2e-2 +RTOL = 2e-2 + + +@dataclass(frozen=True) +class Scenario: + name: str + seq_lens: Tuple[int, ...] + # DENSE when ``q_uniform_len > 0``: every sequence owns ``q_uniform_len`` Q + # rows; ``q_lens`` (if given) is ``seq_lens_q``. RAGGED otherwise: ``q_lens`` + # are the query lengths and ``gaps`` the unused tokens after each sequence, + # or ``offsets`` gives off[0..B] as is (non-decreasing, off[B] the end of + # the last block; needs ``has_seq_lens_q``). The kernel gets + # q_uniform_len = 0. + q_uniform_len: int = 0 + q_lens: Optional[Tuple[int, ...]] = None + gaps: Optional[Tuple[int, ...]] = None + offsets: Optional[Tuple[int, ...]] = None + has_seq_lens_q: bool = False + window: int = NO_WINDOW + kv_layout: str = "vllm" # "vllm" interleaved or "nhd" + fused_qkv: bool = True # Q token stride = (Hq + 2*Hkv) * D + grid_y_div: int = 1 # launch grid.y = ceil(full grid.y / grid_y_div) + # V pages through its own block table (another permutation of the blocks); + # otherwise block_tables_v_ptr is block_tables_ptr. + separate_v_table: bool = False + + +SCENARIOS = ( + # Decode batch; seq_len 0 rows still exist (no seq_lens_q) and must be 0. + Scenario("dense_l1", seq_lens=(37, 0, 1, 130, 64), q_uniform_len=1), + # Speculative-style L=3 with padded rows (seq_lens_q < L, one empty). + Scenario( + "dense_l3_padded", + seq_lens=(50, 3, 0, 77), + q_uniform_len=3, + q_lens=(3, 2, 0, 1), + has_seq_lens_q=True, + window=21, + kv_layout="nhd", + ), + Scenario( + "dense_l3_grid_stride", + seq_lens=(9, 40, 3, 100, 18, 66), + q_uniform_len=3, + kv_layout="nhd", + fused_qkv=False, + grid_y_div=3, + ), + # Mixed decode + chunked prefill, offset gaps, an empty sequence. + Scenario( + "ragged_mixed_gap", + seq_lens=(33, 17, 1, 0, 140, 69), + q_lens=(1, 17, 1, 0, 40, 5), + gaps=(0, 3, 0, 2, 7, 2), + has_seq_lens_q=True, + ), + Scenario( + "ragged_exact_window", + seq_lens=(6, 90, 50), + q_lens=(6, 1, 23), + window=16, + kv_layout="nhd", + ), + Scenario( + "ragged_grid_stride_window", + seq_lens=(33, 17, 1, 140, 69), + q_lens=(1, 17, 1, 40, 5), + gaps=(0, 3, 0, 7, 2), + has_seq_lens_q=True, + window=29, + grid_y_div=4, + ), + Scenario( + "dense_l1_separate_v_table", + seq_lens=(37, 0, 1, 130, 64), + q_uniform_len=1, + separate_v_table=True, + ), + Scenario( + "ragged_separate_v_table_window", + seq_lens=(33, 17, 1, 0, 140, 69), + q_lens=(1, 17, 1, 0, 40, 5), + gaps=(0, 3, 0, 2, 7, 2), + has_seq_lens_q=True, + window=29, + kv_layout="nhd", + separate_v_table=True, + ), + # 0 < seq_len < q_len: the leading rows see no key (zeros), the rest see the + # keys up to their own bottom-right diagonal. + Scenario( + "dense_l5_keyless_leading_rows", + seq_lens=(2, 1, 40, 4), + q_uniform_len=5, + q_lens=(5, 5, 3, 5), + has_seq_lens_q=True, + ), + Scenario( + "ragged_keyless_leading_rows_window", + seq_lens=(2, 30, 1), + q_lens=(5, 1, 4), + gaps=(1, 0, 2), + has_seq_lens_q=True, + window=16, + kv_layout="nhd", + ), + # One decode row whose origin lies past the first q-blocks: those blocks + # find no sequence and write nothing (rows before off[0] keep the sentinel). + Scenario( + "ragged_shifted_first_origin", + seq_lens=(20,), + q_lens=(1,), + offsets=(64, 65), + has_seq_lens_q=True, + ), +) + + +def _kernel_cases(): + """(dtype, head_size, block_size, qpk) kernels exercised on the device.""" + cases = list( + itertools.product(("bf16", "fp16"), (64, 128, 256), (16, 64), (1, 4, 5, 8)) + ) + cases += [(dt, hd, 32, 4) for dt in ("bf16", "fp16") for hd in (64, 128, 256)] + return cases + + +_LAUNCHERS: dict = {} + + +def _launcher(dtype: str, head_size: int, block_size: int, qpk: int): + key = (dtype, head_size, block_size, qpk) + if key not in _LAUNCHERS: + from kernels.gfx950.attention_tiled_2d import ( + UnifiedAttention2DTiledSpec, + build_unified_attention_2d_tiled, + runtime_layout_catalog_spec, + supports_tiled_2d_spec, + ) + from rocke.helpers.compile import compile_kernel + from rocke.helpers.spec import SignatureBuilder + from rocke.runtime.launcher import KernelLauncher + + spec = runtime_layout_catalog_spec( + dtype=dtype, + head_size=head_size, + block_size=block_size, + num_queries_per_kv=qpk, + ) + ok, why = supports_tiled_2d_spec(spec, arch="gfx950") + assert ok, why + art = compile_kernel(build_unified_attention_2d_tiled(spec), arch="gfx950") + io = "f16" if dtype == "fp16" else "bf16" + sb = SignatureBuilder() + for name in ("output_ptr", "query_ptr", "key_cache_ptr", "value_cache_ptr"): + sb.ptr(name, io) + sb.ptr("sink_ptr", io) + sb.ptr("block_tables_ptr", "i32") + sb.ptr("seq_lens_ptr", "i32") + sb.ptr("alibi_slopes_ptr", "f32") + sb.ptr("qq_bias_ptr", "f32") + sb.ptr("query_start_len_ptr", "i32") + for name in ("scale", "k_scale", "v_scale", "out_scale", "softcap"): + sb.scalar(name, "f32") + for name in ("num_seqs", "block_table_stride", "qq_bias_stride_0"): + sb.scalar(name, "i32") + for name in UnifiedAttention2DTiledSpec.RUNTIME_KERNARG_FIELDS: + sb.scalar(name, "i32") + sb.ptr("block_tables_v_ptr", "i32") + sb.ptr("seq_lens_q_ptr", "i32") + for name in ( + "has_seq_lens_q", + "q_uniform_len", + "q_seq_stride", + "q_tok_stride", + "q_head_stride", + "o_seq_stride", + "o_tok_stride", + "o_head_stride", + "kv_block_stride", + "kv_tok_stride", + "kv_head_stride", + "kv_block_span_bytes", + "q_block_grid", + ): + sb.scalar(name, "i32") + launcher = KernelLauncher( + hsaco=art.hsaco, kernel_name=art.kernel_name, signature=sb.build() + ) + _LAUNCHERS[key] = (spec, launcher) + return _LAUNCHERS[key] + + +def _encode(a: np.ndarray, dtype: str) -> np.ndarray: + """fp32 -> raw 16-bit storage of ``dtype``.""" + from rocke.numeric.bf16 import f32_to_bf16 + + if dtype == "bf16": + return f32_to_bf16(a.astype(np.float32)) + return a.astype(np.float16).view(np.uint16) + + +def _decode(a: np.ndarray, dtype: str) -> np.ndarray: + from rocke.numeric.bf16 import bf16_to_f32 + + if dtype == "bf16": + return bf16_to_f32(a) + return a.view(np.float16).astype(np.float32) + + +def _reference( + q: np.ndarray, + k: Sequence[np.ndarray], + v: Sequence[np.ndarray], + seq_len: int, + q_len: int, + qpk: int, + window: int, + scale: float, +) -> np.ndarray: + """Bottom-right causal (+ window) attention of one sequence, fp32. + + ``q`` is ``[q_len, Hq, D]``; ``k``/``v`` are the gathered ``[seq_len, Hkv, D]`` + live tokens. Rows with no visible key are zero. + """ + hq, d = q.shape[1], q.shape[2] + out = np.zeros((q_len, hq, d), dtype=np.float32) + if q_len == 0: + return out + diag = (seq_len - q_len) + np.arange(q_len)[:, None] + key = np.arange(seq_len)[None, :] + visible = (key <= diag) & (diag - key < window) + for h in range(hq): + kvh = h // qpk + s = (q[:, h, :] @ k[:, kvh, :].T) * scale + s = np.where(visible, s, -np.inf) + row_max = np.max(s, axis=1, initial=-np.inf, where=visible) + has_key = np.isfinite(row_max) + p = np.where(visible, np.exp(s - np.where(has_key, row_max, 0.0)[:, None]), 0.0) + denom = p.sum(axis=1) + o = p @ v[:, kvh, :] + out[:, h, :] = np.where( + has_key[:, None], o / np.where(has_key, denom, 1.0)[:, None], 0.0 + ) + return out + + +def _run(dtype: str, head_size: int, block_size: int, qpk: int, sc: Scenario): + from rocke.runtime.hip_module import Runtime + from rocke.runtime.host_buffers import as_u8_buffer + from rocke.runtime.launcher import DeviceMem, LaunchConfig + + spec, launcher = _launcher(dtype, head_size, block_size, qpk) + rng = np.random.default_rng( + zlib.crc32(f"{dtype}/{head_size}/{block_size}/{qpk}/{sc.name}".encode()) + ) + D, BS = head_size, block_size + hkv = NUM_KV_HEADS + hq = hkv * qpk + B = len(sc.seq_lens) + seq_lens = np.array(sc.seq_lens, dtype=np.int32) + dense = sc.q_uniform_len > 0 + if dense: + L = sc.q_uniform_len + slq = np.array(sc.q_lens if sc.q_lens else (L,) * B, dtype=np.int32) + q_lens = np.minimum(slq, L) if sc.has_seq_lens_q else np.full(B, L, np.int32) + rows_per_seq = np.full(B, L) + starts = np.arange(B) * L + offsets = None + else: + q_lens = np.array(sc.q_lens, dtype=np.int32) + slq = q_lens + if sc.offsets is not None: + assert sc.has_seq_lens_q, "explicit offsets need seq_lens_q" + offsets = np.array(sc.offsets, dtype=np.int32) + rows_per_seq = q_lens + else: + gaps = np.array(sc.gaps if sc.gaps else (0,) * B, dtype=np.int32) + offsets = np.zeros(B + 1, dtype=np.int32) + offsets[1:] = np.cumsum(q_lens + gaps) + rows_per_seq = q_lens + gaps + starts = offsets[:B] + total_rows = int((starts + rows_per_seq).max()) if B else 0 + q_uniform_len = sc.q_uniform_len if dense else 0 + + # ---- Q (optionally a fused-QKV row) ---- + q_tok = (hq + 2 * hkv) * D if sc.fused_qkv else hq * D + q_host_f = rng.standard_normal((max(total_rows, 1), q_tok)).astype(np.float32) + q_host = _encode(q_host_f, dtype) + q_view = _decode(q_host, dtype)[:, : hq * D].reshape(-1, hq, D) + + # ---- O with padded token stride and sentinel guards ---- + o_tok = hq * D + 8 + o_host = np.full(GUARD + max(total_rows, 1) * o_tok + GUARD, SENTINEL, np.uint16) + + # ---- paged KV cache: NaN everywhere except live tokens ---- + nblk = [(int(s) + BS - 1) // BS for s in seq_lens] + num_blocks = sum(nblk) + 3 + perm = rng.permutation(num_blocks).astype(np.int32) + v_perm = ( + rng.permutation(num_blocks).astype(np.int32) if sc.separate_v_table else perm + ) + bt_width = max(nblk) + 2 + block_tables = np.full((B, bt_width), GARBAGE_BLOCK, dtype=np.int32) + v_block_tables = np.full((B, bt_width), GARBAGE_BLOCK, dtype=np.int32) + nan_bits = _encode(np.array([np.nan], np.float32), dtype)[0] + if sc.kv_layout == "vllm": + cache = np.full((num_blocks, hkv, BS, 2 * D), nan_bits, np.uint16) + kv_block_stride, kv_head_stride, kv_tok_stride = ( + hkv * BS * 2 * D, + BS * 2 * D, + 2 * D, + ) + else: + k_cache = np.full((num_blocks, BS, hkv, D), nan_bits, np.uint16) + v_cache = np.full((num_blocks, BS, hkv, D), nan_bits, np.uint16) + kv_block_stride, kv_tok_stride, kv_head_stride = BS * hkv * D, hkv * D, D + kv_span_bytes = ((hkv - 1) * kv_head_stride + (BS - 1) * kv_tok_stride + D) * 2 + gathered = [] + used = 0 + for b in range(B): + n = nblk[b] + blocks = perm[used : used + n] + v_blocks = v_perm[used : used + n] + used += n + block_tables[b, :n] = blocks + v_block_tables[b, :n] = v_blocks + sl = int(seq_lens[b]) + kf = _encode(rng.standard_normal((sl, hkv, D)).astype(np.float32), dtype) + vf = _encode(rng.standard_normal((sl, hkv, D)).astype(np.float32), dtype) + for t in range(sl): + blk, vblk, tt = blocks[t // BS], v_blocks[t // BS], t % BS + if sc.kv_layout == "vllm": + cache[blk, :, tt, :D] = kf[t] + cache[vblk, :, tt, D:] = vf[t] + else: + k_cache[blk, tt] = kf[t] + v_cache[vblk, tt] = vf[t] + gathered.append((_decode(kf, dtype), _decode(vf, dtype))) + + # ---- launch ---- + bq = spec.block_q + if dense: + full_grid_y = B * ((sc.q_uniform_len + bq - 1) // bq) + else: + full_grid_y = int(offsets[-1]) // bq + B + grid_y = max(1, -(-full_grid_y // sc.grid_y_div)) + scale = 1.0 / math.sqrt(D) + + rt = Runtime() + bufs = [] + + def upload(a: np.ndarray) -> DeviceMem: + a = np.ascontiguousarray(a) + m = DeviceMem(max(a.nbytes, 4)) + if a.nbytes: + rt.memcpy_h2d(m.ptr(), as_u8_buffer(a), a.nbytes) + bufs.append(m) + return m + + q_dev = upload(q_host) + o_dev = upload(o_host) + seq_lens_dev = upload(seq_lens) + bt_dev = upload(block_tables) + v_bt_dev = upload(v_block_tables) if sc.separate_v_table else bt_dev + if sc.separate_v_table: + assert not np.array_equal(v_block_tables, block_tables) + slq_dev = upload(slq) if sc.has_seq_lens_q else seq_lens_dev + # DENSE: a one-entry offsets buffer, so only index 0 is addressable. + cu_dev = upload(offsets if offsets is not None else np.zeros(1, np.int32)) + if sc.kv_layout == "vllm": + cache_dev = upload(cache) + k_ptr, v_ptr = cache_dev.ptr(), cache_dev.ptr() + D * 2 + else: + k_ptr, v_ptr = upload(k_cache).ptr(), upload(v_cache).ptr() + values = { + "output_ptr": o_dev.ptr() + GUARD * 2, + "query_ptr": q_dev, + "key_cache_ptr": k_ptr, + "value_cache_ptr": v_ptr, + "sink_ptr": 0, + "block_tables_ptr": bt_dev, + "seq_lens_ptr": seq_lens_dev, + "alibi_slopes_ptr": 0, + "qq_bias_ptr": 0, + "query_start_len_ptr": cu_dev, + "scale": scale, + "k_scale": 1.0, + "v_scale": 1.0, + "out_scale": 1.0, + "softcap": 0.0, + "num_seqs": B, + "block_table_stride": bt_width, + "qq_bias_stride_0": 0, + "seq_lens_q_ptr": slq_dev, + "block_tables_v_ptr": v_bt_dev, + "has_seq_lens_q": int(sc.has_seq_lens_q), + "q_uniform_len": q_uniform_len, + "num_query_heads": hq, + "num_kv_heads": hkv, + "sliding_window": sc.window, + "q_seq_stride": sc.q_uniform_len * q_tok if dense else q_tok, + "q_tok_stride": q_tok, + "q_head_stride": D, + "o_seq_stride": sc.q_uniform_len * o_tok if dense else o_tok, + "o_tok_stride": o_tok, + "o_head_stride": D, + "kv_block_stride": kv_block_stride, + "kv_tok_stride": kv_tok_stride, + "kv_head_stride": kv_head_stride, + "kv_block_span_bytes": kv_span_bytes, + "q_block_grid": grid_y, + } + launcher( + values, + config=LaunchConfig( + grid=(hkv, grid_y, 1), block=(64 * spec.num_warps, 1, 1), fence=True + ), + ) + rt.memcpy_d2h(as_u8_buffer(o_host), o_dev.ptr(), o_host.nbytes) + + # ---- check ---- + written = np.zeros(o_host.shape, dtype=bool) + for b in range(B): + ql = int(q_lens[b]) + if ql == 0: + continue + rows = int(starts[b]) + np.arange(ql) + kf, vf = gathered[b] + ref = _reference( + q_view[rows], kf, vf, int(seq_lens[b]), ql, qpk, sc.window, scale + ) + idx = ( + GUARD + + rows[:, None, None] * o_tok + + np.arange(hq)[None, :, None] * D + + np.arange(D)[None, None, :] + ) + written[idx] = True + got = _decode(o_host[idx], dtype) + where = f"{sc.name} seq {b} (seq_len {seq_lens[b]}, q_len {ql})" + assert np.isfinite(got).all(), f"non-finite output in {where}" + no_key = ~np.any(ref != 0.0, axis=2) + assert ( + got[no_key] == 0.0 + ).all(), f"rows with no visible key not zero in {where}" + err = np.abs(got - ref) - (ATOL + RTOL * np.abs(ref)) + assert ( + err.max() <= 0.0 + ), f"{where}: max_abs {np.abs(got - ref).max():.3e} exceeds tolerance" + # A dense Q's rows past seq_lens_q are padding: they store zeros. A ragged + # Q's gap rows (past seq_lens_q, up to the next offset) belong to no + # sequence: the kernel must not write them, so they keep the sentinel. + for b in range(B if dense else 0): + pad = int(starts[b]) + np.arange(int(q_lens[b]), int(rows_per_seq[b])) + if pad.size == 0: + continue + idx = GUARD + pad[:, None] * o_tok + np.arange(hq * D)[None, :] + written[idx] = True + assert ( + _decode(o_host[idx], dtype) == 0.0 + ).all(), f"{sc.name} seq {b}: padding rows not zero" + untouched = o_host[~written] + assert (untouched == SENTINEL).all(), ( + f"{sc.name}: {(untouched != SENTINEL).sum()} O elements outside the owned " + "rows were written (token-stride padding or guard)" + ) + del bufs + + +@pytest.mark.gpu +@_NEEDS_GFX950 +@pytest.mark.parametrize("sc", SCENARIOS, ids=lambda s: s.name) +@pytest.mark.parametrize( + "dtype,head_size,block_size,qpk", + _kernel_cases(), + ids=lambda v: str(v), +) +def test_runtime_layout_matches_reference(dtype, head_size, block_size, qpk, sc): + _run(dtype, head_size, block_size, qpk, sc) + + +def test_runtime_layout_appends_v_block_table(): + """V's block table is the first appended kernarg, after the 18 fixed ones and + the runtime shape kernargs.""" + from kernels.gfx950.attention_tiled_2d import ( + _RTL_PARAMS, + build_unified_attention_2d_tiled, + runtime_layout_catalog_spec, + ) + + spec = runtime_layout_catalog_spec( + dtype="fp16", head_size=64, block_size=16, num_queries_per_kv=1 + ) + names = [p.name.lstrip("%") for p in build_unified_attention_2d_tiled(spec).params] + assert names[5] == "block_tables_ptr" + assert names[18:21] == ["num_query_heads", "num_kv_heads", "sliding_window"] + assert names[21:] == list(_RTL_PARAMS) + assert names[21] == "block_tables_v_ptr" + + +def test_runtime_layout_catalog_supported_and_named(): + """Every catalog combination passes the support predicate and carries ``rtl``.""" + from kernels.gfx950.attention_tiled_2d import ( + runtime_layout_catalog_spec, + supports_tiled_2d_spec, + ) + + for dtype, hd, bs, qpk in itertools.product( + ("fp16", "bf16"), (64, 128, 256), (16, 32, 64), (1, 2, 4, 5, 6, 7, 8, 16) + ): + spec = runtime_layout_catalog_spec( + dtype=dtype, head_size=hd, block_size=bs, num_queries_per_kv=qpk + ) + ok, why = supports_tiled_2d_spec(spec, arch="gfx950") + assert ok, (spec, why) + assert spec.kernel_name().endswith("_rtl") + + +@pytest.mark.parametrize( + "overrides,needle", + [ + (dict(use_additive_bias=True), "use_additive_bias"), + (dict(emit_lse=True), "emit_lse"), + (dict(sliding_window=128), "sliding_window"), + (dict(use_v_double_buffer=True), "use_v_double_buffer"), + (dict(use_qblock_reverse=True), "use_qblock_reverse"), + (dict(tile_size=64), "tile_size"), + # Refused before the async-DMA divisibility check divides by it. + (dict(num_warps=0), r"runtime_layout requires num_warps in \{1, 2, 4, 8\}"), + ], +) +def test_runtime_layout_incompatible_spec_rejected(overrides, needle): + """Flags outside the runtime_layout pipeline are refused at spec construction.""" + import dataclasses + + from kernels.gfx950.attention_tiled_2d import runtime_layout_catalog_spec + + spec = runtime_layout_catalog_spec( + dtype="bf16", head_size=128, block_size=32, num_queries_per_kv=4 + ) + with pytest.raises(ValueError, match=needle): + dataclasses.replace(spec, **overrides) + + +@pytest.mark.parametrize( + "overrides,needle", + [ + # use_additive_bias is not a field of the C spec struct. + (dict(emit_lse=True), "emit_lse"), + (dict(sliding_window=128), "sliding_window"), + (dict(use_v_double_buffer=True), "use_v_double_buffer"), + (dict(use_qblock_reverse=True), "use_qblock_reverse"), + (dict(tile_size=64), "tile_size"), + (dict(num_warps=0), r"runtime_layout requires num_warps in \{1, 2, 4, 8\}"), + ], +) +def test_runtime_layout_native_builder_rejects_incompatible_spec(overrides, needle): + """The C twin of the reject check refuses the same specs, with the same cause.""" + import dataclasses + + from kernels.gfx950.attention_tiled_2d import runtime_layout_catalog_spec + + engine = pytest.importorskip("rocke_engine") + spec = runtime_layout_catalog_spec( + dtype="bf16", head_size=128, block_size=32, num_queries_per_kv=4 + ) + with pytest.raises(RuntimeError, match=needle): + engine.gfx950_attention_tiled_2d_lower_llvm( + {**dataclasses.asdict(spec), **overrides}, "gfx950" + ) + + +_FASTKV_RTL = dict( + use_fast_paged_kv_desc=True, use_mfma_32x32=True, use_transposed_qk_32x32=True +) +# Both reject checks name use_mfma_32x32 (the first of these flags they meet). +_FASTKV_RTL_NEEDLE = "use_mfma_32x32" + + +def test_runtime_layout_fastkv_spec_rejected(): + """The fastKV register-P flags are outside the runtime_layout pipeline.""" + import dataclasses + + from kernels.gfx950.attention_tiled_2d import runtime_layout_catalog_spec + + spec = runtime_layout_catalog_spec( + dtype="bf16", head_size=128, block_size=32, num_queries_per_kv=4 + ) + with pytest.raises(ValueError, match=_FASTKV_RTL_NEEDLE): + dataclasses.replace(spec, **_FASTKV_RTL) + + +def test_runtime_layout_fastkv_native_builder_rejects(): + """The fastKV register-P binding reads ``runtime_layout`` and refuses it with + the reject check's cause, rather than building a fixed-layout kernel.""" + import dataclasses + + from kernels.gfx950.attention_tiled_2d import runtime_layout_catalog_spec + + engine = pytest.importorskip("rocke_engine") + spec = runtime_layout_catalog_spec( + dtype="bf16", head_size=128, block_size=32, num_queries_per_kv=4 + ) + with pytest.raises(RuntimeError, match=_FASTKV_RTL_NEEDLE): + engine.gfx950_attention_tiled_2d_fastkv_regp_lower_llvm( + {**dataclasses.asdict(spec), **_FASTKV_RTL, "runtime_layout": True}, + "gfx950", + ) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py new file mode 100644 index 000000000000..d61364d8c0a0 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -0,0 +1,683 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# SPDX-License-Identifier: MIT +"""gfx942 tiled-2D unified attention in ``runtime_layout`` mode. + +``runtime_layout=True`` makes one compiled object serve any head count, sliding +window, DENSE or RAGGED query layout, Q/O strides and paged-KV layout (vLLM's +interleaved ``[nb, Hkv, bs, 2D]`` view, NHD, HND): the head counts and window +are the body's runtime shape kernargs, the rest 15 appended kernargs. + +The CPU tests check that every catalog spec passes ``supports_tiled_2d_spec`` +and emits, and that the Python and native (C) checks reject incompatible specs. +The GPU test runs through the HIP runtime alone (no torch) and launches the +catalog kernels against an fp32 numpy gather-then-dense reference: shuffled page +tables with garbage past each sequence's used blocks, empty sequences, padded +DENSE rows, RAGGED offsets with gaps, fused-QKV Q strides, padded O strides, a +sliding window, grids smaller than the q-block count (grid-stride loop), and a +separate V block table that places V in other blocks than K. +Rows of sequences without visible keys, and padded DENSE rows past seq_lens_q, +must be exactly 0, and every O element the kernel must not write (RAGGED gap +rows past seq_lens_q, stride padding, guard regions) must keep its sentinel. +""" + +from __future__ import annotations + +import dataclasses +import itertools +import math +import re +import zlib + +import numpy as np +import pytest + +from kernels.gfx942.attention_tiled_2d import ( + RUNTIME_LAYOUT_EXTRA_ARGS, + UnifiedAttention2DTiledSpec, + build_unified_attention_2d_tiled, + runtime_layout_catalog_spec, + supports_tiled_2d_spec, +) + +_CATALOG = list( + itertools.product( + ("fp16", "bf16"), (64, 128, 256), (16, 32, 64), (1, 2, 4, 5, 6, 7, 8, 16) + ) +) + + +# --------------------------------------------------------------------------- +# CPU: catalog predicate + emit, rejections +# --------------------------------------------------------------------------- + + +@pytest.mark.parametrize("dtype,head_size,block_size,qpk", _CATALOG) +def test_catalog_spec_supported_and_emits(dtype, head_size, block_size, qpk): + spec = runtime_layout_catalog_spec( + dtype=dtype, head_size=head_size, block_size=block_size, num_queries_per_kv=qpk + ) + ok, why = supports_tiled_2d_spec(spec, arch="gfx942") + assert ok, why + kernel = build_unified_attention_2d_tiled(spec, arch="gfx942") + names = [p.name.lstrip("%") for p in kernel.params] + assert names[18:21] == list(UnifiedAttention2DTiledSpec.RUNTIME_KERNARG_FIELDS) + assert names[21:] == [n for n, _ in RUNTIME_LAYOUT_EXTRA_ARGS] + assert kernel.name.endswith("_rtl") + + +def _rtl_spec(**overrides): + base = dict( + head_size=128, + block_size=32, + num_query_heads=4, + num_kv_heads=1, + dtype="bf16", + use_sinks=False, + sliding_window=0, + has_softcap=False, + num_warps=4, + runtime_layout=True, + ) + base.update(overrides) + return base + + +_REJECTED = [ + (dict(use_sinks=True), "use_sinks"), + (dict(has_softcap=True), "has_softcap"), + (dict(use_alibi=True), "use_alibi"), + (dict(use_qq_bias=True), "use_qq_bias"), + (dict(sliding_window=128), "sliding_window"), + (dict(use_fast_paged_kv_desc=True), "use_fast_paged_kv_desc"), + (dict(use_q_major_grid=True), "use_q_major_grid"), + (dict(block_m_per_warp=32), "block_m_per_warp"), + (dict(tile_size=24), "tile_size"), + (dict(tile_size=64), "tile_size"), + (dict(num_query_heads=5, num_kv_heads=2), "divisible"), + (dict(emit_lse=True), "emit_lse"), +] + + +@pytest.mark.parametrize("overrides,needle", _REJECTED) +def test_incompatible_spec_rejected(overrides, needle): + with pytest.raises(ValueError, match=needle): + UnifiedAttention2DTiledSpec(**_rtl_spec(**overrides)) + + +@pytest.mark.parametrize("overrides,needle", _REJECTED) +def test_native_builder_rejects_incompatible_spec(overrides, needle): + """The C twin of the reject check refuses the same specs, with the same cause.""" + engine = pytest.importorskip("rocke_engine") + with pytest.raises(RuntimeError, match=needle): + engine.gfx942_attention_tiled_2d_lower_llvm(_rtl_spec(**overrides), "gfx942") + + +def test_4warp_gqa_builder_refuses_runtime_layout(): + from kernels.gfx942.attention_tiled_2d import build_gfx942_4warp_gqa + + spec = UnifiedAttention2DTiledSpec(**_rtl_spec()) + with pytest.raises(NotImplementedError, match="runtime_layout"): + build_gfx942_4warp_gqa(spec) + + +# D256, 64-token tile, 4 warps: 2*64*256*2 + 64*264*2 + 64*72*2 + 64*256*2 +# = 141312 B, over gfx942's 65536 B. +_OVER_LDS = dict(head_size=256, block_size=64) +_OVER_LDS_NEEDLE = r"estimated LDS 141312 B .* exceeds the gfx942 65536 B LDS budget" + + +def test_lds_budget_rejected_with_reason(): + spec = UnifiedAttention2DTiledSpec(**_rtl_spec(**_OVER_LDS)) + ok, why = supports_tiled_2d_spec(spec, arch="gfx942") + assert not ok + assert re.search(_OVER_LDS_NEEDLE, why), why + + +def test_builder_rejects_lds_over_budget(): + spec = UnifiedAttention2DTiledSpec(**_rtl_spec(**_OVER_LDS)) + with pytest.raises(ValueError, match=_OVER_LDS_NEEDLE): + build_unified_attention_2d_tiled(spec, arch="gfx942") + + +def test_native_builder_rejects_lds_over_budget(): + """The C builder charges the same LDS bytes against the same capacity.""" + engine = pytest.importorskip("rocke_engine") + with pytest.raises(RuntimeError, match=_OVER_LDS_NEEDLE): + engine.gfx942_attention_tiled_2d_lower_llvm(_rtl_spec(**_OVER_LDS), "gfx942") + + +def test_runtime_layout_off_keeps_name(): + plain = UnifiedAttention2DTiledSpec(**_rtl_spec(runtime_layout=False)) + assert not plain.kernel_name().endswith("rtl") + rtl = dataclasses.replace(plain, runtime_layout=True) + assert rtl.kernel_name() == plain.kernel_name() + "_rtl" + + +# --------------------------------------------------------------------------- +# GPU +# --------------------------------------------------------------------------- + + +def _gpu_ready() -> bool: + # Through the HIP runtime only, no torch: TheRock's test environment has none. + try: + from rocke.runtime.hip_module import get_device_arch + + return get_device_arch(0) == "gfx942" + except Exception: # noqa: BLE001 - no runtime / no device + return False + + +requires_gfx942_gpu = pytest.mark.skipif(not _gpu_ready(), reason="needs a gfx942 GPU") + +_NO_WINDOW = 0x3FFFFFFF +_HKV = 2 +_GUARD = 1024 # elements of sentinel before and after the O view +_SENTINEL = -777.0 +_GPU_KERNELS = [ + (dt, hd, bs, qpk) + for dt in ("bf16", "fp16") + for hd in (64, 128, 256) + for bs in (16, 64) + for qpk in (1, 4, 5, 8) +] + [ + ("bf16", 128, 32, 4), + ("bf16", 128, 32, 8), + ("fp16", 64, 32, 1), + ("fp16", 64, 32, 5), + ("bf16", 256, 32, 8), +] + +_LAUNCHERS = {} + + +def _launcher(spec): + from kernels.common.attention_unified import _tiled_2d_signature + from rocke import compile_kernel + from rocke.helpers.spec import SignatureBuilder + from rocke.runtime import KernelLauncher + + key = spec.kernel_name() + if key not in _LAUNCHERS: + artifact = compile_kernel( + build_unified_attention_2d_tiled(spec, arch="gfx942"), + arch="gfx942", + capture_ir_text=False, + ) + sb = SignatureBuilder().extend(_tiled_2d_signature("gfx942", spec.dtype)) + for name, ty in RUNTIME_LAYOUT_EXTRA_ARGS: + if ty == "ptr": + sb.ptr(name, "i32") + else: + sb.scalar(name, ty) + _LAUNCHERS[key] = KernelLauncher( + hsaco=artifact.hsaco, + kernel_name=artifact.kernel_name, + signature=sb.build(), + cache_key=("rtl_test", key), + ) + return _LAUNCHERS[key] + + +# Scenario fields: mode (dense/ragged), seq_lens, q_lens (per-seq query rows), +# L (dense rows per seq), has_lq, gaps (ragged trailing gap per seq), offsets +# (ragged off[0..B] as given: non-decreasing, off[B] the end; needs has_lq), +# kv layout, fused_q (Q is the Q slice of a fused QKV row), o_pad (O +# token-stride padding), window (None = off), grid_y (None = full grid). +def _scenarios(bs): + return [ + dict( + name="dense_L1_empty_seqs", + mode="dense", + L=1, + has_lq=0, + seq_lens=[0, 1, 17, 3 * bs + 5, 2 * bs, 70], + q_lens=None, + kv="nhd", + fused_q=False, + o_pad=0, + window=None, + grid_y=None, + ), + dict( + name="dense_L3_padded_rows_vllm_window", + mode="dense", + L=3, + has_lq=1, + seq_lens=[40, 2, 0, 0, 3, bs + 1], + q_lens=[3, 1, 0, 2, 3, 2], + kv="vllm", + fused_q=True, + o_pad=8, + window=5, + grid_y=None, + ), + dict( + name="dense_L3_gridstride_hnd", + mode="dense", + L=3, + has_lq=0, + seq_lens=[3, 50, 2 * bs + 7, 9], + q_lens=None, + kv="hnd", + fused_q=False, + o_pad=8, + window=None, + grid_y=1, + ), + dict( + name="ragged_mixed_gaps_vllm", + mode="ragged", + has_lq=1, + seq_lens=[33, 37 + 2 * bs + 3, 1, 0, 26, 64], + q_lens=[1, 37, 1, 0, 19, 1], + gaps=[2, 0, 5, 1, 3, 8], + kv="vllm", + fused_q=True, + o_pad=8, + window=None, + grid_y=None, + ), + dict( + name="ragged_offsets_window_hnd", + mode="ragged", + has_lq=0, + seq_lens=[4, 90, 60, 1], + q_lens=[4, 1, 50, 1], + gaps=None, + kv="hnd", + fused_q=False, + o_pad=0, + window=16, + grid_y=None, + ), + dict( + name="ragged_gridstride_nhd", + mode="ragged", + has_lq=0, + seq_lens=[70, 100, 2 * bs + 1], + q_lens=[70, 33, 1], + gaps=None, + kv="nhd", + fused_q=True, + o_pad=8, + window=None, + grid_y=2, + ), + # K and V page through two tables: V's blocks are another permutation. + dict( + name="dense_L1_separate_v_table_vllm", + mode="dense", + L=1, + has_lq=0, + seq_lens=[0, 1, 2 * bs + 3, 90, bs], + q_lens=None, + kv="vllm", + fused_q=False, + o_pad=0, + window=None, + grid_y=None, + v_table=True, + ), + dict( + name="ragged_separate_v_table_window_hnd", + mode="ragged", + has_lq=1, + seq_lens=[50, 3 * bs + 2, 1, 0], + q_lens=[50, 4, 1, 0], + gaps=[1, 0, 2, 0], + kv="hnd", + fused_q=True, + o_pad=8, + window=24, + grid_y=None, + v_table=True, + ), + # 0 < seq_len < q_len: the leading rows see no key (zeros), the rest see the + # keys up to their own bottom-right diagonal. + dict( + name="dense_L5_keyless_leading_rows", + mode="dense", + L=5, + has_lq=1, + seq_lens=[2, 1, 40, 4], + q_lens=[5, 5, 3, 5], + kv="vllm", + fused_q=True, + o_pad=0, + window=None, + grid_y=None, + ), + dict( + name="ragged_keyless_leading_rows_window", + mode="ragged", + has_lq=1, + seq_lens=[2, 30, 1], + q_lens=[5, 1, 4], + gaps=[1, 0, 2], + kv="nhd", + fused_q=False, + o_pad=8, + window=16, + grid_y=None, + ), + # One decode row whose origin lies past the first q-blocks: those blocks + # find no sequence and write nothing (rows before off[0] keep the + # sentinel). + dict( + name="ragged_shifted_first_origin", + mode="ragged", + has_lq=1, + seq_lens=[20], + q_lens=[1], + offsets=[64, 65], + kv="nhd", + fused_q=False, + o_pad=0, + window=None, + grid_y=None, + ), + ] + + +def _reference( + q_rows, k_logical, v_logical, table, seq_lens, q_lens, qpk, bs, window, v_table=None +): + """fp32 gather-then-dense attention. Returns {(seq, s): [Hq, D]}. + + V pages through ``v_table`` when given, else through ``table``. + """ + hq = q_rows[0].shape[1] if q_rows else 0 + v_table = table if v_table is None else v_table + out = {} + for b, (sl, ql) in enumerate(zip(seq_lens, q_lens)): + if ql == 0: + continue + k = ( + np.stack([k_logical[table[b, t // bs], t % bs] for t in range(sl)]) + if sl + else None + ) + v = ( + np.stack([v_logical[v_table[b, t // bs], t % bs] for t in range(sl)]) + if sl + else None + ) + ctx = sl - ql + for s in range(ql): + d = ctx + s + keys = np.arange(sl) + vis = (keys <= d) & (d - keys < window) + res = np.zeros((hq, q_rows[b].shape[2]), np.float32) + if vis.any(): + for h in range(hq): + kv_h = h // qpk + sc = (k[vis, kv_h] @ q_rows[b][s, h]) / math.sqrt( + q_rows[b].shape[2] + ) + p = np.exp(sc - sc.max()) + res[h] = (p @ v[vis, kv_h]) / p.sum() + out[(b, s)] = res + return out + + +def _encode(a, dtype): + """fp32 -> raw 16-bit storage of ``dtype``.""" + from rocke.numeric.bf16 import f32_to_bf16 + + if dtype == "bf16": + return f32_to_bf16(np.ascontiguousarray(a, dtype=np.float32)) + return a.astype(np.float16).view(np.uint16) + + +def _decode(a, dtype): + from rocke.numeric.bf16 import bf16_to_f32 + + if dtype == "bf16": + return bf16_to_f32(a) + return a.view(np.float16).astype(np.float32) + + +def _run_case(spec, sc, rng): + from rocke.runtime.hip_module import Runtime + from rocke.runtime.host_buffers import as_u8_buffer + from rocke.runtime.launcher import DeviceMem, LaunchConfig + + dt = spec.dtype + rt = Runtime() + keep = [] + + def upload(a): + a = np.ascontiguousarray(a) + m = DeviceMem(max(a.nbytes, 4)) + if a.nbytes: + rt.memcpy_h2d(m.ptr(), as_u8_buffer(a), a.nbytes) + keep.append(m) + return m.ptr() + + hd, bs, qpk = spec.head_size, spec.block_size, spec.num_queries_per_kv + hq = qpk * _HKV + nseq = len(sc["seq_lens"]) + seq_lens = list(sc["seq_lens"]) + bq = spec.block_q + dense = sc["mode"] == "dense" + + # ---- query layout ---- + if dense: + L = sc["L"] + q_lens = list(sc["q_lens"]) if sc["has_lq"] else [L] * nseq + q_lens_kernel = [min(L, x) for x in q_lens] + tok_base = [b * L for b in range(nseq)] + total_tok = nseq * L + else: + q_lens = list(sc["q_lens"]) + if sc.get("offsets") is not None: + assert sc["has_lq"], "explicit offsets need seq_lens_q" + off = list(sc["offsets"]) + rows = q_lens + else: + gaps = sc["gaps"] or [0] * nseq + off = [0] + for ql, g in zip(q_lens, gaps): + off.append(off[-1] + ql + g) + rows = [off[b + 1] - off[b] for b in range(nseq)] + q_lens_kernel = q_lens + tok_base = off[:nseq] + total_tok = max(t + r for t, r in zip(tok_base, rows)) + q_row = (hq + 2 * _HKV) * hd if sc["fused_q"] else hq * hd + q_alloc = rng.standard_normal((max(total_tok, 1), q_row)).astype(np.float32) + q_host = _encode(q_alloc, dt) + q_ptr = upload(q_host) + q_np = _decode(q_host, dt) + q_rows = [ + q_np[tok_base[b] : tok_base[b] + q_lens_kernel[b], : hq * hd].reshape( + -1, hq, hd + ) + for b in range(nseq) + ] + + # ---- paged KV ---- + used = [-(-sl // bs) for sl in seq_lens] + nb = sum(used) + 3 + perm = rng.permutation(nb) + max_blocks = max(used + [1]) + table = np.full((nseq, max_blocks + 1), 0x7FFFFFFF, np.int32) + nxt = 0 + for b in range(nseq): + for i in range(used[b]): + table[b, i] = perm[nxt] + nxt += 1 + v_table = table + if sc.get("v_table"): + # V's blocks: another permutation, so V lives in other blocks than K. + v_perm = rng.permutation(nb) + v_table = np.full_like(table, 0x7FFFFFFF) + nxt = 0 + for b in range(nseq): + for i in range(used[b]): + v_table[b, i] = v_perm[nxt] + nxt += 1 + assert not np.array_equal(v_table, table) + kv_layout = sc["kv"] + if kv_layout == "vllm": + kv = _encode(rng.standard_normal((nb, _HKV, bs, 2 * hd)), dt) + kv_np = _decode(kv, dt) + k_logical = kv_np[..., :hd].transpose(0, 2, 1, 3) + v_logical = kv_np[..., hd:].transpose(0, 2, 1, 3) + k_ptr = upload(kv) + v_ptr = k_ptr + hd * 2 + strides = (_HKV * bs * 2 * hd, 2 * hd, bs * 2 * hd) + else: + shape = (nb, bs, _HKV, hd) if kv_layout == "nhd" else (nb, _HKV, bs, hd) + k = _encode(rng.standard_normal(shape), dt) + v = _encode(rng.standard_normal(shape), dt) + k_np, v_np = _decode(k, dt), _decode(v, dt) + if kv_layout == "nhd": + k_logical, v_logical = k_np, v_np + strides = (bs * _HKV * hd, _HKV * hd, hd) + else: + k_logical, v_logical = k_np.transpose(0, 2, 1, 3), v_np.transpose( + 0, 2, 1, 3 + ) + strides = (_HKV * bs * hd, hd, bs * hd) + k_ptr, v_ptr = upload(k), upload(v) + kv_block_stride, kv_tok_stride, kv_head_stride = strides + span_bytes = ((_HKV - 1) * kv_head_stride + (bs - 1) * kv_tok_stride + hd) * 2 + + # ---- output with sentinel guards ---- + o_tok = hq * hd + sc["o_pad"] + o_elems = max(total_tok, 1) * o_tok + sentinel = _encode(np.array([_SENTINEL], np.float32), dt)[0] + o_host = np.full(_GUARD + o_elems + _GUARD, sentinel, np.uint16) + o_base = upload(o_host) + o_ptr = o_base + _GUARD * 2 + + seq_lens_dev = upload(np.array(seq_lens, np.int32)) + table_dev = upload(table) + v_table_dev = upload(v_table) if v_table is not table else table_dev + lq_dev = upload(np.array(q_lens_kernel if not dense else q_lens, np.int32)) + off_dev = upload(np.array(off, np.int32)) if not dense else seq_lens_dev + + if dense: + full_grid = nseq * -(-sc["L"] // bq) + else: + full_grid = off[-1] // bq + nseq + if dense: + q_seq_stride, o_seq_stride = sc["L"] * q_row, sc["L"] * o_tok + else: + q_seq_stride, o_seq_stride = q_row, o_tok + grid_y = sc["grid_y"] or full_grid + window = sc["window"] + values = dict( + output_ptr=o_ptr, + query_ptr=q_ptr, + key_cache_ptr=k_ptr, + value_cache_ptr=v_ptr, + sink_ptr=0, + block_tables_ptr=table_dev, + seq_lens_ptr=seq_lens_dev, + alibi_slopes_ptr=0, + qq_bias_ptr=0, + query_start_len_ptr=off_dev, + scale=1.0 / math.sqrt(hd), + k_scale=1.0, + v_scale=1.0, + out_scale=1.0, + softcap=0.0, + num_seqs=nseq, + block_table_stride=table.shape[1], + qq_bias_stride_0=0, + seq_lens_q_ptr=lq_dev if sc["has_lq"] else seq_lens_dev, + block_tables_v_ptr=v_table_dev, + has_seq_lens_q=sc["has_lq"], + q_uniform_len=sc["L"] if dense else 0, + num_query_heads=hq, + num_kv_heads=_HKV, + sliding_window=window if window is not None else _NO_WINDOW, + q_seq_stride=q_seq_stride, + q_tok_stride=q_row, + q_head_stride=hd, + o_seq_stride=o_seq_stride, + o_tok_stride=o_tok, + o_head_stride=hd, + kv_block_stride=kv_block_stride, + kv_tok_stride=kv_tok_stride, + kv_head_stride=kv_head_stride, + kv_block_span_bytes=span_bytes, + q_block_grid=grid_y, + ) + _launcher(spec)( + values, + config=LaunchConfig( + grid=(_HKV, grid_y, 1), block=(spec.num_warps * 64, 1, 1), fence=True + ), + ) + rt.memcpy_d2h(as_u8_buffer(o_host), o_base, o_host.nbytes) + del keep + got = _decode(o_host, dt) + ref = _reference( + q_rows, + k_logical, + v_logical, + table, + seq_lens, + q_lens_kernel, + qpk, + bs, + window if window is not None else _NO_WINDOW, + v_table, + ) + written = np.zeros(got.shape, bool) + for (b, s), res in ref.items(): + base = _GUARD + (tok_base[b] + s) * o_tok + for h in range(hq): + sl = slice(base + h * hd, base + (h + 1) * hd) + written[sl] = True + out = got[sl] + assert np.isfinite( + out + ).all(), f"{sc['name']}: non-finite seq {b} row {s} head {h}" + if not np.any(res[h]): + assert not np.any( + out + ), f"{sc['name']}: seq {b} row {s} head {h} not zero" + # The kernel rounds P and O to bf16/fp16 (8 or 11 mantissa bits); the + # reference stays in fp32. 2e-2 covers that rounding, not a looser kernel. + np.testing.assert_allclose( + out, + res[h], + atol=2e-2, + rtol=2e-2, + err_msg=f"{sc['name']}: seq {b} row {s} head {h}", + ) + # A dense Q's rows past seq_lens_q are padding: they store zeros. A ragged + # Q's gap rows (past seq_lens_q, up to the next offset) belong to no + # sequence: the kernel must not write them, so they keep the sentinel. + for b in range(nseq if dense else 0): + for s in range(q_lens_kernel[b], sc["L"]): + base = _GUARD + (tok_base[b] + s) * o_tok + sl = slice(base, base + hq * hd) + written[sl] = True + assert not np.any( + got[sl] + ), f"{sc['name']}: padding row {s} of seq {b} not zero" + untouched = o_host == sentinel + bad = np.flatnonzero(~written & ~untouched) + assert bad.size == 0, ( + f"{sc['name']}: {bad.size} elements outside the written rows changed " + f"(first at {bad[0] - _GUARD} relative to the O view)" + ) + + +@pytest.mark.gpu +@requires_gfx942_gpu +@pytest.mark.parametrize("dtype,head_size,block_size,qpk", _GPU_KERNELS) +def test_runtime_layout_numerics(dtype, head_size, block_size, qpk): + spec = runtime_layout_catalog_spec( + dtype=dtype, head_size=head_size, block_size=block_size, num_queries_per_kv=qpk + ) + rng = np.random.default_rng( + zlib.crc32(f"{dtype}:{head_size}:{block_size}:{qpk}".encode()) + ) + for sc in _scenarios(block_size): + _run_case(spec, sc, rng) diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/CMakeLists.txt b/dnn-providers/hip-kernel-provider/rocke/platform/CMakeLists.txt index cbeaab599849..ecf87622fb94 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/rocke/platform/CMakeLists.txt @@ -840,6 +840,27 @@ if(ROCKE_INSTALL_TESTS) " ENVIRONMENT \"PYTHONPATH=${ROCKE_TEST_CTEST_REL}tests/library\"\n" " TIMEOUT 900)\n") + # Tiled 2D runtime_layout host checks (no GPU required): catalog predicate and + # emit for every shipped cell, the rejection matrix, `_rtl` naming and the + # appended kernel arguments, for gfx942 and gfx950. The same files' GPU numerics + # are marked `gpu` and run in rocke_library_gpu_pytest, so `-m "not gpu"` keeps + # them out of this entry on a GPU runner. Same PYTHONPATH rule as the conv entry. + set(_ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TEST_RELPATHS + "tests/library/tests/test_gfx942_attention_runtime_layout.py" + "tests/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py") + set(_ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TESTS "") + foreach(_t ${_ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TEST_RELPATHS}) + string(APPEND _ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TESTS + " \"${ROCKE_TEST_CTEST_REL}${_t}\"") + endforeach() + string(APPEND _ROCKE_INSTALLED_CTEST_ENTRIES + "add_test(rocke_library_attention_runtime_layout_pytest python -m pytest${_ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TESTS} -m \"not gpu\" -v -rs --timeout=60)\n") + string(APPEND _ROCKE_INSTALLED_CTEST_ENTRIES + "set_tests_properties(rocke_library_attention_runtime_layout_pytest PROPERTIES\n" + " LABELS \"ckc\\;python\\;attention\\;host\\;quick\"\n" + " ENVIRONMENT \"PYTHONPATH=${ROCKE_TEST_CTEST_REL}tests/library\"\n" + " TIMEOUT 300)\n") + # DSA lightning-indexer CPU tests (no GPU: validator, dispatch wiring, and the # Python-lowered IR-sha golden). Same staged-library PYTHONPATH as the conv # lane. The on-GPU numeric tests are enrolled in the GPU lane below. @@ -1108,6 +1129,8 @@ if(ROCKE_INSTALL_TESTS) "tests/library/tests/test_attention_unified_2d_masked_tile_numeric.py" "tests/library/tests/test_attention_unified_scalar_masked_tile_numeric.py" "tests/library/tests/test_attention_tiled_3d_wave_page_id_load.py" + "tests/library/tests/test_gfx942_attention_runtime_layout.py" + "tests/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py" "tests/library/tests/test_kda_chunkwise_gfx942_numeric.py" "tests/library/tests/test_kda_chunkwise_gfx950_numeric.py" "tests/library/tests/test_kda_gdn_gfx950_numeric.py" diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py index 9af6118f7766..fd08399749fd 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py @@ -10,6 +10,36 @@ as a DIFF. """ + +def _rtl( + head_size, + block_size, + num_query_heads, + dtype, + *, + num_kv_heads=1, + use_sinks=False, + num_warps=4, + tile_size=None, +): + """A runtime_layout row, as the emitters' ``_rtl`` builds it.""" + cfg = { + "head_size": head_size, + "block_size": block_size, + "num_query_heads": num_query_heads, + "num_kv_heads": num_kv_heads, + "dtype": dtype, + "use_sinks": use_sinks, + "sliding_window": 0, + "has_softcap": False, + "num_warps": num_warps, + "runtime_layout": True, + } + if tile_size is not None: + cfg["tile_size"] = tile_size + return cfg + + GFX942_ATTENTION_TILED_2D = [ { "head_size": 64, @@ -264,6 +294,53 @@ "use_q_major_grid": True, "emit_lse": True, }, + { + "head_size": 64, + "block_size": 32, + "num_query_heads": 32, + "num_kv_heads": 8, + "dtype": "bf16", + "use_sinks": False, + "sliding_window": 0, + "has_softcap": False, + "num_warps": 4, + "block_m_per_warp": 32, + "tile_size": 64, + "use_mfma_32x32x8": True, + "use_transposed_qk_32x32": True, + "use_conflict_free_v_store": True, + }, + { + "head_size": 64, + "block_size": 32, + "num_query_heads": 32, + "num_kv_heads": 8, + "dtype": "bf16", + "use_sinks": False, + "sliding_window": 0, + "has_softcap": False, + "num_warps": 4, + "block_m_per_warp": 32, + "tile_size": 64, + "use_mfma_32x32x8": True, + "use_transposed_qk_32x32": True, + "use_conflict_free_v_store": True, + "use_i64_kv_addr": True, + }, +] + +# idx20-29: runtime_layout (catalog geometry). +GFX942_ATTENTION_TILED_2D += [ + _rtl(64, 16, 1, "fp16"), + _rtl(64, 32, 4, "bf16"), + _rtl(64, 64, 6, "fp16"), + _rtl(128, 16, 8, "bf16"), + _rtl(128, 32, 1, "fp16"), + _rtl(128, 64, 4, "bf16", tile_size=32), + _rtl(256, 16, 6, "fp16", num_warps=2), + _rtl(256, 32, 8, "bf16", num_warps=2, tile_size=16), + _rtl(256, 64, 1, "fp16", num_warps=2, tile_size=16), + _rtl(128, 32, 16, "bf16", num_kv_heads=4), ] GFX950_ATTENTION_TILED_2D = [ @@ -1348,6 +1425,20 @@ }, ] +# idx72-81 of the emitters: runtime_layout (catalog geometry). +GFX950_ATTENTION_TILED_2D += [ + _rtl(64, 16, 1, "fp16", num_warps=2), + _rtl(64, 32, 4, "bf16"), + _rtl(64, 64, 6, "fp16"), + _rtl(128, 16, 8, "bf16"), + _rtl(128, 32, 1, "fp16"), + _rtl(128, 64, 4, "bf16"), + _rtl(256, 16, 6, "fp16"), + _rtl(256, 32, 8, "bf16"), + _rtl(256, 64, 1, "fp16"), + _rtl(128, 32, 16, "bf16", num_kv_heads=4), +] + GFX942_ATTENTION_TILED_3D = [ { "head_size": 64, diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/rocke_engine_attention.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/rocke_engine_attention.cpp index 381aab312aaf..0b6ddb2afe71 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/rocke_engine_attention.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/rocke_engine_attention.cpp @@ -824,6 +824,7 @@ rocke_attention_tiled_2d_spec_t t2d_build(const py::dict& d, Store& st) s.use_fast_paged_kv_desc = a_bool(d, "use_fast_paged_kv_desc", s.use_fast_paged_kv_desc); s.use_qblock_reverse = a_bool(d, "use_qblock_reverse", s.use_qblock_reverse); s.emit_lse = a_bool(d, "emit_lse", s.emit_lse); + s.runtime_layout = a_bool(d, "runtime_layout", s.runtime_layout); /* Every other field the C struct shares with the Python spec. A field left * out here silently keeps its C default, so the native builder would build * a different kernel (e.g. gfx942 x8 transposed specs fail validation @@ -1030,6 +1031,7 @@ rocke_attention_tiled_2d_spec_t fkv_build(const py::dict& d, Store& st) s.use_agpr_alloc_zero = a_bool(d, "use_agpr_alloc_zero", s.use_agpr_alloc_zero); s.use_grouped_kv2_softmax = a_bool(d, "use_grouped_kv2_softmax", s.use_grouped_kv2_softmax); s.emit_lse = a_bool(d, "emit_lse", s.emit_lse); + s.runtime_layout = a_bool(d, "runtime_layout", s.runtime_layout); std::string v; if(a_str(d, "dtype", v)) s.dtype = st.keep(v); diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/abi.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/abi.h index 4b739b3d586a..963219916ee1 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/abi.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/abi.h @@ -108,8 +108,12 @@ extern "C" { * 12: indexed matrix sources, independent destination, and source-owned scales * replace the flat MMA fields and role enum. Indexed queries supplement the * result-aware A/B/C queries; native consumers must rebuild. ABI11 libraries - * do not share this combined layout and must be refused. */ -#define ROCKE_ABI_VERSION 12 + * do not share this combined layout and must be refused. + * 13: rocke_attention_tiled_2d_spec_t gained runtime_layout at its end. The + * bool lands in the struct's tail padding, so sizeof stays 152, but a + * caller built against the old header leaves the byte the builder now + * reads unset. */ +#define ROCKE_ABI_VERSION 13 /* Wire ABI: the CBOR recipe/bundle/guard vocabulary this engine understands. * 2: list-tagged ("l") kernel attrs such as cluster_dims; level-1 engines drop them. diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h index 4969371817ef..000a9c4b4924 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h @@ -183,6 +183,13 @@ typedef struct rocke_attention_tiled_2d_spec * [total_q, num_query_heads] through a trailing lse_ptr param. Off emits * no new IR; on appends the "lse" kernel-name token. */ bool emit_lse; /* False (Python kw_only) */ + /* Runtime-layout mode (hipDNN paged/ragged SDPA): the Q/O/KV strides and a + * dense-or-ragged Q become 15 appended kernel arguments (after the runtime + * head counts and window), + * the page tables and lengths are read on the device and the q-block grid + * is walked with a grid-stride loop. Off emits no new IR; on appends the + * "rtl" kernel-name token. See the Python spec field for the contract. */ + bool runtime_layout; /* False */ } rocke_attention_tiled_2d_spec_t; /* Materialise every defaulted field (the dataclass defaults). The required @@ -219,6 +226,24 @@ int rocke_attention_tiled_2d_spec_binary_search_iters(const rocke_attention_tile bool rocke_attention_tiled_2d_spec_validate(rocke_ir_builder_t* b, const rocke_attention_tiled_2d_spec_t* s); +/* _runtime_layout_reject_reason, gfx942 (kernels/gfx942/attention_tiled_2d.py) + * and gfx950 (kernels/gfx950/attention_tiled_2d.py). Each returns false when + * the spec is a valid runtime_layout spec on that arch (or runtime_layout is + * off); otherwise it returns true and writes the Python ValueError text into + * ``reason`` (capacity ``reason_cap``; ``reason`` may be NULL). Spec fields the + * Python spec has and this struct does not (always False here) are skipped. */ +bool rocke_gfx942_attention_tiled_2d_runtime_layout_reject_reason( + const rocke_attention_tiled_2d_spec_t* s, char* reason, size_t reason_cap); +bool rocke_gfx950_attention_tiled_2d_runtime_layout_reject_reason( + const rocke_attention_tiled_2d_spec_t* s, char* reason, size_t reason_cap); + +/* runtime_layout_lds_bytes, gfx942: static LDS bytes of a runtime_layout + * kernel (fp16/bf16). Both builders refuse a runtime_layout spec whose bytes + * exceed the target's ArchTarget lds_capacity_bytes. */ +int rocke_gfx942_attention_tiled_2d_runtime_layout_lds_bytes(int head_size, + int tile_size, + int num_warps); + /* ----------------------------------------------- config-from-spec (build head) * * * The pile of ALL-CAPS config constants the build function derives from the diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h new file mode 100644 index 000000000000..bfbcc335dc3f --- /dev/null +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h @@ -0,0 +1,84 @@ +// Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT +/* runtime_layout kernel arguments of the gfx942 and gfx950 tiled 2D unified + * attention twins. Mirrors RUNTIME_LAYOUT_EXTRA_ARGS + * (kernels/gfx942/attention_tiled_2d.py) and _RTL_PARAMS + * (kernels/gfx950/attention_tiled_2d.py): the same 15 arguments, in the same + * order, appended after the fixed ones and the runtime shape arguments + * (num_query_heads, num_kv_heads, sliding_window). Not a public ABI. */ +#ifndef ROCKE_INSTANCE_ATTENTION_TILED_2D_RTL_INTERNAL_H +#define ROCKE_INSTANCE_ATTENTION_TILED_2D_RTL_INTERNAL_H + +#include + +#include "rocke/ir.h" + +/* Kernel argument index, in ABI order. The first two are ptr, the rest + * i32. Strides are in elements; kv_block_span_bytes is the byte range of one + * page's buffer resource. block_tables_v_ptr is V's block table; it shares + * block_table_stride with block_tables_ptr (K's) and may be the same pointer. + * q_uniform_len is L > 0 for a dense Q and 0 for a ragged one (offsets + * non-decreasing, off[b+1] - off[b] >= seq_lens_q[b], off[B] the end of the + * last block). */ +typedef enum rocke_attn2d_rtl_param +{ + ROCKE_ATTN2D_RTL_BLOCK_TABLES_V = 0, + ROCKE_ATTN2D_RTL_SEQ_LENS_Q, + ROCKE_ATTN2D_RTL_HAS_SEQ_LENS_Q, + ROCKE_ATTN2D_RTL_Q_UNIFORM_LEN, + ROCKE_ATTN2D_RTL_Q_SEQ_STRIDE, + ROCKE_ATTN2D_RTL_Q_TOK_STRIDE, + ROCKE_ATTN2D_RTL_Q_HEAD_STRIDE, + ROCKE_ATTN2D_RTL_O_SEQ_STRIDE, + ROCKE_ATTN2D_RTL_O_TOK_STRIDE, + ROCKE_ATTN2D_RTL_O_HEAD_STRIDE, + ROCKE_ATTN2D_RTL_KV_BLOCK_STRIDE, + ROCKE_ATTN2D_RTL_KV_TOK_STRIDE, + ROCKE_ATTN2D_RTL_KV_HEAD_STRIDE, + ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES, + ROCKE_ATTN2D_RTL_Q_BLOCK_GRID, + ROCKE_ATTN2D_RTL_NUM_PARAMS +} rocke_attn2d_rtl_param_t; + +/* Declare the appended arguments, in order, into out[0..NUM_PARAMS). The + * pointers are readonly with align 4, the scalars plain i32. */ +static inline void rocke_attn2d_rtl_declare_params(rocke_ir_builder_t* b, rocke_value_t** out) +{ + static const char* const names[ROCKE_ATTN2D_RTL_NUM_PARAMS] = { + "block_tables_v_ptr", + "seq_lens_q_ptr", + "has_seq_lens_q", + "q_uniform_len", + "q_seq_stride", + "q_tok_stride", + "q_head_stride", + "o_seq_stride", + "o_tok_stride", + "o_head_stride", + "kv_block_stride", + "kv_tok_stride", + "kv_head_stride", + "kv_block_span_bytes", + "q_block_grid", + }; + const rocke_type_t* ptr_i32 = rocke_ptr_type(b, rocke_i32(), "global"); + for(int i = 0; i < ROCKE_ATTN2D_RTL_NUM_PARAMS; ++i) + { + if(i <= ROCKE_ATTN2D_RTL_SEQ_LENS_Q) + { + rocke_param_opts_t o; + memset(&o, 0, sizeof(o)); + o.readonly = true; + o.readonly_set = true; + o.align = 4; + o.align_set = true; + out[i] = rocke_b_param(b, names[i], ptr_i32, &o); + } + else + { + out[i] = rocke_b_param(b, names[i], rocke_i32(), NULL); + } + } +} + +#endif /* ROCKE_INSTANCE_ATTENTION_TILED_2D_RTL_INTERNAL_H */ diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h index dd2274b84870..43e691d4313e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h @@ -71,6 +71,7 @@ #include "rocke/helper_rocke.helpers.atoms.h" /* rocke_mfma_atom_t */ #include "rocke/helper_rocke.helpers.attention.h" /* binary_search / softmax reduces */ #include "rocke/helper_rocke.helpers.transforms.h" /* rocke_tensor_descriptor_t */ +#include "rocke/instance_attention_tiled_2d_rtl_internal.h" /* ROCKE_ATTN2D_RTL_* */ #include "rocke/instance_gfx942_attention_tiled_2d.h" /* spec_t + config_t (via helper hdr) */ #include "rocke/ir.h" @@ -184,6 +185,10 @@ typedef struct rocke_gfx942_attn2d_build_ctx rocke_value_t* sliding_window_p; /* Trailing lse_ptr (F32*), declared only when spec->emit_lse; else NULL. */ rocke_value_t* lse; + /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, + * indexed by ROCKE_ATTN2D_RTL_*; all NULL when off. */ + bool RTL; + rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; /* ---- grid ids + wave decomposition (lines 1371-1388) ---- */ rocke_value_t* q_block_global_idx; @@ -204,6 +209,21 @@ typedef struct rocke_gfx942_attn2d_build_ctx rocke_value_t* context_len; rocke_value_t* qb_start_pos; + /* ---- runtime_layout q-block geometry (Python ``if RTL:`` seq lookup) ---- + * rtl_q_rows: the rows the kernel writes in Q/O (a dense Q's padding rows + * included; a ragged Q's live rows only); + * rtl_q_src / rtl_o_dst: the per-sequence 64-bit Q/O bases; rtl_q_desc / + * rtl_o_desc: the runtime-stride [token, head, dim] descriptors. The + * grid-stride q-block loop and the "block has rows" branch are entered in + * the prologue and closed by the epilogue. */ + rocke_value_t* rtl_q_rows; + rocke_value_t* rtl_q_src; + rocke_value_t* rtl_o_dst; + rocke_dynamic_tensor_descriptor_t* rtl_q_desc; + rocke_dynamic_tensor_descriptor_t* rtl_o_desc; + rocke_for_t rtl_qb_loop; + rocke_if_t rtl_rows_if; + /* ---- Acc_lds stripe geometry (lines 1436-1443) ---- */ int OUT_STRIPE_COLS, OUT_STRIPES; @@ -299,6 +319,16 @@ typedef struct rocke_gfx942_attn2d_build_ctx rocke_value_t* k_rsrc; /* make_buffer_resource(K) */ rocke_value_t* v_rsrc; /* make_buffer_resource(V) */ rocke_value_t* out_rsrc; + /* big_bytes (const 0x7FFF0000), the K/V/block-table resource range. */ + rocke_value_t* big_bytes_v; + /* runtime_layout paged K/V: i64 page stride in bytes, the per-page byte + * descriptor [token, kv_head, dim], the masked-lane voffset and the K / V + * block-table buffer resources. NULL when off. */ + rocke_value_t* rtl_kv_page_stride_b; + rocke_dynamic_tensor_descriptor_t* rtl_kv_desc; + rocke_value_t* rtl_kv_oob; + rocke_value_t* rtl_bt_rsrc; + rocke_value_t* rtl_bt_v_rsrc; /* ---- per-lane Q VGPR gather (lines 3426-3592) ---- * * The Q MFMA A-operand registers (one path: the legacy 16x16 gather; the @@ -392,7 +422,6 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, * byte-identical Python order. Names track the Python source so a reviewer can * diff each .c against its closure. * ===================================================================== */ - /* ----- per-lane row map + bit helpers (lines 2031-2052) ----- */ rocke_value_t* rocke_gfx942_attn2d_in_warp_row(rocke_gfx942_attn2d_build_ctx_t* ctx, int r); rocke_value_t* rocke_gfx942_attn2d_state_row(rocke_gfx942_attn2d_build_ctx_t* ctx, int r); diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h index 8665f4c206c4..1de5bbcf7f9c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h @@ -71,6 +71,7 @@ #include "rocke/helper_rocke.helpers.distribution.h" /* static tile distribution (32x32 C dist) */ #include "rocke/helper_rocke.helpers.layouts.h" /* rocke_transpose_lds_reader_t (PV reader) */ #include "rocke/helper_rocke.helpers.transforms.h" /* rocke_tensor_descriptor_t */ +#include "rocke/instance_attention_tiled_2d_rtl_internal.h" /* ROCKE_ATTN2D_RTL_* */ #include "rocke/instance_gfx950_attention_tiled_2d.h" /* spec_t + config_t (via helper hdr) */ #include "rocke/ir.h" @@ -183,6 +184,10 @@ typedef struct rocke_gfx950_attn2d_build_ctx rocke_value_t* num_kv_p; rocke_value_t* sliding_window_p; rocke_value_t* lse; /* lse_ptr (spec->emit_lse only, else NULL) */ + /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, + * indexed by ROCKE_ATTN2D_RTL_* (Python _RTL_PARAMS); all NULL when off. */ + bool RTL; + rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; /* ---- grid ids + wave decomposition ---- */ rocke_value_t* q_block_global_idx; @@ -203,6 +208,18 @@ typedef struct rocke_gfx950_attn2d_build_ctx rocke_value_t* context_len; rocke_value_t* qb_start_pos; + /* ---- runtime_layout q-block geometry (Python ``if RTL:`` seq lookup) ---- + * rtl_q_rows: the rows the kernel writes in Q/O (a dense Q's padding rows + * included; a ragged Q's live rows only); + * rtl_q_ptr / rtl_o_ptr: the per-sequence 64-bit Q/O bases. The grid-stride + * q-block loop and the live-block branch are entered in the prologue and + * closed by the epilogue. */ + rocke_value_t* rtl_q_rows; + rocke_value_t* rtl_q_ptr; + rocke_value_t* rtl_o_ptr; + rocke_for_t rtl_qb_loop; + rocke_if_t rtl_live_block; + /* ---- Acc_lds stripe geometry (lines 935-960) ---- */ int OUT_STRIPE_COLS, OUT_STRIPES; /* 32x32 epilogue stripe geometry (lines 3658-3717). */ @@ -312,6 +329,10 @@ typedef struct rocke_gfx950_attn2d_build_ctx rocke_value_t* k_rsrc; /* make_buffer_resource(K) */ rocke_value_t* v_rsrc; /* make_buffer_resource(V) */ rocke_value_t* out_rsrc; + /* runtime_layout paged K/V: i64 page stride in bytes and the per-page byte + * descriptor [token, kv_head, dim]. NULL when off. */ + rocke_value_t* rtl_kv_page_stride_b; + rocke_dynamic_tensor_descriptor_t* rtl_kv_desc; /* ---- per-lane Q VGPR gather ---- * * The Q MFMA A-operand registers (legacy 16x16 gather q_regs; the 32x32x16 / diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp index 427151670a77..8fcbe92d272e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp @@ -35,6 +35,7 @@ #include "rocke/error.hpp" #include "rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h" +#include "rocke/helper_rocke.instances.common._fmha_common.h" /* rocke_attention_check_head_counts */ #include "rocke/ir.h" /* ------------------------------------------------------------- error latch */ @@ -130,9 +131,235 @@ rocke_attention_tiled_2d_spec_t rocke_attention_tiled_2d_spec_default(void) s.use_q_major_grid = false; s.use_qblock_reverse = false; s.emit_lse = false; + s.runtime_layout = false; return s; } +/* ------------------------------------------------ runtime_layout spec checks */ + +static void rocke_attn2d_reason(char* reason, size_t cap, const char* fmt, ...) +{ + if(reason == NULL || cap == 0) + return; + va_list ap; + va_start(ap, fmt); + (void)vsnprintf(reason, cap, fmt, ap); + va_end(ap); + reason[cap - 1] = '\0'; +} + +typedef struct rocke_attn2d_rtl_flag +{ + const char* name; + bool on; +} rocke_attn2d_rtl_flag_t; + +/* gfx942 _runtime_layout_reject_reason: every _RTL_INCOMPATIBLE_FLAGS entry + * that is set (in Python order), then kv_storage_dtype, a compile-time window + * and block_m_per_warp != 16, reported together; then the GQA ratio; then the + * sub-block tile_size rule. use_v_hbm_direct, use_k_hbm_direct and + * use_causal_mask_phase_split are not fields of the C struct. */ +bool rocke_gfx942_attention_tiled_2d_runtime_layout_reject_reason( + const rocke_attention_tiled_2d_spec_t* s, char* reason, size_t reason_cap) +{ + if(s == NULL || !s->runtime_layout) + return false; + const rocke_attn2d_rtl_flag_t flags[] = { + {"use_sinks", s->use_sinks}, + {"has_softcap", s->has_softcap}, + {"use_alibi", s->use_alibi}, + {"use_qq_bias", s->use_qq_bias}, + {"use_fp8_mfma_qk", s->use_fp8_mfma_qk}, + {"use_fp8_mfma_pv", s->use_fp8_mfma_pv}, + {"use_register_pv", s->use_register_pv}, + {"use_mfma_32x32", s->use_mfma_32x32}, + {"use_mfma_32x32x8", s->use_mfma_32x32x8}, + {"use_transposed_qk_32x32", s->use_transposed_qk_32x32}, + {"use_transposed_scalar_state", s->use_transposed_scalar_state}, + {"use_transposed_invariant_hoist", s->use_transposed_invariant_hoist}, + {"use_transposed_mask_once", s->use_transposed_mask_once}, + {"use_transposed_half_local_pv", s->use_transposed_half_local_pv}, + {"use_mfma32_skip_legacy_qreg", s->use_mfma32_skip_legacy_qreg}, + {"use_transposed_mask_limit", s->use_transposed_mask_limit}, + {"use_grouped_kv2_softmax", s->use_grouped_kv2_softmax}, + {"use_fast_paged_kv_desc", s->use_fast_paged_kv_desc}, + {"use_i64_kv_addr", s->use_i64_kv_addr}, + {"use_early_v_schedule", s->use_early_v_schedule}, + {"use_agpr_alloc_zero", s->use_agpr_alloc_zero}, + {"use_conflict_free_v", s->use_conflict_free_v}, + {"use_conflict_free_v_store", s->use_conflict_free_v_store}, + {"use_k_single_buffer", s->use_k_single_buffer}, + {"use_k_sliced_ring", s->use_k_sliced_ring}, + {"use_k_sliced_ldsseq", s->use_k_sliced_ldsseq}, + {"use_iglp_opt", s->use_iglp_opt}, + {"use_qk_pv_sched_group_barrier", s->use_qk_pv_sched_group_barrier}, + {"use_q_direct_global", s->use_q_direct_global}, + {"use_global_load_lds_k", s->use_global_load_lds_k}, + {"use_q_major_grid", s->use_q_major_grid}, + {"emit_lse", s->emit_lse}, + {"kv_storage_dtype", s->kv_storage_dtype != NULL}, + {"sliding_window != 0 (the window is a runtime kernarg)", s->sliding_window != 0}, + {"block_m_per_warp != 16", s->block_m_per_warp != 16}, + }; + char bad[ROCKE_ERR_MSG_CAP]; + size_t used = 0; + bad[0] = '\0'; + for(size_t i = 0; i < sizeof(flags) / sizeof(flags[0]); ++i) + { + if(!flags[i].on) + continue; + int n = snprintf( + bad + used, sizeof(bad) - used, "%s%s", used == 0 ? "" : ", ", flags[i].name); + if(n > 0) + used = (used + (size_t)n < sizeof(bad)) ? used + (size_t)n : sizeof(bad) - 1; + } + if(used != 0) + { + rocke_attn2d_reason(reason, reason_cap, "runtime_layout is incompatible with: %s", bad); + return true; + } + if(!rocke_attention_check_head_counts(s->num_query_heads, s->num_kv_heads, reason, reason_cap)) + return true; + if(s->has_tile_size) + { + const int t = s->tile_size; + if(t < 16 || t % 16 != 0 || t > s->block_size || s->block_size % t != 0) + { + rocke_attn2d_reason(reason, + reason_cap, + "runtime_layout tile_size must be a multiple of 16 that divides " + "block_size (got tile_size=%d, block_size=%d)", + t, + s->block_size); + return true; + } + } + return false; +} + +/* gfx950 _runtime_layout_reject_reason: the first failing check, in Python + * order. use_additive_bias, causal_top_left, right_bound, use_kq_lds_pad and + * use_mask_phase_split are not fields of the C struct. */ +bool rocke_gfx950_attention_tiled_2d_runtime_layout_reject_reason( + const rocke_attention_tiled_2d_spec_t* s, char* reason, size_t reason_cap) +{ + if(s == NULL || !s->runtime_layout) + return false; + if(!rocke_attention_check_head_counts(s->num_query_heads, s->num_kv_heads, reason, reason_cap)) + return true; + if(s->sliding_window != 0) + { + rocke_attn2d_reason(reason, + reason_cap, + "runtime_layout takes the sliding window as a kernarg; " + "spec sliding_window must be 0"); + return true; + } + const rocke_attn2d_rtl_flag_t features[] = { + {"use_sinks", s->use_sinks}, + {"has_softcap", s->has_softcap}, + {"use_alibi", s->use_alibi}, + {"use_qq_bias", s->use_qq_bias}, + {"kv_storage_dtype (fp8 KV)", s->kv_storage_dtype != NULL}, + {"use_fp8_mfma_qk", s->use_fp8_mfma_qk}, + {"use_fp8_mfma_pv", s->use_fp8_mfma_pv}, + {"emit_lse", s->emit_lse}, + }; + for(size_t i = 0; i < sizeof(features) / sizeof(features[0]); ++i) + { + if(features[i].on) + { + rocke_attn2d_reason( + reason, reason_cap, "runtime_layout does not support %s", features[i].name); + return true; + } + } + const rocke_attn2d_rtl_flag_t pipeline[] = { + {"use_mfma_32x32", s->use_mfma_32x32}, + {"use_transposed_qk_32x32", s->use_transposed_qk_32x32}, + {"use_fast_paged_kv_desc", s->use_fast_paged_kv_desc}, + {"use_i64_kv_addr (always 64-bit in runtime_layout)", s->use_i64_kv_addr}, + {"use_register_pv", s->use_register_pv}, + {"use_v_double_buffer", s->use_v_double_buffer}, + {"kv_ring_depth != 2", s->kv_ring_depth != 2}, + {"use_staggered_iter_wait", s->use_staggered_iter_wait}, + {"use_early_v_schedule", s->use_early_v_schedule}, + {"use_k_single_buffer", s->use_k_single_buffer}, + {"use_grouped_kv2_softmax", s->use_grouped_kv2_softmax}, + {"use_q_reread", s->use_q_reread}, + {"use_q_direct_reg", s->use_q_direct_reg}, + {"use_agpr_alloc_zero", s->use_agpr_alloc_zero}, + {"use_sched_barrier", s->use_sched_barrier}, + {"use_softmax_mfma_interleave", s->use_softmax_mfma_interleave}, + {"use_qblock_reverse", s->use_qblock_reverse}, + }; + for(size_t i = 0; i < sizeof(pipeline) / sizeof(pipeline[0]); ++i) + { + if(pipeline[i].on) + { + rocke_attn2d_reason(reason, + reason_cap, + "runtime_layout runs the default 16x16x32 pipeline; " + "%s is not supported", + pipeline[i].name); + return true; + } + } + if(s->block_m_per_warp != 16) + { + rocke_attn2d_reason(reason, reason_cap, "runtime_layout requires block_m_per_warp=16"); + return true; + } + if(s->has_tile_size && s->tile_size != s->block_size) + { + rocke_attn2d_reason(reason, + reason_cap, + "runtime_layout requires tile_size == block_size " + "(one paged block per KV tile)"); + return true; + } + /* Checked before the DMA divisibility below, which divides by it. */ + if(!(s->num_warps == 1 || s->num_warps == 2 || s->num_warps == 4 || s->num_warps == 8)) + { + rocke_attn2d_reason(reason, + reason_cap, + "runtime_layout requires num_warps in {1, 2, 4, 8} (got %d)", + s->num_warps); + return true; + } + const int threads = s->num_warps * 64; + if((s->block_size * s->head_size) % (threads * 8) != 0) + { + rocke_attn2d_reason(reason, + reason_cap, + "runtime_layout: block_size*head_size=%d must be a multiple of " + "num_warps*512=%d (whole async-DMA calls per tile)", + s->block_size * s->head_size, + threads * 8); + return true; + } + return false; +} + +/* gfx942 runtime_layout_lds_bytes: every allocation is touched inside the + * q-block grid-stride loop, so none alias. K double buffer + V (with the + * bank-deconflict row pad, an upper bound) + P_lds + Q_lds (only when Q does + * not fit in K_lds) + Acc_lds. */ +int rocke_gfx942_attention_tiled_2d_runtime_layout_lds_bytes(int head_size, + int tile_size, + int num_warps) +{ + const int t = tile_size; + const int hd = head_size; + const int bm = num_warps * 16; + const int k_lds = 2 * t * hd * 2; + const int v_lds = t * (hd + 8) * 2; + const int p_lds = bm * (t + 8) * 2; + const int q_lds = (bm <= 2 * t) ? 0 : bm * hd * 2; + const int acc_lds = bm * (hd <= 64 ? 32 : hd) * 2; + return k_lds + v_lds + p_lds + q_lds + acc_lds; +} + /* ------------------------------------------------- derived @property bodies */ int rocke_attention_tiled_2d_spec_num_queries_per_kv(const rocke_attention_tiled_2d_spec_t* s) @@ -246,6 +473,16 @@ bool rocke_attention_tiled_2d_spec_validate(rocke_ir_builder_t* b, rocke_attn2d_set_err(b, ROCKE_ERR_VALUE, "attention_tiled_2d spec is NULL"); return false; } + { + /* runtime_layout restrictions first, as in __post_init__. */ + char rtl_reason[ROCKE_ERR_MSG_CAP]; + if(rocke_gfx942_attention_tiled_2d_runtime_layout_reject_reason( + s, rtl_reason, sizeof(rtl_reason))) + { + rocke_attn2d_set_err(b, ROCKE_ERR_VALUE, "%s", rtl_reason); + return false; + } + } /* gfx950-only experimental knobs rejected up front on gfx942. * NOTE: use_agpr_alloc_zero is NOT an ISA feature -- it is a backend codegen diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp index a221662cb4c0..5b3fe6f6259f 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp @@ -99,6 +99,125 @@ static bool rocke_a2d_require_tiled_attention_arch(rocke_ir_builder_t* b, const return false; } +/* Python ``if RTL:`` seq lookup: the dense-or-ragged q-block mapping (ragged: + * binary search over non-decreasing offsets; a q-block before the first + * origin finds -1, reads sequence 0 and writes no row), the grid-stride + * q-block loop (entered here, closed by the epilogue), the per-sequence row + * counts and lengths, the "block has rows" branch (also closed by the + * epilogue) and the 64-bit Q/O bases + runtime-stride Q/O descriptors. */ +static void rocke_a2d_rtl_seq_lookup(rocke_gfx942_attn2d_build_ctx_t* ctx, int BLOCK_Q) +{ + rocke_ir_builder_t* b = ctx->b; + rocke_value_t* const* p = ctx->rtl_p; + rocke_value_t* num_seqs = ctx->num_seqs_p; + rocke_value_t* q_len_u = p[ROCKE_ATTN2D_RTL_Q_UNIFORM_LEN]; + + rocke_value_t* c0 = rocke_b_const_i32(b, 0); + rocke_value_t* dense = rocke_b_cmp_gt(b, q_len_u, c0); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* ragged = rocke_b_cmp_eq(b, q_len_u, c0); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* has_lq = rocke_b_cmp_ne(b, p[ROCKE_ATTN2D_RTL_HAS_SEQ_LENS_Q], c0); + rocke_value_t* bq_m1 = rocke_b_const_i32(b, BLOCK_Q - 1); + rocke_value_t* len_up = rocke_b_add(b, q_len_u, bq_m1); + rocke_value_t* bq = rocke_b_const_i32(b, BLOCK_Q); + rocke_value_t* bps_dense = rocke_b_div(b, len_up, bq); + rocke_value_t* c1 = rocke_b_const_i32(b, 1); + rocke_value_t* bps = rocke_b_select(b, dense, bps_dense, c1); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* off_end + = rocke_b_masked_global_load(b, ctx->cu_q, num_seqs, ragged, c0, rocke_i32(), 4); + rocke_value_t* total_dense = rocke_b_mul(b, num_seqs, bps); + bq = rocke_b_const_i32(b, BLOCK_Q); + rocke_value_t* off_end_blocks = rocke_b_div(b, off_end, bq); + rocke_value_t* total_ragged = rocke_b_add(b, off_end_blocks, num_seqs); + rocke_value_t* total = rocke_b_select(b, dense, total_dense, total_ragged); + + ctx->rtl_qb_loop = rocke_b_scf_for( + b, ctx->q_block_global_idx, total, p[ROCKE_ATTN2D_RTL_Q_BLOCK_GRID], "rtl_qb"); + rocke_b_region_enter(b, ctx->rtl_qb_loop.body); + rocke_value_t* qb = ctx->rtl_qb_loop.iv; + ctx->q_block_global_idx = qb; + + /* DENSE maps q-blocks arithmetically: its search runs no iteration. */ + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* trip = rocke_binary_search_seq_idx_trip_count(b, num_seqs); + rocke_value_t* iters = rocke_b_select(b, dense, c0, trip); + rocke_value_t* seq_ragged + = rocke_binary_search_seq_idx_dyn(b, ctx->cu_q, qb, num_seqs, BLOCK_Q, iters, false); + rocke_value_t* seq_dense = rocke_b_div(b, qb, bps); + rocke_value_t* seq_found = rocke_b_select(b, dense, seq_dense, seq_ragged); + /* A q-block before the first origin finds no sequence (-1). */ + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* seq_ok = rocke_b_cmp_ge(b, seq_found, c0); + c0 = rocke_b_const_i32(b, 0); + ctx->seq_idx = rocke_b_smax(b, seq_found, c0); + rocke_value_t* seq_idx = ctx->seq_idx; + + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* off_start + = rocke_b_masked_global_load(b, ctx->cu_q, seq_idx, ragged, c0, rocke_i32(), 4); + c1 = rocke_b_const_i32(b, 1); + rocke_value_t* seq_p1 = rocke_b_add(b, seq_idx, c1); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* off_stop + = rocke_b_masked_global_load(b, ctx->cu_q, seq_p1, ragged, c0, rocke_i32(), 4); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* lq = rocke_b_masked_global_load( + b, p[ROCKE_ATTN2D_RTL_SEQ_LENS_Q], seq_idx, has_lq, c0, rocke_i32(), 4); + + /* owned: the rows the sequence's block spans; a ragged Q writes only its live + * rows (rows of the block past seq_lens_q belong to no sequence). */ + rocke_value_t* rows_ragged = rocke_b_sub(b, off_stop, off_start); + rocke_value_t* owned = rocke_b_select(b, dense, q_len_u, rows_ragged); + rocke_value_t* live = rocke_b_smin(b, owned, lq); + ctx->cur_batch_q_len = rocke_b_select(b, has_lq, live, owned); + rocke_value_t* q_rows = rocke_b_select(b, dense, q_len_u, ctx->cur_batch_q_len); + /* Below the (negative) start position of a q-block with no sequence. */ + rocke_value_t* no_rows = rocke_b_const_i32(b, -2147483647 - 1); + ctx->rtl_q_rows = rocke_b_select(b, seq_ok, q_rows, no_rows); + rocke_value_t* seq_base_idx = rocke_b_select(b, dense, seq_idx, off_start); + rocke_value_t* qbs_dense = rocke_b_mul(b, seq_idx, bps); + bq = rocke_b_const_i32(b, BLOCK_Q); + rocke_value_t* off_start_blocks = rocke_b_div(b, off_start, bq); + rocke_value_t* qbs_ragged = rocke_b_add(b, off_start_blocks, seq_idx); + ctx->q_block_start_idx = rocke_b_select(b, dense, qbs_dense, qbs_ragged); + ctx->q_block_local_idx = rocke_b_sub(b, qb, ctx->q_block_start_idx); + ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, seq_idx, 0); + ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); + bq = rocke_b_const_i32(b, BLOCK_Q); + ctx->qb_start_pos = rocke_b_mul(b, ctx->q_block_local_idx, bq); + + rocke_value_t* has_rows = rocke_b_cmp_lt(b, ctx->qb_start_pos, ctx->rtl_q_rows); + ctx->rtl_rows_if = rocke_b_scf_if(b, has_rows); + rocke_b_region_enter(b, ctx->rtl_rows_if.then_region); + + /* 64-bit per-sequence Q/O bases; within-sequence offsets stay i32. */ + rocke_value_t* sb64 = rocke_b_zext(b, seq_base_idx, rocke_i64()); + rocke_value_t* q_seq64 = rocke_b_zext(b, p[ROCKE_ATTN2D_RTL_Q_SEQ_STRIDE], rocke_i64()); + rocke_value_t* q_elems = rocke_b_mul(b, sb64, q_seq64); + rocke_value_t* one64 = rocke_b_const_i64(b, 1); + rocke_value_t* q_bytes = rocke_b_shl(b, q_elems, one64); + ctx->rtl_q_src = rocke_b_global_ptr_add(b, ctx->query, q_bytes); + rocke_value_t* o_seq64 = rocke_b_zext(b, p[ROCKE_ATTN2D_RTL_O_SEQ_STRIDE], rocke_i64()); + rocke_value_t* o_elems = rocke_b_mul(b, sb64, o_seq64); + one64 = rocke_b_const_i64(b, 1); + rocke_value_t* o_bytes = rocke_b_shl(b, o_elems, one64); + ctx->rtl_o_dst = rocke_b_global_ptr_add(b, ctx->output, o_bytes); + + static const char* const qo_coords[3] = {"token", "head", "dim"}; + rocke_value_t* q_strides[3]; + q_strides[0] = p[ROCKE_ATTN2D_RTL_Q_TOK_STRIDE]; + q_strides[1] = p[ROCKE_ATTN2D_RTL_Q_HEAD_STRIDE]; + q_strides[2] = rocke_b_const_i32(b, 1); + ctx->rtl_q_desc = rocke_tensor_descriptor_naive_dynamic(b, "rtl_q", qo_coords, 3, q_strides); + rocke_value_t* o_strides[3]; + o_strides[0] = p[ROCKE_ATTN2D_RTL_O_TOK_STRIDE]; + o_strides[1] = p[ROCKE_ATTN2D_RTL_O_HEAD_STRIDE]; + o_strides[2] = rocke_b_const_i32(b, 1); + ctx->rtl_o_desc = rocke_tensor_descriptor_naive_dynamic(b, "rtl_o", qo_coords, 3, o_strides); +} + /* ===================================================================== * * rocke_gfx942_attn2d_build_ctx_init -- the prologue (lines 1104-1912) * ===================================================================== */ @@ -118,6 +237,18 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, ctx->spec = spec; ctx->arch = arch; + /* ---- runtime_layout spec checks (__post_init__ raises them first) ---- */ + { + char rtl_reason[ROCKE_ERR_MSG_CAP]; + if(rocke_gfx942_attention_tiled_2d_runtime_layout_reject_reason( + spec, rtl_reason, sizeof(rtl_reason))) + { + b->status = ROCKE_ERR_VALUE; + snprintf(b->err, ROCKE_ERR_MSG_CAP, "%s", rtl_reason); + return false; + } + } + /* ---- require_tiled_attention_arch(arch) (lines 1139-1141) ---- */ if(!rocke_a2d_require_tiled_attention_arch(b, arch)) return false; @@ -154,6 +285,29 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, * the op_id are consumed downstream. */ ctx->qk_atom = (const rocke_mfma_atom_t*)qk_atom; + /* ---- runtime_layout LDS budget (ArchTarget lds_capacity_bytes) ---- */ + if(spec->runtime_layout) + { + const int rtl_t = rocke_attention_tiled_2d_spec_tile_size_eff(spec); + const int rtl_lds = rocke_gfx942_attention_tiled_2d_runtime_layout_lds_bytes( + spec->head_size, rtl_t, spec->num_warps); + if(target == NULL || rtl_lds > target->lds_capacity_bytes) + { + b->status = ROCKE_ERR_VALUE; + snprintf(b->err, + ROCKE_ERR_MSG_CAP, + "runtime_layout: estimated LDS %d B (num_warps=%d, T=%d, HD=%d) " + "exceeds the %s %d B LDS budget", + rtl_lds, + spec->num_warps, + rtl_t, + spec->head_size, + arch, + target == NULL ? 0 : target->lds_capacity_bytes); + return false; + } + } + /* ---- ALL-CAPS geometry constants (lines 1161-1184) ---- */ const int HD = spec->head_size; const int T = rocke_attention_tiled_2d_spec_tile_size_eff(spec); @@ -413,6 +567,12 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } + /* runtime_layout: the 17 appended arguments (RUNTIME_LAYOUT_EXTRA_ARGS). */ + if(spec->runtime_layout) + { + ctx->RTL = true; + rocke_attn2d_rtl_declare_params(b, ctx->rtl_p); + } } /* ---- grid ids + wave decomposition (lines 1371-1388) ---- */ @@ -442,28 +602,33 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, } /* ---- seq lookup + Q-block geometry (lines 1390-1409) ---- */ + if(ctx->RTL) + { + rocke_a2d_rtl_seq_lookup(ctx, BLOCK_Q); + } + else { rocke_value_t* trip = rocke_binary_search_seq_idx_trip_count(b, ctx->num_seqs_p); ctx->seq_idx = rocke_binary_search_seq_idx_dyn( b, ctx->cu_q, ctx->q_block_global_idx, ctx->num_seqs_p, BLOCK_Q, trip, false); - } - ctx->cu_q_start = rocke_b_global_load_i32(b, ctx->cu_q, ctx->seq_idx, 0); - ctx->cu_q_stop = rocke_b_global_load_i32( - b, ctx->cu_q, rocke_b_add(b, ctx->seq_idx, rocke_b_const_i32(b, 1)), 0); - ctx->cur_batch_q_len = rocke_b_sub(b, ctx->cu_q_stop, ctx->cu_q_start); - ctx->q_block_start_idx = rocke_b_add( - b, rocke_b_div(b, ctx->cu_q_start, rocke_b_const_i32(b, BLOCK_Q)), ctx->seq_idx); - ctx->q_block_local_idx = rocke_b_sub(b, ctx->q_block_global_idx, ctx->q_block_start_idx); - ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, ctx->seq_idx, 0); - ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); - - ctx->qb_start_pos = rocke_b_mul(b, ctx->q_block_local_idx, rocke_b_const_i32(b, BLOCK_Q)); - { - rocke_if_t f - = rocke_b_scf_if(b, rocke_b_cmp_ge(b, ctx->qb_start_pos, ctx->cur_batch_q_len)); - rocke_b_region_enter(b, f.then_region); - rocke_b_ret(b); - rocke_b_region_leave(b); + ctx->cu_q_start = rocke_b_global_load_i32(b, ctx->cu_q, ctx->seq_idx, 0); + ctx->cu_q_stop = rocke_b_global_load_i32( + b, ctx->cu_q, rocke_b_add(b, ctx->seq_idx, rocke_b_const_i32(b, 1)), 0); + ctx->cur_batch_q_len = rocke_b_sub(b, ctx->cu_q_stop, ctx->cu_q_start); + ctx->q_block_start_idx = rocke_b_add( + b, rocke_b_div(b, ctx->cu_q_start, rocke_b_const_i32(b, BLOCK_Q)), ctx->seq_idx); + ctx->q_block_local_idx = rocke_b_sub(b, ctx->q_block_global_idx, ctx->q_block_start_idx); + ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, ctx->seq_idx, 0); + ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); + + ctx->qb_start_pos = rocke_b_mul(b, ctx->q_block_local_idx, rocke_b_const_i32(b, BLOCK_Q)); + { + rocke_if_t f + = rocke_b_scf_if(b, rocke_b_cmp_ge(b, ctx->qb_start_pos, ctx->cur_batch_q_len)); + rocke_b_region_enter(b, f.then_region); + rocke_b_ret(b); + rocke_b_region_leave(b); + } } /* ---- Acc_lds stripe geometry (lines 1436-1443) ---- */ diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_epilogue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_epilogue.cpp index 1fb7c7b97637..802828762783 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_epilogue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_epilogue.cpp @@ -375,11 +375,15 @@ rocke_kernel_def_t* rocke_gfx942_attn2d_emit_epilogue(rocke_gfx942_attn2d_build_ rocke_value_t* op_pos = rocke_b_add(b, qb_start_pos, rocke_b_div(b, OUT_ROW_BASE, rocke_b_const_i32(b, NQK))); /* op_qh = kv_head*NQK + OUT_ROW_BASE%NQK (mul before mod); op_mask = (op_pos - * < q_len) && (op_qh < NUM_QH) (pos cmp before qh cmp). Sequence via temps. */ + * < q_len) && (op_qh < NUM_QH) (pos cmp before qh cmp). Sequence via temps. + * runtime_layout stores every row it owns (rtl_q_rows): live rows get their + * attention, and a dense Q's padding rows past seq_lens_q were masked like + * keyless rows, so they store zeros. A ragged Q owns only its live rows. */ rocke_value_t* op_qh_mul = rocke_b_mul(b, kv_head_idx, rocke_b_const_i32(b, NQK)); rocke_value_t* op_qh_mod = rocke_b_mod(b, OUT_ROW_BASE, rocke_b_const_i32(b, NQK)); rocke_value_t* op_qh = rocke_b_add(b, op_qh_mul, op_qh_mod); - rocke_value_t* op_mask_pos = rocke_b_cmp_lt(b, op_pos, cur_batch_q_len); + rocke_value_t* op_mask_pos + = rocke_b_cmp_lt(b, op_pos, ctx->RTL ? ctx->rtl_q_rows : cur_batch_q_len); rocke_value_t* op_mask_qh = rocke_b_cmp_lt(b, op_qh, ctx->num_qh_p); rocke_value_t* op_mask_inner = rocke_b_land(b, op_mask_pos, op_mask_qh); /* Skip the VALID_ROWS guard when VALID_ROWS == BLOCK_M (NQK divides BLOCK_M). */ @@ -396,10 +400,27 @@ rocke_kernel_def_t* rocke_gfx942_attn2d_emit_epilogue(rocke_gfx942_attn2d_build_ } /* Python evaluates token=add(cu_q_start, op_pos) BEFORE dim=const(0) * (kwargs left-to-right). Bind them in that order so C's arg-eval order - * does not allocate the dim const ahead of the token add and shift it. */ - rocke_value_t* out_token = rocke_b_add(b, cu_q_start, op_pos); - rocke_value_t* out_dim0 = rocke_b_const_i32(b, 0); - rocke_value_t* out_base = epilogue_q_desc_offset(ctx, out_token, op_qh, out_dim0); + * does not allocate the dim const ahead of the token add and shift it. + * runtime_layout: rtl_o_desc.offset(token=op_pos, head=op_qh, dim=0) from + * the per-sequence base rtl_o_dst. */ + rocke_value_t* out_base = NULL; + if(ctx->RTL) + { + static const char* const o_names[3] = {"token", "head", "dim"}; + rocke_value_t* o_vals[3]; + o_vals[0] = op_pos; + o_vals[1] = op_qh; + o_vals[2] = rocke_b_const_i32(b, 0); + (void)rocke_dynamic_tensor_descriptor_offset( + b, ctx->rtl_o_desc, o_names, o_vals, 3, &out_base, NULL); + output = ctx->rtl_o_dst; + } + else + { + rocke_value_t* out_token = rocke_b_add(b, cu_q_start, op_pos); + rocke_value_t* out_dim0 = rocke_b_const_i32(b, 0); + out_base = epilogue_q_desc_offset(ctx, out_token, op_qh, out_dim0); + } for(stripe = 0; stripe < OUT_STRIPES; ++stripe) { @@ -470,5 +491,15 @@ rocke_kernel_def_t* rocke_gfx942_attn2d_emit_epilogue(rocke_gfx942_attn2d_build_ } } + if(ctx->RTL) + { + /* Close the "block has rows" branch, then fence LDS reuse before the + * next grid-stride q-block (its Q staging and K/V DMA rewrite the slabs + * this q-block's epilogue just read), then close the q-block loop. */ + rocke_b_region_leave(b); + rocke_b_sync(b); + rocke_b_region_leave(b); + } + return rocke_ir_builder_kernel(b); } diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_body_qk_softmax.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_body_qk_softmax.cpp index ca504a72a79d..fc33df2dc65b 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_body_qk_softmax.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_body_qk_softmax.cpp @@ -1099,7 +1099,7 @@ void rocke_gfx942_attn2d_emit_kv_body(rocke_gfx942_attn2d_build_ctx_t* ctx) rocke_value_t* in_prefix = rocke_b_cmp_lt(b, col_abs, max_seq_prefix_len); rocke_value_t* m_ok = rocke_b_land(b, rocke_b_land(b, row_ok, causal_ok), in_prefix); - if(ctx->SLIDING_WINDOW > 0) + if(ctx->SLIDING_WINDOW > 0 || ctx->RTL) { rocke_value_t* dist = rocke_b_sub(b, causal_lim, col_abs); m_ok = rocke_b_land(b, m_ok, rocke_b_cmp_lt(b, dist, sw_const)); diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp index c1a400150979..cfef57a41b16 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp @@ -323,6 +323,7 @@ void rocke_gfx942_attn2d_emit_preloop(rocke_gfx942_attn2d_build_ctx_t* ctx) /* big-bytes K/V buffer resources (2166-2168). The buffer rsrc bounds OOB * voffsets to return zero; size it large so valid offsets never trip it. */ rocke_value_t* big_bytes = rocke_b_const_i32(b, 0x7FFF0000); + ctx->big_bytes_v = big_bytes; ctx->k_rsrc = rocke_b_buffer_rsrc(b, ctx->key, big_bytes); ctx->v_rsrc = rocke_b_buffer_rsrc(b, ctx->value, big_bytes); @@ -388,6 +389,36 @@ void rocke_gfx942_attn2d_emit_preloop(rocke_gfx942_attn2d_build_ctx_t* ctx) rocke_value_t* seq_base = rocke__seq_base(ctx); rocke_value_t* max_idx = rocke__block_table_max_idx(ctx); + if(ctx->RTL) + { + /* Runtime-stride paged K/V (bytes): K and V share all strides. A tile + * never crosses a cache block (tile_size divides block_size), so each + * tile load reads its page id once and builds one buffer resource at the + * page's 64-bit base, with range kv_block_span_bytes. Block-table reads + * go through a buffer resource so a masked entry is an out-of-range + * voffset. K pages through block_tables_ptr, V through + * block_tables_v_ptr. */ + rocke_value_t* const* p = ctx->rtl_p; + (void)max_idx; + rocke_value_t* blk_stride64 + = rocke_b_sext(b, p[ROCKE_ATTN2D_RTL_KV_BLOCK_STRIDE], rocke_i64()); + rocke_value_t* one64 = rocke_b_const_i64(b, 1); + ctx->rtl_kv_page_stride_b = rocke_b_shl(b, blk_stride64, one64); + static const char* const kv_coords_rtl[3] = {"token", "kv_head", "dim"}; + rocke_value_t* strides[3]; + rocke_value_t* one = rocke_b_const_i32(b, 1); + strides[0] = rocke_b_shl(b, p[ROCKE_ATTN2D_RTL_KV_TOK_STRIDE], one); + one = rocke_b_const_i32(b, 1); + strides[1] = rocke_b_shl(b, p[ROCKE_ATTN2D_RTL_KV_HEAD_STRIDE], one); + strides[2] = rocke_b_const_i32(b, 2); + ctx->rtl_kv_desc = rocke_tensor_descriptor_naive_dynamic( + b, "rtl_kv_page_bytes", kv_coords_rtl, 3, strides); + ctx->rtl_kv_oob = rocke_b_const_i32(b, 0x7FFFFFF0); + ctx->rtl_bt_rsrc = rocke_b_buffer_rsrc(b, ctx->block_tables, big_bytes); + ctx->rtl_bt_v_rsrc = rocke_b_buffer_rsrc(b, p[ROCKE_ATTN2D_RTL_BLOCK_TABLES_V], big_bytes); + ctx->kv_desc = NULL; + return; + } /* _kv_base = naive("paged_kv_bytes", * lengths=[1<<24, BS, NUM_KV, HD], * strides=[kv_stride_blk_b, kv_stride_tok_b, kv_stride_h_b, KV_BYTES], @@ -684,6 +715,77 @@ static rocke_value_t* return rocke_gfx942_attn2d_kv_page_off(ctx, token, dim, kv_head_b); } +/* ========================================================================== + * runtime_layout paged K/V (Python _rtl_kv_block / _rtl_kv_call). + * ========================================================================== */ + +typedef struct rocke__rtl_kv_block +{ + rocke_value_t* tok0; /* first token of the tile */ + rocke_value_t* tok_in_blk0; /* its offset within the cache block */ + rocke_value_t* rsrc; /* the page's buffer resource */ +} rocke__rtl_kv_block_t; + +/* _rtl_kv_block(cache, bt_rsrc, kv_tile_idx): one page-table read and one + * buffer resource per tile load. Entries at or past ceil(seq_len / BS) read + * through an out-of-range voffset and return block 0 without touching memory. */ +static rocke__rtl_kv_block_t rocke__rtl_kv_block(rocke_gfx942_attn2d_build_ctx_t* ctx, + rocke_value_t* cache, + rocke_value_t* bt_rsrc, + rocke_value_t* kv_tile_idx) +{ + rocke_ir_builder_t* b = ctx->b; + rocke__rtl_kv_block_t blk; + rocke_value_t* c_t = rocke_b_const_i32(b, ctx->T); + blk.tok0 = rocke_b_mul(b, kv_tile_idx, c_t); + rocke_value_t* c_bs = rocke_b_const_i32(b, ctx->BS); + rocke_value_t* lblk = rocke_b_div(b, blk.tok0, c_bs); + c_bs = rocke_b_const_i32(b, ctx->BS); + rocke_value_t* lblk_tok = rocke_b_mul(b, lblk, c_bs); + rocke_value_t* blk_ok = rocke_b_cmp_lt(b, lblk_tok, ctx->seq_len); + rocke_value_t* bt_idx = rocke_b_add(b, rocke__seq_base(ctx), lblk); + rocke_value_t* c2 = rocke_b_const_i32(b, 2); + rocke_value_t* bt_byte = rocke_b_shl(b, bt_idx, c2); + rocke_value_t* bt_voff = rocke_b_select(b, blk_ok, bt_byte, ctx->rtl_kv_oob); + rocke_value_t* phys_v + = rocke_b_buffer_load_vN(b, bt_rsrc, bt_voff, rocke__zero_soff(ctx), rocke_i32(), 1); + rocke_value_t* phys_e = rocke_b_vec_extract(b, phys_v, 0); + rocke_value_t* phys = rocke_b_to_sgpr_u32(b, phys_e); + rocke_value_t* phys64 = rocke_b_zext(b, phys, rocke_i64()); + rocke_value_t* page_off = rocke_b_mul(b, phys64, ctx->rtl_kv_page_stride_b); + rocke_value_t* page = rocke_b_global_ptr_add(b, cache, page_off); + blk.rsrc = rocke_b_buffer_rsrc(b, page, ctx->rtl_p[ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES]); + blk.tok_in_blk0 = rocke_b_sub(b, blk.tok0, lblk_tok); + return blk; +} + +/* _rtl_kv_call(call, blk): this lane's voffset within the page for one async + * K/V call; lanes whose token is at or past seq_len read nothing. */ +static rocke_value_t* rocke__rtl_kv_call(rocke_gfx942_attn2d_build_ctx_t* ctx, + int call, + const rocke__rtl_kv_block_t* blk) +{ + rocke_ir_builder_t* b = ctx->b; + rocke_value_t* c_call = rocke_b_const_i32(b, call * rocke__kv_halves_per_call(ctx)); + rocke_value_t* linear_half = rocke_b_add(b, c_call, rocke__lane_half_base(ctx)); + rocke_value_t* c_hd = rocke_b_const_i32(b, ctx->HD); + rocke_value_t* tok = rocke_b_div(b, linear_half, c_hd); + c_hd = rocke_b_const_i32(b, ctx->HD); + rocke_value_t* dim = rocke_b_mod(b, linear_half, c_hd); + static const char* const in_names[3] = {"token", "kv_head", "dim"}; + rocke_value_t* in_values[3]; + in_values[0] = rocke_b_add(b, blk->tok_in_blk0, tok); + in_values[1] = ctx->kv_head_idx; + in_values[2] = dim; + rocke_value_t* within = NULL; + if(!rocke_dynamic_tensor_descriptor_offset( + b, ctx->rtl_kv_desc, in_names, in_values, 3, &within, NULL)) + return NULL; + rocke_value_t* tok_abs = rocke_b_add(b, blk->tok0, tok); + rocke_value_t* tok_ok = rocke_b_cmp_lt(b, tok_abs, ctx->seq_len); + return rocke_b_select(b, tok_ok, within, ctx->rtl_kv_oob); +} + /* ========================================================================== * Standard K/V async-DMA loaders (Python lines 2440-2619). * ========================================================================== */ @@ -711,14 +813,17 @@ void rocke_gfx942_attn2d_issue_k_load_runtime(rocke_gfx942_attn2d_build_ctx_t* c rocke_value_t* fast_block0 = NULL; rocke_value_t* fast_block1 = NULL; - if(ctx->FAST_PAGED_KV_DESC) - rocke_gfx942_attn2d_fast_paged_kv_blocks(ctx, kv_tile_idx, &fast_block0, &fast_block1); + rocke__rtl_kv_block_t rtl_blk = {NULL, NULL, NULL}; bool page_rsrc = rocke_gfx942_attn2d_page_rsrc_i64(ctx); rocke_value_t** page_ptrs = NULL; rocke_value_t** page_rsrcs = NULL; rocke_value_t* kv_head_b = NULL; - if(page_rsrc - && !rocke__tile_pages(ctx, ctx->key, kv_tile_idx, &page_ptrs, &page_rsrcs, &kv_head_b)) + if(ctx->FAST_PAGED_KV_DESC) + rocke_gfx942_attn2d_fast_paged_kv_blocks(ctx, kv_tile_idx, &fast_block0, &fast_block1); + else if(ctx->RTL) + rtl_blk = rocke__rtl_kv_block(ctx, ctx->key, ctx->rtl_bt_rsrc, kv_tile_idx); + else if(page_rsrc + && !rocke__tile_pages(ctx, ctx->key, kv_tile_idx, &page_ptrs, &page_rsrcs, &kv_head_b)) return; for(int call = 0; call < kv_calls_per_tile; ++call) @@ -726,7 +831,12 @@ void rocke_gfx942_attn2d_issue_k_load_runtime(rocke_gfx942_attn2d_build_ctx_t* c rocke_value_t* k_rsrc = ctx->k_rsrc; rocke_value_t* k_ptr = ctx->key; rocke_value_t* voff = NULL; - if(ctx->FAST_PAGED_KV_DESC) + if(ctx->RTL) + { + k_rsrc = rtl_blk.rsrc; + voff = rocke__rtl_kv_call(ctx, call, &rtl_blk); + } + else if(ctx->FAST_PAGED_KV_DESC) { rocke_value_t* base_i64 = NULL; rocke__fast_paged_kv_voff_split( @@ -848,21 +958,30 @@ void rocke_gfx942_attn2d_issue_v_load_runtime(rocke_gfx942_attn2d_build_ctx_t* c rocke_value_t* fast_block0 = NULL; rocke_value_t* fast_block1 = NULL; - if(ctx->FAST_PAGED_KV_DESC) - rocke_gfx942_attn2d_fast_paged_kv_blocks(ctx, kv_tile_idx, &fast_block0, &fast_block1); + rocke__rtl_kv_block_t rtl_blk = {NULL, NULL, NULL}; bool page_rsrc = rocke_gfx942_attn2d_page_rsrc_i64(ctx); rocke_value_t** page_ptrs = NULL; rocke_value_t** page_rsrcs = NULL; rocke_value_t* kv_head_b = NULL; - if(page_rsrc - && !rocke__tile_pages(ctx, ctx->value, kv_tile_idx, &page_ptrs, &page_rsrcs, &kv_head_b)) + if(ctx->FAST_PAGED_KV_DESC) + rocke_gfx942_attn2d_fast_paged_kv_blocks(ctx, kv_tile_idx, &fast_block0, &fast_block1); + else if(ctx->RTL) + rtl_blk = rocke__rtl_kv_block(ctx, ctx->value, ctx->rtl_bt_v_rsrc, kv_tile_idx); + else if(page_rsrc + && !rocke__tile_pages( + ctx, ctx->value, kv_tile_idx, &page_ptrs, &page_rsrcs, &kv_head_b)) return; for(int call = 0; call < kv_calls_per_tile; ++call) { rocke_value_t* v_rsrc = ctx->v_rsrc; rocke_value_t* voff = NULL; - if(ctx->FAST_PAGED_KV_DESC) + if(ctx->RTL) + { + v_rsrc = rtl_blk.rsrc; + voff = rocke__rtl_kv_call(ctx, call, &rtl_blk); + } + else if(ctx->FAST_PAGED_KV_DESC) { rocke_value_t* base_i64 = NULL; rocke__fast_paged_kv_voff_split( diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp index c3edf6420ac4..a98d8431f911 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp @@ -107,9 +107,17 @@ void rocke_gfx942_attn2d_emit_loop_bounds_and_inits(rocke_gfx942_attn2d_build_ct * const) emitted before the outer divisor const, matching Python. */ rocke_value_t* nt_inner = rocke_b_add(B, max_seq_prefix_len, rocke_b_const_i32(B, T - 1)); rocke_value_t* num_tiles = rocke_b_div(B, nt_inner, rocke_b_const_i32(B, T)); + if(ctx->RTL) + { + /* A q-block of padding rows only reads no key: its rows store zeros. */ + rocke_value_t* has_live = rocke_b_cmp_lt(B, ctx->qb_start_pos, ctx->cur_batch_q_len); + rocke_value_t* c0 = rocke_b_const_i32(B, 0); + num_tiles = rocke_b_select(B, has_live, num_tiles, c0); + } - /* tile_start / tile_end (1987-2005). */ - if(SLIDING_WINDOW > 0) + /* tile_start / tile_end (1987-2005). runtime_layout always compiles the + * window bounds (the window is a kernel argument). */ + if(SLIDING_WINDOW > 0 || ctx->RTL) { /* Reuse the cached sw_const (line 1910), do NOT create a fresh const * here -- Python references the same SSA value. */ diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_public_entry_glue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_public_entry_glue.cpp index 79e3128f5fb6..8b12b78271f3 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_public_entry_glue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_public_entry_glue.cpp @@ -639,6 +639,7 @@ static rocke_status_t s->use_iglp_opt ? "iglp1" : "", s->use_k_single_buffer ? "k1buf" : "", s->emit_lse ? "lse" : "", + s->runtime_layout ? "rtl" : "", }; size_t num_parts = sizeof(parts) / sizeof(parts[0]); return rocke_kernel_name_join( diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_q_load_gather.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_q_load_gather.cpp index 81135a4eb790..cfa357ebe94e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_q_load_gather.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_q_load_gather.cpp @@ -169,19 +169,37 @@ void rocke_gfx942_attn2d_emit_q_load(rocke_gfx942_attn2d_build_ctx_t* ctx) qh_safe = rocke_b_select(b, qmask_t, qh_t, rocke_b_const_i32(b, 0)); /* q_off_base, _ = q_desc.offset(b, token=cu_q_start+q_pos_safe, - * head=qh_safe, dim=0) */ + * head=qh_safe, dim=0) + * runtime_layout: rtl_q_desc.offset(token=q_pos_safe, head=qh_safe, + * dim=0) from the per-sequence base rtl_q_src. */ { static const char* const in_names[3] = {"token", "head", "dim"}; rocke_value_t* in_values[3]; - in_values[0] = rocke_b_add(b, ctx->cu_q_start, q_pos_safe); - in_values[1] = qh_safe; - in_values[2] = rocke_b_const_i32(b, 0); - rocke_transforms_descriptor_offset( - b, ctx->q_desc, in_names, in_values, 3, &q_off_base, NULL); + if(ctx->RTL) + { + in_values[0] = q_pos_safe; + in_values[1] = qh_safe; + in_values[2] = rocke_b_const_i32(b, 0); + rocke_dynamic_tensor_descriptor_offset( + b, ctx->rtl_q_desc, in_names, in_values, 3, &q_off_base, NULL); + } + else + { + in_values[0] = rocke_b_add(b, ctx->cu_q_start, q_pos_safe); + in_values[1] = qh_safe; + in_values[2] = rocke_b_const_i32(b, 0); + rocke_transforms_descriptor_offset( + b, ctx->q_desc, in_names, in_values, 3, &q_off_base, NULL); + } } - /* v8 = b.global_load_vN(query, q_off_base + Q_col, dtype, 8, align=16) */ - v8 = rocke_b_global_load_vN(b, ctx->query, rocke_b_add(b, q_off_base, Q_col), dtype, 8, 16); + /* v8 = b.global_load_vN(_q_src, q_off_base + Q_col, dtype, 8, align=16) */ + v8 = rocke_b_global_load_vN(b, + ctx->RTL ? ctx->rtl_q_src : ctx->query, + rocke_b_add(b, q_off_base, Q_col), + dtype, + 8, + 16); /* Q store index: K_lds-aliased (buf,row_in_buf,col) or plain (row,col). */ if(ctx->Q_ALIAS_K) diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_fastkv_regp_helpers.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_fastkv_regp_helpers.cpp index ad988823cddc..be1179244b5f 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_fastkv_regp_helpers.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_fastkv_regp_helpers.cpp @@ -124,6 +124,7 @@ static rocke_status_t rocke__fastkv_gfx950_base_name(const rocke_attention_tiled s->use_fp8_mfma_pv ? "fp8pv" : "", s->use_register_pv ? "regpv" : "", s->emit_lse ? "lse" : "", + s->runtime_layout ? "rtl" : "", }; size_t num_parts = sizeof(parts) / sizeof(parts[0]); return rocke_kernel_name_join( diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_pv_epilogue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_pv_epilogue.cpp index 86feab10a348..7566905d124f 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_pv_epilogue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_pv_epilogue.cpp @@ -1056,7 +1056,12 @@ rocke_kernel_def_t* rocke_gfx950_attn2d_emit_epilogue(rocke_gfx950_attn2d_build_ op_qh = rocke_b_add(b, qh_mul, qh_mod); } { - rocke_value_t* mask_pos = rocke_b_cmp_lt(b, op_pos, ctx->cur_batch_q_len); + /* runtime_layout stores every row it owns (rtl_q_rows): live rows get + * their attention, and a dense Q's padding rows past seq_lens_q were + * masked like keyless rows, so they store zeros. A ragged Q owns only + * its live rows. */ + rocke_value_t* mask_pos + = rocke_b_cmp_lt(b, op_pos, ctx->RTL ? ctx->rtl_q_rows : ctx->cur_batch_q_len); rocke_value_t* mask_qh = rocke_b_cmp_lt(b, op_qh, ctx->num_qh_p); rocke_value_t* mask_inner = rocke_b_land(b, mask_pos, mask_qh); if(ctx->VALID_ROWS < ctx->BLOCK_M) @@ -1070,15 +1075,29 @@ rocke_kernel_def_t* rocke_gfx950_attn2d_emit_epilogue(rocke_gfx950_attn2d_build_ op_mask = mask_inner; } } - in_names[0] = coord_names[0]; - in_names[1] = coord_names[1]; - in_names[2] = coord_names[2]; - in_values[0] = rocke_b_add(b, ctx->cu_q_start, op_pos); - in_values[1] = op_qh; - in_values[2] = rocke_b_const_i32(b, 0); - if(!rocke_transforms_descriptor_offset( - b, ctx->q_desc, in_names, in_values, 3, &out_base, NULL)) - return NULL; + /* out_base = _o_row_off(op_pos, op_qh): q_desc.offset(token=cu_q_start+ + * op_pos, head=op_qh, dim=0), or in runtime_layout op_pos*o_tok_stride + + * op_qh*o_head_stride from rtl_o_ptr. */ + if(ctx->RTL) + { + rocke_value_t* pos_off + = rocke_b_mul(b, op_pos, ctx->rtl_p[ROCKE_ATTN2D_RTL_O_TOK_STRIDE]); + rocke_value_t* head_off + = rocke_b_mul(b, op_qh, ctx->rtl_p[ROCKE_ATTN2D_RTL_O_HEAD_STRIDE]); + out_base = rocke_b_add(b, pos_off, head_off); + } + else + { + in_names[0] = coord_names[0]; + in_names[1] = coord_names[1]; + in_names[2] = coord_names[2]; + in_values[0] = rocke_b_add(b, ctx->cu_q_start, op_pos); + in_values[1] = op_qh; + in_values[2] = rocke_b_const_i32(b, 0); + if(!rocke_transforms_descriptor_offset( + b, ctx->q_desc, in_names, in_values, 3, &out_base, NULL)) + return NULL; + } for(stripe = 0; stripe < ctx->OUT_STRIPES; ++stripe) { int n_start = stripe * N_TILES_PER_STRIPE; @@ -1128,8 +1147,12 @@ rocke_kernel_def_t* rocke_gfx950_attn2d_emit_epilogue(rocke_gfx950_attn2d_build_ col_in_stripe); iff = rocke_b_scf_if(b, op_mask); rocke_b_region_enter(b, iff.then_region); - rocke_b_global_store_vN( - b, ctx->output, rocke_b_add(b, out_base, out_col), v8h, OUT_VEC, 16); + rocke_b_global_store_vN(b, + ctx->RTL ? ctx->rtl_o_ptr : ctx->output, + rocke_b_add(b, out_base, out_col), + v8h, + OUT_VEC, + 16); rocke_b_region_leave(b); } if(stripe + 1 < ctx->OUT_STRIPES) @@ -1164,6 +1187,16 @@ rocke_kernel_def_t* rocke_gfx950_attn2d_emit_epilogue(rocke_gfx950_attn2d_build_ } } + if(ctx->RTL) + { + /* Close the live-block branch, then a barrier between grid-stride + * iterations (the next q-block reuses the same LDS: Q staging aliases + * K_lds; Acc_lds is rewritten), then close the q-block loop. */ + rocke_b_region_leave(b); + rocke_b_sync(b); + rocke_b_region_leave(b); + } + (void)i; return ctx->b->kernel; } diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_qk_softmax.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_qk_softmax.cpp index 20065f467d2a..f541bf8a281a 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_qk_softmax.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_body_qk_softmax.cpp @@ -798,7 +798,7 @@ void rocke_gfx950_attn2d_emit_kv_body(rocke_gfx950_attn2d_build_ctx_t* ctx) causal_ok = rocke_b_cmp_le(b, col_abs, causal_lim); in_prefix = rocke_b_cmp_lt(b, col_abs, max_seq_prefix_len); m_ok = rocke_b_land(b, rocke_b_land(b, row_ok, causal_ok), in_prefix); - if(ctx->SLIDING_WINDOW > 0) + if(ctx->SLIDING_WINDOW > 0 || ctx->RTL) /* SW_ACTIVE */ { rocke_value_t* dist = rocke_b_sub(b, causal_lim, col_abs); m_ok = rocke_b_land(b, m_ok, rocke_b_cmp_lt(b, dist, sw_const)); @@ -997,7 +997,7 @@ void rocke_gfx950_attn2d_emit_kv_body(rocke_gfx950_attn2d_build_ctx_t* ctx) rocke_value_t* s_raw; rocke_value_t* s_scaled; rocke_value_t* score; - if(ctx->SLIDING_WINDOW > 0) + if(ctx->SLIDING_WINDOW > 0 || ctx->RTL) /* SW_ACTIVE */ { rocke_value_t* dist = rocke_b_sub(b, causal_lim, col_abs); m_ok = rocke_b_land(b, m_ok, rocke_b_cmp_lt(b, dist, sw_const)); @@ -1186,7 +1186,7 @@ void rocke_gfx950_attn2d_emit_kv_body(rocke_gfx950_attn2d_build_ctx_t* ctx) rocke_value_t* in_prefix = rocke_b_cmp_lt(b, col_abs, max_seq_prefix_len); rocke_value_t* m_ok = rocke_b_land(b, rocke_b_land(b, row_ok, causal_ok), in_prefix); - if(ctx->SLIDING_WINDOW > 0) + if(ctx->SLIDING_WINDOW > 0 || ctx->RTL) /* SW_ACTIVE */ { rocke_value_t* dist = rocke_b_sub(b, causal_lim, col_abs); m_ok = rocke_b_land(b, m_ok, rocke_b_cmp_lt(b, dist, sw_const)); diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp index b613250ea548..2062eb5f9f5e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp @@ -195,9 +195,11 @@ static int rocke__copy_tokens(const rocke_gfx950_attn2d_build_ctx_t* ctx) return rocke__kv_halves_per_call(ctx) / ctx->HD; } +/* runtime_layout builds its own page resources (rocke__rtl_kv_page). */ static bool rocke__page_copies(const rocke_gfx950_attn2d_build_ctx_t* ctx) { - return !ctx->FAST_PAGED_KV_DESC && !ctx->KV_FP8 && rocke__kv_halves_per_call(ctx) % ctx->HD == 0 + return !ctx->RTL && !ctx->FAST_PAGED_KV_DESC && !ctx->KV_FP8 + && rocke__kv_halves_per_call(ctx) % ctx->HD == 0 && ctx->BS % rocke__copy_tokens(ctx) == 0; } @@ -391,14 +393,51 @@ void rocke_gfx950_attn2d_emit_preloop(rocke_gfx950_attn2d_build_ctx_t* ctx) /* seq_base (1525) + block_table_max_idx (1538): the per-sequence base index * into block_tables and the global footprint bound; both wave-uniform SGPRs. * Python emits these BEFORE the FAST_PAGED_KV_DESC branch, so both paths see - * them in the same source position. */ + * them in the same source position. runtime_layout bounds the lookups by + * this sequence's ceil(seq_len / BS) entries instead. */ rocke_value_t* seq_base = rocke__seq_base(ctx); + if(ctx->RTL) + { + rocke_value_t* bs_m1 = rocke_b_const_i32(b, ctx->BS - 1); + rocke_value_t* len_up = rocke_b_add(b, ctx->seq_len, bs_m1); + rocke_value_t* bs = rocke_b_const_i32(b, ctx->BS); + rocke_value_t* n_blocks = rocke_b_div(b, len_up, bs); + ctx->block_table_max_idx = rocke_b_to_sgpr_u32(b, rocke_b_add(b, seq_base, n_blocks)); + } rocke_value_t* max_idx = rocke__block_table_max_idx(ctx); (void)rocke__bytes_per_buf; (void)rocke__bytes_per_call; (void)rocke__kv_calls_per_tile; + if(ctx->RTL) + { + /* Runtime-stride paged KV bytes. One paged block per tile (T == BS): + * each tile load reads its page id once and builds one buffer resource + * at the page's 64-bit base, with range kv_block_span_bytes. + * Token/head/dim stay in the i32 voffset. K and V share strides. */ + rocke_value_t* const* p = ctx->rtl_p; + rocke_value_t* blk_stride64 + = rocke_b_zext(b, p[ROCKE_ATTN2D_RTL_KV_BLOCK_STRIDE], rocke_i64()); + rocke_value_t* kv_bytes64 = rocke_b_const_i64(b, ctx->KV_BYTES); + ctx->rtl_kv_page_stride_b = rocke_b_mul(b, blk_stride64, kv_bytes64); + static const char* const kv_coords_rtl[3] = {"token", "kv_head", "dim"}; + rocke_value_t* strides[3]; + rocke_value_t* kv_bytes = rocke_b_const_i32(b, ctx->KV_BYTES); + strides[0] = rocke_b_mul(b, p[ROCKE_ATTN2D_RTL_KV_TOK_STRIDE], kv_bytes); + kv_bytes = rocke_b_const_i32(b, ctx->KV_BYTES); + strides[1] = rocke_b_mul(b, p[ROCKE_ATTN2D_RTL_KV_HEAD_STRIDE], kv_bytes); + strides[2] = rocke_b_const_i32(b, ctx->KV_BYTES); + ctx->rtl_kv_desc = rocke_tensor_descriptor_naive_dynamic( + b, "rtl_kv_page_bytes", kv_coords_rtl, 3, strides); + ctx->kv_desc = NULL; + (void)max_idx; + /* fp8 async-loader setup (Python 1785-1796) runs after the paged-KV + * descriptor branch on every path. */ + rocke_gfx950_attn2d_emit_fp8_async_preloop_setup(ctx); + return; + } + /* FAST_PAGED_KV_DESC (1539): the gfx950 production fast paged-KV path emits no * standalone descriptor object -- the per-call byte offsets are built directly * by _fast_paged_kv_blocks / _fast_paged_kv_voff (1550-1589). */ @@ -547,6 +586,58 @@ rocke_value_t* rocke_gfx950_attn2d_fast_paged_kv_voff(rocke_gfx950_attn2d_build_ return voff; } +/* ========================================================================== + * runtime_layout paged K/V (Python _rtl_kv_page / _rtl_kv_voff). + * ========================================================================== */ + +/* _rtl_kv_page(src, table, kv_tile_idx): the buffer resource of the tile's + * page (block 0 past the table). ``table`` is K's block_tables_ptr or V's + * block_tables_v_ptr; both rows start at seq_base. */ +static rocke_value_t* rocke__rtl_kv_page(rocke_gfx950_attn2d_build_ctx_t* ctx, + rocke_value_t* src, + rocke_value_t* table, + rocke_value_t* kv_tile_idx) +{ + rocke_ir_builder_t* b = ctx->b; + rocke_value_t* idx = rocke_b_add(b, rocke__seq_base(ctx), kv_tile_idx); + rocke_value_t* in_table = rocke_b_cmp_lt(b, idx, rocke__block_table_max_idx(ctx)); + rocke_value_t* c0 = rocke_b_const_i32(b, 0); + rocke_value_t* phys = rocke_b_masked_global_load(b, table, idx, in_table, c0, rocke_i32(), 4); + rocke_value_t* phys_s = rocke_b_to_sgpr_u32(b, phys); + rocke_value_t* phys64 = rocke_b_zext(b, phys_s, rocke_i64()); + rocke_value_t* page_off = rocke_b_mul(b, phys64, ctx->rtl_kv_page_stride_b); + rocke_value_t* page = rocke_b_global_ptr_add(b, src, page_off); + return rocke_b_buffer_rsrc(b, page, ctx->rtl_p[ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES]); +} + +/* _rtl_kv_voff(kv_tile_idx, linear_half): this lane's voffset within the page + * for one async-DMA call. Lanes whose token is at or past seq_len get an + * out-of-range voffset, so the DMA writes zeros without touching memory. */ +static rocke_value_t* rocke__rtl_kv_voff(rocke_gfx950_attn2d_build_ctx_t* ctx, + rocke_value_t* kv_tile_idx, + rocke_value_t* linear_half) +{ + rocke_ir_builder_t* b = ctx->b; + rocke_value_t* c_hd = rocke_b_const_i32(b, ctx->HD); + rocke_value_t* tok_in_tile = rocke_b_div(b, linear_half, c_hd); + c_hd = rocke_b_const_i32(b, ctx->HD); + rocke_value_t* dim = rocke_b_mod(b, linear_half, c_hd); + static const char* const in_names[3] = {"token", "kv_head", "dim"}; + rocke_value_t* in_values[3]; + in_values[0] = tok_in_tile; + in_values[1] = ctx->kv_head_idx; + in_values[2] = dim; + rocke_value_t* within = NULL; + if(!rocke_dynamic_tensor_descriptor_offset( + b, ctx->rtl_kv_desc, in_names, in_values, 3, &within, NULL)) + return NULL; + rocke_value_t* c_t = rocke_b_const_i32(b, ctx->T); + rocke_value_t* tile_tok0 = rocke_b_mul(b, kv_tile_idx, c_t); + rocke_value_t* tok = rocke_b_add(b, tile_tok0, tok_in_tile); + rocke_value_t* tok_ok = rocke_b_cmp_lt(b, tok, ctx->seq_len); + return rocke_b_select(b, tok_ok, within, ctx->rtl_p[ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES]); +} + /* ========================================================================== * Standard (bf16) K/V async-DMA loaders (Python lines 1631-1739). * ========================================================================== */ @@ -576,8 +667,11 @@ void rocke_gfx950_attn2d_issue_k_load_runtime(rocke_gfx950_attn2d_build_ctx_t* c rocke_value_t* fast_block0 = NULL; rocke_value_t* fast_block1 = NULL; + rocke_value_t* rtl_rsrc = NULL; if(ctx->FAST_PAGED_KV_DESC) rocke_gfx950_attn2d_fast_paged_kv_blocks(ctx, kv_tile_idx, &fast_block0, &fast_block1); + else if(ctx->RTL) + rtl_rsrc = rocke__rtl_kv_page(ctx, ctx->key, ctx->block_tables, kv_tile_idx); /* This tile's page ids by block, read on first use. */ rocke_value_t** pages = rocke__value_table(ctx, ctx->N_BLOCKS_PER_TILE); @@ -609,13 +703,19 @@ void rocke_gfx950_attn2d_issue_k_load_runtime(rocke_gfx950_attn2d_build_ctx_t* c * linear_half = call*KV_HALVES_PER_CALL + lane_half_base * voff, _ = paged_kv_desc.offset(tile_idx=, linear_half=, kv_head=) * (Python 1660-1681). I64_KV_ADDR uses offset_i64_split, folding the - * physical_block term into a 64-bit buffer base. */ + * physical_block term into a 64-bit buffer base. runtime_layout uses + * the tile's page resource and the page voffset. */ rocke_value_t* linear_half = rocke_b_add(b, rocke_b_const_i32(b, call * kv_halves_per_call), lane_half_base); const char* in_names[3] = {"tile_idx", "linear_half", "kv_head"}; rocke_value_t* in_values[3] = {kv_tile_idx, linear_half, ctx->kv_head_idx}; rocke_value_t* valid = NULL; - if(ctx->I64_KV_ADDR) + if(ctx->RTL) + { + k_rsrc = rtl_rsrc; + voff = rocke__rtl_kv_voff(ctx, kv_tile_idx, linear_half); + } + else if(ctx->I64_KV_ADDR) { rocke_value_t* base_i64 = NULL; if(!rocke_transforms_descriptor_offset_i64_split(b, @@ -664,8 +764,12 @@ void rocke_gfx950_attn2d_issue_v_load_runtime(rocke_gfx950_attn2d_build_ctx_t* c rocke_value_t* fast_block0 = NULL; rocke_value_t* fast_block1 = NULL; + rocke_value_t* rtl_rsrc = NULL; if(ctx->FAST_PAGED_KV_DESC) rocke_gfx950_attn2d_fast_paged_kv_blocks(ctx, kv_tile_idx, &fast_block0, &fast_block1); + else if(ctx->RTL) + rtl_rsrc = rocke__rtl_kv_page( + ctx, ctx->value, ctx->rtl_p[ROCKE_ATTN2D_RTL_BLOCK_TABLES_V], kv_tile_idx); /* This tile's page ids by block, read on first use. */ rocke_value_t** pages = rocke__value_table(ctx, ctx->N_BLOCKS_PER_TILE); @@ -696,13 +800,19 @@ void rocke_gfx950_attn2d_issue_v_load_runtime(rocke_gfx950_attn2d_build_ctx_t* c /* Non-fast paged-KV: voff = paged_kv_desc.offset(tile_idx=, * linear_half=call*KV_HALVES_PER_CALL+lane_half_base, kv_head=) * (Python 1711-1732). I64_KV_ADDR uses offset_i64_split, folding the - * physical_block term into a 64-bit buffer base. */ + * physical_block term into a 64-bit buffer base. runtime_layout uses + * the tile's page resource and the page voffset. */ rocke_value_t* linear_half = rocke_b_add(b, rocke_b_const_i32(b, call * kv_halves_per_call), lane_half_base); const char* in_names[3] = {"tile_idx", "linear_half", "kv_head"}; rocke_value_t* in_values[3] = {kv_tile_idx, linear_half, ctx->kv_head_idx}; rocke_value_t* valid = NULL; - if(ctx->I64_KV_ADDR) + if(ctx->RTL) + { + v_rsrc = rtl_rsrc; + voff = rocke__rtl_kv_voff(ctx, kv_tile_idx, linear_half); + } + else if(ctx->I64_KV_ADDR) { rocke_value_t* base_i64 = NULL; if(!rocke_transforms_descriptor_offset_i64_split(b, diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp index 3fd542998938..73d000f0ef05 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp @@ -368,6 +368,95 @@ bool rocke_gfx950_attention_tiled_2d_supports( return true; } +/* Python ``if RTL:`` seq lookup. DENSE (q_uniform_len = L > 0): bps = + * ceil(L / BLOCK_Q) q-blocks per sequence, seq = qb / bps, base token seq. + * RAGGED (L == 0): query_start_len_ptr holds token offsets (non-decreasing, + * off[b+1] - off[b] >= seq_lens_q[b], off[B] the end of the last block); seq + * comes from the q-block binary search, base token off[seq]. A q-block before + * the first origin (search result -1) reads sequence 0 and writes no row. + * Enters the grid-stride q-block loop (closed by the epilogue). One builder + * call per statement, in Python order. */ +static void rocke_g950_rtl_seq_lookup(rocke_gfx950_attn2d_build_ctx_t* ctx, int BLOCK_Q) +{ + rocke_ir_builder_t* b = ctx->b; + rocke_value_t* const* p = ctx->rtl_p; + rocke_value_t* num_seqs = ctx->num_seqs_p; + rocke_value_t* zero = rocke_b_const_i32(b, 0); + rocke_value_t* one = rocke_b_const_i32(b, 1); + rocke_value_t* bq = rocke_b_const_i32(b, BLOCK_Q); + rocke_value_t* q_len_u = p[ROCKE_ATTN2D_RTL_Q_UNIFORM_LEN]; + rocke_value_t* dense = rocke_b_cmp_gt(b, q_len_u, zero); + rocke_value_t* ragged = rocke_b_cmp_le(b, q_len_u, zero); + rocke_value_t* has_slq = rocke_b_cmp_ne(b, p[ROCKE_ATTN2D_RTL_HAS_SEQ_LENS_Q], zero); + rocke_value_t* bq_m1 = rocke_b_const_i32(b, BLOCK_Q - 1); + rocke_value_t* len_up = rocke_b_add(b, q_len_u, bq_m1); + rocke_value_t* bps_dense = rocke_b_div(b, len_up, bq); + rocke_value_t* bps = rocke_b_select(b, dense, bps_dense, one); + rocke_value_t* off_total + = rocke_b_masked_global_load(b, ctx->cu_q, num_seqs, ragged, zero, rocke_i32(), 4); + rocke_value_t* total_dense = rocke_b_mul(b, num_seqs, bps); + rocke_value_t* off_total_blocks = rocke_b_div(b, off_total, bq); + rocke_value_t* total_ragged = rocke_b_add(b, off_total_blocks, num_seqs); + rocke_value_t* total = rocke_b_select(b, dense, total_dense, total_ragged); + + ctx->rtl_qb_loop = rocke_b_scf_for( + b, ctx->q_block_global_idx, total, p[ROCKE_ATTN2D_RTL_Q_BLOCK_GRID], "rtl_qb"); + rocke_b_region_enter(b, ctx->rtl_qb_loop.body); + rocke_value_t* qb = ctx->rtl_qb_loop.iv; + ctx->q_block_global_idx = qb; + + /* DENSE maps q-blocks arithmetically: its search runs no iteration. */ + rocke_value_t* trip = rocke_binary_search_seq_idx_trip_count(b, num_seqs); + rocke_value_t* iters = rocke_b_select(b, dense, zero, trip); + rocke_value_t* seq_ragged + = rocke_binary_search_seq_idx_dyn(b, ctx->cu_q, qb, num_seqs, BLOCK_Q, iters, false); + rocke_value_t* seq_dense = rocke_b_div(b, qb, bps); + rocke_value_t* seq_found = rocke_b_select(b, dense, seq_dense, seq_ragged); + /* A q-block before the first origin finds no sequence (-1). */ + rocke_value_t* seq_ok = rocke_b_cmp_ge(b, seq_found, zero); + ctx->seq_idx = rocke_b_smax(b, seq_found, zero); + rocke_value_t* seq_idx = ctx->seq_idx; + rocke_value_t* off_start + = rocke_b_masked_global_load(b, ctx->cu_q, seq_idx, ragged, zero, rocke_i32(), 4); + rocke_value_t* seq_p1 = rocke_b_add(b, seq_idx, one); + rocke_value_t* off_stop + = rocke_b_masked_global_load(b, ctx->cu_q, seq_p1, ragged, zero, rocke_i32(), 4); + rocke_value_t* slq = rocke_b_masked_global_load( + b, p[ROCKE_ATTN2D_RTL_SEQ_LENS_Q], seq_idx, has_slq, zero, rocke_i32(), 4); + + /* owned: the rows the sequence's block spans; a ragged Q writes only its live + * rows (rows of the block past seq_lens_q belong to no sequence). */ + rocke_value_t* rows_ragged = rocke_b_sub(b, off_stop, off_start); + rocke_value_t* owned = rocke_b_select(b, dense, q_len_u, rows_ragged); + rocke_value_t* live = rocke_b_smin(b, owned, slq); + ctx->cur_batch_q_len = rocke_b_select(b, has_slq, live, owned); + rocke_value_t* q_rows = rocke_b_select(b, dense, q_len_u, ctx->cur_batch_q_len); + /* Below the (negative) start position of a q-block with no sequence. */ + rocke_value_t* no_rows = rocke_b_const_i32(b, -2147483647 - 1); + ctx->rtl_q_rows = rocke_b_select(b, seq_ok, q_rows, no_rows); + rocke_value_t* qbs_dense = rocke_b_mul(b, seq_idx, bps); + rocke_value_t* off_start_blocks = rocke_b_div(b, off_start, bq); + rocke_value_t* qbs_ragged = rocke_b_add(b, off_start_blocks, seq_idx); + ctx->q_block_start_idx = rocke_b_select(b, dense, qbs_dense, qbs_ragged); + ctx->q_block_local_idx = rocke_b_sub(b, qb, ctx->q_block_start_idx); + ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, seq_idx, 0); + ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); + + /* Per-sequence Q/O base terms in i64 (ragged offsets times the multiplier + * can pass 2^31 elements); within-sequence terms stay i32. */ + rocke_value_t* sb = rocke_b_select(b, dense, seq_idx, off_start); + rocke_value_t* sb64 = rocke_b_zext(b, sb, rocke_i64()); + rocke_value_t* elem_bytes = rocke_b_const_i64(b, 2); + rocke_value_t* q_seq64 = rocke_b_zext(b, p[ROCKE_ATTN2D_RTL_Q_SEQ_STRIDE], rocke_i64()); + rocke_value_t* q_elems = rocke_b_mul(b, sb64, q_seq64); + rocke_value_t* q_bytes = rocke_b_mul(b, q_elems, elem_bytes); + ctx->rtl_q_ptr = rocke_b_global_ptr_add(b, ctx->query, q_bytes); + rocke_value_t* o_seq64 = rocke_b_zext(b, p[ROCKE_ATTN2D_RTL_O_SEQ_STRIDE], rocke_i64()); + rocke_value_t* o_elems = rocke_b_mul(b, sb64, o_seq64); + rocke_value_t* o_bytes = rocke_b_mul(b, o_elems, elem_bytes); + ctx->rtl_o_ptr = rocke_b_global_ptr_add(b, ctx->output, o_bytes); +} + /* ===================================================================== * * rocke_gfx950_attn2d_build_ctx_init -- the prologue (Python 711-1151) * @@ -391,6 +480,14 @@ static bool rocke_gfx950_attn2d_build_ctx_init(rocke_gfx950_attn2d_build_ctx_t* ctx->spec = spec; ctx->arch = arch; + /* ---- runtime_layout spec checks (__post_init__ raises them first) ---- */ + { + char rtl_reason[ROCKE_ERR_MSG_CAP]; + if(rocke_gfx950_attention_tiled_2d_runtime_layout_reject_reason( + spec, rtl_reason, sizeof(rtl_reason))) + rocke_g950_fail(b, ROCKE_ERR_VALUE, rtl_reason); + } + /* ---- require_tiled_attention_arch(arch) (Py748) ---- */ if(!rocke_g950_require_tiled_attention_arch(b, arch)) return false; @@ -755,6 +852,12 @@ static bool rocke_gfx950_attn2d_build_ctx_init(rocke_gfx950_attn2d_build_ctx_t* o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } + /* runtime_layout: the 17 appended arguments (_RTL_PARAMS). */ + if(spec->runtime_layout) + { + ctx->RTL = true; + rocke_attn2d_rtl_declare_params(b, ctx->rtl_p); + } } /* ---- grid ids + wave decomposition (Py891-904) ---- */ @@ -787,22 +890,36 @@ static bool rocke_gfx950_attn2d_build_ctx_init(rocke_gfx950_attn2d_build_ctx_t* } /* ---- seq lookup + Q-block geometry (Py906-925) ---- */ + if(ctx->RTL) + { + rocke_g950_rtl_seq_lookup(ctx, BLOCK_Q); + } + else { rocke_value_t* trip = rocke_binary_search_seq_idx_trip_count(b, ctx->num_seqs_p); ctx->seq_idx = rocke_binary_search_seq_idx_dyn( b, ctx->cu_q, ctx->q_block_global_idx, ctx->num_seqs_p, BLOCK_Q, trip, false); + ctx->cu_q_start = rocke_b_global_load_i32(b, ctx->cu_q, ctx->seq_idx, 0); + ctx->cu_q_stop = rocke_b_global_load_i32( + b, ctx->cu_q, rocke_b_add(b, ctx->seq_idx, rocke_b_const_i32(b, 1)), 0); + ctx->cur_batch_q_len = rocke_b_sub(b, ctx->cu_q_stop, ctx->cu_q_start); + ctx->q_block_start_idx = rocke_b_add( + b, rocke_b_div(b, ctx->cu_q_start, rocke_b_const_i32(b, BLOCK_Q)), ctx->seq_idx); + ctx->q_block_local_idx = rocke_b_sub(b, ctx->q_block_global_idx, ctx->q_block_start_idx); + ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, ctx->seq_idx, 0); + ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); } - ctx->cu_q_start = rocke_b_global_load_i32(b, ctx->cu_q, ctx->seq_idx, 0); - ctx->cu_q_stop = rocke_b_global_load_i32( - b, ctx->cu_q, rocke_b_add(b, ctx->seq_idx, rocke_b_const_i32(b, 1)), 0); - ctx->cur_batch_q_len = rocke_b_sub(b, ctx->cu_q_stop, ctx->cu_q_start); - ctx->q_block_start_idx = rocke_b_add( - b, rocke_b_div(b, ctx->cu_q_start, rocke_b_const_i32(b, BLOCK_Q)), ctx->seq_idx); - ctx->q_block_local_idx = rocke_b_sub(b, ctx->q_block_global_idx, ctx->q_block_start_idx); - ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, ctx->seq_idx, 0); - ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); ctx->qb_start_pos = rocke_b_mul(b, ctx->q_block_local_idx, rocke_b_const_i32(b, BLOCK_Q)); + if(ctx->RTL) + { + /* Inside the grid-stride loop a q-block past the owned rows skips its + * body instead of returning; closed after the epilogue. */ + rocke_value_t* has_rows = rocke_b_cmp_lt(b, ctx->qb_start_pos, ctx->rtl_q_rows); + ctx->rtl_live_block = rocke_b_scf_if(b, has_rows); + rocke_b_region_enter(b, ctx->rtl_live_block.then_region); + } + else { rocke_if_t f = rocke_b_scf_if(b, rocke_b_cmp_ge(b, ctx->qb_start_pos, ctx->cur_batch_q_len)); @@ -1149,6 +1266,7 @@ static rocke_status_t rocke_g950_attn2d_kernel_name(const rocke_attention_tiled_ s->use_register_pv ? "regpv" : "", s->use_qblock_reverse ? "qrev" : "", s->emit_lse ? "lse" : "", + s->runtime_layout ? "rtl" : "", }; size_t num_parts = sizeof(parts) / sizeof(parts[0]); return rocke_kernel_name_join( diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp index ae3d0609cf0f..07f20d387c52 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp @@ -185,8 +185,18 @@ void rocke_gfx950_attn2d_emit_q_load(rocke_gfx950_attn2d_build_ctx_t* ctx) q_pos_safe = rocke_b_select(b, qmask_t, q_pos_t, rocke_b_const_i32(b, 0)); qh_safe = rocke_b_select(b, qmask_t, qh_t, rocke_b_const_i32(b, 0)); - /* q_off_base, _ = q_desc.offset(b, token=cu_q_start+q_pos_safe, - * head=qh_safe, dim=0) */ + /* q_off_base = _q_row_off(q_pos_safe, qh_safe): + * q_desc.offset(token=cu_q_start+q_pos_safe, head=qh_safe, dim=0), or in + * runtime_layout pos*q_tok_stride + head*q_head_stride from rtl_q_ptr. */ + if(ctx->RTL) + { + rocke_value_t* pos_off + = rocke_b_mul(b, q_pos_safe, ctx->rtl_p[ROCKE_ATTN2D_RTL_Q_TOK_STRIDE]); + rocke_value_t* head_off + = rocke_b_mul(b, qh_safe, ctx->rtl_p[ROCKE_ATTN2D_RTL_Q_HEAD_STRIDE]); + q_off_base = rocke_b_add(b, pos_off, head_off); + } + else { static const char* const in_names[3] = {"token", "head", "dim"}; rocke_value_t* in_values[3]; @@ -197,8 +207,13 @@ void rocke_gfx950_attn2d_emit_q_load(rocke_gfx950_attn2d_build_ctx_t* ctx) b, ctx->q_desc, in_names, in_values, 3, &q_off_base, NULL); } - /* v8 = b.global_load_vN(query, q_off_base + Q_col, dtype, 8, align=16) */ - v8 = rocke_b_global_load_vN(b, ctx->query, rocke_b_add(b, q_off_base, Q_col), dtype, 8, 16); + /* v8 = b.global_load_vN(q_base_ptr, q_off_base + Q_col, dtype, 8, align=16) */ + v8 = rocke_b_global_load_vN(b, + ctx->RTL ? ctx->rtl_q_ptr : ctx->query, + rocke_b_add(b, q_off_base, Q_col), + dtype, + 8, + 16); /* Q store index: K_lds-aliased (buf,row_in_buf,col) or plain (row,col). */ if(ctx->Q_ALIAS_K) @@ -264,9 +279,17 @@ void rocke_gfx950_attn2d_emit_loop_bounds_and_inits(rocke_gfx950_attn2d_build_ct * const) emitted before the outer divisor const, matching Python. */ rocke_value_t* nt_inner = rocke_b_add(B, max_seq_prefix_len, rocke_b_const_i32(B, T - 1)); rocke_value_t* num_tiles = rocke_b_div(B, nt_inner, rocke_b_const_i32(B, T)); + if(ctx->RTL) + { + /* A q-block of padding rows only reads no key: its rows store zeros. */ + rocke_value_t* has_live = rocke_b_cmp_lt(B, ctx->qb_start_pos, ctx->cur_batch_q_len); + rocke_value_t* c0 = rocke_b_const_i32(B, 0); + num_tiles = rocke_b_select(B, has_live, num_tiles, c0); + } - /* tile_start / tile_end (1226-1244). */ - if(SLIDING_WINDOW > 0) + /* tile_start / tile_end (1226-1244). SW_ACTIVE: a compile-time window, or + * always in runtime_layout mode (window kernel argument). */ + if(SLIDING_WINDOW > 0 || ctx->RTL) { /* Reuse the cached sw_const (line 1244 in the prologue), do NOT create a * fresh const here -- Python references the same SSA value. */ diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/portable_ir/src/abi.py b/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/portable_ir/src/abi.py index e7295ea79071..a9e66454abd0 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/portable_ir/src/abi.py +++ b/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/portable_ir/src/abi.py @@ -81,7 +81,7 @@ #: is checked at library load: ctypes argtypes are a hand-written mirror of the C #: signatures, and calling a mismatched library with them is memory-unsafe rather #: than merely wrong. -BINARY_ABI = 12 +BINARY_ABI = 13 class AbiError(RuntimeError): diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json index 5f0dadaa6e89..e2f8c0d56458 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json @@ -1364,6 +1364,16 @@ "18": "bf7b02b7aa2d32470335fc8dbb966b40af321525e28b3f351bc7405a27265d69", "19": "d9b3c7bf671ce53b4eaed65a93a88fdc88eadc9a4013f22a4c654984440711e0", "2": "ee4683453afbbc49e5ae11714bccf200fada5e75884a59405cc6676af6e57b81", + "20": "666303a6b2e796bc57262ee0d602d0d5b7bfe1d072348b55cd531316602077e8", + "21": "454b75f8bc1ecdee95a2638e88fef0e8c884e1d8cba5c57c91f7d916c9915268", + "22": "73afa617beb3add79f4b3cec4b40552b9d27293b1f980dbe1147a64e2bf5f96f", + "23": "56ad09bbf240243bf55ab217031f75ae05c63247b097a8c7d15800fc7711ac31", + "24": "86ad26838baf83b893b43390ef75a38c6ac6d5fd7838e70a2ea171e7e7bd5f99", + "25": "25d3537319d899b4f2690823f20952cf78922532f4b9bf1f5a54d6be76bc2f1e", + "26": "91c6afd3ad49023f966b7b9265d05a1b8802121d61c92222d84cf1aac003e42d", + "27": "7206c529f514d7f6d3c62f44ae05143e783f41c7babffcc9132433e88d58f5a3", + "28": "70641ee085d38835020d7e8681ed04ae085e909ebb28210646d3fc6aff508f11", + "29": "6e4f5b4d2bfe3d7866077ae463a7eccc0b4066fd3160e75568eb45fe5fa27a3c", "3": "b364ec606939a153220377511d8bb21345bf28f998a41c1f8e3b0d96cac6c4a8", "4": "66849d43bf1485879bcf1c5f173d72862cca98a1985d0d2d0ef824fba8c5cbe6", "5": "e9427bcb1fe7b9bfe568b7451b9f6ccd770c9399ff05deae35775479e13a407b", @@ -1530,7 +1540,17 @@ "7": "1067ddfadbdb481e9623ec4389070eca0a385d2968de4d5218cdaf62f68481f0", "70": "6b98a1c3fe47f3794abb2eac2c2be60dddd0030b9247848df12867450260a76b", "71": "f072b9b61cc857838d5cddd76a6b9796a00c613392c172c6e837a20f76969019", + "72": "f9134ac77ebda713d0abd51835a0dae98bee946247bc9fe6a40e349c3140bfa5", + "73": "4234b32422c8ab20c15b720b38f661cb73a121aa69982c39b9c43f798b52da77", + "74": "4b867000de3d7981d3435abe475f7c517c59b8a9115f25a81967770a7ddec9ef", + "75": "4018c03a10ec9b450cd061cf8cb2a59db635527f4a9940f14d87967246174ce1", + "76": "81ec48f4a3bc5239c9a0de08962a16c3f7ff72a661dd9e8e15bbeb4c71046bb8", + "77": "a2338afd929c6a5e60c4fd6b6bc9f64283fa38dfcffc24eecb22ee357f888dee", + "78": "f26157886fbaf79ffb6ada88da0650701c3d41c48f0f843a650cf04b136751bf", + "79": "7d2ec86467e0760be88a4669eaea0d1f2f998a2c4469714ae8eeb2caa006f89a", "8": "f4f0267af6f85a06591533f53a3cc74339723fa2e33c5f68e5fcd1b1ac4a6520", + "80": "5e0743eb0be9c60c86567fc1b1a12d24f63351282852ac6c0d67aa522728fb59", + "81": "a4ab530ee81f1480733c390b3e62add7ba94a40d58e32e65643b3cd7fee98d73", "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25" }, "gfx950_attention_tiled_2d_fastkv_regp": { @@ -3209,6 +3229,16 @@ "18": "7d21d4ce1dd271b1dfe7f82d0c6c128c3e249b1f00833a090b74b3facb94f80e", "19": "d5b8888550a1db52d497b490f09cc169d739d054d269284ff7be8f5e3d3c2031", "2": "5841c730e964542b171c289e6075eaf6332b3cae253707da9fd74d8bb3c9ba9a", + "20": "bcb4a07d3fc11b9577b30479578b782bd621376369f2f46a3bc2592ebbed440b", + "21": "d292fe091fb4e072f208730de8763da9f440cc146ec8bba646d65ac406d8067c", + "22": "56af4240da55d6176a75b974ec502194259be7b8c4c4537236a990a05c269081", + "23": "8f42c5eb0bf9b30f7df0f860edcb2ee681676355c4e9f2ccc61df5e79e2f375a", + "24": "8b0996f3a7486152e495eeba150cac329438053a6a6d91e877e0ef83aaabd248", + "25": "9a1bb67798af4586458004200f2bddf05ccda51d3ae5590c908fae3bbca2b1bd", + "26": "8c01099cdc4e52852af594bc68742a28c91e03fa2e2ee5da7b2eab9783bbb679", + "27": "c35dcb6ae2ced1ee068fbb21d3a3b0570aed7335be8d68010a8d134643646cf2", + "28": "57481c929026e8b74c8eea29eb92223201498193b20a110acb6a0238a4c18645", + "29": "5dd25528c8f42ac34bf4e92d996df104de0ec6f648b135593288afe871031c0f", "3": "bd9164bfbcff6da42e08428ca167eeb648967f4c40c019f79ef435be664b0d6a", "4": "1b04fa2470af0aa59452389cb41125418154ab3939758ed4a38789ce290b33ab", "5": "f6e5cf8a0392c1bce3fd7d9ce4d0eccf9d39fe29f02ab9bcf5c342152eba4ffb", @@ -3375,7 +3405,17 @@ "7": "763832662414ae026dad9670f8f064ceea6145dd42ec2159941d37f3927ed2f7", "70": "2a3870347ab70cbcb276925da1726e5c51dcb737771d9d2af5e742a8c22680fe", "71": "2e6df5bd9a6d6430bdd7cec8fb061975b840cc885565eb058307102a26e52b8b", + "72": "0233372e8a00b9fca79590c1cf9828802b9e28c0b951af6504f921aac69eb3a2", + "73": "99696217544419c1745ffe87e0fc43c094db13871f32b903ae083043e1eeae19", + "74": "ab47555355973e27326bc4ff5c9137409a42730c247c6f6575f99146e95062e1", + "75": "54544b94041b9e2b3dba2408e88cc34e421b3d41ff81b9fca35dfa10d0a626b0", + "76": "e4c3d292055d5e3a73bc0ac6c27c2ca022213fae0a436a2f6add4703fd52fb92", + "77": "c36631ec3a1353c919476ff4ae3254185566485ef7e68c150fdc8eae90e025d5", + "78": "c7aa33fdaaa57de209d1fb115d77d106b35a8ad8a418052fd751bfdaccd2a6f3", + "79": "1d4bdea08c34fb3776b779f5b56ad989fc7baab3ce26d7d8ea02b65ef095f5f0", "8": "436a62f0670b97e464439f466724c5d911a96b10e4bb035429b37d5be8d85243", + "80": "6fdaac51b884fbbdbdd1e01ee5afce4c334fc1c203836842c6f91ae4196086a5", + "81": "7be0d9f0c4e9b40c65b962ee1e0e7611517f838d1b6b7d08f4a77694c1b70c76", "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9" }, "gfx950_attention_tiled_2d_fastkv_regp": { @@ -5053,6 +5093,16 @@ "18": "eb020317c6d6bab712c0379731bdb9eab253ad67be3b1937c759c4ead5743c78", "19": "a8cc1af85ca357f2e5b109402706d4be4e6f9235839c3016290441ed7cdd6799", "2": "9b7b8d4ad0d7c67143c5887f561e08182cf9a095bed1a76ed53b406cbd45f768", + "20": "f6bd8ea4eb1b37d26ea34d20bbf07decdb6a4023db827b685c6b1016744f5ea0", + "21": "3f2dc386df2b174af12fd7ca2e7b6c93ff2748c3c192214bbf780a8663696006", + "22": "061b9089542c4fc2a5549af05166b92a547c1519330d28339228a8afb9e4a6c3", + "23": "a89724e214221d6bd23c09b2a1aa51517bc8e8246b9e7ed7d6b25726453a915f", + "24": "9270bdf1d5a416515efed92e90efb653162b46ebe87ca709c0640834315649f2", + "25": "30837d1a4206cd52910371072feff61e44e5ceacb7994b643815aae8e0b4d687", + "26": "61f5b9508ba3bf6c455e4ca12b0ab20cbf63fd945d96dd628b5a12ae582b9f7a", + "27": "6b2b72fd5802b0897d9a177602c7887c6726bc6b6bc55ab427b84ab47457ae2a", + "28": "1a15806eeb788f57adc4b2f71223f50f15b3d632d3d17fd8140c26fe15110d07", + "29": "940d064ac0ec9ba66eac1bb0b1fe71cb27d13325d4843f1654a86bc52785455c", "3": "04366ee133dbfc67fba244a8d80ef386386c288436c373fd2ba3fb34581287e7", "4": "f7627f88969eff7df1add5b6a54937fff1c2eb1f869cf4db71f51ab1657c72f8", "5": "3b8b9c52b4b74d31c9be73c6d0ba0c5e7549a0015ff4e3fffb86fa16968912e4", @@ -5219,7 +5269,17 @@ "7": "8212f1103d5177844f6a8f6ae2e4beb73c28486bb07d975da6aa94cbac407c41", "70": "6a08f23a301f5f3025c4f0aa673f1848a6a91af57b81f853f3150e347b6fd164", "71": "b8eff71e24ee9632e4c37ab8c589975411b851bc1abaaf0e47e4a2dada05ce10", + "72": "007d93ce03076713cf93ad873a579f17917d9709ad90c591bb9075094ad4802e", + "73": "eae27df1173f23b64cb3ddda39d9420015b916d63e06de219524add66556cfe5", + "74": "6dc84613c57a816aedbb938541768c4b39f579e35c6816b883ef8dc8c810909d", + "75": "69638ff6a45e11a355075f13ec4952cac7bb671412c96b168b62d8f23cad528e", + "76": "4597a2588631eda6b60b2d07bd84322f3d24628b0d62f2ec718e1d0a003dade1", + "77": "ac0c2ab073e44542d88d124530f446eeb4d7f6d81a8ff1646568714b8a1b73b6", + "78": "0cc4ae127fa9c5bac58a717f13a55bad2ff989b07160bd740997be6d5893d502", + "79": "8b01743f559c178bb3b5e01473f7f5d085fe40782d9b3b29984efd1c1690ce44", "8": "7d827babcb8192445726b06e4250deb674158b5a77d87ecdd9e873118dc0ec93", + "80": "67dbe9c3dc6e3d01481ef6916ec6133cf0af5337a5463c3ac49c6975e09a2129", + "81": "a21cc72c28178f143ca1fdd2c3d81e5cebe4b18e5c5004af5553a4c9da5591a3", "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0" }, "gfx950_attention_tiled_2d_fastkv_regp": { @@ -7051,6 +7111,16 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", + "20": "ded0e8367c888ce468cb360995bdc16a3cf4a19b5871623918a44d27fad1b608", + "21": "3340e3adbf99fab5dfb75636bc3b6e52e3d645bdb3c1c56369d2d36ce1162635", + "22": "2fc147e6e38c77ab35278a458b3111e9cf6a809b8ff66df0dfeb0d4fcd75384a", + "23": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", + "24": "880d76bde4f69ddc629b36c5b9bdcb6c7daafbf43dad70e9e543366fef0619ee", + "25": "78aa461277b5b14266c99b87f6ba4f807d81c3c66d58d0007ef13429cd73c1f1", + "26": "ec7c5ae8d471cf87beca8d8dc66da692dbaea6f062f2a8bab130424e0fdb0b62", + "27": "f1bc3ee0b93035b537cc675c5b20a479ac63c72bbdff1a0df0151822226a0bf3", + "28": "0f86e62577b31c17dd6541a1481587dd76a7c96d5ded6d3d1844621e04d1cd50", + "29": "8f9a60a9d1695a7b971b5ccdc559cae67c20ba8e33db7817171c9329024f4996", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", @@ -7217,7 +7287,17 @@ "7": "9f8857f7a94b9b8524bd631b0b1fcd3c89d8733d317d2ccfd9e26af3ff72e3ea", "70": "2d702df8314f65d553d8f0e1d72d0d202625361d26ec2a361f7ff3dd012ea947", "71": "a1e8c2259d9baa180cd31a07c3974ff01d000af87bc24a21a7e4b3a157e939ab", + "72": "55449a83cb5e965a2ab3051685e107aa4c3c1d592ebf815aeba153039434d888", + "73": "3c0fe43e46ba8a16c43283bd3034ec9402f1c346f5837c66262ad5ae6c1cb871", + "74": "8cb971881d8c1c5fd87a064d9e7151cfa2701d7e7ee400f43fb072a781522439", + "75": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", + "76": "f9ada83d0ffb7a07153d9364a661f8d9cafec0e9b3c8c3ed36ff655dab3924e9", + "77": "92cf4de7f3fe53a82389564a5ffe50b8af9b40663cd52c7b24f15ee926e596af", + "78": "087cbf264ef35b42a190255b5353b32993a83b6c65965754a4d9017e54f6c8ed", + "79": "b990325eb902c8682c90abbb3056fecb8013ded88fec6dc0fc21b43cd4f7dbd8", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", + "80": "67aee1395648bf72d013d292201b336b6607d73b5974c2e82848c36b210e92b5", + "81": "2dcfe01e3dd46e0569097c2f72b071691fffa702195e42dced454017aaa1ea99", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07" }, "gfx950_attention_tiled_2d_fastkv_regp": { @@ -9356,6 +9436,16 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", + "20": "ded0e8367c888ce468cb360995bdc16a3cf4a19b5871623918a44d27fad1b608", + "21": "3340e3adbf99fab5dfb75636bc3b6e52e3d645bdb3c1c56369d2d36ce1162635", + "22": "2fc147e6e38c77ab35278a458b3111e9cf6a809b8ff66df0dfeb0d4fcd75384a", + "23": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", + "24": "880d76bde4f69ddc629b36c5b9bdcb6c7daafbf43dad70e9e543366fef0619ee", + "25": "78aa461277b5b14266c99b87f6ba4f807d81c3c66d58d0007ef13429cd73c1f1", + "26": "ec7c5ae8d471cf87beca8d8dc66da692dbaea6f062f2a8bab130424e0fdb0b62", + "27": "f1bc3ee0b93035b537cc675c5b20a479ac63c72bbdff1a0df0151822226a0bf3", + "28": "0f86e62577b31c17dd6541a1481587dd76a7c96d5ded6d3d1844621e04d1cd50", + "29": "8f9a60a9d1695a7b971b5ccdc559cae67c20ba8e33db7817171c9329024f4996", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", @@ -9522,7 +9612,17 @@ "7": "9f8857f7a94b9b8524bd631b0b1fcd3c89d8733d317d2ccfd9e26af3ff72e3ea", "70": "2d702df8314f65d553d8f0e1d72d0d202625361d26ec2a361f7ff3dd012ea947", "71": "a1e8c2259d9baa180cd31a07c3974ff01d000af87bc24a21a7e4b3a157e939ab", + "72": "55449a83cb5e965a2ab3051685e107aa4c3c1d592ebf815aeba153039434d888", + "73": "3c0fe43e46ba8a16c43283bd3034ec9402f1c346f5837c66262ad5ae6c1cb871", + "74": "8cb971881d8c1c5fd87a064d9e7151cfa2701d7e7ee400f43fb072a781522439", + "75": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", + "76": "f9ada83d0ffb7a07153d9364a661f8d9cafec0e9b3c8c3ed36ff655dab3924e9", + "77": "92cf4de7f3fe53a82389564a5ffe50b8af9b40663cd52c7b24f15ee926e596af", + "78": "087cbf264ef35b42a190255b5353b32993a83b6c65965754a4d9017e54f6c8ed", + "79": "b990325eb902c8682c90abbb3056fecb8013ded88fec6dc0fc21b43cd4f7dbd8", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", + "80": "67aee1395648bf72d013d292201b336b6607d73b5974c2e82848c36b210e92b5", + "81": "2dcfe01e3dd46e0569097c2f72b071691fffa702195e42dced454017aaa1ea99", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07" }, "gfx950_attention_tiled_2d_fastkv_regp": { From 9be07ddd075246d02fbedbeaf9617767bef05076 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 21 Oct 2026 18:55:18 -0600 Subject: [PATCH 02/22] feat(hip-kernel-provider): hipkernel:AttentionPagedUnified paged/ragged SDPA for gfx942/gfx950 Native ingestor engine over rocKE tiled 2D unified attention (runtime_layout): paged K/V with arbitrary strides (incl. vLLM's interleaved K|V view), INT32 page tables (one tensor for K and V, or separate page_table_k and page_table_v tensors with the same width and batch stride), seq_len_q and seq_len_kv, dense or ragged Q, bottom-right causal with optional left bound (cuDNN meaning: L keys up to the diagonal), GQA, fp16/bf16, head size 64/128/256, block size 16/32/64. Query rows past seq_len_q come back zero. max_seq_len_kv may be unset: the kernel reads only seq_len_kv, which the inferred extent bounds the same way. Declines everything else with a logged cause, including valid paged graphs the kernel cannot read: one-sided paging, K and V page tables of different widths or batch strides, differing K and V block sizes, packed page tables, a ragged Q/O whose ragged_offset_multiplier is not its token stride (the kernel reads stored offsets as token counts), and a declared tensor alignment below what the kernels load (cause alignment: 16 bytes for Q/K/V/O, 4 for the INT32 page tables, sequence lengths and ragged offsets). UED sdk_version 1.4.0, so these graphs reach the matcher rather than stopping at the schema gate. Adds matcher unit tests, the descriptor census, and GPU integration tests against a gather-then-dense reference that is itself checked against hipDNN's CPU SDPA reference (CpuFpReferenceSdpa over gatherPagedKv), including padded query rows, rows with no visible key (0 < seq_len_kv < seq_len_q), an unset max_seq_len_kv, separate K and V page tables and HIP-graph capture/replay. The three quick paged bundles the engine serves claim it on gfx942 and gfx950 (linux), and one engine-pinned external integration lane per shipped architecture runs the SdpaFwd bundles against it with those claims enforced. The engine takes a gfx942 and a gfx950 row of HKP_PINNED_ATTENTION_ENGINES, which registers those lanes, a GPU-reference target per architecture and the Packs census (the census table now collects a multi-arch engine's rows into one registration); each row's TOML skips the other architecture, so a package carrying both shards runs the bundles once. --- .../hip-kernel-provider/CMakeLists.txt | 3 + ...ipkernel_AttentionPagedUnified_gfx942.toml | 18 + ...ipkernel_AttentionPagedUnified_gfx950.toml | 18 + .../descriptor-packaging/README.md | 5 +- ...edUnified_test_categories_integration.yaml | 82 + .../hip-kernel-provider/src/CMakeLists.txt | 15 +- .../kernel_ingestor_engine/CMakeLists.txt | 1 + .../kernel_ingestor_engine/IngestorPacks.cpp | 3 + .../kernel_ingestor_engine/IngestorPacks.hpp | 9 + .../rocKE/attention_paged_unified/README.md | 122 + .../attention_paged_unified.kmd.json | 38 + .../attention_paged_unified.udd.json | 6 + .../attention_paged_unified.ued.json | 10 + .../attention_paged_unified_gfx942.kdp.json | 4866 +++++++++++++++++ .../attention_paged_unified_gfx950.kdp.json | 4818 ++++++++++++++++ .../kernel_dtype_matches_graph.umd.json | 7 + .../operation_is_gfx942.umd.json | 7 + .../operation_is_gfx950.umd.json | 7 + .../packs/AttentionPagedUnifiedNative.cpp | 1362 +++++ .../packs/AttentionTiled2DSignature.hpp | 90 + .../packs/Gfx950AttentionUnified2DNative.cpp | 47 +- .../src/integration_tests/CMakeLists.txt | 12 +- .../IntegrationGpuAttentionPagedUnified.cpp | 985 ++++ .../src/tests/CMakeLists.txt | 44 +- .../kernel_ingestor_engine/CMakeLists.txt | 2 + .../TestKernelIngestorEngine.cpp | 1 + .../TestAttentionPagedUnifiedMatchers.cpp | 831 +++ .../packs/TestAttentionPagedUnifiedPacks.cpp | 519 ++ .../integration-tests/docs/file-formats.md | 2 +- .../Decode/Decode.support.json | 11 +- .../SpecDecode/SpecDecode.support.json | 11 +- .../Mixed/Mixed.support.json | 11 +- .../hipdnn/tools/IngestorGenerator/README.md | 1 + .../configs/attention_paged_unified.yaml | 333 ++ 34 files changed, 14231 insertions(+), 66 deletions(-) create mode 100644 dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx942.toml create mode 100644 dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx950.toml create mode 100644 dnn-providers/hip-kernel-provider/hipkernel_AttentionPagedUnified_test_categories_integration.yaml create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.udd.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.ued.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/kernel_dtype_matches_graph.umd.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx942.umd.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx950.umd.json create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp create mode 100644 dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp create mode 100644 dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp create mode 100644 dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp create mode 100644 projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml diff --git a/dnn-providers/hip-kernel-provider/CMakeLists.txt b/dnn-providers/hip-kernel-provider/CMakeLists.txt index c17023bdf4b0..a7e801bf18ec 100644 --- a/dnn-providers/hip-kernel-provider/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/CMakeLists.txt @@ -484,6 +484,7 @@ if(HIPKERNELPROVIDER_ENABLE_TESTS) set(HIPKERNELPROVIDER_GFX950_ATTENTION_INTEGRATION_CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/hipkernel_Gfx950Attention_test_categories_integration.yaml") set(HIPKERNELPROVIDER_GFX942_ATTENTION_UNIFIED_3D_INTEGRATION_CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/hipkernel_Gfx942AttentionUnified3d_test_categories_integration.yaml") set(HIPKERNELPROVIDER_GFX942_ATTENTION_DENSE_INTEGRATION_CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/hipkernel_Gfx942AttentionDense_test_categories_integration.yaml") + set(HIPKERNELPROVIDER_ATTENTION_PAGED_UNIFIED_INTEGRATION_CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/hipkernel_AttentionPagedUnified_test_categories_integration.yaml") set(ROCKE_ENGINE_CTEST_CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/ROCKE_ENGINE_test_categories_external.yaml") set(HKP_PACK_CTEST_CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/HKP_PACK_test_categories_external.yaml") set(HIPKERNELPROVIDER_CTEST_INSTALL_FILE "") @@ -495,6 +496,7 @@ if(HIPKERNELPROVIDER_ENABLE_TESTS) AND EXISTS "${HIPKERNELPROVIDER_GFX950_ATTENTION_INTEGRATION_CATEGORIES_YAML}" AND EXISTS "${HIPKERNELPROVIDER_GFX942_ATTENTION_UNIFIED_3D_INTEGRATION_CATEGORIES_YAML}" AND EXISTS "${HIPKERNELPROVIDER_GFX942_ATTENTION_DENSE_INTEGRATION_CATEGORIES_YAML}" + AND EXISTS "${HIPKERNELPROVIDER_ATTENTION_PAGED_UNIFIED_INTEGRATION_CATEGORIES_YAML}" AND EXISTS "${ROCKE_ENGINE_CTEST_CATEGORIES_YAML}" AND EXISTS "${ROCM_LIBRARIES_ROOT}/shared/ctest/TestCategories.cmake") include("${ROCM_LIBRARIES_ROOT}/shared/ctest/TestCategories.cmake") @@ -506,6 +508,7 @@ if(HIPKERNELPROVIDER_ENABLE_TESTS) "${HIPKERNELPROVIDER_GFX950_ATTENTION_INTEGRATION_CATEGORIES_YAML}" "${HIPKERNELPROVIDER_GFX942_ATTENTION_UNIFIED_3D_INTEGRATION_CATEGORIES_YAML}" "${HIPKERNELPROVIDER_GFX942_ATTENTION_DENSE_INTEGRATION_CATEGORIES_YAML}" + "${HIPKERNELPROVIDER_ATTENTION_PAGED_UNIFIED_INTEGRATION_CATEGORIES_YAML}" "${ROCKE_ENGINE_CTEST_CATEGORIES_YAML}" "${HIPKERNELPROVIDER_CTEST_CATEGORIES_YAML}" ) diff --git a/dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx942.toml b/dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx942.toml new file mode 100644 index 000000000000..b067cbf5a16d --- /dev/null +++ b/dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx942.toml @@ -0,0 +1,18 @@ +# Integration test configuration for hipkernel:AttentionPagedUnified, gfx942 entry +# Filters use GTest-style globs: * matches any sequence of characters + +[meta] +version = 1 + +# The engine serves the paged/ragged SdpaFwd bundles on gfx942 and gfx950. No tolerance +# overrides needed: the forward pass uses the common SdpaAttributes tolerance +# (tol::sdpa::getToleranceFwd()). +# +# The engine ships for both architectures, so on a gfx950 device this entry would repeat +# the gfx950 entry's run. Skip there, so a package carrying both shards runs the bundles +# once. Any other device declines through the ordinary path (the packs arch-prune +# before the matcher). +[[test_skips]] +archs = ["gfx950"] +filters = ["*"] +reason = "hipkernel:AttentionPagedUnified: this entry runs on gfx942 only" diff --git a/dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx950.toml b/dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx950.toml new file mode 100644 index 000000000000..d0e04e1e1aff --- /dev/null +++ b/dnn-providers/hip-kernel-provider/config/hipkernel_AttentionPagedUnified_gfx950.toml @@ -0,0 +1,18 @@ +# Integration test configuration for hipkernel:AttentionPagedUnified, gfx950 entry +# Filters use GTest-style globs: * matches any sequence of characters + +[meta] +version = 1 + +# The engine serves the paged/ragged SdpaFwd bundles on gfx942 and gfx950. No tolerance +# overrides needed: the forward pass uses the common SdpaAttributes tolerance +# (tol::sdpa::getToleranceFwd()). +# +# The engine ships for both architectures, so on a gfx942 device this entry would repeat +# the gfx942 entry's run. Skip there, so a package carrying both shards runs the bundles +# once. Any other device declines through the ordinary path (the packs arch-prune +# before the matcher). +[[test_skips]] +archs = ["gfx942"] +filters = ["*"] +reason = "hipkernel:AttentionPagedUnified: this entry runs on gfx950 only" diff --git a/dnn-providers/hip-kernel-provider/descriptor-packaging/README.md b/dnn-providers/hip-kernel-provider/descriptor-packaging/README.md index 0252b1a555d8..5854549a261b 100644 --- a/dnn-providers/hip-kernel-provider/descriptor-packaging/README.md +++ b/dnn-providers/hip-kernel-provider/descriptor-packaging/README.md @@ -111,8 +111,9 @@ too. Two answers decide which engine-pinned tests are registered: - **Per-arch registrations** (the census, and the external and gpu_ref integration checks) install into a gfx-specific shard and are gated on `hkp_product_ships_engine_for_arch()`, which reads what the shard for that arch - ships. The single-arch rocKE attention engines pinned against the SdpaFwd bundles - are registered from one table, `HKP_PINNED_ATTENTION_ENGINES` in `src/CMakeLists.txt`. + ships. The rocKE attention engines pinned against the SdpaFwd bundles are registered + from one table, `HKP_PINNED_ATTENTION_ENGINES` in `src/CMakeLists.txt`, one row per + engine and architecture. - **Host-side sources that pin an engine**, such as the attention knob suites, are gated on `hkp_product_offers_engine()`, which reads what the product root carries for any arch under this build's filters. It never reads `GPU_TARGETS`: the host libraries and diff --git a/dnn-providers/hip-kernel-provider/hipkernel_AttentionPagedUnified_test_categories_integration.yaml b/dnn-providers/hip-kernel-provider/hipkernel_AttentionPagedUnified_test_categories_integration.yaml new file mode 100644 index 000000000000..956d8469a389 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/hipkernel_AttentionPagedUnified_test_categories_integration.yaml @@ -0,0 +1,82 @@ +# Copyright © Advanced Micro Devices, Inc., or its affiliates. +# SPDX-License-Identifier: MIT +# +# hip-kernel-provider hipkernel:AttentionPagedUnified external integration test categories. +# +# One lane per architecture the engine ships for (gfx942, gfx950), each pinned to +# hipkernel:AttentionPagedUnified via --test-engine. Selects the shared +# integration-test-bundles/{quick,standard,comprehensive,full}/SdpaFwd/ suites by suite +# name. Engine pinning and support claims do the rest: a claimed case the engine declines +# fails its lane, an unclaimed one it declines skips (every non-paged SdpaFwd bundle), and +# an unclaimed one it accepts runs and is reported as unclaimed support. +# Tiers cascade: standard runs quick + standard, comprehensive runs quick + standard + +# comprehensive; only "full" runs the full-tier bundles. + +_common_excludes: &common_excludes + - "*DISABLED*" + +test_categories: + quick: + description: "Quick paged attention SdpaFwd bundle coverage" + test_patterns: + - "quick_SdpaFwd_*.*" + exclude: *common_excludes + labels: + - "quick" + - "pre-commit" + - "smoke" + + standard: + description: "Standard paged attention SdpaFwd bundle coverage" + test_patterns: + - "quick_SdpaFwd_*.*" + - "standard_SdpaFwd_*.*" + exclude: *common_excludes + labels: + - "standard" + - "pr" + - "precheckin" + + comprehensive: + description: "Comprehensive paged attention SdpaFwd coverage: quick + standard + comprehensive-tier bundles" + test_patterns: + - "quick_SdpaFwd_*.*" + - "standard_SdpaFwd_*.*" + - "comprehensive_SdpaFwd_*.*" + exclude: *common_excludes + labels: + - "comprehensive" + - "nightly" + - "extended" + + full: + description: "Full paged attention SdpaFwd coverage" + test_patterns: + - "*_SdpaFwd_*.*" + exclude: *common_excludes + labels: + - "full" + - "all" + + ffm-quick: + description: "Fast-feedback quick tier: paged attention SdpaFwd quick bundles" + test_patterns: + - "quick_SdpaFwd_*.*" + exclude: *common_excludes + labels: + - "ffm-quick" + - "ffm-full" + +# category_timeouts are CTest kill limits, set to 2x the tier's runtime budget +# (quick ~5 min, standard ~30 min incl. quick, comprehensive <= 60 min incl. +# quick+standard; full has no budget) so a budget overrun is a failure to +# investigate while ordinary run-to-run variance does not trip the timeout. +execution_settings: + default_timeout: 300 + timeout_multiplier: 1 + category_timeouts: + quick: 600 + standard: 3600 + comprehensive: 7200 + full: 14400 + ffm-quick: 1800 diff --git a/dnn-providers/hip-kernel-provider/src/CMakeLists.txt b/dnn-providers/hip-kernel-provider/src/CMakeLists.txt index 195ee0fb5ba1..6c7e32fd86fc 100644 --- a/dnn-providers/hip-kernel-provider/src/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/src/CMakeLists.txt @@ -179,7 +179,7 @@ if(HIPKERNELPROVIDER_ENABLE_TESTS) # Bundle filters for the attention engines' external integration checks below and # their GPU-reference targets in integration_tests/. Under YAML categorization the # checks' CTest suites select from each engine's - # ../hipkernel_Gfx9*Attention*_test_categories_integration.yaml instead, and + # ../hipkernel_*Attention*_test_categories_integration.yaml instead, and # ../descriptor-packaging/tests/test_attention_bundle_filters.py fails on a mismatch. string(JOIN ":" HKP_SDPA_FWD_DEFAULT_GTEST_FILTER "quick_SdpaFwd_Default.*" "standard_SdpaFwd_Default.*" @@ -188,12 +188,19 @@ if(HIPKERNELPROVIDER_ENABLE_TESTS) # output Gfx942AttentionDense serves. set(HKP_GFX942_ATTENTION_DENSE_GTEST_FILTER "${HKP_SDPA_FWD_DEFAULT_GTEST_FILTER}:*_SdpaFwd_bshd_*_stats_*") + # Every SdpaFwd bundle: AttentionPagedUnified's support claims pick the paged bundles + # it must pass, and it declines (skips) the rest. + string(JOIN ":" HKP_SDPA_FWD_ALL_GTEST_FILTER + "quick_SdpaFwd_*.*" "standard_SdpaFwd_*.*" + "comprehensive_SdpaFwd_*.*" "full_SdpaFwd_*.*") # The engine-pinned attention engines, each with an external integration check below, # a GPU-reference target in integration_tests/ and a census in tests/. Six fields per # engine: , then its # TOML under ../config/ and its categories YAML variable from ../CMakeLists.txt. # test_attention_bundle_filters.py reads the rows to pair each filter with its YAML. + # An engine that ships for several architectures takes one row per architecture, each + # TOML skipping the others so a package carrying several shards runs its bundles once. set(HKP_PINNED_ATTENTION_ENGINES gfx950 dense Gfx950AttentionDense HKP_SDPA_FWD_DEFAULT_GTEST_FILTER hipkernel_Gfx950Attention.toml @@ -210,6 +217,12 @@ if(HIPKERNELPROVIDER_ENABLE_TESTS) gfx942 dense Gfx942AttentionDense HKP_GFX942_ATTENTION_DENSE_GTEST_FILTER hipkernel_Gfx942AttentionDense.toml HIPKERNELPROVIDER_GFX942_ATTENTION_DENSE_INTEGRATION_CATEGORIES_YAML + gfx942 paged_unified AttentionPagedUnified HKP_SDPA_FWD_ALL_GTEST_FILTER + hipkernel_AttentionPagedUnified_gfx942.toml + HIPKERNELPROVIDER_ATTENTION_PAGED_UNIFIED_INTEGRATION_CATEGORIES_YAML + gfx950 paged_unified AttentionPagedUnified HKP_SDPA_FWD_ALL_GTEST_FILTER + hipkernel_AttentionPagedUnified_gfx950.toml + HIPKERNELPROVIDER_ATTENTION_PAGED_UNIFIED_INTEGRATION_CATEGORIES_YAML ) add_subdirectory(tests) diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/CMakeLists.txt b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/CMakeLists.txt index 9ccbd1819e39..d5d6cb5f39bf 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/CMakeLists.txt @@ -26,6 +26,7 @@ target_sources(hip_kernel_provider_impl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/packs/Gfx942AttentionDenseNative.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/Gfx1151WmmaAttentionNative.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/Gfx950ConvDgradNative.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/packs/AttentionPagedUnifiedNative.cpp ${CMAKE_CURRENT_SOURCE_DIR}/serialization/IngestorPlanHeader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/serialization/IngestorPlanCodec.cpp ) diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.cpp index 8d6679dfe9e4..e2165a3bb070 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.cpp @@ -65,6 +65,9 @@ const std::vector& ingestorPacks() {"hipkernel:Gfx950ConvDgradAot", ®isterGfx950ConvDgradAotSymbols, &resetGfx950ConvDgradAotModuleCache}, + {ATTENTION_PAGED_UNIFIED_ENGINE_NAME, + ®isterAttentionPagedUnifiedSymbols, + &resetAttentionPagedUnifiedModuleCache}, }; return s_packs; } diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.hpp index a914d1142d3e..214b1be78e83 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/IngestorPacks.hpp @@ -144,6 +144,15 @@ void resetGfx950ConvDgradAotModuleCache(); /// plan build actually reads; this function runs inside the plugin. FOR TESTS ONLY. void setGfx950ConvDgradAotBatchChunkByteLimitForTesting(int64_t limit); +/// The engine name attention_paged_unified.ued.json declares; read by the pack table, the +/// pack's decline log lines and its descriptor census. +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_ENGINE_NAME + = "hipkernel:AttentionPagedUnified"; + +/// @see packs/AttentionPagedUnifiedNative.cpp +void registerAttentionPagedUnifiedSymbols(hipdnn_plugin_sdk::ingestor::SymbolScope& scope); +void resetAttentionPagedUnifiedModuleCache(); + /// Drops every pack's cached kpack modules and closes every kpack archive /// SharedKpackArchives retains, so the next dispatch re-reads its archive from disk. Leases /// stay held: the archive that next dispatch opens is retained again. diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md new file mode 100644 index 000000000000..98f7deac4426 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md @@ -0,0 +1,122 @@ +# hipkernel:AttentionPagedUnified + +Paged (and ragged-query) SDPA forward for gfx942 and gfx950, served by rocKE's tiled 2D +unified-attention kernels (`rocke/library/kernels/{gfx942,gfx950}/attention_tiled_2d.py`, +`build_unified_attention_2d_tiled`) built with `runtime_layout=True`. The catalog source +of truth is `projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml`; +the native half is `packs/AttentionPagedUnifiedNative.cpp`. + +## Graphs served + +cuDNN paged-attention semantics (`projects/hipdnn/docs/SdpaSemanticsRegister.md`, SEM-008 +padding, SEM-009 paged K/V, SEM-010 empty rows), one SDPA-forward node, compute type FLOAT: + +| Operand | Logical dims | Rules | +|---|---|---| +| Q, O | `[B, Hq, Sq, D]` | FP16 or BF16 (all four operands alike); dense with arbitrary strides, or both ragged through the same INT32 `[B+1,1,1,1]` `ragged_offset` (token units times each tensor's `ragged_offset_multiplier`) | +| K, V | `[num_blocks, Hkv, block_size, D]` | paged containers with equal, arbitrary strides (the interleaved K\|V views of one cache allocation included), a unit D stride, and one block size | +| page tables | `[B, 1, M, 1]` INT32 | `page_table_k` and `page_table_v`: one tensor for both, or two tensors with the same `M` and batch stride; unit stride along M; not packed | +| `seq_len_q`, `seq_len_kv` | `[B,1,1,1]` INT32 | both required, as for every paged graph | +| `max_seq_len_kv` | | set or unset; unset is inferred as `M * block_size` | + +- Head size 64, 128 or 256; block size 16, 32 or 64; `Hq / Hkv` in {1, 2, 4, 5, 6, 7, 8, 16}. +- Masking: bottom-right causal (`right_bound` 0), optionally with a `left_bound` L, which + keeps the L keys ending at the diagonal as in cuDNN: key k is visible to diagonal d iff + `d - L < k <= d`, with `d = row + seq_len_kv - seq_len_q`. A vLLM sliding window W is + `left_bound = W`. The kernel's `sliding_window` argument is L. +- Strides of non-unit axes and both buffer bases must keep 16-byte alignment. + +A dense Q's rows past `seq_len_q[b]` (up to `Sq`) are padding and get O = 0. A ragged Q +writes only its live rows, the first `seq_len_q[b]` rows from its origin: rows of the offset +block past them belong to no sequence (RFC 0014), so the kernel leaves them untouched and +never writes past the last live row. A live row with no visible key, including every row +of a sequence with `seq_len_kv == 0`, also gets O = 0. The kernel never +loads K/V past `seq_len_kv` nor page-table entries past `ceil(seq_len_kv / block_size)`, so +unused entries may hold anything (`-1`, a null block). K pages through `page_table_k` and V +through `page_table_v`, so with two tables V may sit in other blocks than K. + +The engine does not clamp `seq_len_kv`: `0 <= seq_len_kv[b] <= max_seq_len_kv <= M * +block_size` is a precondition (with `max_seq_len_kv` unset, `M * block_size`), and a length +past it reads page-table entries past row `b`. + +A ragged Q needs vLLM's `query_start_loc` layout: non-decreasing origins with +`ragged_offset[b+1] - ragged_offset[b] >= seq_len_q[b]` and `ragged_offset[B]` the end of +the last block. The first origin need not be 0. The kernel finds each query block's +sequence by a binary search over the offsets and sizes its grid from `ragged_offset[B]`. +RFC 0014 (#15080) also allows origins in any order and an unused `ragged_offset[B]` when +`seq_len_q` is bound; those are valid graphs whose offset values this engine cannot see at +match time, so it cannot decline them, and its output for them is wrong. The follow-up is +a packed query-block numbering driven by `seq_len_q` (a wave prefix sum over the +sequences' block counts), which reads each sequence's own origin and does not grow the +grid for a mixed batch. + +Every other graph is declined, with the cause logged at INFO as +`hipkernel:AttentionPagedUnified declined the graph []: `. Some are valid +hipDNN graphs this kernel cannot read: + +| Cause | Graphs | +|---|---| +| `not_paged` | neither K nor V paged | +| `one_sided_paging` | only K or only V paged | +| `page_table` | K and V page tables of different widths `M` or batch strides, a packed table (with a ragged offset), a table that is not INT32 `[B, 1, M, 1]` with a unit entry stride | +| `alignment` | a declared tensor `alignment` (engine API 1.3.0) below what the kernels load: Q, K, V or O not a multiple of 16 bytes (16-byte vectors), or a page table, `seq_len_q`, `seq_len_kv` or ragged offset not a multiple of 4 bytes (INT32 words) | +| `block_size` | K and V block sizes differ, or a block size outside 16/32/64 | +| `seq_len_q`, `seq_len_kv` | a missing or malformed length tensor | +| `ragged` | a ragged Q/O whose `ragged_offset_multiplier` is not its token (sequence-axis) stride, i.e. offsets stored in other units than tokens (RFC 0014 allows them; the kernel reads offsets as token counts); a ragged K or V; Q and O not ragged through one offset tensor; an offset tensor that is not INT32 `[B+1, 1, 1, 1]` | +| `mask` | no causal mask, top-left alignment, a right bound other than 0, `left_bound = 0` | + +Other causes: `sinks`, `alibi_mask`, `fp8`, `stats`, `dropout`, `attn_mask`, +`scale_tensor`, `block_mask`, `implementation`, `gqa`, `head_size`, `kv_layout`, `layout`, +`size_limit`, `operand`, `node`, `compute_data_type`, `shape`, `mma_core_mode`, `scale`. + +## Execution + +Workspace is zero. `execute()` performs one kernel launch with no host synchronization +and no allocation, so after a first (warm-up) execution on a device, which loads the +module, a plan can be captured into a HIP graph and replayed with new lengths, block ids +and data (`IntegrationGpuAttentionPagedUnified.HipGraphCaptureReplaysWithChangedLengthsAndBlocks`). + +Each kernel is one object per (arch, dtype, head size, block size, GQA ratio). The grid +is `(Hkv, q_block_grid)` with `num_warps * 64` threads; query blocks are walked by a +grid-stride loop, so a ragged batch whose total token count exceeds `Sq` is still covered. +K and V are read through one 64-bit buffer resource per page; K's page ids come from +`block_tables_ptr` and V's from `block_tables_v_ptr` (the same buffer for one table), with +one `block_table_stride`. +Split-KV (3D) decode needs kernel slots and is not part of this engine. + +### Register pressure + +The `runtime_layout` kernels take the Q/O/K/V strides, the head count, the window and the +query form as kernel arguments, which the fixed-layout kernels fold into constants. Those +values live in SGPRs, and most kernels run out: the compiler spills SGPRs into VGPR lanes +(`v_writelane`/`v_readlane`), never to scratch memory. Measured on the shipped catalog +(288 kernels per architecture, `runtime_layout_catalog_spec`), against the same specs with +`runtime_layout` off and no window: + +| | gfx942 | gfx950 | +|---|---|---| +| Kernels that spill SGPRs | 264 of 288 | 232 of 288 | +| SGPRs spilled, per kernel (max) / in total | 57 / 4869 | 76 / 5596 | +| VGPR spills, scratch use | none | none | +| Lane moves added per kernel, median (max) | 30 (114) | 24 (152) | +| Lane moves as a share of the kernel's instructions, median (max) | 1.7% (7.4%) | 1.5% (6.3%) | +| Fixed-layout twins that spill | 0 of 192 that build | 4 of 288, 1 SGPR each | + +The runtime head count, window and batch arguments of #15024 barely move the fixed layout +(gfx942: no spills before or after; gfx950: 2 kernels spilling 6 SGPRs before, 4 spilling 4 +after), so the spills come from the runtime strides. The lane moves are a small part of +each kernel, but the lanes they hold count against VGPRs: the VGPR-limited occupancy +estimate is lower than the fixed twin's for 70 of 192 gfx942 kernels (higher for 20) and +for 209 of 288 gfx950 kernels. Removing the spills means fewer runtime arguments, and the +runtime arguments are what lets one plan serve every layout and step, so the cost is +accepted. The runtime cost has not been measured: no fixed-layout kernel serves the same +paged graph. + +## One plan for every step + +`B` in the graph is an upper bound. Batch size, lengths, offsets and block ids are read on +the device, so a plan built once serves every step of a serving loop: sequences past the +live batch carry `seq_len_q = seq_len_kv = 0` and their rows come back zero. For vLLM, bind +the cache's K and V halves as two containers over one allocation, its `block_table` as both +page tables (one tensor, `[B, 1, max_blocks, 1]`), `seq_lens` as `seq_len_kv`, the query lengths as +`seq_len_q`, and `query_start_loc` as the ragged offset of Q and O. diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json new file mode 100644 index 000000000000..ee5f4f2652bc --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json @@ -0,0 +1,38 @@ +{ + "version": "1.0", + "id": "29593010-20c8-41e6-9197-d4d617e1d25b", + "name": "AttentionPagedUnified variant fields", + "fields": [ + { + "name": "dtype", + "type": "string" + }, + { + "name": "head_size", + "type": "int" + }, + { + "name": "block_size", + "type": "int" + }, + { + "name": "num_query_heads", + "type": "int" + }, + { + "name": "num_kv_heads", + "type": "int", + "default_value": 1 + }, + { + "name": "num_warps", + "type": "int", + "default_value": 1 + }, + { + "name": "block_m_per_warp", + "type": "int", + "default_value": 16 + } + ] +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.udd.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.udd.json new file mode 100644 index 000000000000..ab79bcaa1172 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.udd.json @@ -0,0 +1,6 @@ +{ + "version": "1.0", + "id": "b4085b75-ea3b-4d38-878d-9998a03e15c7", + "name": "AttentionPagedUnified dispatch", + "dispatch_symbol": "hipkernel.attention_paged_unified.dispatch" +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.ued.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.ued.json new file mode 100644 index 000000000000..0e92010fdfe6 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.ued.json @@ -0,0 +1,10 @@ +{ + "version": "1.0", + "id": "c9af5aa1-86fc-4186-aa3c-307b929710af", + "name": "hipkernel:AttentionPagedUnified", + "sdk_version": "1.4.0", + "graph_match": { + "native": "hipkernel.attention_paged_unified.graph_match" + }, + "metadata": "29593010-20c8-41e6-9197-d4d617e1d25b" +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json new file mode 100644 index 000000000000..dd459c7ef65a --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json @@ -0,0 +1,4866 @@ +{ + "version": "1.0", + "id": "bde2bdfd-013d-4775-a8e4-850d05605d39", + "name": "hipkernel:attention_paged_unified_gfx942", + "matchers": [ + "cb28d2d1-dbfc-43cf-92bf-b2c1b6fc0f90", + "2af4cb01-70e7-485f-9f09-da2d3aa55fd2" + ], + "engine": "c9af5aa1-86fc-4186-aa3c-307b929710af", + "dispatch": "b4085b75-ea3b-4d38-878d-9998a03e15c7", + "provenance": { + "specialization_contract": { + "schema_version": 1, + "consumers": [ + { + "engine_id": "c9af5aa1-86fc-4186-aa3c-307b929710af", + "kmd_id": "29593010-20c8-41e6-9197-d4d617e1d25b", + "metadata_fields": [ + "dtype", + "head_size", + "block_size", + "num_query_heads", + "num_kv_heads", + "num_warps", + "block_m_per_warp" + ], + "matcher_only_fields": [], + "bindings": { + "dtype": { + "field": "dtype" + }, + "head_size": { + "field": "head_size" + }, + "block_size": { + "field": "block_size" + }, + "num_query_heads": { + "field": "num_query_heads" + }, + "num_kv_heads": { + "field": "num_kv_heads" + }, + "num_warps": { + "field": "num_warps" + }, + "block_m_per_warp": { + "field": "block_m_per_warp" + } + }, + "vocabulary": { + "dtype": { + "bf16": "BF16", + "fp16": "FP16" + } + } + } + ] + } + }, + "kernelDescriptors": [ + { + "version": "1.0", + "id": "ac3a259f-aa67-44ae-ad33-7739352f3438", + "name": "paged_unified.fp16_d64_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cae5f1d7-c651-436c-a93b-a1d63b9e377b", + "name": "paged_unified.fp16_d64_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "88b6cd85-ea9d-4e53-88db-31491311af36", + "name": "paged_unified.fp16_d64_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3e8eb1f2-0b9d-4db1-a962-4bc05cfd7f09", + "name": "paged_unified.fp16_d64_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a9466a6a-fbf0-40f2-a873-91e97c793b1f", + "name": "paged_unified.fp16_d64_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c7fd2902-61cd-467f-acd4-e7f1d3605af2", + "name": "paged_unified.fp16_d64_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "25e2b2bd-019d-4844-8e46-8308adf5dc4b", + "name": "paged_unified.fp16_d64_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "fc1fa730-8bea-4db4-a146-e8b9d0d42570", + "name": "paged_unified.fp16_d64_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "32ca0794-8c05-42ac-b85e-4457c70d89c8", + "name": "paged_unified.fp16_d64_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3b8143dc-3fe8-4b83-9b15-734b14e7f881", + "name": "paged_unified.fp16_d64_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f90937ed-8368-4396-adec-35869a03e653", + "name": "paged_unified.fp16_d64_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9244a4e5-b98d-418c-b179-4895ace3e36b", + "name": "paged_unified.fp16_d64_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8dd76620-ebb9-4069-9dc5-05dfe1c7fcd9", + "name": "paged_unified.fp16_d64_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "93e4b1a0-b2dc-4f97-9d2a-415666fe09f5", + "name": "paged_unified.fp16_d64_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "60a2abaa-1b1a-43b8-b8e6-cfbbb73dd38e", + "name": "paged_unified.fp16_d64_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c4415aed-a925-44ec-b263-dd46068e4d2c", + "name": "paged_unified.fp16_d64_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "07fa4bb6-3538-461f-a852-f464c6dd291e", + "name": "paged_unified.fp16_d64_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0dc8f904-057b-4728-bc87-29f346d27614", + "name": "paged_unified.fp16_d64_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2783f100-44aa-4f9c-a167-819dfe59f0da", + "name": "paged_unified.fp16_d64_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "85e02c6e-2ebe-48b8-b19b-471219987ffa", + "name": "paged_unified.fp16_d64_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "dd0a65ef-c32e-4a50-8fda-6927dbfbd898", + "name": "paged_unified.fp16_d64_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "894c8fcb-df93-49fb-9ccf-62bfdb2909ec", + "name": "paged_unified.fp16_d64_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "78b92668-42c9-4f97-b5f3-e8988bf8dfe5", + "name": "paged_unified.fp16_d64_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ddf9579a-5419-4723-b0cd-d036a3ccc726", + "name": "paged_unified.fp16_d64_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e45fa13b-f3d5-4a2e-800a-6efefb5c06e3", + "name": "paged_unified.bf16_d64_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8807f353-49d4-4599-acb4-3d298dd00061", + "name": "paged_unified.bf16_d64_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "dc7719b1-cdc9-4b76-b6a1-137bee2ec07d", + "name": "paged_unified.bf16_d64_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "473f6036-9469-4a18-86c1-310216af799d", + "name": "paged_unified.bf16_d64_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ad0ed6a6-579d-4376-8014-286ae081b034", + "name": "paged_unified.bf16_d64_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0168ed44-b741-43c6-9842-baac7a9b0f37", + "name": "paged_unified.bf16_d64_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e1a4b62d-774e-4334-a2a1-7cb86657c03c", + "name": "paged_unified.bf16_d64_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d36cc8c3-48d4-4c67-a96f-06f498191f1b", + "name": "paged_unified.bf16_d64_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2aaa6841-a001-475f-bd60-c6bf2e2c7aff", + "name": "paged_unified.bf16_d64_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "218889ee-10b8-4b53-9d73-8adc47814c14", + "name": "paged_unified.bf16_d64_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2dbe1234-1127-4957-8a8c-5f7634684218", + "name": "paged_unified.bf16_d64_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8d136bda-0bef-4ffd-b2b3-ac82d7c23550", + "name": "paged_unified.bf16_d64_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "dc8a84f3-b5de-49ad-97b2-514c9c876b74", + "name": "paged_unified.bf16_d64_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d75370a0-d31b-4257-94a1-7e44027e5136", + "name": "paged_unified.bf16_d64_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6a655662-6be4-468f-9b59-64f369e3067c", + "name": "paged_unified.bf16_d64_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a7c0afba-8f25-46a4-97e5-74666ccb0358", + "name": "paged_unified.bf16_d64_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f5c758e5-d5f2-4642-bd91-b99cf4f8f060", + "name": "paged_unified.bf16_d64_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6d29b974-059b-4d0b-a395-013bb4251f41", + "name": "paged_unified.bf16_d64_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1b276dda-105f-4294-ada1-1798f1ff24c5", + "name": "paged_unified.bf16_d64_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e313f681-8989-4a98-880f-d86a69575ccd", + "name": "paged_unified.bf16_d64_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8723bedb-b052-44f7-bf69-f9645da03300", + "name": "paged_unified.bf16_d64_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "464e8970-163d-4c3e-bb16-fecae28b67c9", + "name": "paged_unified.bf16_d64_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5e9c3468-94f6-46e7-8c33-12a22e1419c1", + "name": "paged_unified.bf16_d64_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9cff9c09-3473-4e87-a102-535cd94ee448", + "name": "paged_unified.bf16_d64_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "701f27e2-1560-46bf-bf5c-0f4859384cfe", + "name": "paged_unified.fp16_d128_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d50f33f2-58d5-4081-8936-4865bb8634cf", + "name": "paged_unified.fp16_d128_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "fd7b7e40-e45a-42bc-bae7-b88fc6cf68e1", + "name": "paged_unified.fp16_d128_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "80f7dd0d-aa5b-4f56-b4e5-5348fbe2938d", + "name": "paged_unified.fp16_d128_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6e936022-555f-4ba7-82ef-6aaef6e28aaa", + "name": "paged_unified.fp16_d128_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "44491d76-6096-47a4-94e2-ede91b0df490", + "name": "paged_unified.fp16_d128_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cfccbc6b-ee3b-49ae-9600-cc202f29a4a9", + "name": "paged_unified.fp16_d128_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "88a19b4b-4564-408c-8abb-9327a3974cdd", + "name": "paged_unified.fp16_d128_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a641185b-5f20-4091-8a82-6c296b90b609", + "name": "paged_unified.fp16_d128_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9f5a1fd7-3694-47cf-972c-2b2cb2a4f534", + "name": "paged_unified.fp16_d128_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "75312411-5fc9-42e4-a32a-e053d0b49c30", + "name": "paged_unified.fp16_d128_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "88678d21-5e9b-4ad1-aaa5-88ab75c79f36", + "name": "paged_unified.fp16_d128_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d8044804-2395-4d7f-aced-613dbb18a5e5", + "name": "paged_unified.fp16_d128_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6d889bb3-3530-421e-9bfb-99caed2a2129", + "name": "paged_unified.fp16_d128_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4641983e-55ea-430e-b3c2-1efc43b63c99", + "name": "paged_unified.fp16_d128_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4e2c8d14-471d-4073-bf96-fcfa50b41d15", + "name": "paged_unified.fp16_d128_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "09069d51-a53b-42e0-868d-5c988d6ad258", + "name": "paged_unified.bf16_d128_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "97a2206e-6618-4bcf-8fb8-f7f50d4f1647", + "name": "paged_unified.bf16_d128_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "514bc828-2d04-4a1f-abbf-275299038ffd", + "name": "paged_unified.bf16_d128_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0dd22a87-666c-4908-9043-1f336f4572be", + "name": "paged_unified.bf16_d128_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6807f611-dabe-43c2-90e4-9ad2d554d3f4", + "name": "paged_unified.bf16_d128_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c12fe6fe-7ff6-4dab-932a-0785c62eacf0", + "name": "paged_unified.bf16_d128_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b2c33dd4-1a94-4ff5-b608-d542c8ac86aa", + "name": "paged_unified.bf16_d128_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "175c08b0-a170-41d3-83c9-792e4a52b548", + "name": "paged_unified.bf16_d128_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b411a49c-412c-4e06-a800-f12dc574f857", + "name": "paged_unified.bf16_d128_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ed58e83c-f25f-4e65-b538-b0770e25a349", + "name": "paged_unified.bf16_d128_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c63de556-8f99-450c-b314-70a06e5ed83c", + "name": "paged_unified.bf16_d128_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2260732c-5eed-40b9-9ef7-efb5aba4fe69", + "name": "paged_unified.bf16_d128_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d67f5676-606a-4806-83ca-d38332f1ae7f", + "name": "paged_unified.bf16_d128_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a913addc-0225-4271-b72e-450296107b78", + "name": "paged_unified.bf16_d128_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5e7109ba-5996-4a22-b50f-76ac74bc4bdd", + "name": "paged_unified.bf16_d128_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6177c073-1d67-48e2-b1bf-2276ca576323", + "name": "paged_unified.bf16_d128_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "86747b15-9cd1-4100-b342-b141cfb866c7", + "name": "paged_unified.fp16_d128_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4e370ce1-dd0a-4007-adce-f60fca42798a", + "name": "paged_unified.fp16_d128_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f0f1bcaa-d60a-4cce-aa9d-da0fce673723", + "name": "paged_unified.fp16_d128_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1b5aa6c7-c2e9-48bc-8a21-730cbff8931d", + "name": "paged_unified.fp16_d128_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "293e79fa-4d2e-4217-b958-85eac443ae20", + "name": "paged_unified.fp16_d128_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e65ad64f-8be5-4ed7-9581-6dc36ee21a37", + "name": "paged_unified.fp16_d128_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0f5fdc64-0bca-4f70-8eaf-34b354ab515f", + "name": "paged_unified.fp16_d128_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "66eb77a7-9294-4c39-942f-7450b1c6ce57", + "name": "paged_unified.fp16_d128_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7b25d583-ad68-46c3-879a-16bbc173e263", + "name": "paged_unified.bf16_d128_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1db67e22-b005-4897-a718-dcf582a9ff52", + "name": "paged_unified.bf16_d128_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c5dc14ec-03ed-4856-a5ec-712f5cf89c3b", + "name": "paged_unified.bf16_d128_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4e7b3dd7-efb8-48b4-86f5-3531a252ab39", + "name": "paged_unified.bf16_d128_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6c694e99-03a7-45e5-9784-aec50b7f3dca", + "name": "paged_unified.bf16_d128_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6a0be8fc-a18a-4394-8d6c-44fb1f635aba", + "name": "paged_unified.bf16_d128_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7d25615f-88ce-4c94-ac3e-700adc1203ca", + "name": "paged_unified.bf16_d128_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1988811f-6442-4704-bfed-87152b891790", + "name": "paged_unified.bf16_d128_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5c514c06-d72c-447a-b40b-d91c24f311ad", + "name": "paged_unified.fp16_d256_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cebbdb37-ba3d-4768-8603-922559efb84b", + "name": "paged_unified.fp16_d256_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5179bd59-7ad4-459d-8670-252529f6e40f", + "name": "paged_unified.fp16_d256_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "abb8d874-4c87-47dd-8b55-1a9123fc0b52", + "name": "paged_unified.fp16_d256_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e2fa0990-75a3-4348-9bc3-8a38348bb4dd", + "name": "paged_unified.fp16_d256_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b673c8ea-17e8-4582-9959-755b90c78c56", + "name": "paged_unified.fp16_d256_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8006a158-39f9-4c23-8d69-7dc7a9815665", + "name": "paged_unified.fp16_d256_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "18035187-7ead-4e13-8f04-d426787f774d", + "name": "paged_unified.fp16_d256_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "61554637-a037-4334-87bd-7590768fdd36", + "name": "paged_unified.bf16_d256_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "64b4aff1-dc26-4529-9858-6c332be5a7a6", + "name": "paged_unified.bf16_d256_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b0b6dde0-c33a-4412-9c48-ed3f53db151c", + "name": "paged_unified.bf16_d256_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a07594c6-c531-4de9-a665-ad71aaeea49a", + "name": "paged_unified.bf16_d256_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "20aedd92-dfac-42ec-be28-52d8c42eb69a", + "name": "paged_unified.bf16_d256_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d85f359-75dd-4491-9ed1-0bc53aadcad9", + "name": "paged_unified.bf16_d256_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cdbf067b-17a1-45de-839d-a9354959a517", + "name": "paged_unified.bf16_d256_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8d2b1838-4a4c-44bb-896a-1ce30a4c5c5a", + "name": "paged_unified.bf16_d256_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6cc3a1e4-015e-4b86-a948-e319eaeb7ad8", + "name": "paged_unified.fp16_d256_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "78ad1dc2-4990-4d20-8a11-ad65c2cc6fa7", + "name": "paged_unified.fp16_d256_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ab7ccf3c-6f0a-4473-add0-841dfe04d594", + "name": "paged_unified.fp16_d256_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f12530ae-4c7e-4d4e-90e8-d846b8c9ea03", + "name": "paged_unified.fp16_d256_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "187fcb77-6d3e-45dc-8f7a-7ecabd9bf22f", + "name": "paged_unified.fp16_d256_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1539cfde-01d5-48f1-9e3e-51ccce665c7d", + "name": "paged_unified.fp16_d256_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a3962ed8-48c3-4040-b2d5-46ada767c728", + "name": "paged_unified.fp16_d256_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3e4d2855-4f32-4cd6-92f2-bbdc792ceadf", + "name": "paged_unified.fp16_d256_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6b178d54-2b96-4643-88f1-26780eeb1813", + "name": "paged_unified.fp16_d256_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "07f693c9-03f5-494f-83a0-b2481c44fad3", + "name": "paged_unified.fp16_d256_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "234d4c84-c735-4db1-9ddb-9c84da40b0c4", + "name": "paged_unified.fp16_d256_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "87d08061-89b3-4209-8ebb-ff0eaa9e0753", + "name": "paged_unified.fp16_d256_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "758eec60-0f53-4755-a860-ed7eea5b2b93", + "name": "paged_unified.fp16_d256_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b998310a-e62b-414f-8a93-1494caf207fb", + "name": "paged_unified.fp16_d256_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9e5eb0bd-5f29-4d73-b4d5-d28947f4b9ea", + "name": "paged_unified.fp16_d256_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b488e074-e8a6-472f-95f9-729f4a462ba8", + "name": "paged_unified.fp16_d256_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "da969a4d-689d-4180-8d48-406c9fc00ba7", + "name": "paged_unified.bf16_d256_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "adf8af59-6f60-4030-9463-4e16d8903f8a", + "name": "paged_unified.bf16_d256_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2a09f9a3-39fb-40ae-b1f9-204d94180745", + "name": "paged_unified.bf16_d256_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e64a72c8-3a9c-46ef-a26f-3a2bfd6df039", + "name": "paged_unified.bf16_d256_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9d505e57-3cec-45c1-8321-8f0161440b3f", + "name": "paged_unified.bf16_d256_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d6010192-7a8d-478d-887f-ebeb51098cf7", + "name": "paged_unified.bf16_d256_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "23ec2d33-8201-42a4-b218-5863ad63979e", + "name": "paged_unified.bf16_d256_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d7c30411-7e7d-42f0-95dd-3db195b79e67", + "name": "paged_unified.bf16_d256_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4cb9a5a8-f644-4a31-8bde-83745097f756", + "name": "paged_unified.bf16_d256_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "481b8d6e-1b0e-4a1c-99cd-80242ce47f87", + "name": "paged_unified.bf16_d256_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f8c079c8-4ffa-4712-acfe-48aa868670c4", + "name": "paged_unified.bf16_d256_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cc5c8c01-c52f-4dae-a16e-4bca837e9632", + "name": "paged_unified.bf16_d256_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "be5c397d-609a-4b96-92dd-b996bb385694", + "name": "paged_unified.bf16_d256_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "636cfdbc-7fcd-4a0d-93d4-69ec63cd2eb1", + "name": "paged_unified.bf16_d256_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2323658c-2c4a-4095-9d60-56d95d8cc4af", + "name": "paged_unified.bf16_d256_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c9b1aa2c-b30c-4cc4-84c8-e4e63e62da99", + "name": "paged_unified.bf16_d256_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + } + ], + "arch": [ + "gfx942" + ] +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json new file mode 100644 index 000000000000..caa4ea849069 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json @@ -0,0 +1,4818 @@ +{ + "version": "1.0", + "id": "1f1678e0-cce5-4d0f-9f98-3b7b9e5a95e6", + "name": "hipkernel:attention_paged_unified_gfx950", + "matchers": [ + "f5baea64-2961-4555-9a77-6576fc1ec21b", + "2af4cb01-70e7-485f-9f09-da2d3aa55fd2" + ], + "engine": "c9af5aa1-86fc-4186-aa3c-307b929710af", + "dispatch": "b4085b75-ea3b-4d38-878d-9998a03e15c7", + "provenance": { + "specialization_contract": { + "schema_version": 1, + "consumers": [ + { + "engine_id": "c9af5aa1-86fc-4186-aa3c-307b929710af", + "kmd_id": "29593010-20c8-41e6-9197-d4d617e1d25b", + "metadata_fields": [ + "dtype", + "head_size", + "block_size", + "num_query_heads", + "num_kv_heads", + "num_warps", + "block_m_per_warp" + ], + "matcher_only_fields": [], + "bindings": { + "dtype": { + "field": "dtype" + }, + "head_size": { + "field": "head_size" + }, + "block_size": { + "field": "block_size" + }, + "num_query_heads": { + "field": "num_query_heads" + }, + "num_kv_heads": { + "field": "num_kv_heads" + }, + "num_warps": { + "field": "num_warps" + }, + "block_m_per_warp": { + "field": "block_m_per_warp" + } + }, + "vocabulary": { + "dtype": { + "bf16": "BF16", + "fp16": "FP16" + } + } + } + ] + } + }, + "kernelDescriptors": [ + { + "version": "1.0", + "id": "e0e1aa28-a902-47e9-a32a-256b4e0f6e19", + "name": "paged_unified.fp16_d64_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d603a5f4-b38d-4c94-956f-d1e266f93f00", + "name": "paged_unified.fp16_d64_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "075e1fd7-75f1-4926-a899-d9b86770f963", + "name": "paged_unified.fp16_d64_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2486bd1b-be6c-48ab-bac7-13e324f45d47", + "name": "paged_unified.fp16_d64_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "04df86ad-ba56-49b9-8aed-91f535bc7928", + "name": "paged_unified.fp16_d64_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "95ce7f9f-c3e7-43f6-b4a4-8a95e2b14b1f", + "name": "paged_unified.fp16_d64_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d5a4cd73-2493-401f-a084-bb91e65f9612", + "name": "paged_unified.fp16_d64_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f22afe8d-bf17-4482-86f6-dd96e70f443f", + "name": "paged_unified.fp16_d64_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e7c89c4a-000a-4a88-9936-237b1a2ae509", + "name": "paged_unified.bf16_d64_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "63aef063-cba9-41f7-8192-d60563e21d03", + "name": "paged_unified.bf16_d64_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a447f5eb-3deb-401d-8c1e-f896f95cfa26", + "name": "paged_unified.bf16_d64_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "54fe06a7-598e-4e41-8734-e49fe1081fcc", + "name": "paged_unified.bf16_d64_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1ec90bc4-6a59-48a0-a916-f3842f999fd6", + "name": "paged_unified.bf16_d64_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "03b5b732-ac75-421f-b12d-d94b23507f4b", + "name": "paged_unified.bf16_d64_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3468bdcd-aaed-4be3-b882-dfc8e9fd5a3d", + "name": "paged_unified.bf16_d64_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f7011f88-1704-4148-989e-79ae67e35c97", + "name": "paged_unified.bf16_d64_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3c57294e-aa86-4d8e-a977-63836834b3fb", + "name": "paged_unified.fp16_d64_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6d50865e-ec9f-47af-b1d9-e3cea05e075b", + "name": "paged_unified.fp16_d64_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "96ce9b03-3d22-4075-82c4-8c6f470308dd", + "name": "paged_unified.fp16_d64_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "32dc0320-1390-4058-a5aa-7b41a4feb34c", + "name": "paged_unified.fp16_d64_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7b80b955-5731-42b9-a50f-b0b818068b6c", + "name": "paged_unified.fp16_d64_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "388eb1ae-26dc-445d-b7c4-beb93c5d24ce", + "name": "paged_unified.fp16_d64_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a5b94936-29d4-4677-88df-ee64c61c9e33", + "name": "paged_unified.fp16_d64_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a8c9b734-110c-4002-b81d-abdcd80a726c", + "name": "paged_unified.fp16_d64_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8b8b5d9f-a4a6-4419-b898-e1a989bfebaa", + "name": "paged_unified.fp16_d64_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5876e267-e08f-43f1-b288-86674bc939f1", + "name": "paged_unified.fp16_d64_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2705c668-49f4-436e-8ef4-1bf57fba9cbf", + "name": "paged_unified.fp16_d64_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "141b573a-62cd-4771-a286-3df9c4632638", + "name": "paged_unified.fp16_d64_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c65accd0-999f-4a35-a81b-771ca9be1828", + "name": "paged_unified.fp16_d64_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7f6021f2-0ff2-4688-8ecd-5c483823108a", + "name": "paged_unified.fp16_d64_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e46d369e-a7d1-40c2-9cce-d54036c0aeda", + "name": "paged_unified.fp16_d64_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "720796fa-4f4a-4f8e-bdbc-c09578cf37b1", + "name": "paged_unified.fp16_d64_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d3673551-1e87-4273-a6bc-7f3a03d7075a", + "name": "paged_unified.bf16_d64_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "41e45ba3-2cf2-464c-b0fe-0fc90cb08c1a", + "name": "paged_unified.bf16_d64_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "12aba46e-ebf1-4731-8bef-bf89e65e1d18", + "name": "paged_unified.bf16_d64_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b9217fa4-ff5e-4047-a4c3-dda52c8b0396", + "name": "paged_unified.bf16_d64_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6b4bfb42-5697-4ade-85d9-27f0d9ff6afd", + "name": "paged_unified.bf16_d64_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d1529ffe-c165-4d07-8a38-9fcdd1192965", + "name": "paged_unified.bf16_d64_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b463eb65-5f6d-4e68-bcbb-2ac01cb2fcca", + "name": "paged_unified.bf16_d64_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f707aade-0291-4874-9333-40f9057b901d", + "name": "paged_unified.bf16_d64_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "63085891-7778-4a61-94c3-e0a9fa74c121", + "name": "paged_unified.bf16_d64_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3b13cc9c-d7d0-4c09-b93d-1626e8afac0e", + "name": "paged_unified.bf16_d64_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f0caa26e-b447-4500-8178-5cc1e2198662", + "name": "paged_unified.bf16_d64_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0800e3b4-a7a8-480c-aed3-637c9678fbd1", + "name": "paged_unified.bf16_d64_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e73b9c43-0b14-42b8-941f-bbd12be9c1c7", + "name": "paged_unified.bf16_d64_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0552bb5f-565d-4691-beee-8bb13599a25c", + "name": "paged_unified.bf16_d64_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "20a29bf6-de20-4f06-8738-dffd43a0e8dc", + "name": "paged_unified.bf16_d64_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d53a6276-2868-496f-a389-9b4859449ac2", + "name": "paged_unified.bf16_d64_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5cdd41ab-3aef-45bb-8703-9dcb85cab0ca", + "name": "paged_unified.fp16_d128_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6cc64843-166e-4bd8-8fbd-51f0d4151236", + "name": "paged_unified.fp16_d128_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "91d01894-8216-428d-8530-839baaba14a7", + "name": "paged_unified.fp16_d128_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0a4f89b0-b385-4fe7-93b3-3795d358b0aa", + "name": "paged_unified.fp16_d128_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ab8c2b08-e5e9-4808-b440-34c73fb76857", + "name": "paged_unified.fp16_d128_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d446be9-dce1-44f7-a4a1-f1f763e5a473", + "name": "paged_unified.fp16_d128_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "58e82185-fdd9-4cd8-b5e5-bef8a18c6184", + "name": "paged_unified.fp16_d128_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "fe2be135-c4e3-4c31-a7a1-1ce826615e97", + "name": "paged_unified.fp16_d128_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ae667f2a-398f-4756-8c1c-dab9ec357ae5", + "name": "paged_unified.fp16_d128_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2acc9f68-9c32-46b3-8a24-7fe02eece8b3", + "name": "paged_unified.fp16_d128_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "50eb5d30-b66a-4c8d-b81d-514109d4ede7", + "name": "paged_unified.fp16_d128_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c6c5da58-a5a3-4701-bc0d-45893fcf857f", + "name": "paged_unified.fp16_d128_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "615b49c5-95fc-465d-bf1f-adcbb6897c23", + "name": "paged_unified.fp16_d128_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6a72e374-f7f0-4271-8d77-4c824a839da9", + "name": "paged_unified.fp16_d128_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d9c89124-2bd0-4bef-b164-4820bc78dcf5", + "name": "paged_unified.fp16_d128_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6fe2e2b2-9ba0-47a9-a771-312e8c42443d", + "name": "paged_unified.fp16_d128_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a8658448-58d9-4a21-af14-c772630b7af5", + "name": "paged_unified.fp16_d128_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ce4906d8-b10e-4883-9703-d033c650dfcd", + "name": "paged_unified.fp16_d128_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "65e687fa-7307-47aa-8450-91c648ff04a3", + "name": "paged_unified.fp16_d128_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "32ef65bd-0c74-406b-8579-4443d1b9ecf5", + "name": "paged_unified.fp16_d128_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "81ad98d6-542d-4954-aaf2-c4778b6c1a18", + "name": "paged_unified.fp16_d128_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "87d0050b-4319-4163-9c72-a277e38ec71a", + "name": "paged_unified.fp16_d128_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "345d5868-b3ec-43e8-bea0-7d21920607da", + "name": "paged_unified.fp16_d128_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2bdc88d4-6288-4ce6-be67-c264a7c7f416", + "name": "paged_unified.fp16_d128_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "212e2c5b-a4fa-49be-8591-01bad9ce2e51", + "name": "paged_unified.fp16_d256_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0e0716c8-916e-4662-8740-8b8f12c7156e", + "name": "paged_unified.fp16_d256_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c8776003-b78a-49ce-9984-72bf5539347d", + "name": "paged_unified.fp16_d256_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "12d560a0-3087-4e3e-b463-a534c1144c20", + "name": "paged_unified.fp16_d256_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3a950075-7baa-4a59-b8b2-2e040fe7726a", + "name": "paged_unified.fp16_d256_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "57a3c2ca-aefc-4c8c-a82a-805d9d045179", + "name": "paged_unified.fp16_d256_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cd5fe387-1c55-4259-81f8-96b92fc6dfcf", + "name": "paged_unified.fp16_d256_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "74c22353-32ce-4987-91d3-f5f93c483290", + "name": "paged_unified.fp16_d256_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e71e3205-6ddd-4c48-acdc-abdee8ef25a6", + "name": "paged_unified.fp16_d256_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "83f435ff-c4e1-41eb-b181-653964b5e0a7", + "name": "paged_unified.fp16_d256_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1211fee3-7b28-4b3f-8281-59a2e8b2e72f", + "name": "paged_unified.fp16_d256_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "35d744c2-bb64-4b18-a676-ced7fed9c37b", + "name": "paged_unified.fp16_d256_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "80787923-e0e5-4c81-83dd-9bf0e6bd5245", + "name": "paged_unified.fp16_d256_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e0250241-14e3-4afe-9b93-a177b9463e72", + "name": "paged_unified.fp16_d256_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6ea257a0-cb99-4a9a-aeff-25c711d35c1f", + "name": "paged_unified.fp16_d256_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2abafb51-1dc8-477b-8590-3d3da623682c", + "name": "paged_unified.fp16_d256_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "367682ef-d49d-402a-8fc5-5c2a8c62ccf3", + "name": "paged_unified.fp16_d256_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "02811807-31c2-4dde-bd76-a115cad59a14", + "name": "paged_unified.fp16_d256_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8feb86cd-9438-4df6-b54f-9cf25fa3f61d", + "name": "paged_unified.fp16_d256_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5fa6ab9c-3b33-4f72-8c20-8f6f71e5cc7b", + "name": "paged_unified.fp16_d256_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "bc333d48-114b-4562-bbe1-300e2c7546a7", + "name": "paged_unified.fp16_d256_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e17f0c38-26ee-4ef8-8696-a39b1358ece8", + "name": "paged_unified.fp16_d256_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "93e6c2ec-1223-44a2-b0f1-a376dda4f3f4", + "name": "paged_unified.fp16_d256_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5e25702f-6c55-42f8-bdf6-2762c9751a29", + "name": "paged_unified.fp16_d256_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "258b21d7-84f6-4763-8456-a9f5eef1f0f9", + "name": "paged_unified.bf16_d128_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7da0b28b-d3e1-42b2-b639-4e6d68a9edfd", + "name": "paged_unified.bf16_d128_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ed30ea7f-e65a-4cfd-ab85-59f6f434bc4c", + "name": "paged_unified.bf16_d128_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7edd94cf-1bc0-4ebe-9119-690a7c220a69", + "name": "paged_unified.bf16_d128_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cba0a8fa-bedf-4fab-b897-e6ec325982a1", + "name": "paged_unified.bf16_d128_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0ec0503d-7072-4601-a1f3-4f3d9f034adc", + "name": "paged_unified.bf16_d128_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9bf7d181-7aad-4890-be52-98717c69a02c", + "name": "paged_unified.bf16_d128_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "82f69d9c-31ef-48d2-bd8c-0a3222e0f44a", + "name": "paged_unified.bf16_d128_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "699fd5c5-2c5f-4bdc-aa76-a358ef187fea", + "name": "paged_unified.bf16_d128_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a7662c5f-4864-4eae-a627-96016eeae194", + "name": "paged_unified.bf16_d128_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2ee0cd45-4b51-4727-98b0-b9dbefe6ee38", + "name": "paged_unified.bf16_d128_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4b724bcf-57ef-43e2-9033-106094af8a8c", + "name": "paged_unified.bf16_d128_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "24b9c183-75d9-48bd-8ffe-c30558a6e6a7", + "name": "paged_unified.bf16_d128_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5fccd6f1-e517-40f9-bdcd-68d19f1413f1", + "name": "paged_unified.bf16_d128_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8d227a60-c5c8-461a-9199-06b114559418", + "name": "paged_unified.bf16_d128_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "69e2888d-bf79-4b0f-9ced-9b1b5bcde74b", + "name": "paged_unified.bf16_d128_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "075fcfd4-a09d-4e07-8ada-d25091b84ec0", + "name": "paged_unified.bf16_d128_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2247b974-9cc4-4acb-9541-b891a71001fb", + "name": "paged_unified.bf16_d128_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3d9e1e93-287c-43b8-8ae0-0288c521457d", + "name": "paged_unified.bf16_d128_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6ff9caa4-a548-4a28-8c36-20b79334724e", + "name": "paged_unified.bf16_d128_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2ff04cdc-827b-4bdb-80bf-1b1f00381986", + "name": "paged_unified.bf16_d128_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "02f9702a-a0df-4acf-93f6-cea88ee1d62e", + "name": "paged_unified.bf16_d128_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a97cf320-07f7-45f4-8ec7-b5e43dfb5494", + "name": "paged_unified.bf16_d128_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4aa3f44b-7d26-4570-b0d0-56af35a46aa0", + "name": "paged_unified.bf16_d128_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5dcbc493-fd56-4e70-8d1b-8be3578d0a64", + "name": "paged_unified.bf16_d256_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1b167790-ad72-43e9-b69d-39d2d03e2982", + "name": "paged_unified.bf16_d256_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "43259880-c763-4787-8c99-e7c97cab2ed1", + "name": "paged_unified.bf16_d256_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "eb8c6681-9561-454c-a31c-aac0af6afea3", + "name": "paged_unified.bf16_d256_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d19948cb-313c-4c5a-b955-456dd822405b", + "name": "paged_unified.bf16_d256_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a08db64c-9962-4abc-87b6-00f8fc3073a0", + "name": "paged_unified.bf16_d256_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f635af58-729f-4c9f-b8ed-70c4857378e8", + "name": "paged_unified.bf16_d256_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7e358fe4-43f0-46d7-8be0-4660c77247b0", + "name": "paged_unified.bf16_d256_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8352754f-ece1-4ba6-9c35-398768cf41b7", + "name": "paged_unified.bf16_d256_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5885853c-e7c6-4834-b065-25d49a139056", + "name": "paged_unified.bf16_d256_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6729cecc-1077-4605-9695-b8dfb3843526", + "name": "paged_unified.bf16_d256_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "45eae18e-aac5-460b-a1dd-615b433ca8eb", + "name": "paged_unified.bf16_d256_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "723d1174-3d03-4a21-98aa-4d4c3cc5fabc", + "name": "paged_unified.bf16_d256_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5c4e2d08-0659-4131-8125-b217367e338a", + "name": "paged_unified.bf16_d256_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2aab1fe6-4b4a-4e67-972f-cad674985bc4", + "name": "paged_unified.bf16_d256_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "de53e03a-fbcc-405a-84f8-a42f071fe89c", + "name": "paged_unified.bf16_d256_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b553b247-2f2b-4b24-8d18-2e038d353462", + "name": "paged_unified.bf16_d256_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e666ef18-dfd2-4112-8859-b78f0c2a47e0", + "name": "paged_unified.bf16_d256_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3ccdbb49-02c7-4f0d-a20d-d50f31a01528", + "name": "paged_unified.bf16_d256_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9564ff74-d7b3-452d-bfa1-1098adbdf84c", + "name": "paged_unified.bf16_d256_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4718b8a9-1eaa-46f9-a7ef-906f07358d1b", + "name": "paged_unified.bf16_d256_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "914620ee-0cbe-48c2-8b89-946a28cdfe47", + "name": "paged_unified.bf16_d256_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d7d550e4-1012-4034-9dda-0cd4f82a4f60", + "name": "paged_unified.bf16_d256_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5fe3a4a9-7cdc-4855-bf39-7c0b3a1aff30", + "name": "paged_unified.bf16_d256_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16 + }, + "priority": 0 + } + ], + "arch": [ + "gfx950" + ] +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/kernel_dtype_matches_graph.umd.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/kernel_dtype_matches_graph.umd.json new file mode 100644 index 000000000000..0d79bf340adc --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/kernel_dtype_matches_graph.umd.json @@ -0,0 +1,7 @@ +{ + "version": "1.0", + "id": "2af4cb01-70e7-485f-9f09-da2d3aa55fd2", + "name": "kernel dtype matches the graph's dtype", + "scope": "kernel", + "match_symbol": "hipkernel.attention_paged_unified.kernel_match" +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx942.umd.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx942.umd.json new file mode 100644 index 000000000000..50ec32498c50 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx942.umd.json @@ -0,0 +1,7 @@ +{ + "version": "1.0", + "id": "cb28d2d1-dbfc-43cf-92bf-b2c1b6fc0f90", + "name": "graph operation is gfx942", + "scope": "graph", + "match_symbol": "hipkernel.attention_paged_unified.gfx942_match" +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx950.umd.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx950.umd.json new file mode 100644 index 000000000000..b993726b3b99 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/operation_is_gfx950.umd.json @@ -0,0 +1,7 @@ +{ + "version": "1.0", + "id": "f5baea64-2961-4555-9a77-6576fc1ec21b", + "name": "graph operation is gfx950", + "scope": "graph", + "match_symbol": "hipkernel.attention_paged_unified.gfx950_match" +} diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp new file mode 100644 index 000000000000..3a482c9466ae --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -0,0 +1,1362 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#ifdef HIPDNN_ENABLE_KERNEL_INGESTOR + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "compilation/KpackKernelLoader.hpp" +#include "compilation/KpackModuleCache.hpp" +#include "core/Handle.hpp" +#include "engines/asm_sdpa_engine/plans/SdpaPlanUtils.hpp" +#include "engines/kernel_ingestor_engine/IngestorKernelCode.hpp" +#include "engines/kernel_ingestor_engine/IngestorPacks.hpp" +#include "engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp" + +/** + * @file AttentionPagedUnifiedNative.cpp + * @brief The hipkernel:AttentionPagedUnified engine's native half: matching and dispatch. + * + * The kernels are rocKE's tiled 2D unified-attention builders + * (`rocke/library/kernels/{gfx942,gfx950}/attention_tiled_2d.py`, + * `build_unified_attention_2d_tiled`) built with `runtime_layout=True`, packaged + * (kind: rocke -> kpack) per architecture. Every tiled 2D body takes the head counts + * and the sliding window as launch arguments; in that mode the kernel also takes every + * Q/O/K/V stride and the batch's query layout (dense or ragged), and reads the graph's + * real page table and sequence lengths from device memory. One object therefore serves + * every shape with the same (dtype, head_size, block_size, queries_per_kv), and one + * plan serves every step of a serving loop: actual lengths and block ids are only ever read on the + * device, so execute performs no host synchronization and no allocation. + * + * Graphs served (cuDNN paged-attention semantics, SdpaSemanticsRegister SEM-008/009/010): + * - Q `[B, Hq, Sq, D]`, either dense with arbitrary strides (uniform decode, Sq rows per + * sequence) or ragged at the sequence axis through an INT32 `[B+1,1,1,1]` + * `ragged_offset` shared with O, in vLLM's query_start_loc layout (non-decreasing + * origins, off[b+1] - off[b] >= seq_len_q[b], off[B] the end of the last block): the + * kernel binary-searches the offsets. RFC 0014 also allows other orders, which no graph + * attribute shows; + * - paged K and V containers `[num_blocks, Hkv, block_size, D]` with arbitrary (equal) + * strides, including the interleaved K|V view of one cache allocation; + * - INT32 page tables `[B, 1, M, 1]`, not packed: one tensor for K and V, or separate + * `page_table_k` and `page_table_v` tensors with the same M and batch stride (the + * kernel reads K through block_tables_ptr and V through block_tables_v_ptr); + * - INT32 `seq_len_q` and `seq_len_kv` `[B,1,1,1]` (a paged graph carries both); a dense + * Q's rows past seq_len_q[b] get O = 0, and a ragged Q writes only its live rows; + * - `max_seq_len_kv` set or unset: the kernel reads only seq_len_kv, and the extent cuDNN + * infers for an unset one (M * block_size) bounds it the same way; + * - bottom-right causal masking with an optional left bound (sliding window). + * + * One-sided paging, K and V page tables of different widths or batch strides, differing + * K and V block sizes, packed page tables and a declared alignment below what the kernels + * load (16 bytes for Q/K/V/O, 4 for the INT32 operands) are valid graphs that this engine + * declines with a logged cause. + */ +namespace hip_kernel_provider::kernel_ingestor_engine +{ + +using namespace hipdnn_plugin_sdk::ingestor; +namespace data_objects = hipdnn_flatbuffers_sdk::data_objects; + +namespace +{ + +// The contract with the installed descriptor files, which restate these same strings. +constexpr std::string_view GRAPH_MATCHER_SYMBOL = "hipkernel.attention_paged_unified.graph_match"; +constexpr std::string_view KERNEL_MATCHER_SYMBOL = "hipkernel.attention_paged_unified.kernel_match"; +constexpr std::string_view DISPATCH_SYMBOL = "hipkernel.attention_paged_unified.dispatch"; +constexpr std::string_view GFX942_MATCHER_SYMBOL = "hipkernel.attention_paged_unified.gfx942_match"; +constexpr std::string_view GFX950_MATCHER_SYMBOL = "hipkernel.attention_paged_unified.gfx950_match"; + +// KMD fields. The catalog builds every kernel with num_kv_heads = 1 (head counts are +// launch arguments), so its num_query_heads field IS the queries-per-KV-head ratio. +constexpr std::string_view DTYPE_FIELD = "dtype"; +constexpr std::string_view HEAD_SIZE_FIELD = "head_size"; +constexpr std::string_view BLOCK_SIZE_FIELD = "block_size"; +constexpr std::string_view NUM_QUERY_HEADS_FIELD = "num_query_heads"; +constexpr std::string_view NUM_KV_HEADS_FIELD = "num_kv_heads"; +constexpr std::string_view NUM_WARPS_FIELD = "num_warps"; +constexpr std::string_view BLOCK_M_PER_WARP_FIELD = "block_m_per_warp"; + +// Bound tokens. +constexpr std::string_view Q_TOKEN = "attention_paged_unified.q.uid"; +constexpr std::string_view K_TOKEN = "attention_paged_unified.k.uid"; +constexpr std::string_view V_TOKEN = "attention_paged_unified.v.uid"; +constexpr std::string_view O_TOKEN = "attention_paged_unified.o.uid"; +/// UIDs of page_table_k and page_table_v (equal when one tensor pages both). +constexpr std::string_view PAGE_TABLE_K_TOKEN = "attention_paged_unified.page_table_k.uid"; +constexpr std::string_view PAGE_TABLE_V_TOKEN = "attention_paged_unified.page_table_v.uid"; +constexpr std::string_view SEQ_LEN_KV_TOKEN = "attention_paged_unified.seq_len_kv.uid"; +/// UID of seq_len_q. +constexpr std::string_view SEQ_LEN_Q_TOKEN = "attention_paged_unified.seq_len_q.uid"; +/// UID of the ragged offset table Q and O share, or NO_UID for a dense Q. +constexpr std::string_view RAGGED_OFFSET_TOKEN = "attention_paged_unified.ragged_offset.uid"; +constexpr std::string_view SCALE_BITS_TOKEN = "attention_paged_unified.scale_bits"; +/// The kernel's sliding_window argument: `d - k < window` keeps key k for diagonal d. +constexpr std::string_view WINDOW_TOKEN = "attention_paged_unified.window"; +constexpr std::string_view DTYPE_TOKEN = "attention_paged_unified.dtype"; +constexpr std::string_view HEAD_SIZE_TOKEN = "attention_paged_unified.head_size"; +constexpr std::string_view BLOCK_SIZE_TOKEN = "attention_paged_unified.block_size"; +constexpr std::string_view QUERIES_PER_KV_TOKEN = "attention_paged_unified.queries_per_kv"; + +constexpr int64_t NO_UID = -1; +/// Integer codes for the bound dtype. +constexpr int64_t DTYPE_FP16 = 1; +constexpr int64_t DTYPE_BF16 = 2; + +/// The window the kernel receives when the graph has no left bound: wider than any +/// sequence the int32 positions can describe, so it never masks. +constexpr int64_t NO_WINDOW = 0x3FFFFFFF; + +/// hipDNN tensor axes. The LOGICAL order is always (B, H, S, D) regardless of layout; a +/// paged container's B axis is the block index and its S axis the token within a block. +constexpr uint32_t BATCH_AXIS = 0; +constexpr uint32_t HEAD_AXIS = 1; +constexpr uint32_t SEQ_AXIS = 2; +constexpr uint32_t HEAD_SIZE_AXIS = 3; +constexpr uint32_t SDPA_RANK = 4; + +/// The kernel's vector loads and stores move 8 elements (16 bytes) at a time, so every +/// stride of a non-unit axis and every base pointer must keep that alignment. +constexpr int64_t VECTOR_ELEMENTS = 8; +constexpr uintptr_t VECTOR_BYTES = 16; +constexpr int64_t ELEMENT_BYTES = 2; + +/// Buffer-resource record limit the kernels use for one K/V block. +constexpr int64_t MAX_BLOCK_SPAN_BYTES = 0x7FFF0000; +/// The gfx942 kernel reads page-table entries through a buffer of MAX_BLOCK_SPAN_BYTES with +/// an int32 byte offset, so a table reaches at most this many entries. +constexpr int64_t MAX_PAGE_TABLE_ENTRIES = MAX_BLOCK_SPAN_BYTES / 4; +constexpr int64_t INT32_LIMIT = std::numeric_limits::max(); +/// Grid-y cap. The kernel walks query blocks with a grid-stride loop, so a smaller grid +/// is always correct; this keeps the launch inside every device's grid limits. +constexpr int64_t MAX_GRID_Y = 65535; +constexpr int64_t WAVE_LANES = 64; + +/// Catalog coverage. The descriptors ship exactly these, and graph_match declines a graph +/// outside them with a named cause, so they must match the axes of +/// IngestorGenerator/configs/attention_paged_unified.yaml. kernel_match compares the +/// candidate's own metadata. +constexpr std::array HEAD_SIZES = {64, 128, 256}; +constexpr std::array BLOCK_SIZES = {16, 32, 64}; +constexpr std::array QUERIES_PER_KV = {1, 2, 4, 5, 6, 7, 8, 16}; + +template +bool contains(const std::array& values, int64_t value) +{ + for(const auto v : values) + { + if(v == value) + { + return true; + } + } + return false; +} + +// --------------------------------------------------------------------------- +// Matching helpers +// --------------------------------------------------------------------------- + +const data_objects::TensorAttributes* findTensor(const MatchContext& context, int64_t uid) +{ + const auto& tensors = context.graph.getTensorMap(); + const auto it = tensors.find(uid); + return it == tensors.end() ? nullptr : it->second; +} + +std::optional checkedProduct(std::initializer_list factors) +{ + int64_t product = 1; + for(const int64_t factor : factors) + { + if(__builtin_mul_overflow(product, factor, &product)) + { + return std::nullopt; + } + } + return product; +} + +std::optional checkedSum(std::initializer_list terms) +{ + int64_t sum = 0; + for(const int64_t term : terms) + { + if(__builtin_add_overflow(sum, term, &sum)) + { + return std::nullopt; + } + } + return sum; +} + +/// The head of a decline line: " declined the graph []: ". The cause is a +/// stable key per check, for log filters and tests; the text after it is for people. +struct Declined +{ + std::string_view cause; +}; + +std::ostream& operator<<(std::ostream& out, const Declined& declined) +{ + return out << ATTENTION_PAGED_UNIFIED_ENGINE_NAME << " declined the graph [" << declined.cause + << "]: "; +} + +bool hasSdpaForwardNode(const MatchContext& context) +{ + for(const auto& node : context.graph.nodeWrappers()) + { + if(node->attributesType() == data_objects::NodeAttributes::SdpaAttributes) + { + return true; + } + } + return false; +} + +std::string describeOperand(std::string_view role, const data_objects::TensorAttributes& tensor) +{ + using hipdnn_data_sdk::utilities::vecToString; + using hipdnn_flatbuffers_sdk::utilities::convertFlatBufferVectorToStdVector; + std::ostringstream out; + out << role << " (uid " << tensor.uid() << "): dims " + << vecToString(convertFlatBufferVectorToStdVector(tensor.dims())) << ", strides " + << vecToString(convertFlatBufferVectorToStdVector(tensor.strides())); + return out.str(); +} + +/// The single SDPA-forward node, or nullptr. Override-shape graphs (admitted by the +/// 1.4.0 schema floor) are not served: launch arguments come from the built shapes. +const data_objects::SdpaAttributes* sdpaNode(const MatchContext& context) +{ + if(context.graph.nodeCount() != 1 || context.graph.getGraph().is_override_shape_enabled()) + { + return nullptr; + } + const auto& node = context.graph.getNodeWrapper(0); + if(node.attributesType() != data_objects::NodeAttributes::SdpaAttributes) + { + return nullptr; + } + return &node.attributesAs(); +} + +/// A rank-4 device operand with positive extents and non-negative strides, read +/// directly from the variant pack (not virtual, not pass-by-value). +bool isWellFormedRank4(const data_objects::TensorAttributes& tensor) +{ + const auto* dims = tensor.dims(); + const auto* strides = tensor.strides(); + if(dims == nullptr || strides == nullptr || dims->size() != SDPA_RANK + || strides->size() != SDPA_RANK || tensor.virtual_() + || hipdnn_flatbuffers_sdk::utilities::isPassByValueTensor(&tensor)) + { + return false; + } + for(uint32_t i = 0; i < SDPA_RANK; ++i) + { + if(dims->Get(i) <= 0 || strides->Get(i) < 0) + { + return false; + } + } + return true; +} + +/// Strides with every unit-extent axis set to zero: an index that is always zero makes +/// its stride irrelevant, so it must neither decline a graph nor reach the kernel. +std::array effectiveStrides(const data_objects::TensorAttributes& tensor) +{ + std::array strides{}; + for(uint32_t i = 0; i < SDPA_RANK; ++i) + { + strides[i] = tensor.dims()->Get(i) == 1 ? 0 : tensor.strides()->Get(i); + } + return strides; +} + +int64_t dim(const data_objects::TensorAttributes& tensor, uint32_t axis) +{ + return tensor.dims()->Get(axis); +} + +/// Every stride a vector load or store walks: a multiple of 8 elements and within int32. +bool vectorStridesOk(const std::array& strides, bool includeBatch) +{ + for(uint32_t axis = includeBatch ? BATCH_AXIS : HEAD_AXIS; axis < HEAD_SIZE_AXIS; ++axis) + { + if(strides[axis] % VECTOR_ELEMENTS != 0 || strides[axis] > INT32_LIMIT) + { + return false; + } + } + return true; +} + +/// An INT32 per-sequence vector `[n, 1, 1, 1]` the kernel indexes contiguously. +bool isInt32Vector(const data_objects::TensorAttributes& tensor, int64_t length) +{ + if(!isWellFormedRank4(tensor) || tensor.data_type() != data_objects::DataType::INT32 + || tensor.ragged_offset_tensor_uid().has_value() || dim(tensor, BATCH_AXIS) != length) + { + return false; + } + for(uint32_t axis = HEAD_AXIS; axis < SDPA_RANK; ++axis) + { + if(dim(tensor, axis) != 1) + { + return false; + } + } + return length == 1 || tensor.strides()->Get(BATCH_AXIS) == 1; +} + +/// Whether @p tensor declares a device-pointer alignment that is a multiple of @p bytes. +bool declaresAlignment(const data_objects::TensorAttributes& tensor, int64_t bytes) +{ + return tensor.alignment() >= bytes && tensor.alignment() % bytes == 0; +} + +/// The extent of the elements an operand addresses within one sequence (or one block), +/// in elements, without its batch axis: the largest within-sequence offset plus one. +std::optional innerExtent(const data_objects::TensorAttributes& tensor) +{ + const auto strides = effectiveStrides(tensor); + const auto head = checkedProduct({dim(tensor, HEAD_AXIS) - 1, strides[HEAD_AXIS]}); + const auto seq = checkedProduct({dim(tensor, SEQ_AXIS) - 1, strides[SEQ_AXIS]}); + if(!head.has_value() || !seq.has_value()) + { + return std::nullopt; + } + return checkedSum({*head, *seq, dim(tensor, HEAD_SIZE_AXIS)}); +} + +std::optional dataTypeCode(data_objects::DataType dataType) +{ + if(dataType == data_objects::DataType::HALF) + { + return DTYPE_FP16; + } + if(dataType == data_objects::DataType::BFLOAT16) + { + return DTYPE_BF16; + } + return std::nullopt; +} + +std::string_view dataTypeName(int64_t code) +{ + return code == DTYPE_FP16 ? "FP16" : "BF16"; +} + +/// Q's or O's layout, the part of the problem prepare() turns into kernel arguments. +struct QueryLayout +{ + int64_t seqStride = 0; ///< dense: batch stride; ragged: the offset multiplier + int64_t tokenStride = 0; + int64_t headStride = 0; +}; + +QueryLayout queryLayout(const data_objects::TensorAttributes& tensor, bool ragged) +{ + const auto strides = effectiveStrides(tensor); + QueryLayout layout; + layout.seqStride = ragged ? tensor.ragged_offset_multiplier() : strides[BATCH_AXIS]; + layout.tokenStride = strides[SEQ_AXIS]; + layout.headStride = strides[HEAD_AXIS]; + return layout; +} + +/// Checks Q or O (identical dims already established). Logs its own declines. +bool queryOperandOk(std::string_view role, + const data_objects::TensorAttributes& tensor, + bool ragged) +{ + const auto strides = effectiveStrides(tensor); + if(tensor.strides()->Get(HEAD_SIZE_AXIS) != 1) + { + HIPDNN_PLUGIN_LOG_INFO(Declined{"layout"} << describeOperand(role, tensor) + << " has a non-unit head-size stride"); + return false; + } + const int64_t seqStride = ragged ? tensor.ragged_offset_multiplier() : strides[BATCH_AXIS]; + // A ragged sequence starts at offset * multiplier: a zero multiplier would put every + // sequence at the buffer base. + if(!vectorStridesOk(strides, false) || seqStride % VECTOR_ELEMENTS != 0 || seqStride < 0 + || (ragged && seqStride == 0) || seqStride > INT32_LIMIT) + { + HIPDNN_PLUGIN_LOG_INFO(Declined{"layout"} + << describeOperand(role, tensor) + << (ragged ? " with ragged_offset_multiplier " + : " with batch stride ") + << seqStride + << ": strides must be multiples of 8 elements and fit int32, " + "and a ragged multiplier must be positive"); + return false; + } + // The kernel reads offset deltas as token counts: rows per sequence and query-block + // starts come from the stored offsets themselves, and only a sequence's base is + // scaled. So a stored offset must count tokens, i.e. the multiplier is the token + // (sequence-axis) stride. RFC 0014 also allows other units; the ASM SDPA engine + // declines them the same way. + if(ragged && seqStride != tensor.strides()->Get(SEQ_AXIS)) + { + HIPDNN_PLUGIN_LOG_INFO(Declined{"ragged"} + << describeOperand(role, tensor) << " with ragged_offset_multiplier " + << seqStride + << ": the multiplier must equal the sequence-axis (token) stride; " + "the kernel reads stored offsets as token counts"); + return false; + } + const auto extent = innerExtent(tensor); + if(!extent.has_value() || *extent > INT32_LIMIT) + { + HIPDNN_PLUGIN_LOG_INFO(Declined{"size_limit"} + << describeOperand(role, tensor) + << ": one sequence spans more than 2^31-1 elements"); + return false; + } + return true; +} + +/// Logs and declines. +std::nullopt_t decline(std::string_view cause, const std::string& reason) +{ + HIPDNN_PLUGIN_LOG_INFO(Declined{cause} << reason); + return std::nullopt; +} + +/** + * @brief Graph-scoped applicability for the whole engine. + * + * Each decline of a graph with an SDPA-forward node logs its cause at INFO; any other + * graph declines silently. Messages are built only when INFO logging is enabled. + * + * @warning Returning std::nullopt empties this engine's WHOLE catalog. + */ +std::optional graphMatches(const MatchContext& context) +{ + // --- 1. Node shape. + const auto* attributesPtr = sdpaNode(context); + if(attributesPtr == nullptr) + { + if(HIPDNN_PLUGIN_LOG_IS_INFO_ENABLED() && hasSdpaForwardNode(context)) + { + HIPDNN_PLUGIN_LOG_INFO( + Declined{"node"} + << "the graph is not a single SDPA-forward node without override shapes (" + << context.graph.nodeCount() << " node(s))"); + } + return std::nullopt; + } + const auto& attributes = *attributesPtr; + const bool info = HIPDNN_PLUGIN_LOG_IS_INFO_ENABLED(); + const auto reason = [info](const auto&... parts) { + if(!info) + { + return std::string(); + } + std::ostringstream out; + (out << ... << parts); + return out.str(); + }; + + if(context.graph.getNodeWrapper(0).computeDataType() != data_objects::DataType::FLOAT) + { + return decline("compute_data_type", reason("compute data type must be FLOAT")); + } + + // --- 2. Paging. This engine serves paged K and V only, each through its own block + // table (which may be the same tensor). cuDNN also allows K or V paged alone. + const auto pageTableK = attributes.page_table_k_tensor_uid(); + const auto pageTableV = attributes.page_table_v_tensor_uid(); + if(!pageTableK.has_value() && !pageTableV.has_value()) + { + return decline("not_paged", + reason("K/V without page tables (page_table_k/page_table_v) are not " + "served; this engine reads paged K/V containers")); + } + if(!pageTableK.has_value() || !pageTableV.has_value()) + { + return decline("one_sided_paging", + reason("only ", + pageTableK.has_value() ? "K" : "V", + " is paged; the kernel reads both K and V through page tables")); + } + + // --- 3. Operands. + const auto* q = findTensor(context, attributes.q_tensor_uid()); + const auto* k = findTensor(context, attributes.k_tensor_uid()); + const auto* v = findTensor(context, attributes.v_tensor_uid()); + const auto* o = findTensor(context, attributes.o_tensor_uid()); + const auto* pageTableKTensor = findTensor(context, *pageTableK); + const auto* pageTableVTensor = findTensor(context, *pageTableV); + const std::array, 6> operands + = {{{"Q", q}, + {"K", k}, + {"V", v}, + {"O", o}, + {"page_table_k", pageTableKTensor}, + {"page_table_v", pageTableVTensor}}}; + for(const auto& [role, tensor] : operands) + { + if(tensor == nullptr || !isWellFormedRank4(*tensor)) + { + return decline("operand", + reason(role, + " is missing, virtual, pass-by-value, not rank 4, or has a " + "non-positive extent or negative stride")); + } + } + + // --- 4. Data types. + const auto dtype = dataTypeCode(q->data_type()); + if(!dtype.has_value() || k->data_type() != q->data_type() || v->data_type() != q->data_type() + || o->data_type() != q->data_type()) + { + return decline( + "data_type", + reason("Q/K/V/O must all be FP16 or all BFLOAT16 (Q is ", q->data_type(), ")")); + } + + // --- 5. Shapes. + const int64_t batch = dim(*q, BATCH_AXIS); + const int64_t numQueryHeads = dim(*q, HEAD_AXIS); + const int64_t seqLenQ = dim(*q, SEQ_AXIS); + const int64_t headSize = dim(*q, HEAD_SIZE_AXIS); + const int64_t numKvHeads = dim(*k, HEAD_AXIS); + const int64_t blockSize = dim(*k, SEQ_AXIS); + if(dim(*v, SEQ_AXIS) != blockSize) + { + return decline("block_size", + reason("K block size ", + blockSize, + " and V block size ", + dim(*v, SEQ_AXIS), + " differ; the kernel pages K and V alike")); + } + for(uint32_t axis = 0; axis < SDPA_RANK; ++axis) + { + if(dim(*v, axis) != dim(*k, axis) || dim(*o, axis) != dim(*q, axis)) + { + return decline("shape", + reason(describeOperand("V", *v), + " must match ", + describeOperand("K", *k), + ", and ", + describeOperand("O", *o), + " must match ", + describeOperand("Q", *q))); + } + } + if(dim(*k, HEAD_SIZE_AXIS) != headSize) + { + return decline("head_size", reason("Q and K/V head sizes differ")); + } + if(!contains(HEAD_SIZES, headSize)) + { + return decline("head_size", reason("head size ", headSize, " is not one of 64, 128, 256")); + } + if(!contains(BLOCK_SIZES, blockSize)) + { + return decline("block_size", + reason("K/V block size ", blockSize, " is not one of 16, 32, 64")); + } + if(numQueryHeads % numKvHeads != 0 || !contains(QUERIES_PER_KV, numQueryHeads / numKvHeads)) + { + return decline("gqa", + reason("query heads ", + numQueryHeads, + " over K/V heads ", + numKvHeads, + " is not a shipped ratio (1, 2, 4, 5, 6, 7, 8, 16)")); + } + const int64_t queriesPerKv = numQueryHeads / numKvHeads; + + // --- 6. Q/O layout: dense, or ragged through one shared offset table. + const bool qRagged = q->ragged_offset_tensor_uid().has_value(); + const bool oRagged = o->ragged_offset_tensor_uid().has_value(); + if(qRagged != oRagged + || (qRagged && *q->ragged_offset_tensor_uid() != *o->ragged_offset_tensor_uid())) + { + return decline("ragged", + reason("Q and O must both be dense or both ragged through the same " + "ragged_offset tensor")); + } + if(k->ragged_offset_tensor_uid().has_value() || v->ragged_offset_tensor_uid().has_value()) + { + return decline("ragged", reason("ragged K/V containers are not supported")); + } + for(const auto* table : {pageTableKTensor, pageTableVTensor}) + { + if(table->ragged_offset_tensor_uid().has_value()) + { + return decline("page_table", + reason("a packed page table (with a ragged_offset) is not supported; " + "the kernel reads B rows of M entries")); + } + } + int64_t raggedOffsetUid = NO_UID; + if(qRagged) + { + raggedOffsetUid = *q->ragged_offset_tensor_uid(); + const auto* offsets = findTensor(context, raggedOffsetUid); + if(offsets == nullptr || !isInt32Vector(*offsets, batch + 1)) + { + return decline("ragged", + reason("the ragged_offset tensor must be an INT32 [B+1, 1, 1, 1] " + "device vector with unit stride")); + } + } + if(!queryOperandOk("Q", *q, qRagged) || !queryOperandOk("O", *o, qRagged)) + { + return std::nullopt; + } + + // --- 7. K/V containers: equal strides (the kernel shares one descriptor), D-contiguous. + const auto kStrides = effectiveStrides(*k); + if(effectiveStrides(*v) != kStrides) + { + return decline("kv_layout", + reason(describeOperand("K", *k), + " and ", + describeOperand("V", *v), + " must have equal strides")); + } + if(k->strides()->Get(HEAD_SIZE_AXIS) != 1 || v->strides()->Get(HEAD_SIZE_AXIS) != 1 + || !vectorStridesOk(kStrides, true)) + { + return decline("kv_layout", + reason(describeOperand("K", *k), + ": K/V need a unit head-size stride and other strides that are " + "multiples of 8 elements within int32")); + } + const auto kvExtent = innerExtent(*k); + const auto kvSpanBytes + = kvExtent.has_value() ? checkedProduct({*kvExtent, ELEMENT_BYTES}) : std::nullopt; + if(!kvSpanBytes.has_value() || *kvSpanBytes > MAX_BLOCK_SPAN_BYTES) + { + return decline("size_limit", reason("one K/V block spans more than 0x7FFF0000 bytes")); + } + + // --- 8. Page tables INT32 [B, 1, M, 1] with a unit entry stride. Separate K and V + // tables share one width M and one batch stride: the kernel takes one + // block_table_stride for both. + for(const auto& [role, table] : {std::pair{std::string_view("page_table_k"), pageTableKTensor}, + std::pair{std::string_view("page_table_v"), pageTableVTensor}}) + { + if(table->data_type() != data_objects::DataType::INT32 || dim(*table, BATCH_AXIS) != batch + || dim(*table, HEAD_AXIS) != 1 || dim(*table, HEAD_SIZE_AXIS) != 1 + || (dim(*table, SEQ_AXIS) > 1 && table->strides()->Get(SEQ_AXIS) != 1)) + { + return decline("page_table", + reason(describeOperand(role, *table), + " must be INT32 [B, 1, max_blocks, 1] with unit block stride")); + } + } + const auto pageTableStrides = effectiveStrides(*pageTableKTensor); + if(*pageTableV != *pageTableK) + { + if(dim(*pageTableVTensor, SEQ_AXIS) != dim(*pageTableKTensor, SEQ_AXIS)) + { + return decline("page_table", + reason(describeOperand("page_table_k", *pageTableKTensor), + " and ", + describeOperand("page_table_v", *pageTableVTensor), + " differ in width (max_blocks); the kernel reads both with " + "one width")); + } + if(effectiveStrides(*pageTableVTensor)[BATCH_AXIS] != pageTableStrides[BATCH_AXIS]) + { + return decline("page_table", + reason(describeOperand("page_table_k", *pageTableKTensor), + " and ", + describeOperand("page_table_v", *pageTableVTensor), + " differ in batch stride; the kernel takes one " + "block_table_stride for both")); + } + } + const auto pageTableExtent + = checkedSum({checkedProduct({batch - 1, pageTableStrides[BATCH_AXIS]}) + .value_or(std::numeric_limits::max()), + dim(*pageTableKTensor, SEQ_AXIS)}); + if(!pageTableExtent.has_value() || *pageTableExtent > MAX_PAGE_TABLE_ENTRIES) + { + return decline("size_limit", + reason("the page table spans more than ", + MAX_PAGE_TABLE_ENTRIES, + " entries (0x7FFF0000 bytes)")); + } + + // --- 9. Sequence lengths, both required for a paged graph (SEM-009). The kernels read + // the first ceil(seq_len_kv[b] / block_size) entries of row b of each table and do not + // clamp seq_len_kv: 0 <= seq_len_kv[b] <= max_seq_len_kv <= M * block_size is a + // precondition of the launch. An unset max_seq_len_kv is inferred as M * block_size + // (both tables have the same M), which bounds seq_len_kv the same way, so it is served + // either way. A dense Q's rows past seq_len_q[b] (padding) are written as zeros; a + // ragged Q writes only its first seq_len_q[b] rows. + const auto seqLenKvUid = attributes.seq_len_kv_tensor_uid(); + if(!seqLenKvUid.has_value()) + { + return decline("seq_len_kv", reason("paged attention needs a seq_len_kv tensor")); + } + const auto* seqLenKv = findTensor(context, *seqLenKvUid); + if(seqLenKv == nullptr || !isInt32Vector(*seqLenKv, batch)) + { + return decline("seq_len_kv", + reason("seq_len_kv must be an INT32 [B, 1, 1, 1] device vector with " + "unit stride")); + } + const auto seqLenQUid = attributes.seq_len_q_tensor_uid(); + if(!seqLenQUid.has_value()) + { + return decline("seq_len_q", reason("paged attention needs a seq_len_q tensor")); + } + const auto* seqLenQTensor = findTensor(context, *seqLenQUid); + if(seqLenQTensor == nullptr || !isInt32Vector(*seqLenQTensor, batch)) + { + return decline("seq_len_q", + reason("seq_len_q must be an INT32 [B, 1, 1, 1] device vector with " + "unit stride")); + } + + // --- 10. Declared alignment. A graph declares each operand's device-pointer alignment + // (16 bytes unless set; setting it needs engine API 1.3.0, which this engine's 1.4.0 + // admits). The kernels load Q/K/V/O as 16-byte vectors and the INT32 operands as 4-byte + // words, and launch() rejects a pointer short of either, so a graph declaring less is + // declined here, where hipDNN can still pick another engine. + const std::array, 4> + vectorOperands = {{{"Q", q}, {"K", k}, {"V", v}, {"O", o}}}; + for(const auto& [role, tensor] : vectorOperands) + { + if(!declaresAlignment(*tensor, static_cast(VECTOR_BYTES))) + { + return decline("alignment", + reason(role, + " declares a ", + tensor->alignment(), + "-byte alignment; the kernels load Q, K, V and O as 16-byte " + "vectors, so each must declare a multiple of 16 bytes")); + } + } + // A dense Q has no offset table; its entry is null and skipped. + const auto* raggedOffsets = qRagged ? findTensor(context, raggedOffsetUid) : nullptr; + const std::array, 5> + wordOperands = {{{"page_table_k", pageTableKTensor}, + {"page_table_v", pageTableVTensor}, + {"seq_len_kv", seqLenKv}, + {"seq_len_q", seqLenQTensor}, + {"ragged_offset", raggedOffsets}}}; + for(const auto& [role, tensor] : wordOperands) + { + if(tensor != nullptr && !declaresAlignment(*tensor, int64_t{sizeof(int32_t)})) + { + return decline("alignment", + reason(role, + " declares a ", + tensor->alignment(), + "-byte alignment; the kernels read the INT32 page tables, " + "sequence lengths and ragged offsets as 4-byte words")); + } + } + + // --- 11. Mask: bottom-right causal, optionally with a left bound (sliding window). + asm_sdpa_engine::plan_utils::DiagonalBand band{}; + try + { + band = asm_sdpa_engine::plan_utils::resolveDiagonalBand(attributes); + } + catch(const hipdnn_plugin_sdk::HipdnnPluginException& e) + { + return decline("mask", reason(e.what())); + } + if(band.rightBound != 0 || band.alignment != data_objects::DiagonalAlignment::BOTTOM_RIGHT) + { + return decline("mask", + reason("only bottom-right causal masking (right_bound 0, BOTTOM_RIGHT " + "alignment) is served; got right_bound ", + band.rightBound, + (band.alignment == data_objects::DiagonalAlignment::BOTTOM_RIGHT + ? ", BOTTOM_RIGHT" + : ", TOP_LEFT"))); + } + int64_t window = NO_WINDOW; + if(band.leftBound >= 0) + { + if(band.leftBound >= NO_WINDOW - 1) + { + window = NO_WINDOW; + } + else + { + // The graph's left_bound L keeps the L keys ending at the diagonal (cuDNN); + // resolveDiagonalBand holds it as the FlashAttention window L - 1. The kernel + // keeps key k for diagonal d iff d - k < window, so window = L. + window = band.leftBound + 1; + } + } + + // --- 12. Every optional attribute the kernel cannot honour. + if(attributes.attn_mask_tensor_uid().has_value()) + { + return decline("attn_mask", reason("an additive attention mask is not supported")); + } + if(attributes.scale_tensor_uid().has_value()) + { + return decline("scale_tensor", + reason("a scale tensor is not supported; set attn_scale_value")); + } + if(attributes.seed_tensor_uid().has_value() || attributes.offset_tensor_uid().has_value() + || attributes.dropout_mask_tensor_uid().has_value() + || attributes.dropout_scale_tensor_uid().has_value() + || attributes.dropout_probability().has_value()) + { + return decline("dropout", reason("dropout is not supported")); + } + if(attributes.block_mask_tensor_uid().has_value()) + { + return decline("block_mask", reason("a block mask is not supported")); + } + if(attributes.sink_token_tensor_uid().has_value()) + { + return decline("sinks", + reason("attention sinks are not supported until hipDNN defines " + "sink_token semantics (per-head logit in the softmax " + "denominator, as gpt-oss uses)")); + } + if(attributes.descale_q_tensor_uid().has_value() + || attributes.descale_k_tensor_uid().has_value() + || attributes.descale_v_tensor_uid().has_value() + || attributes.descale_s_tensor_uid().has_value() + || attributes.scale_s_tensor_uid().has_value() || attributes.scale_o_tensor_uid().has_value() + || attributes.amax_s_tensor_uid().has_value() || attributes.amax_o_tensor_uid().has_value()) + { + return decline("fp8", reason("FP8 descale/scale/amax tensors are not supported")); + } + if(attributes.stats_tensor_uid().has_value() || attributes.max_tensor_uid().has_value() + || attributes.sum_exp_tensor_uid().has_value() + || attributes.rng_dump_tensor_uid().has_value() + || (attributes.generate_stats().has_value() && attributes.generate_stats().value())) + { + return decline("stats", reason("softmax statistics outputs are not supported")); + } + if(attributes.alibi_mask()) + { + return decline("alibi_mask", reason("ALiBi is not supported")); + } + const auto mmaCoreMode = attributes.mma_core_mode(); + if(mmaCoreMode != data_objects::DataType::UNSET && mmaCoreMode != data_objects::DataType::HALF + && mmaCoreMode != data_objects::DataType::BFLOAT16) + { + return decline("mma_core_mode", reason("mma_core_mode ", mmaCoreMode, " is not supported")); + } + if(attributes.implementation() != data_objects::AttentionImplementation::AUTO) + { + return decline("implementation", + reason("implementation hint ", + attributes.implementation(), + " is not supported; only AUTO is")); + } + // Absent attn_scale_value means 1.0 (cuDNN's default). + const float scale = attributes.attn_scale_value().value_or(1.0F); + if(!std::isfinite(scale)) + { + return decline("scale", reason("attn_scale ", scale, " is not finite")); + } + + // --- 13. Launch-size limits that do not depend on the candidate. + if(batch > INT32_LIMIT || seqLenQ > INT32_LIMIT || numQueryHeads > INT32_LIMIT) + { + return decline("size_limit", reason("batch, query length or head count exceeds int32")); + } + + BoundTokens bound; + bound[std::string(Q_TOKEN)] = attributes.q_tensor_uid(); + bound[std::string(K_TOKEN)] = attributes.k_tensor_uid(); + bound[std::string(V_TOKEN)] = attributes.v_tensor_uid(); + bound[std::string(O_TOKEN)] = attributes.o_tensor_uid(); + bound[std::string(PAGE_TABLE_K_TOKEN)] = *pageTableK; + bound[std::string(PAGE_TABLE_V_TOKEN)] = *pageTableV; + bound[std::string(SEQ_LEN_KV_TOKEN)] = *seqLenKvUid; + bound[std::string(SEQ_LEN_Q_TOKEN)] = *seqLenQUid; + bound[std::string(RAGGED_OFFSET_TOKEN)] = raggedOffsetUid; + int32_t scaleBits = 0; + static_assert(sizeof(scaleBits) == sizeof(scale), "float must be 32-bit to round-trip"); + std::memcpy(&scaleBits, &scale, sizeof(scale)); + bound[std::string(SCALE_BITS_TOKEN)] = static_cast(scaleBits); + bound[std::string(WINDOW_TOKEN)] = window; + bound[std::string(DTYPE_TOKEN)] = *dtype; + bound[std::string(HEAD_SIZE_TOKEN)] = headSize; + bound[std::string(BLOCK_SIZE_TOKEN)] = blockSize; + bound[std::string(QUERIES_PER_KV_TOKEN)] = queriesPerKv; + return bound; +} + +/// The device's processor without target features ("gfx942:sramecc+:xnack-" -> "gfx942"). +std::string_view processorOf(const MatchContext& context) +{ + const std::string_view arch = context.deviceProperties.gcnArchName; + return arch.substr(0, arch.find(':')); +} + +/// Pack criteria: each pack holds one architecture's builder output (the gfx942 and +/// gfx950 tiled kernels are different modules), so a pack serves only its own device. +bool gfx942PackMatches(const MatchContext& context, const BoundTokens& /*bound*/) +{ + return processorOf(context) == "gfx942"; +} + +bool gfx950PackMatches(const MatchContext& context, const BoundTokens& /*bound*/) +{ + return processorOf(context) == "gfx950"; +} + +int64_t readBound(const BoundTokens& bound, std::string_view token) +{ + const auto value = tryGetBoundInt(bound, token); + if(!value.has_value()) + { + throw hipdnn_plugin_sdk::HipdnnPluginException( + HIPDNN_PLUGIN_STATUS_INTERNAL_ERROR, + std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + " dispatch is missing bound token '" + + std::string(token) + "', or it does not hold an integer"); + } + return *value; +} + +/// The candidate's CTA geometry: threads per CTA and query rows (tokens) per q-block. +struct CandidateGeometry +{ + int64_t threads = 0; + int64_t blockQ = 0; +}; + +/// A candidate's integer metadata field, or nullopt when it is absent or holds another +/// type. Total: a malformed record declines instead of throwing out of a match. +std::optional integerMetadata(const KernelDefinition& kernel, std::string_view field) +{ + const auto it = kernel.metadata.find(std::string(field)); + if(it == kernel.metadata.end()) + { + return std::nullopt; + } + const auto* value = std::get_if(&it->second); + return value == nullptr ? std::nullopt : std::optional(*value); +} + +std::optional stringMetadata(const KernelDefinition& kernel, std::string_view field) +{ + const auto it = kernel.metadata.find(std::string(field)); + if(it == kernel.metadata.end()) + { + return std::nullopt; + } + const auto* value = std::get_if(&it->second); + return value == nullptr ? std::nullopt : std::optional(*value); +} + +/// The geometry the candidate's baked metadata implies, mirroring the rocKE spec: +/// `block_m = block_m_per_warp * num_warps`, `block_q = block_m // queries_per_kv`, +/// `threads = num_warps * 64`. nullopt for a record that lacks a field, was not built +/// with one KV head, or yields no query rows per block. +std::optional candidateGeometry(const KernelDefinition& kernel) +{ + const auto numWarps = integerMetadata(kernel, NUM_WARPS_FIELD); + const auto blockMPerWarp = integerMetadata(kernel, BLOCK_M_PER_WARP_FIELD); + const auto queries = integerMetadata(kernel, NUM_QUERY_HEADS_FIELD); + const auto kvHeads = integerMetadata(kernel, NUM_KV_HEADS_FIELD); + if(!numWarps.has_value() || !blockMPerWarp.has_value() || !queries.has_value() + || !kvHeads.has_value() || *numWarps <= 0 || *numWarps > 16 || *blockMPerWarp <= 0 + || *kvHeads != 1 || *queries <= 0) + { + return std::nullopt; + } + CandidateGeometry geometry; + geometry.threads = *numWarps * WAVE_LANES; + geometry.blockQ = (*blockMPerWarp * *numWarps) / *queries; + if(geometry.blockQ <= 0) + { + return std::nullopt; + } + return geometry; +} + +/** + * @brief Kernel-scoped applicability: the candidate was built for this graph's dtype, + * head size, block size and GQA ratio, with one KV head (runtime head counts). + */ +bool kernelMatches(const MatchContext& /*context*/, + const BoundTokens& bound, + const KernelDefinition& kernel) +{ + const auto dtype = tryGetBoundInt(bound, DTYPE_TOKEN); + const auto headSize = tryGetBoundInt(bound, HEAD_SIZE_TOKEN); + const auto blockSize = tryGetBoundInt(bound, BLOCK_SIZE_TOKEN); + const auto queriesPerKv = tryGetBoundInt(bound, QUERIES_PER_KV_TOKEN); + if(!dtype.has_value() || !headSize.has_value() || !blockSize.has_value() + || !queriesPerKv.has_value() || !candidateGeometry(kernel).has_value()) + { + return false; + } + return stringMetadata(kernel, DTYPE_FIELD) == std::string(dataTypeName(*dtype)) + && integerMetadata(kernel, HEAD_SIZE_FIELD) == *headSize + && integerMetadata(kernel, BLOCK_SIZE_FIELD) == *blockSize + && integerMetadata(kernel, NUM_QUERY_HEADS_FIELD) == *queriesPerKv; +} + +// --------------------------------------------------------------------------- +// Dispatch +// --------------------------------------------------------------------------- + +/// The kernel signature (runtime_layout=True): the arguments every tiled 2D body takes, +/// then the runtime_layout ones. NAMES ARE LOAD-BEARING (see AttentionTiled2DSignature.hpp): +/// keep them identical to kernels/{gfx942,gfx950}/attention_tiled_2d.py. +std::vector kernelSignature() +{ + constexpr auto PTR = static_cast(sizeof(void*)); + constexpr auto I32 = static_cast(sizeof(int32_t)); + auto signature = tiled2DKernelSignature(); + appendKernelArgument(signature, "global_buffer", PTR, "block_tables_v_ptr"); + appendKernelArgument(signature, "global_buffer", PTR, "seq_lens_q_ptr"); + for(const auto* name : {"has_seq_lens_q", + "q_uniform_len", + "q_seq_stride", + "q_tok_stride", + "q_head_stride", + "o_seq_stride", + "o_tok_stride", + "o_head_stride", + "kv_block_stride", + "kv_tok_stride", + "kv_head_stride", + "kv_block_span_bytes", + { + appendKernelArgument(signature, "by_value", I32, name); + } + return signature; +} + +/// Every by-value launch argument, resolved once at prepare(). +struct LaunchScalars +{ + float scale = 0.0F; + int32_t numSeqs = 0; + int32_t blockTableStride = 0; + int32_t numQueryHeads = 0; + int32_t numKvHeads = 0; + int32_t slidingWindow = 0; + int32_t qUniformLen = 0; + QueryLayout q; + QueryLayout o; + int32_t kvBlockStride = 0; + int32_t kvTokStride = 0; + int32_t kvHeadStride = 0; + int32_t kvBlockSpanBytes = 0; + int32_t qBlockGrid = 0; +}; + +struct BoundUids +{ + int64_t q = 0; + int64_t k = 0; + int64_t v = 0; + int64_t o = 0; + int64_t pageTableK = 0; + int64_t pageTableV = 0; + int64_t seqLenKv = 0; + int64_t seqLenQ = 0; + int64_t raggedOffset = NO_UID; +}; + +class PreparedAttentionPagedUnified : public PreparedDispatch +{ +public: + PreparedAttentionPagedUnified(IngestorKernelCode code, BoundUids uids, LaunchScalars scalars) + : _code(std::move(code)) + , _uids(uids) + , _scalars(scalars) + { + } + + compilation::IRunnableKernel& kernelForStream(hipStream_t stream) const + { + return _code.kernelForStream(stream); + } + + const BoundUids& uids() const + { + return _uids; + } + + const LaunchScalars& scalars() const + { + return _scalars; + } + +private: + IngestorKernelCode _code; + BoundUids _uids; + LaunchScalars _scalars; +}; + +int32_t narrow(int64_t value, std::string_view what) +{ + if(value < std::numeric_limits::min() || value > INT32_LIMIT) + { + throw hipdnn_plugin_sdk::HipdnnPluginException( + HIPDNN_PLUGIN_STATUS_BAD_PARAM, + std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + ": " + std::string(what) + + " does not fit int32"); + } + return static_cast(value); +} + +const data_objects::TensorAttributes& requireTensor(const MatchContext& context, int64_t uid) +{ + const auto* tensor = findTensor(context, uid); + if(tensor == nullptr || !isWellFormedRank4(*tensor)) + { + throw hipdnn_plugin_sdk::HipdnnPluginException( + HIPDNN_PLUGIN_STATUS_BAD_PARAM, + std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + ": tensor uid " + std::to_string(uid) + + " is missing or malformed"); + } + return *tensor; +} + +class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler +{ +public: + explicit AttentionPagedUnifiedDispatchHandler(const compilation::KpackKernelLoader& loader) + : _loader(loader) + { + } + + /// Zero: the kernel keeps all scratch in LDS and registers. + size_t workspaceBytes(const MatchContext& /*context*/, + const BoundTokens& /*bound*/, + const KernelDefinition& /*kernel*/) const override + { + return 0; + } + + std::unique_ptr prepare(const MatchContext& context, + const BoundTokens& bound, + const KernelDefinition& kernel) const override + { + // graph_match and kernel_match are the gates; this is defence in depth for a + // caller that reaches the handler without having matched. + if(!graphMatches(context).has_value() || !kernelMatches(context, bound, kernel)) + { + throw hipdnn_plugin_sdk::HipdnnPluginException( + HIPDNN_PLUGIN_STATUS_BAD_PARAM, + std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + + ": the graph or the kernel candidate is not supported"); + } + const auto geometry = candidateGeometry(kernel); + + BoundUids uids; + uids.q = readBound(bound, Q_TOKEN); + uids.k = readBound(bound, K_TOKEN); + uids.v = readBound(bound, V_TOKEN); + uids.o = readBound(bound, O_TOKEN); + uids.pageTableK = readBound(bound, PAGE_TABLE_K_TOKEN); + uids.pageTableV = readBound(bound, PAGE_TABLE_V_TOKEN); + uids.seqLenKv = readBound(bound, SEQ_LEN_KV_TOKEN); + uids.seqLenQ = readBound(bound, SEQ_LEN_Q_TOKEN); + uids.raggedOffset = readBound(bound, RAGGED_OFFSET_TOKEN); + const bool ragged = uids.raggedOffset != NO_UID; + + const auto& q = requireTensor(context, uids.q); + const auto& o = requireTensor(context, uids.o); + const auto& k = requireTensor(context, uids.k); + // graph_match checked that a separate V table has K's batch stride. + const auto& pageTableK = requireTensor(context, uids.pageTableK); + + LaunchScalars s; + const auto scaleBits = static_cast(readBound(bound, SCALE_BITS_TOKEN)); + std::memcpy(&s.scale, &scaleBits, sizeof(s.scale)); + const int64_t batch = dim(q, BATCH_AXIS); + const int64_t seqLenQ = dim(q, SEQ_AXIS); + const int64_t numQueryHeads = dim(q, HEAD_AXIS); + const int64_t numKvHeads = dim(k, HEAD_AXIS); + s.numSeqs = narrow(batch, "batch"); + s.blockTableStride = narrow(effectiveStrides(pageTableK)[BATCH_AXIS], "page-table stride"); + s.numQueryHeads = narrow(numQueryHeads, "query heads"); + s.numKvHeads = narrow(numKvHeads, "KV heads"); + s.slidingWindow = narrow(readBound(bound, WINDOW_TOKEN), "window"); + s.qUniformLen = ragged ? 0 : narrow(seqLenQ, "query length"); + s.q = queryLayout(q, ragged); + s.o = queryLayout(o, ragged); + const auto kStrides = effectiveStrides(k); + s.kvBlockStride = narrow(kStrides[BATCH_AXIS], "K/V block stride"); + s.kvTokStride = narrow(kStrides[SEQ_AXIS], "K/V token stride"); + s.kvHeadStride = narrow(kStrides[HEAD_AXIS], "K/V head stride"); + const auto kvExtent = innerExtent(k); + s.kvBlockSpanBytes = narrow(kvExtent.value_or(-1) * ELEMENT_BYTES, "K/V block span"); + for(const auto value : {s.q.seqStride, + s.q.tokenStride, + s.q.headStride, + s.o.seqStride, + s.o.tokenStride, + s.o.headStride}) + { + narrow(value, "Q/O stride"); + } + + // q-block grid: exact for a dense Q; for a ragged Q, enough blocks for every + // sequence when the batch's tokens fit in Sq (the serving convention) -- the kernel's + // grid-stride loop covers any larger batch. Capped by MAX_GRID_Y either way. + const int64_t blocksPerSequence = (seqLenQ + geometry->blockQ - 1) / geometry->blockQ; + const int64_t gridY = ragged ? blocksPerSequence + batch : batch * blocksPerSequence; + s.qBlockGrid = static_cast(std::min(std::max(gridY, 1), MAX_GRID_Y)); + + auto code = buildIngestorKernelCode(_loader, context, kernel, kernelSignature()); + code.setBlockSize(static_cast(geometry->threads), 1, 1); + code.setGridSize( + static_cast(numKvHeads), static_cast(s.qBlockGrid), 1); + return std::make_unique(std::move(code), uids, s); + } + + void launch(const Handle& handle, + const PreparedDispatch& prepared, + const hipdnnPluginDeviceBuffer_t* buffers, + uint32_t count, + void* /*workspace*/) const override + { + const auto& p = dynamic_cast(prepared); + const auto& u = p.uids(); + const auto& s = p.scalars(); + const auto ptr = [&](int64_t uid, bool vectorAligned) { + void* result = hipdnn_plugin_sdk::findDeviceBuffer(uid, buffers, count).ptr; + if(result == nullptr + || (vectorAligned && reinterpret_cast(result) % VECTOR_BYTES != 0) + || reinterpret_cast(result) % sizeof(int32_t) != 0) + { + throw hipdnn_plugin_sdk::HipdnnPluginException( + HIPDNN_PLUGIN_STATUS_BAD_PARAM, + std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + ": buffer for uid " + + std::to_string(uid) + + (vectorAligned ? " is null or not 16-byte aligned" + : " is null or not 4-byte aligned")); + } + return result; + }; + void* q = ptr(u.q, true); + void* k = ptr(u.k, true); + void* v = ptr(u.v, true); + void* o = ptr(u.o, true); + void* pageTableK = ptr(u.pageTableK, false); + void* pageTableV = ptr(u.pageTableV, false); + void* seqLenKv = ptr(u.seqLenKv, false); + void* seqLenQ = ptr(u.seqLenQ, false); + // A dense Q has no offset table: seq_len_kv, a valid INT32 buffer, stands in, and + // the kernel reads it only through index-0 masked loads. + void* raggedOffset = u.raggedOffset != NO_UID ? ptr(u.raggedOffset, false) : seqLenKv; + const void* unused = nullptr; + + p.kernelForStream(handle.getStream()) + .launch(handle.getStream(), + o, + q, + k, + v, + unused, // sink_ptr + pageTableK, + seqLenKv, + unused, // alibi_slopes_ptr + unused, // qq_bias_ptr + raggedOffset, + s.scale, + 1.0F, // k_scale + 1.0F, // v_scale + 1.0F, // out_scale + 0.0F, // softcap + s.numSeqs, + s.blockTableStride, + int32_t{0}, // qq_bias_stride_0 + s.numQueryHeads, + s.numKvHeads, + s.slidingWindow, + pageTableV, + seqLenQ, + int32_t{1}, // has_seq_lens_q: a paged graph always carries seq_len_q + s.qUniformLen, + static_cast(s.q.seqStride), + static_cast(s.q.tokenStride), + static_cast(s.q.headStride), + static_cast(s.o.seqStride), + static_cast(s.o.tokenStride), + static_cast(s.o.headStride), + s.kvBlockStride, + s.kvTokStride, + s.kvHeadStride, + s.kvBlockSpanBytes, + s.qBlockGrid); + } + +private: + const compilation::KpackKernelLoader& _loader; +}; + +compilation::KpackModuleCache& moduleCache() +{ + static compilation::KpackModuleCache s_cache; + return s_cache; +} + +} // namespace + +void resetAttentionPagedUnifiedModuleCache() +{ + moduleCache().clear(); +} + +void registerAttentionPagedUnifiedSymbols(SymbolScope& scope) +{ + static const compilation::KpackKernelLoader s_loader(moduleCache()); + static const AttentionPagedUnifiedDispatchHandler s_handler(s_loader); + scope.add(std::string(GRAPH_MATCHER_SYMBOL), &graphMatches); + scope.add(std::string(GFX942_MATCHER_SYMBOL), &gfx942PackMatches); + scope.add(std::string(GFX950_MATCHER_SYMBOL), &gfx950PackMatches); + scope.add(std::string(KERNEL_MATCHER_SYMBOL), &kernelMatches); + scope.add(std::string(DISPATCH_SYMBOL), &s_handler); +} + +} // namespace hip_kernel_provider::kernel_ingestor_engine + +#endif // HIPDNN_ENABLE_KERNEL_INGESTOR diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp new file mode 100644 index 000000000000..50587449690b --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp @@ -0,0 +1,90 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#pragma once + +#include +#include +#include +#include + +#include + +/** + * @file AttentionTiled2DSignature.hpp + * @brief The kernel signature of rocKE's tiled 2D unified attention + * (`kernels/{gfx942,gfx950}/attention_tiled_2d.py`, `build_unified_attention_2d_tiled`), + * shared by every engine that launches it. + * + * NAMES ARE LOAD-BEARING. requireSignatureMatch compares kind and size always, but names + * only when BOTH sides carry one. Kind and size alone cannot tell the ten pointers apart, nor + * the f32 scalars from the i32 ones, so without names an operand permutation passes the check + * and the kernel reads the wrong buffers with no error and no status code. hkp_pack lowers + * the recorded names out of the rocKE builder's own parameter list, so keep these spellings + * identical to the Python (build_unified_attention_2d_tiled's `b.param` calls); a divergence + * here fails every dispatch rather than silently weakening the check. + * + * Offsets mirror the packed kernarg layout. They are not compared -- they exist so the + * mismatch diagnostic prints the real layout beside the recorded one. + */ +namespace hip_kernel_provider::kernel_ingestor_engine +{ + +/// Appends one argument at the next offset its size aligns to. +inline void + appendKernelArgument(std::vector& signature, + std::string_view kind, + uint32_t size, + std::string_view name) +{ + uint32_t offset = 0; + if(!signature.empty()) + { + offset = signature.back().offset + signature.back().size; + } + offset = (offset + size - 1) / size * size; + signature.push_back(hipdnn_plugin_sdk::ingestor::KernelArgument{ + std::string(kind), size, offset, std::string(name)}); +} + +/// The arguments every tiled 2D body takes: 10 pointers, 6 scalars, the two strides +/// (`_attn_signature(include_bt_stride=True, include_qq_bias_stride=True)`) and the runtime +/// shape kernargs (`RUNTIME_KERNARG_FIELDS`: head counts and window). A runtime_layout +/// kernel appends its own arguments after these. +inline std::vector tiled2DKernelSignature() +{ + constexpr auto PTR = static_cast(sizeof(void*)); + constexpr auto I32 = static_cast(sizeof(int32_t)); + constexpr auto F32 = static_cast(sizeof(float)); + + std::vector signature; + for(const auto* name : {"output_ptr", + "query_ptr", + "key_cache_ptr", + "value_cache_ptr", + "sink_ptr", + "block_tables_ptr", + "seq_lens_ptr", + "alibi_slopes_ptr", + "qq_bias_ptr", + "query_start_len_ptr"}) + { + appendKernelArgument(signature, "global_buffer", PTR, name); + } + for(const auto* name : {"scale", "k_scale", "v_scale", "out_scale", "softcap"}) + { + appendKernelArgument(signature, "by_value", F32, name); + } + for(const auto* name : {"num_seqs", + "block_table_stride", + "qq_bias_stride_0", + "num_query_heads", + "num_kv_heads", + "sliding_window"}) + { + appendKernelArgument(signature, "by_value", I32, name); + } + return signature; +} + +} // namespace hip_kernel_provider::kernel_ingestor_engine diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx950AttentionUnified2DNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx950AttentionUnified2DNative.cpp index 2062a3deec9c..af12d8c47144 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx950AttentionUnified2DNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx950AttentionUnified2DNative.cpp @@ -41,6 +41,7 @@ #include "engines/asm_sdpa_engine/plans/SdpaPlanUtils.hpp" #include "engines/kernel_ingestor_engine/IngestorKernelCode.hpp" #include "engines/kernel_ingestor_engine/IngestorPacks.hpp" +#include "engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp" #include "engines/kernel_ingestor_engine/packs/Gfx950AttentionUnified2DGeometry.hpp" #include "engines/kernel_ingestor_engine/packs/Gfx950AttentionUnified3DGeometry.hpp" #include "engines/kernel_ingestor_engine/packs/UnifiedAttentionGraphMatch.hpp" @@ -446,50 +447,6 @@ double scoreKernel(const MatchContext& /*context*/, // Dispatch // --------------------------------------------------------------------------- -/// The kernel signature for all variants in this engine: 10 pointers, 6 scalars, the two -/// strides (`_attn_signature(include_bt_stride=True, include_qq_bias_stride=True)`) and the -/// runtime shape kernargs (`RUNTIME_KERNARG_FIELDS`: head counts and window). -/// -/// NAMES ARE LOAD-BEARING. requireSignatureMatch compares kind and size always, but names -/// only when BOTH sides carry one. Kind and size alone cannot tell the ten pointers apart, nor -/// the f32 scalars from the i32 ones, so without names an operand permutation passes the check -/// and the kernel reads the wrong buffers with no error and no status code. hkp_pack lowers -/// the recorded names out of the rocKE builder's own parameter list, so keep these spellings -/// identical to the Python (kernels/gfx950/attention_tiled_2d.py, -/// build_unified_attention_2d_tiled's `b.param` calls); a divergence here fails every -/// dispatch rather than silently weakening the check. -/// -/// Offsets mirror the packed kernarg layout. They are not compared -- they exist so the -/// mismatch diagnostic prints the real layout beside the recorded one. -std::vector unified2DKernelSignature() -{ - constexpr auto PTR = static_cast(sizeof(void*)); - constexpr auto I32 = static_cast(sizeof(int32_t)); - constexpr auto F32 = static_cast(sizeof(float)); - - return {KernelArgument{"global_buffer", PTR, 0, "output_ptr"}, - KernelArgument{"global_buffer", PTR, 8, "query_ptr"}, - KernelArgument{"global_buffer", PTR, 16, "key_cache_ptr"}, - KernelArgument{"global_buffer", PTR, 24, "value_cache_ptr"}, - KernelArgument{"global_buffer", PTR, 32, "sink_ptr"}, - KernelArgument{"global_buffer", PTR, 40, "block_tables_ptr"}, - KernelArgument{"global_buffer", PTR, 48, "seq_lens_ptr"}, - KernelArgument{"global_buffer", PTR, 56, "alibi_slopes_ptr"}, - KernelArgument{"global_buffer", PTR, 64, "qq_bias_ptr"}, - KernelArgument{"global_buffer", PTR, 72, "query_start_len_ptr"}, - KernelArgument{"by_value", F32, 80, "scale"}, - KernelArgument{"by_value", F32, 84, "k_scale"}, - KernelArgument{"by_value", F32, 88, "v_scale"}, - KernelArgument{"by_value", F32, 92, "out_scale"}, - KernelArgument{"by_value", F32, 96, "softcap"}, - KernelArgument{"by_value", I32, 100, "num_seqs"}, - KernelArgument{"by_value", I32, 104, "block_table_stride"}, - KernelArgument{"by_value", I32, 108, "qq_bias_stride_0"}, - KernelArgument{"by_value", I32, 112, "num_query_heads"}, - KernelArgument{"by_value", I32, 116, "num_kv_heads"}, - KernelArgument{"by_value", I32, 120, "sliding_window"}}; -} - /// The compiled kernel plus everything launch() needs, owning nothing that points back into /// the MatchContext or BoundTokens it came from. class PreparedGfx950AttentionUnified2D : public PreparedDispatch @@ -661,7 +618,7 @@ class Gfx950AttentionUnified2DDispatchHandler : public IKernelDispatchHandler +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * @file IntegrationGpuAttentionPagedUnified.cpp + * @brief End-to-end runs of hipkernel:AttentionPagedUnified through the hipDNN frontend: + * paged uniform decode (dense Q), ragged Q over paged K/V (mixed decode and + * chunked prefill, a first origin past 0), sliding windows, separate K and V page + * tables, and HIP-graph capture/replay with changed sequence lengths, block ids and + * data. Every output is compared with a host gather-then-dense fp32 reference over + * the same page tables, which is itself checked against hipDNN's CPU SDPA reference. + * A dense Q's rows past seq_len_q, and rows with no visible key, must be zero + * (SdpaSemanticsRegister SEM-008, SEM-010); a ragged Q's rows past seq_len_q belong + * to no sequence (RFC 0014) and must keep their contents. + * + * Set HIPDNN_TEST_EXPECTED_ARCH=gfx942 (or gfx950) on required runs so a missing or + * different device fails instead of skipping. + */ +namespace +{ + +using namespace hipdnn_frontend; +using namespace hipdnn_frontend::graph; + +constexpr const char* ENGINE = "hipkernel:AttentionPagedUnified"; + +uint16_t toBits(float x, DataType type) +{ + if(type == DataType::BFLOAT16) + { + uint32_t bits = 0; + std::memcpy(&bits, &x, 4); + bits += 0x7fffU + ((bits >> 16) & 1U); + return static_cast(bits >> 16); + } + const auto half = static_cast<_Float16>(x); + uint16_t bits = 0; + std::memcpy(&bits, &half, 2); + return bits; +} + +float fromBits(uint16_t bits, DataType type) +{ + if(type == DataType::BFLOAT16) + { + const uint32_t wide = static_cast(bits) << 16; + float value = 0; + std::memcpy(&value, &wide, 4); + return value; + } + _Float16 half = 0; + std::memcpy(&half, &bits, 2); + return static_cast(half); +} + +/// One problem. Q/O are token-major (`[tokens, Hq, D]` with a token stride of +/// `qTokenHeads * D`, so a fused QKV view is expressible); the cache is one +/// `[numBlocks, Hkv, blockSize, 2*D]` allocation viewed as K (first D) and V (last D), +/// exactly vLLM's TRITON_ATTN layout. +struct Problem +{ + DataType type = DataType::BFLOAT16; + int64_t queryHeads = 32; + int64_t kvHeads = 8; + int64_t headSize = 128; + int64_t blockSize = 16; + int64_t numBlocks = 96; + int64_t maxBlocks = 24; ///< page-table width M; max_seq_len_kv = M * blockSize + bool ragged = false; + int64_t denseQueryLength = 1; ///< Sq of a dense Q + int64_t raggedMaxLength = 0; ///< Sq (S_max) of a ragged Q + /// Ragged origins [B+1] (non-decreasing, off[B] the end of the last block); empty = + /// each sequence right after the previous one's live rows and gap. + std::vector raggedOffsets; + std::vector queryLengths; ///< seq_len_q; empty = denseQueryLength each + std::vector kvLengths; + std::vector gapsAfter; ///< ragged: unaddressed tokens after each sequence + bool setMaxSeqLenKv = true; ///< false leaves max_seq_len_kv for the engine to infer + int64_t leftBound = -1; ///< the graph's (cuDNN) left_bound; -1 = none + int64_t qTokenHeads = 0; ///< Q token stride in heads; 0 = queryHeads + /// V pages through its own page_table_v, which places V in other blocks than K; + /// otherwise one tensor is both page_table_k and page_table_v. + bool separateVTable = false; + uint32_t seed = 1; + + int64_t batch() const + { + return static_cast(kvLengths.size()); + } +}; + +class DeviceBuffers +{ +public: + DeviceBuffers() = default; + DeviceBuffers(const DeviceBuffers&) = delete; + DeviceBuffers& operator=(const DeviceBuffers&) = delete; + DeviceBuffers(DeviceBuffers&&) = delete; + DeviceBuffers& operator=(DeviceBuffers&&) = delete; + ~DeviceBuffers() + { + for(void* p : _allocations) + { + EXPECT_EQ(hipFree(p), hipSuccess); + } + } + void* allocate(size_t bytes) + { + void* p = nullptr; + if(hipMalloc(&p, std::max(bytes, 16)) != hipSuccess) + { + throw std::runtime_error("hipMalloc failed"); + } + _allocations.push_back(p); + return p; + } + +private: + std::vector _allocations; +}; + +/// Host-side state of one problem instance: data, page table and lengths. +struct HostState +{ + std::vector q; ///< token-major, token stride qTokenHeads*D + std::vector cache; ///< [NB, Hkv, bs, 2D] + std::vector pageTable; ///< [B, M]: K's table (and V's, unless separate) + std::vector vPageTable; ///< [B, M]: V's table + std::vector kvLengths; + std::vector queryLengths; + std::vector offsets; ///< ragged token offsets [B+1] + int64_t qTokens = 0; ///< tokens of the Q/O storage +}; + +/// seq_len_q[b]: the live query rows of sequence b. +int64_t queryRowsFor(const HostState& s, int64_t b) +{ + return s.queryLengths[static_cast(b)]; +} + +/// The rows the engine writes for sequence b: Sq for a dense Q (rows past seq_len_q are +/// padding, written as zeros), the live rows for a ragged one (rows of its offset block +/// past seq_len_q belong to no sequence, so the engine leaves them alone). +int64_t rowsWritten(const Problem& p, const HostState& s, int64_t b) +{ + return p.ragged ? queryRowsFor(s, b) : p.denseQueryLength; +} + +int64_t firstToken(const Problem& p, const HostState& s, int64_t b) +{ + return p.ragged ? s.offsets[static_cast(b)] : b * p.denseQueryLength; +} + +/// A ragged Q's offsets [B+1]: p.raggedOffsets, or each sequence after the previous one's +/// live rows and gap. +std::vector raggedOffsetsFor(const Problem& p) +{ + if(!p.raggedOffsets.empty()) + { + return p.raggedOffsets; + } + std::vector offsets(static_cast(p.batch() + 1), 0); + for(int64_t b = 0; b < p.batch(); ++b) + { + const auto gap = p.gapsAfter.empty() ? 0 : p.gapsAfter[static_cast(b)]; + offsets[static_cast(b + 1)] + = offsets[static_cast(b)] + p.queryLengths[static_cast(b)] + gap; + } + return offsets; +} + +/// The tokens the Q and O storage holds: Sq rows per sequence, and for a ragged Q at +/// least Sq rows from every origin, so a write past a sequence's live rows lands in the +/// storage, where check() sees it. +int64_t storageTokens(const Problem& p) +{ + const int64_t sq = p.ragged ? p.raggedMaxLength : p.denseQueryLength; + int64_t tokens = p.batch() * sq; + if(p.ragged) + { + const auto offsets = raggedOffsetsFor(p); + for(int64_t b = 0; b < p.batch(); ++b) + { + const int64_t rows = std::max(sq, p.queryLengths[static_cast(b)]); + tokens = std::max(tokens, offsets[static_cast(b)] + rows); + } + if(p.raggedOffsets.empty()) + { + tokens = std::max(tokens, offsets.back()); + } + } + return std::max(tokens, 1); +} + +/// Random data, and shuffled page tables whose unused entries hold garbage block ids +/// the kernel must never follow. +HostState makeState(const Problem& p, uint32_t seed) +{ + std::mt19937 rng(seed); + std::uniform_real_distribution uniform(-1.0F, 1.0F); + HostState s; + s.kvLengths = p.kvLengths; + s.queryLengths + = p.queryLengths.empty() + ? std::vector(p.kvLengths.size(), static_cast(p.denseQueryLength)) + : p.queryLengths; + const int64_t batch = p.batch(); + if(p.ragged) + { + s.offsets = raggedOffsetsFor(p); + } + s.qTokens = storageTokens(p); + const int64_t tokenHeads = p.qTokenHeads > 0 ? p.qTokenHeads : p.queryHeads; + s.q.resize(static_cast(s.qTokens * tokenHeads * p.headSize)); + for(auto& x : s.q) + { + x = toBits(uniform(rng), p.type); + } + s.cache.resize(static_cast(p.numBlocks * p.kvHeads * p.blockSize * 2 * p.headSize)); + for(auto& x : s.cache) + { + x = toBits(uniform(rng), p.type); + } + std::vector blocks(static_cast(p.numBlocks)); + std::iota(blocks.begin(), blocks.end(), 0); + std::shuffle(blocks.begin(), blocks.end(), rng); + s.pageTable.assign(static_cast(batch * p.maxBlocks), 0x7fffffff); + size_t next = 0; + for(int64_t b = 0; b < batch; ++b) + { + const int64_t used = (s.kvLengths[static_cast(b)] + p.blockSize - 1) / p.blockSize; + for(int64_t i = 0; i < used; ++i) + { + s.pageTable[static_cast(b * p.maxBlocks + i)] + = blocks.at(next++ % blocks.size()); + } + } + s.vPageTable = s.pageTable; + if(p.separateVTable) + { + // Another shuffle: V of a token sits in another block than its K. + std::shuffle(blocks.begin(), blocks.end(), rng); + next = 0; + for(int64_t b = 0; b < batch; ++b) + { + const int64_t used + = (s.kvLengths[static_cast(b)] + p.blockSize - 1) / p.blockSize; + for(int64_t i = 0; i < used; ++i) + { + s.vPageTable[static_cast(b * p.maxBlocks + i)] + = blocks.at(next++ % blocks.size()); + } + } + } + return s; +} + +/// fp32 gather-then-dense reference: for each sequence, gather its K and V through their +/// page tables into dense rows, then bottom-right causal (plus window) softmax attention. +/// Rows past seq_len_q and rows with no visible key stay zero. +std::vector reference(const Problem& p, const HostState& s, float scale) +{ + const int64_t d = p.headSize; + const int64_t tokenHeads = p.qTokenHeads > 0 ? p.qTokenHeads : p.queryHeads; + const int64_t group = p.queryHeads / p.kvHeads; + std::vector out(static_cast(s.qTokens * p.queryHeads * d), 0.0F); + for(int64_t b = 0; b < p.batch(); ++b) + { + const int64_t kv = s.kvLengths[static_cast(b)]; + const int64_t rows = queryRowsFor(s, b); + const int64_t first = firstToken(p, s, b); + const auto cacheAt = [&](int64_t token, int64_t head, int64_t dim, bool value) { + const auto& table = value ? s.vPageTable : s.pageTable; + const int64_t block = table[static_cast(b * p.maxBlocks + token / p.blockSize)]; + const int64_t index + = ((block * p.kvHeads + head) * p.blockSize + token % p.blockSize) * 2 * d + + (value ? d : 0) + dim; + return fromBits(s.cache[static_cast(index)], p.type); + }; + for(int64_t row = 0; row < rows; ++row) + { + const int64_t diagonal = row + kv - rows; + for(int64_t h = 0; h < p.queryHeads; ++h) + { + const int64_t kvHead = h / group; + std::vector scores; + std::vector keys; + for(int64_t key = 0; key < kv; ++key) + { + // left_bound L keeps the L keys ending at the diagonal (cuDNN). + if(key > diagonal || (p.leftBound > 0 && key <= diagonal - p.leftBound)) + { + continue; + } + float dot = 0.0F; + for(int64_t i = 0; i < d; ++i) + { + dot += fromBits(s.q[static_cast(((first + row) * tokenHeads + h) * d + + i)], + p.type) + * cacheAt(key, kvHead, i, false); + } + scores.push_back(dot * scale); + keys.push_back(key); + } + auto* o = &out[static_cast(((first + row) * p.queryHeads + h) * d)]; + if(scores.empty()) + { + continue; // no visible key: zeros + } + const float maximum = *std::max_element(scores.begin(), scores.end()); + float sum = 0.0F; + for(auto& x : scores) + { + x = std::exp(x - maximum); + sum += x; + } + for(size_t j = 0; j < keys.size(); ++j) + { + for(int64_t i = 0; i < d; ++i) + { + o[i] += scores[j] / sum * cacheAt(keys[j], kvHead, i, true); + } + } + } + } + } + return out; +} + +constexpr uint16_t SENTINEL = 0x7e00; // a NaN in fp16, a finite value in bf16; checked bitwise + +/// hipDNN's own SDPA reference (CpuFpReferenceSdpa, the dense path #14358's paged graphs +/// run through) over the same host state, as float O laid out like the device O +/// ([tokens, Hq, D]): K and V gathered through their page tables, Q and O dense padded +/// [B, Hq, Sq, D] with seq_len_q / seq_len_kv padding, and the ragged layout mapped by +/// the offsets. +template +std::vector hipdnnReferenceAs(const Problem& p, HostState s, float scale) +{ + using namespace hipdnn_data_sdk::utilities; + using hipdnn_test_sdk::utilities::CpuFpReferenceSdpa; + using hipdnn_test_sdk::utilities::SdpaFwdOptions; + const int64_t batch = p.batch(); + const int64_t d = p.headSize; + const int64_t tokenHeads = p.qTokenHeads > 0 ? p.qTokenHeads : p.queryHeads; + const int64_t sq = p.ragged ? p.raggedMaxLength : p.denseQueryLength; + const int64_t tokens = s.qTokens; + + Tensor q({batch, p.queryHeads, sq, d}); + q.fillWithValue(static_cast(0.0F)); + for(int64_t b = 0; b < batch; ++b) + { + for(int64_t row = 0; row < std::min(rowsWritten(p, s, b), sq); ++row) + { + for(int64_t h = 0; h < p.queryHeads; ++h) + { + for(int64_t i = 0; i < d; ++i) + { + const auto bits = s.q[static_cast( + ((firstToken(p, s, b) + row) * tokenHeads + h) * d + i)]; + q.setHostValue(static_cast(fromBits(bits, p.type)), + std::vector{b, h, row, i}); + } + } + } + } + const std::vector kvDims = {p.numBlocks, p.kvHeads, p.blockSize, d}; + const std::vector kvStrides + = {p.kvHeads * p.blockSize * 2 * d, p.blockSize * 2 * d, 2 * d, 1}; + const ShallowTensor kCache(s.cache.data(), kvDims, kvStrides); + const ShallowTensor vCache(s.cache.data() + d, kvDims, kvStrides); + Tensor table({batch, 1, p.maxBlocks, 1}, {p.maxBlocks, p.maxBlocks, 1, 1}); + Tensor vTable({batch, 1, p.maxBlocks, 1}, {p.maxBlocks, p.maxBlocks, 1, 1}); + Tensor kvLengths({batch, 1, 1, 1}); + Tensor qLengths({batch, 1, 1, 1}); + for(int64_t b = 0; b < batch; ++b) + { + const int32_t kv = s.kvLengths[static_cast(b)]; + const int64_t used = (kv + p.blockSize - 1) / p.blockSize; + for(int64_t j = 0; j < p.maxBlocks; ++j) + { + // The gather reads only the used ids; the rest may hold anything. + const auto at = static_cast(b * p.maxBlocks + j); + table.setHostValue(j < used ? s.pageTable[at] : -1, std::vector{b, 0, j, 0}); + vTable.setHostValue(j < used ? s.vPageTable[at] : -1, std::vector{b, 0, j, 0}); + } + kvLengths.setHostValue(kv, std::vector{b, 0, 0, 0}); + qLengths.setHostValue(static_cast(queryRowsFor(s, b)), + std::vector{b, 0, 0, 0}); + } + const int64_t maxSeqKv = p.maxBlocks * p.blockSize; + const auto k = CpuFpReferenceSdpa::gatherPagedKv(kCache, table, kvLengths, maxSeqKv); + const auto v = CpuFpReferenceSdpa::gatherPagedKv(vCache, vTable, kvLengths, maxSeqKv); + Tensor o({batch, p.queryHeads, sq, d}); + auto options = SdpaFwdOptions{} + .setScale(scale) + .setBand(p.leftBound, 0, false) + .setSeqLens(&qLengths, &kvLengths); + CpuFpReferenceSdpa::forward(q, k, v, o, options); + + std::vector out(static_cast(tokens * p.queryHeads * d), 0.0F); + for(int64_t b = 0; b < batch; ++b) + { + for(int64_t row = 0; row < std::min(rowsWritten(p, s, b), sq); ++row) + { + for(int64_t h = 0; h < p.queryHeads; ++h) + { + for(int64_t i = 0; i < d; ++i) + { + out[static_cast(((firstToken(p, s, b) + row) * p.queryHeads + h) * d + + i)] + = o.getHostValue(std::vector{b, h, row, i}); + } + } + } + } + return out; +} + +std::vector hipdnnReference(const Problem& p, const HostState& s, float scale) +{ + if(p.type == DataType::BFLOAT16) + { + return hipdnnReferenceAs(p, s, scale); + } + return hipdnnReferenceAs(p, s, scale); +} + +class IntegrationGpuAttentionPagedUnified : public ::testing::Test +{ +protected: + hipdnnHandle_t _handle = nullptr; + hipStream_t _stream = nullptr; + + void SetUp() override + { + const auto expectedArch = hipdnn_data_sdk::utilities::getEnv("HIPDNN_TEST_EXPECTED_ARCH"); + if(expectedArch.empty()) + { + SKIP_IF_NO_DEVICES(); + } + ASSERT_EQ(hipStreamCreate(&_stream), hipSuccess); + const auto pluginPath + = std::filesystem::weakly_canonical( + hipdnn_data_sdk::utilities::getCurrentExecutableDirectory() / PLUGIN_PATH) + .string(); + const char* path = pluginPath.c_str(); + ASSERT_EQ(hipdnnSetEnginePluginPaths_ext(1, &path, HIPDNN_PLUGIN_LOADING_ABSOLUTE), + HIPDNN_STATUS_SUCCESS); + ASSERT_EQ(hipdnnCreate(&_handle), HIPDNN_STATUS_SUCCESS); + ASSERT_EQ(hipdnnSetStream(_handle, _stream), HIPDNN_STATUS_SUCCESS); + int device = 0; + ASSERT_EQ(hipGetDevice(&device), hipSuccess); + hipDeviceProp_t props{}; + ASSERT_EQ(hipGetDeviceProperties(&props, device), hipSuccess); + const std::string arch = props.gcnArchName; + const auto base = arch.substr(0, arch.find(':')); + if(!expectedArch.empty()) + { + ASSERT_EQ(base, expectedArch); + } + if(base != "gfx942" && base != "gfx950") + { + GTEST_SKIP() << ENGINE << " ships for gfx942/gfx950; found " << arch; + } + } + + void TearDown() override + { + if(_stream != nullptr) + { + EXPECT_EQ(hipStreamSynchronize(_stream), hipSuccess); + } + if(_handle != nullptr) + { + EXPECT_EQ(hipdnnDestroy(_handle), HIPDNN_STATUS_SUCCESS); + } + if(_stream != nullptr) + { + EXPECT_EQ(hipStreamDestroy(_stream), hipSuccess); + } + } + + static bool ok(const Error& error) + { + EXPECT_EQ(error.code, ErrorCode::OK) << error.err_msg; + return error.code == ErrorCode::OK; + } + + /// The graph, its uids and the device buffers for one problem. + struct Built + { + std::unique_ptr graph; + DeviceBuffers memory; + std::unordered_map buffers; + void* cache = nullptr; + size_t qBytes = 0; + size_t oBytes = 0; + float scale = 0.0F; + }; + + enum Uid : int64_t + { + Q = 1, + K = 2, + V = 3, + O = 4, + PAGE_TABLE = 5, + SEQ_LEN_KV = 6, + SEQ_LEN_Q = 7, + OFFSETS = 8, + PAGE_TABLE_V = 10 + }; + + /// Builds the graph for @p p, planned on this engine only. + void build(const Problem& p, Built& built) + { + const int64_t batch = p.batch(); + const int64_t d = p.headSize; + const int64_t tokenHeads = p.qTokenHeads > 0 ? p.qTokenHeads : p.queryHeads; + const int64_t sq = p.ragged ? p.raggedMaxLength : p.denseQueryLength; + built.graph = std::make_unique(); + auto& graph = *built.graph; + graph.set_io_data_type(p.type) + .set_compute_data_type(DataType::FLOAT) + .set_intermediate_data_type(DataType::FLOAT); + const auto make = [](int64_t uid, + DataType type, + const std::vector& dims, + const std::vector& strides) { + return std::make_shared( + TensorAttributes().set_uid(uid).set_data_type(type).set_dim(dims).set_stride( + strides)); + }; + auto q = make( + Q, p.type, {batch, p.queryHeads, sq, d}, {sq * tokenHeads * d, d, tokenHeads * d, 1}); + const std::vector kvStrides + = {p.kvHeads * p.blockSize * 2 * d, p.blockSize * 2 * d, 2 * d, 1}; + auto k = make(K, p.type, {p.numBlocks, p.kvHeads, p.blockSize, d}, kvStrides); + auto v = make(V, p.type, {p.numBlocks, p.kvHeads, p.blockSize, d}, kvStrides); + auto pageTable = make(PAGE_TABLE, + DataType::INT32, + {batch, 1, p.maxBlocks, 1}, + {p.maxBlocks, p.maxBlocks, 1, 1}); + auto pageTableV = p.separateVTable ? make(PAGE_TABLE_V, + DataType::INT32, + {batch, 1, p.maxBlocks, 1}, + {p.maxBlocks, p.maxBlocks, 1, 1}) + : pageTable; + auto seqLenKv = make(SEQ_LEN_KV, DataType::INT32, {batch, 1, 1, 1}, {1, 1, 1, 1}); + std::shared_ptr offsets; + if(p.ragged) + { + offsets = make(OFFSETS, DataType::INT32, {batch + 1, 1, 1, 1}, {1, 1, 1, 1}); + q->set_ragged_offset(offsets).set_ragged_offset_multiplier(tokenHeads * d); + } + built.scale = 1.0F / std::sqrt(static_cast(d)); + SdpaAttributes attributes; + // A paged graph carries both seq_len tensors (SdpaSemanticsRegister SEM-009). + attributes.set_attn_scale(built.scale) + .set_generate_stats(false) + .set_padding_mask(true) + .set_seq_len_q(make(SEQ_LEN_Q, DataType::INT32, {batch, 1, 1, 1}, {1, 1, 1, 1})) + .set_seq_len_kv(seqLenKv) + .set_paged_attention_k_table(pageTable) + .set_paged_attention_v_table(pageTableV) + .set_diagonal_band_right_bound(0) + .set_diagonal_alignment(DiagonalAlignment::BOTTOM_RIGHT); + if(p.setMaxSeqLenKv) + { + attributes.set_paged_attention_max_seq_len_kv( + static_cast(p.maxBlocks * p.blockSize)); + } + if(p.leftBound > 0) + { + attributes.set_diagonal_band_left_bound(p.leftBound); + } + auto o = graph.sdpa(q, k, v, attributes)[0]; + o->set_uid(O) + .set_output(true) + .set_data_type(p.type) + .set_dim({batch, p.queryHeads, sq, d}) + .set_stride({sq * p.queryHeads * d, d, p.queryHeads * d, 1}); + if(p.ragged) + { + o->set_ragged_offset(offsets).set_ragged_offset_multiplier(p.queryHeads * d); + } + ASSERT_TRUE(ok(graph.validate())); + ASSERT_TRUE(ok(graph.build_operation_graph(_handle))); + ASSERT_TRUE(ok(graph.create_execution_plan_ext( + hipdnn_data_sdk::utilities::engineNameToId(ENGINE), {}))); + ASSERT_TRUE(ok(graph.check_support())); + ASSERT_TRUE(ok(graph.build_plans())); + int64_t workspace = -1; + ASSERT_TRUE(ok(graph.get_workspace_size(workspace))); + ASSERT_EQ(workspace, 0); + + const int64_t tokens = storageTokens(p); + built.qBytes = static_cast(tokens * tokenHeads * d * 2); + built.oBytes = static_cast(tokens * p.queryHeads * d * 2); + built.cache = built.memory.allocate( + static_cast(p.numBlocks * p.kvHeads * p.blockSize * 2 * d * 2)); + built.buffers[Q] = built.memory.allocate(built.qBytes); + built.buffers[K] = built.cache; + built.buffers[V] = static_cast(built.cache) + d; + built.buffers[O] = built.memory.allocate(built.oBytes); + built.buffers[PAGE_TABLE] + = built.memory.allocate(static_cast(batch * p.maxBlocks * 4)); + if(p.separateVTable) + { + built.buffers[PAGE_TABLE_V] + = built.memory.allocate(static_cast(batch * p.maxBlocks * 4)); + } + built.buffers[SEQ_LEN_KV] = built.memory.allocate(static_cast(batch * 4)); + built.buffers[SEQ_LEN_Q] = built.memory.allocate(static_cast(batch * 4)); + if(p.ragged) + { + built.buffers[OFFSETS] = built.memory.allocate(static_cast((batch + 1) * 4)); + } + } + + /// Uploads @p s and poisons O with SENTINEL (stream-ordered). + void upload(const Problem& p, const HostState& s, Built& built) + { + const auto copy = [&](void* dst, const void* src, size_t bytes) { + ASSERT_EQ(hipMemcpyAsync(dst, src, bytes, hipMemcpyHostToDevice, _stream), hipSuccess); + }; + copy(built.buffers[Q], s.q.data(), std::min(built.qBytes, s.q.size() * 2)); + copy(built.cache, s.cache.data(), s.cache.size() * 2); + copy(built.buffers[PAGE_TABLE], s.pageTable.data(), s.pageTable.size() * 4); + if(p.separateVTable) + { + copy(built.buffers[PAGE_TABLE_V], s.vPageTable.data(), s.vPageTable.size() * 4); + } + copy(built.buffers[SEQ_LEN_KV], s.kvLengths.data(), s.kvLengths.size() * 4); + copy(built.buffers[SEQ_LEN_Q], s.queryLengths.data(), s.queryLengths.size() * 4); + if(p.ragged) + { + copy(built.buffers[OFFSETS], s.offsets.data(), s.offsets.size() * 4); + } + std::vector poison(built.oBytes / 2, SENTINEL); + copy(built.buffers[O], poison.data(), built.oBytes); + } + + /// Reads O back and compares every row the engine writes with the reference: live rows + /// within tolerance, a dense Q's rows past seq_len_q exactly zero. Every other row (a + /// ragged Q's gap rows included) keeps the sentinel. + void check(const Problem& p, const HostState& s, const Built& built) + { + std::vector out(built.oBytes / 2); + ASSERT_EQ( + hipMemcpyAsync( + out.data(), built.buffers.at(O), built.oBytes, hipMemcpyDeviceToHost, _stream), + hipSuccess); + ASSERT_EQ(hipStreamSynchronize(_stream), hipSuccess); + const auto expected = reference(p, s, built.scale); + // hipDNN's CPU SDPA reference on the same inputs: the test's own gather-then-dense + // reference must agree with it. + const auto contract = hipdnnReference(p, s, built.scale); + const int64_t d = p.headSize; + std::vector written(built.oBytes / 2 / static_cast(p.queryHeads * d), false); + for(int64_t b = 0; b < p.batch(); ++b) + { + const int64_t first = firstToken(p, s, b); + const int64_t live = queryRowsFor(s, b); + for(int64_t row = 0; row < rowsWritten(p, s, b); ++row) + { + written[static_cast(first + row)] = true; + for(int64_t i = 0; i < p.queryHeads * d; ++i) + { + const auto index = static_cast((first + row) * p.queryHeads * d + i); + const float actual = fromBits(out[index], p.type); + const float want = expected[index]; + ASSERT_TRUE(std::isfinite(actual)) << "b=" << b << " row=" << row << " i=" << i; + // Bottom-right causal: live row r sees keys up to kv - live + r, so + // every row of an empty sequence, and the leading rows of a sequence + // with fewer keys than live rows, see none and must be exact zeros. + const int64_t kv = s.kvLengths[static_cast(b)]; + if(row >= live || row + kv < live) + { + ASSERT_EQ(actual, 0.0F) + << (row >= live ? "padding row past seq_len_q" : "row with no key") + << ": b=" << b << " row=" << row << " i=" << i; + } + // Both references accumulate in fp32 and differ only in summation + // order. + ASSERT_NEAR(contract[index], want, 1.0e-3F + 1.0e-3F * std::abs(want)) + << "references disagree: b=" << b << " row=" << row << " i=" << i; + // The engine rounds P and O to bf16/fp16 (8 or 11 mantissa bits). + const float error = std::abs(actual - want); + ASSERT_LE(error, 2.0e-2F + 2.0e-2F * std::abs(want)) + << "b=" << b << " row=" << row << " head=" << i / d << " d=" << i % d; + } + } + } + for(size_t token = 0; token < written.size(); ++token) + { + if(written[token]) + { + continue; + } + for(int64_t i = 0; i < p.queryHeads * d; ++i) + { + ASSERT_EQ( + out[token * static_cast(p.queryHeads * d) + static_cast(i)], + SENTINEL) + << "the kernel wrote unaddressed token " << token; + } + } + } + + void run(const Problem& p) + { + Built built; + build(p, built); + if(::testing::Test::HasFatalFailure()) + { + return; + } + const auto state = makeState(p, p.seed); + upload(p, state, built); + ASSERT_TRUE(ok(built.graph->execute(_handle, built.buffers, nullptr))); + check(p, state, built); + } +}; + +Problem decodeProblem(DataType type) +{ + Problem p; + p.type = type; + // Sequence 0 is CUDA-graph padding: no keys, and its row must come back zero. + p.kvLengths = {0, 1, 17, 100, 255, 384}; + return p; +} + +TEST_F(IntegrationGpuAttentionPagedUnified, PagedUniformDecodeBf16) +{ + run(decodeProblem(DataType::BFLOAT16)); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, PagedUniformDecodeHalf) +{ + run(decodeProblem(DataType::HALF)); +} + +/// Sq = 3 rows per sequence, some with fewer live rows (seq_len_q < Sq): the padded rows +/// must come back zero. +TEST_F(IntegrationGpuAttentionPagedUnified, SpeculativeDecodeRowsWithSeqLenQ) +{ + Problem p = decodeProblem(DataType::BFLOAT16); + p.denseQueryLength = 3; + p.queryLengths = {3, 1, 3, 2, 0, 3}; + p.kvLengths = {0, 1, 17, 100, 255, 384}; + run(p); +} + +/// An unset max_seq_len_kv is valid (cuDNN infers it from the table width), and the +/// engine serves it like a set one. +TEST_F(IntegrationGpuAttentionPagedUnified, PagedDecodeWithMaxSeqLenKvUnset) +{ + Problem p = decodeProblem(DataType::HALF); + p.setMaxSeqLenKv = false; + run(p); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, DecodeHeadSizes64And256) +{ + Problem small = decodeProblem(DataType::HALF); + small.headSize = 64; + small.queryHeads = 8; + small.kvHeads = 8; + small.blockSize = 64; + small.numBlocks = 40; + small.maxBlocks = 8; + small.kvLengths = {511, 0, 64, 65}; + run(small); + + Problem large = decodeProblem(DataType::BFLOAT16); + large.headSize = 256; + large.queryHeads = 16; + large.kvHeads = 2; + large.blockSize = 32; + large.numBlocks = 64; + large.maxBlocks = 12; + large.kvLengths = {300, 33, 0, 7}; + run(large); +} + +Problem mixedProblem(DataType type) +{ + Problem p; + p.type = type; + p.ragged = true; + p.raggedMaxLength = 160; + // decode, prefill without context, a padding sequence, chunked prefill with context. + p.queryLengths = {1, 37, 0, 64, 1}; + p.kvLengths = {200, 37, 0, 150, 9}; + p.gapsAfter = {0, 3, 0, 5, 2}; + // Rows past seq_len_q up to the next offset (the gaps, one after the last sequence) + // are addressed by no sequence: the engine must not write them. + // Q as a view of a fused QKV projection. + p.qTokenHeads = 32 + 2 * 8; + return p; +} + +TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryOverPagedKvBf16) +{ + run(mixedProblem(DataType::BFLOAT16)); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryOverPagedKvHalf) +{ + run(mixedProblem(DataType::HALF)); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryWithSlidingWindowAndGqa5) +{ + Problem p = mixedProblem(DataType::BFLOAT16); + p.queryHeads = 40; + p.kvHeads = 8; + p.qTokenHeads = 40 + 16; + p.leftBound = 32; // a vLLM sliding window of 32 keys + run(p); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryWithTotalTokensBeyondSmax) +{ + // Sq (S_max) bounds each sequence, not the batch total, so the kernel's grid-stride + // loop must reach every query block. + Problem p = mixedProblem(DataType::HALF); + p.raggedMaxLength = 64; + p.queryLengths = {64, 64, 64, 64, 64}; + p.kvLengths = {64, 100, 128, 200, 64}; + p.gapsAfter = {}; + run(p); +} + +/// A first origin past 0: the rows before it belong to no sequence and keep the sentinel, +/// and with Sq above seq_len_q the rows after the live one do too. +TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryWithAShiftedFirstOrigin) +{ + for(const int64_t sq : {1, 4}) + { + SCOPED_TRACE("Sq = " + std::to_string(sq)); + Problem p = mixedProblem(DataType::BFLOAT16); + p.raggedMaxLength = sq; + p.queryLengths = {1}; + p.kvLengths = {100}; + p.gapsAfter = {}; + p.raggedOffsets = {64, 65}; + run(p); + if(::testing::Test::HasFatalFailure()) + { + return; + } + } +} + +/// 0 < seq_len_kv < seq_len_q: the bottom-right diagonal of the leading rows sits before +/// the first key, so those rows see no key and must be zero; the later rows each see the +/// keys up to their own diagonal. +TEST_F(IntegrationGpuAttentionPagedUnified, KeylessLeadingRowsWhenSeqLenKvBelowSeqLenQ) +{ + Problem dense = decodeProblem(DataType::BFLOAT16); + dense.denseQueryLength = 5; + dense.queryLengths = {5, 5, 3, 5, 4}; + dense.kvLengths = {2, 1, 40, 4, 0}; + run(dense); + + Problem ragged = mixedProblem(DataType::HALF); + ragged.queryLengths = {5, 37, 0, 64, 3}; + ragged.kvLengths = {2, 37, 0, 150, 1}; + ragged.leftBound = 32; + run(ragged); +} + +/// cuDNN's form: page_table_k and page_table_v are two tensors, and the V of each token +/// sits in another block than its K. +TEST_F(IntegrationGpuAttentionPagedUnified, SeparateKAndVPageTablesDecodeBf16) +{ + Problem p = decodeProblem(DataType::BFLOAT16); + p.separateVTable = true; + run(p); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, SeparateKAndVPageTablesRaggedWithWindowHalf) +{ + Problem p = mixedProblem(DataType::HALF); + p.separateVTable = true; + p.leftBound = 32; + p.setMaxSeqLenKv = false; + run(p); +} +/// One plan, captured once into a HIP graph and replayed with new lengths, new block ids +/// and new data: the engine reads all of them from device memory, so the replay must +/// match a fresh reference every time. +TEST_F(IntegrationGpuAttentionPagedUnified, HipGraphCaptureReplaysWithChangedLengthsAndBlocks) +{ + for(const bool ragged : {false, true}) + { + SCOPED_TRACE(ragged ? "ragged" : "dense"); + const Problem p + = ragged ? mixedProblem(DataType::BFLOAT16) : decodeProblem(DataType::BFLOAT16); + Built built; + build(p, built); + ASSERT_FALSE(::testing::Test::HasFatalFailure()); + auto state = makeState(p, 11); + upload(p, state, built); + // Warm-up outside capture: the first execute on a device loads the module. + ASSERT_TRUE(ok(built.graph->execute(_handle, built.buffers, nullptr))); + ASSERT_EQ(hipStreamSynchronize(_stream), hipSuccess); + + hipGraph_t graph = nullptr; + ASSERT_EQ(hipStreamBeginCapture(_stream, hipStreamCaptureModeThreadLocal), hipSuccess); + const auto status = built.graph->execute(_handle, built.buffers, nullptr); + ASSERT_EQ(hipStreamEndCapture(_stream, &graph), hipSuccess); + ASSERT_TRUE(ok(status)); + hipGraphExec_t exec = nullptr; + ASSERT_EQ(hipGraphInstantiate(&exec, graph, nullptr, nullptr, 0), hipSuccess); + + for(uint32_t step = 0; step < 3; ++step) + { + SCOPED_TRACE(step); + Problem next = p; + // New lengths (B fixed by the plan), new shuffled blocks, new data. + if(ragged) + { + next.queryLengths = {1, static_cast(5 + step), 1, 0, 2}; + next.kvLengths = {static_cast(30 + 50 * step), + static_cast(5 + step), + 300, + 0, + 2}; + next.gapsAfter = {0, 0, 2, 0, 0}; + } + else + { + next.kvLengths = {static_cast(step), + 0, + 383, + static_cast(40 * step + 1), + 16, + 17}; + } + state = makeState(next, 100 + step); + upload(next, state, built); + ASSERT_EQ(hipGraphLaunch(exec, _stream), hipSuccess); + check(next, state, built); + } + ASSERT_EQ(hipGraphExecDestroy(exec), hipSuccess); + ASSERT_EQ(hipGraphDestroy(graph), hipSuccess); + } +} + +} // namespace + +#endif diff --git a/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt b/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt index b0e632e82172..44b8d3531a04 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt @@ -482,20 +482,33 @@ if(HIPDNN_ENABLE_KERNEL_INGESTOR) set(_hkp_model_binding_cases_gfx942_unified_3d TheBoundL2KernelRankerLoads TheBoundL1EnginePredictorLoadsAndMatchesThisBuild) - + # A hand-written TestPacks suite whose cases differ from the generated ones + # lists them under _hkp_packs_cases_. + set(_hkp_packs_cases_AttentionPagedUnified + LoadsExactlyTheEmittedPacks + LoadsExactlyTheEmittedKernels + EveryLoadedDescriptorCoversTheRequestedArch + EveryKernelDeclaresTheEmittedRuntimeSourceKind + DeclaresTheConfiguredSdkVersion + ExposesTheConfiguredKnobs + ShipsNoHeuristicAndRegistersNoScoreSymbol + CarriesOneGraphScopedMatcherPerPack + CarriesExactlyOneSharedKernelScopedMatcher) + + # An engine that ships for several architectures has a row per architecture but one + # Packs suite, and a suite may be declared once, so the rows collect each engine's + # shipped architectures and the Packs census registers after the loop. + set(_hkp_packs_census_engines "") set(_engines ${HKP_PINNED_ATTENTION_ENGINES}) while(_engines) list(POP_FRONT _engines _arch _snake _local _filter_var _toml _categories_var) hkp_product_ships_engine_for_arch(_hkp_${_arch}_attention_${_snake} "hipkernel:${_local}" ${_arch}) if(_hkp_${_arch}_attention_${_snake}) - hkp_register_census_tests( - TARGET hip_kernel_provider_census_tests - PACK_NAME product - ARCHES ${_arch} - SUITES Test${_local}Packs - EXPECTED_CASES ${_hkp_generated_packs_cases} - ) + if(NOT _local IN_LIST _hkp_packs_census_engines) + list(APPEND _hkp_packs_census_engines ${_local}) + endif() + list(APPEND _hkp_packs_census_arches_${_local} ${_arch}) else() message(STATUS "hkp: this configuration does not ship hipkernel:${_local} for " @@ -517,6 +530,20 @@ if(HIPDNN_ENABLE_KERNEL_INGESTOR) unset(_hkp_${_stem}_cases_${_arch}_${_snake}) endwhile() endwhile() + foreach(_local IN LISTS _hkp_packs_census_engines) + if(DEFINED _hkp_packs_cases_${_local}) + set(_cases ${_hkp_packs_cases_${_local}}) + else() + set(_cases ${_hkp_generated_packs_cases}) + endif() + hkp_register_census_tests( + TARGET hip_kernel_provider_census_tests + PACK_NAME product + ARCHES ${_hkp_packs_census_arches_${_local}} + SUITES Test${_local}Packs + EXPECTED_CASES ${_cases} + ) + endforeach() # The loop unsets each row's entries, so one left set names no row and its census would # silently never register. set(_hkp_companion_stems "") @@ -597,7 +624,6 @@ if(HIPDNN_ENABLE_KERNEL_INGESTOR) "hkp: this configuration does not ship hipkernel:Gfx950ConvDgradAot for " "gfx950, so its census is not registered.") endif() - endif() clang_tidy_check(hip_kernel_provider_tests) diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt index c2acf45f8bda..a804852caab6 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt @@ -39,6 +39,7 @@ target_sources(hip_kernel_provider_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx1151WmmaAttentionMatchers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950ConvDgradGeometry.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950ConvDgradMatchers.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestAttentionPagedUnifiedMatchers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestIngestorDispatchAliases.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestPackLaunchValues.cpp ${CMAKE_CURRENT_SOURCE_DIR}/serialization/TestIngestorPlanHeader.cpp @@ -117,6 +118,7 @@ target_sources(hip_kernel_provider_census_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx1151WmmaAttentionPacks.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx1151WmmaAttentionDecodePacks.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950ConvDgradAotPacks.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestAttentionPagedUnifiedPacks.cpp ) # FlyDSL's suites ride FlyDSL's gate, not the ingestor's: they read a shard only FlyDSL diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/TestKernelIngestorEngine.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/TestKernelIngestorEngine.cpp index acd51046ee11..b345be651cf0 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/TestKernelIngestorEngine.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/TestKernelIngestorEngine.cpp @@ -655,6 +655,7 @@ TEST(TestKernelIngestorEngine, EveryHandlerReportsSupportsSavingExactlyWhenItSav "hipkernel.gfx942_attention_dense.dispatch", "hipkernel.gfx1151_wmma_attention.dispatch", "hipkernel.gfx1151_wmma_attention_decode.dispatch", + "hipkernel.attention_paged_unified.dispatch", #ifdef HIPDNN_ENGINE_FLYDSL // FlyDSL's packs, compiled in whenever the production root has FlyDSL content. "hipkernel.flydsl_rmsnorm.dispatch", diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp new file mode 100644 index 000000000000..bfc6105419b3 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp @@ -0,0 +1,831 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#ifdef HIPDNN_ENABLE_KERNEL_INGESTOR + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "engines/kernel_ingestor_engine/IngestorPacks.hpp" +#include "engines/kernel_ingestor_engine/KernelIngestorEngine.hpp" + +/** + * @file TestAttentionPagedUnifiedMatchers.cpp + * @brief Graph and kernel matching for hipkernel:AttentionPagedUnified: the paged + * uniform-decode (dense Q) and ragged-Q graphs it serves, and a logged decline, + * with its cause, for everything else. Matcher-only: no device, no launch. + */ +namespace hip_kernel_provider::kernel_ingestor_engine::testing +{ +namespace +{ + +namespace d = hipdnn_flatbuffers_sdk::data_objects; +using hipdnn_plugin_sdk::ingestor::BoundTokens; +using hipdnn_plugin_sdk::ingestor::DeviceProperties; +using hipdnn_plugin_sdk::ingestor::KernelDefinition; +using hipdnn_plugin_sdk::ingestor::MatchContext; +using hipdnn_plugin_sdk::ingestor::tryGetBoundInt; + +constexpr std::string_view GRAPH_MATCHER_SYMBOL = "hipkernel.attention_paged_unified.graph_match"; +constexpr std::string_view KERNEL_MATCHER_SYMBOL = "hipkernel.attention_paged_unified.kernel_match"; + +constexpr int64_t Q_UID = 1; +constexpr int64_t K_UID = 2; +constexpr int64_t V_UID = 3; +constexpr int64_t O_UID = 4; +constexpr int64_t PAGE_TABLE_UID = 5; +constexpr int64_t SEQ_LEN_KV_UID = 6; +constexpr int64_t SEQ_LEN_Q_UID = 7; +constexpr int64_t RAGGED_OFFSET_UID = 8; +constexpr int64_t EXTRA_UID = 9; + +constexpr int64_t BATCH = 4; +constexpr int64_t QUERY_HEADS = 32; +constexpr int64_t KV_HEADS = 8; +constexpr int64_t HEAD_SIZE = 128; +constexpr int64_t BLOCK_SIZE = 16; +constexpr int64_t NUM_BLOCKS = 1000; +constexpr int64_t MAX_BLOCKS = 64; + +std::unique_ptr + tensor(int64_t uid, d::DataType type, std::vector dims, std::vector strides) +{ + auto t = std::make_unique(); + t->uid = uid; + t->data_type = type; + t->dims = std::move(dims); + t->strides = std::move(strides); + return t; +} + +std::vector packed(const std::vector& dims) +{ + std::vector strides(dims.size(), 1); + for(size_t i = dims.size(); i > 1; --i) + { + strides[i - 2] = strides[i - 1] * dims[i - 1]; + } + return strides; +} + +/** + * The uniform-decode graph the vLLM plugin builds: Q/O `[B, Hq, 1, D]` token-major, + * K/V the interleaved views of one `[num_blocks, Hkv, block_size, 2*D]` cache, one page + * table `[B, 1, M, 1]` (vLLM's block_table view) for both K and V, INT32 seq_len_q and + * seq_len_kv (a paged graph carries both), and bottom-right causal masking. + */ +d::GraphT decodeGraph(d::DataType type = d::DataType::BFLOAT16) +{ + d::GraphT g; + const int64_t tokenStride = QUERY_HEADS * HEAD_SIZE; + g.tensors.push_back(tensor( + Q_UID, type, {BATCH, QUERY_HEADS, 1, HEAD_SIZE}, {tokenStride, HEAD_SIZE, tokenStride, 1})); + const std::vector kvStrides + = {KV_HEADS * BLOCK_SIZE * 2 * HEAD_SIZE, BLOCK_SIZE * 2 * HEAD_SIZE, 2 * HEAD_SIZE, 1}; + g.tensors.push_back( + tensor(K_UID, type, {NUM_BLOCKS, KV_HEADS, BLOCK_SIZE, HEAD_SIZE}, kvStrides)); + g.tensors.push_back( + tensor(V_UID, type, {NUM_BLOCKS, KV_HEADS, BLOCK_SIZE, HEAD_SIZE}, kvStrides)); + g.tensors.push_back(tensor( + O_UID, type, {BATCH, QUERY_HEADS, 1, HEAD_SIZE}, {tokenStride, HEAD_SIZE, tokenStride, 1})); + g.tensors.push_back(tensor(PAGE_TABLE_UID, + d::DataType::INT32, + {BATCH, 1, MAX_BLOCKS, 1}, + {MAX_BLOCKS, MAX_BLOCKS, 1, 1})); + g.tensors.push_back(tensor(SEQ_LEN_KV_UID, d::DataType::INT32, {BATCH, 1, 1, 1}, {1, 1, 1, 1})); + g.tensors.push_back(tensor(SEQ_LEN_Q_UID, d::DataType::INT32, {BATCH, 1, 1, 1}, {1, 1, 1, 1})); + + d::SdpaAttributesT a; + a.q_tensor_uid = Q_UID; + a.k_tensor_uid = K_UID; + a.v_tensor_uid = V_UID; + a.o_tensor_uid = O_UID; + a.page_table_k_tensor_uid = PAGE_TABLE_UID; + a.page_table_v_tensor_uid = PAGE_TABLE_UID; + a.seq_len_kv_tensor_uid = SEQ_LEN_KV_UID; + a.seq_len_q_tensor_uid = SEQ_LEN_Q_UID; + a.max_seq_len_kv = static_cast(MAX_BLOCKS * BLOCK_SIZE); + a.padding_mask = true; + a.right_bound = 0; + a.diagonal_alignment = d::DiagonalAlignment::BOTTOM_RIGHT; + a.attn_scale_value = 0.08838835F; + auto n = std::make_unique(); + n->compute_data_type = d::DataType::FLOAT; + n->attributes.Set(a); + g.nodes.push_back(std::move(n)); + return g; +} + +/// The mixed-batch graph: Q/O ragged at the sequence axis through one token-unit +/// offset table (multiplier = token stride). +d::GraphT raggedGraph() +{ + auto g = decodeGraph(); + const int64_t maxTokens = 2048; + // Q is a view of a fused QKV projection: token stride (Hq + 2 Hkv) * D. + const int64_t qTokenStride = (QUERY_HEADS + 2 * KV_HEADS) * HEAD_SIZE; + auto& q = *g.tensors[0]; + q.dims = {BATCH, QUERY_HEADS, maxTokens, HEAD_SIZE}; + q.strides = {maxTokens * qTokenStride, HEAD_SIZE, qTokenStride, 1}; + q.ragged_offset_tensor_uid = RAGGED_OFFSET_UID; + q.ragged_offset_multiplier = qTokenStride; + auto& o = *g.tensors[3]; + const int64_t oTokenStride = QUERY_HEADS * HEAD_SIZE; + o.dims = {BATCH, QUERY_HEADS, maxTokens, HEAD_SIZE}; + o.strides = {maxTokens * oTokenStride, HEAD_SIZE, oTokenStride, 1}; + o.ragged_offset_tensor_uid = RAGGED_OFFSET_UID; + o.ragged_offset_multiplier = oTokenStride; + g.tensors.push_back( + tensor(RAGGED_OFFSET_UID, d::DataType::INT32, {BATCH + 1, 1, 1, 1}, {1, 1, 1, 1})); + return g; +} + +DeviceProperties deviceProperties() +{ + DeviceProperties properties; + properties.gcnArchName = "gfx942"; + properties.warpSize = 64; + return properties; +} + +d::SdpaAttributesT& attrs(d::GraphT& g) +{ + return *g.nodes[0]->attributes.AsSdpaAttributes(); +} + +d::TensorAttributesT& find(d::GraphT& g, int64_t uid) +{ + for(auto& t : g.tensors) + { + if(t->uid == uid) + { + return *t; + } + } + throw std::runtime_error("no tensor " + std::to_string(uid)); +} + +using Mutation = std::function; + +std::optional match(d::GraphT g, const Mutation& change = {}) +{ + registerNativeIngestorSymbols(); + if(change) + { + change(g); + } + flatbuffers::FlatBufferBuilder builder; + builder.Finish(d::Graph::Pack(builder, &g)); + const hipdnn_flatbuffers_sdk::flatbuffer_utilities::GraphWrapper wrapper( + builder.GetBufferPointer(), builder.GetSize()); + const auto properties = deviceProperties(); + const MatchContext context{wrapper, 0, properties}; + return hipdnn_plugin_sdk::ingestor::GraphMatchRegistry::resolve( + std::string(GRAPH_MATCHER_SYMBOL))(context); +} + +struct LoggedDecline +{ + std::string cause; + std::string detail; +}; + +/// The decline graph_match logged at INFO, or an empty cause. +LoggedDecline loggedDecline(d::GraphT g, const Mutation& change) +{ + const std::string marker + = std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + " declined the graph ["; + const auto recorder + = hipdnn_test_sdk::utilities::SharedLogRecorder::withOverrideLevel(HIPDNN_SEV_INFO); + EXPECT_FALSE(match(std::move(g), change).has_value()); + for(const auto& log : recorder.getRecordedLogs()) + { + const auto at = log.message.find(marker); + const auto end = at == std::string::npos ? at : log.message.find(']', at + marker.size()); + if(log.severity == HIPDNN_SEV_INFO && end != std::string::npos) + { + return {log.message.substr(at + marker.size(), end - at - marker.size()), + log.message.substr(end + 1)}; + } + } + return {}; +} + +KernelDefinition kernel(const std::string& dtype, + int64_t headSize, + int64_t blockSize, + int64_t queriesPerKv, + int64_t numWarps = 1, + int64_t kvHeads = 1) +{ + KernelDefinition k; + k.kernelId + = hipdnn_flatbuffers_sdk::utilities::parseUuid("00000000-0000-4000-8000-0000000000a1"); + k.metadata = { + {std::string("dtype"), dtype}, + {std::string("head_size"), headSize}, + {std::string("block_size"), blockSize}, + {std::string("num_query_heads"), queriesPerKv}, + {std::string("num_kv_heads"), kvHeads}, + {std::string("num_warps"), numWarps}, + {std::string("block_m_per_warp"), int64_t{16}}, + }; + return k; +} + +bool kernelMatches(const d::GraphT& g, const KernelDefinition& candidate) +{ + registerNativeIngestorSymbols(); + flatbuffers::FlatBufferBuilder builder; + builder.Finish(d::Graph::Pack(builder, &g)); + const hipdnn_flatbuffers_sdk::flatbuffer_utilities::GraphWrapper wrapper( + builder.GetBufferPointer(), builder.GetSize()); + const auto properties = deviceProperties(); + const MatchContext context{wrapper, 0, properties}; + const auto bound = hipdnn_plugin_sdk::ingestor::GraphMatchRegistry::resolve( + std::string(GRAPH_MATCHER_SYMBOL))(context); + EXPECT_TRUE(bound.has_value()); + if(!bound.has_value()) + { + return false; + } + return hipdnn_plugin_sdk::ingestor::KernelMatcherRegistry::resolve( + std::string(KERNEL_MATCHER_SYMBOL))(context, *bound, candidate); +} + +TEST(TestAttentionPagedUnifiedMatchers, ServesPagedUniformDecode) +{ + const auto bound = match(decodeGraph()); + ASSERT_TRUE(bound.has_value()); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.queries_per_kv"), 4); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.block_size"), BLOCK_SIZE); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.ragged_offset.uid"), -1); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.seq_len_q.uid"), SEQ_LEN_Q_UID); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.window"), 0x3FFFFFFF); +} + +/// Sq = 3 rows per sequence with seq_len_q below it for some: the padded rows are the +/// kernel's to zero. +TEST(TestAttentionPagedUnifiedMatchers, ServesSpeculativeDecodeRowsWithSeqLenQ) +{ + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + for(const auto uid : {Q_UID, O_UID}) + { + auto& t = find(g, uid); + t.dims[2] = 3; + t.strides + = {3 * QUERY_HEADS * HEAD_SIZE, HEAD_SIZE, QUERY_HEADS * HEAD_SIZE, 1}; + } + }).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, ServesRaggedQueryOverPagedKv) +{ + const auto bound = match(raggedGraph()); + ASSERT_TRUE(bound.has_value()); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.ragged_offset.uid"), + RAGGED_OFFSET_UID); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.seq_len_q.uid"), SEQ_LEN_Q_UID); +} + +/// cuDNN's form: page_table_v is its own tensor (EXTRA_UID), [B, 1, M, 1] with K's width +/// and batch stride unless @p dims / @p strides say otherwise. +void useSeparateVTable(d::GraphT& g, + std::vector dims = {BATCH, 1, MAX_BLOCKS, 1}, + std::vector strides = {MAX_BLOCKS, MAX_BLOCKS, 1, 1}) +{ + g.tensors.push_back(tensor(EXTRA_UID, d::DataType::INT32, std::move(dims), std::move(strides))); + attrs(g).page_table_v_tensor_uid = EXTRA_UID; +} + +TEST(TestAttentionPagedUnifiedMatchers, ServesSeparateKAndVPageTables) +{ + const auto bound = match(decodeGraph(), [](d::GraphT& g) { useSeparateVTable(g); }); + ASSERT_TRUE(bound.has_value()); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.page_table_k.uid"), PAGE_TABLE_UID); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.page_table_v.uid"), EXTRA_UID); + // One tensor for both binds the same uid twice. + const auto shared = match(decodeGraph()); + ASSERT_TRUE(shared.has_value()); + EXPECT_EQ(tryGetBoundInt(*shared, "attention_paged_unified.page_table_v.uid"), PAGE_TABLE_UID); + // A ragged Q with an unset max_seq_len_kv, as #14358's paged bundles build it. + EXPECT_TRUE(match(raggedGraph(), [](d::GraphT& g) { + useSeparateVTable(g); + attrs(g).max_seq_len_kv = flatbuffers::nullopt; + }).has_value()); + // A unit-extent batch makes the batch strides irrelevant. + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + for(const auto uid : + {Q_UID, O_UID, PAGE_TABLE_UID, SEQ_LEN_KV_UID, SEQ_LEN_Q_UID}) + { + find(g, uid).dims[0] = 1; + } + useSeparateVTable(g, {1, 1, MAX_BLOCKS, 1}, {7 * MAX_BLOCKS, 1, 1, 1}); + }).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, ServesDenseAndRaggedBatchesPast65536Sequences) +{ + // A dense Q indexes its sequence from the grid; a ragged Q's sequence search takes its + // trip count from the batch at run time. Neither has a sequence limit below int32. + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + for(const auto uid : + {Q_UID, O_UID, PAGE_TABLE_UID, SEQ_LEN_KV_UID, SEQ_LEN_Q_UID}) + { + find(g, uid).dims[0] = 65537; + } + }).has_value()); + EXPECT_TRUE(match(raggedGraph(), [](d::GraphT& g) { + for(const auto uid : + {Q_UID, O_UID, PAGE_TABLE_UID, SEQ_LEN_KV_UID, SEQ_LEN_Q_UID}) + { + find(g, uid).dims[0] = 65537; + } + find(g, RAGGED_OFFSET_UID).dims[0] = 65538; + }).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, ServesSlidingWindowsAndDeprecatedBottomRightFlag) +{ + const auto bound = match(decodeGraph(), [](d::GraphT& g) { attrs(g).left_bound = 4096; }); + ASSERT_TRUE(bound.has_value()); + // left_bound L keeps the L keys ending at the diagonal (cuDNN); the kernel keeps + // key k for diagonal d iff d - k < window, so window = L. + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.window"), 4096); + EXPECT_EQ(tryGetBoundInt(*match(decodeGraph(), [](d::GraphT& g) { attrs(g).left_bound = 1; }), + "attention_paged_unified.window"), + 1); + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + attrs(g).right_bound = flatbuffers::nullopt; + attrs(g).diagonal_alignment = d::DiagonalAlignment::TOP_LEFT; + attrs(g).causal_mask_bottom_right = true; + }).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, ServesAnUnsetMaxSeqLenKv) +{ + // The kernel reads only seq_len_kv; the extent cuDNN infers (M * block_size) bounds + // it as a set max_seq_len_kv would. + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + attrs(g).max_seq_len_kv = flatbuffers::nullopt; + }).has_value()); + EXPECT_TRUE(match(raggedGraph(), [](d::GraphT& g) { + attrs(g).max_seq_len_kv = flatbuffers::nullopt; + }).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, ServesOtherContainerLayoutsAndHalf) +{ + // Plain NHD caches: [num_blocks, block_size, Hkv, D] contiguous. + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + for(const auto uid : {K_UID, V_UID}) + { + find(g, uid).strides = { + BLOCK_SIZE * KV_HEADS * HEAD_SIZE, HEAD_SIZE, KV_HEADS * HEAD_SIZE, 1}; + } + }).has_value()); + // HND: packed [num_blocks, Hkv, block_size, D]. + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + for(const auto uid : {K_UID, V_UID}) + { + find(g, uid).strides + = packed({NUM_BLOCKS, KV_HEADS, BLOCK_SIZE, HEAD_SIZE}); + } + }).has_value()); + EXPECT_TRUE(match(decodeGraph(d::DataType::HALF)).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, IgnoresStridesOfUnitExtentAxes) +{ + EXPECT_TRUE(match(decodeGraph(), [](d::GraphT& g) { + find(g, Q_UID).strides[2] = 7; // Sq == 1 + find(g, PAGE_TABLE_UID).strides[1] = 3; + }).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, MatchesOnlyTheCandidateBuiltForTheGraph) +{ + EXPECT_TRUE(kernelMatches(decodeGraph(), kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4))); + EXPECT_FALSE(kernelMatches(decodeGraph(), kernel("FP16", HEAD_SIZE, BLOCK_SIZE, 4))); + EXPECT_FALSE(kernelMatches(decodeGraph(), kernel("BF16", 64, BLOCK_SIZE, 4))); + EXPECT_FALSE(kernelMatches(decodeGraph(), kernel("BF16", HEAD_SIZE, 32, 4))); + EXPECT_FALSE(kernelMatches(decodeGraph(), kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 8))); + // A candidate not built for runtime head counts (num_kv_heads != 1) never matches. + EXPECT_FALSE(kernelMatches(decodeGraph(), kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4, 1, 2))); + // Nor one whose geometry has no query rows per block. + EXPECT_FALSE(kernelMatches(decodeGraph(), kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4, 0))); + KernelDefinition incomplete = kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4); + incomplete.metadata.erase("num_warps"); + EXPECT_FALSE(kernelMatches(decodeGraph(), incomplete)); +} + +struct DeclineCase +{ + const char* name; + std::function graph; + Mutation change; + const char* cause; +}; + +TEST(TestAttentionPagedUnifiedMatchers, DeclinesWithALoggedCause) +{ + const auto decode = [] { return decodeGraph(); }; + const auto ragged = [] { return raggedGraph(); }; + const std::vector cases = { + {"no page tables", + decode, + [](d::GraphT& g) { + attrs(g).page_table_k_tensor_uid = flatbuffers::nullopt; + attrs(g).page_table_v_tensor_uid = flatbuffers::nullopt; + }, + "not_paged"}, + {"only K paged", + decode, + [](d::GraphT& g) { attrs(g).page_table_v_tensor_uid = flatbuffers::nullopt; }, + "one_sided_paging"}, + {"only V paged", + decode, + [](d::GraphT& g) { attrs(g).page_table_k_tensor_uid = flatbuffers::nullopt; }, + "one_sided_paging"}, + {"K and V page tables of different widths", + decode, + [](d::GraphT& g) { + useSeparateVTable(g, {BATCH, 1, MAX_BLOCKS / 2, 1}, {MAX_BLOCKS, MAX_BLOCKS, 1, 1}); + }, + "page_table"}, + {"K and V page tables with different batch strides", + decode, + [](d::GraphT& g) { + useSeparateVTable( + g, {BATCH, 1, MAX_BLOCKS, 1}, {2 * MAX_BLOCKS, 2 * MAX_BLOCKS, 1, 1}); + }, + "page_table"}, + {"int64 page table", + decode, + [](d::GraphT& g) { find(g, PAGE_TABLE_UID).data_type = d::DataType::INT64; }, + "page_table"}, + {"int64 V page table", + decode, + [](d::GraphT& g) { + useSeparateVTable(g); + find(g, EXTRA_UID).data_type = d::DataType::INT64; + }, + "page_table"}, + {"strided page-table entries", + decode, + [](d::GraphT& g) { find(g, PAGE_TABLE_UID).strides = {2 * MAX_BLOCKS, 1, 2, 1}; }, + "page_table"}, + {"packed page table", + ragged, + [](d::GraphT& g) { find(g, PAGE_TABLE_UID).ragged_offset_tensor_uid = RAGGED_OFFSET_UID; }, + "page_table"}, + {"packed V page table", + ragged, + [](d::GraphT& g) { + useSeparateVTable(g); + find(g, EXTRA_UID).ragged_offset_tensor_uid = RAGGED_OFFSET_UID; + }, + "page_table"}, + {"fp32", + decode, + [](d::GraphT& g) { + for(auto& t : g.tensors) + { + if(t->data_type == d::DataType::BFLOAT16) + { + t->data_type = d::DataType::FLOAT; + } + } + }, + "data_type"}, + {"mixed dtypes", + decode, + [](d::GraphT& g) { find(g, O_UID).data_type = d::DataType::HALF; }, + "data_type"}, + {"half compute", + decode, + [](d::GraphT& g) { g.nodes[0]->compute_data_type = d::DataType::HALF; }, + "compute_data_type"}, + {"head size 96", + decode, + [](d::GraphT& g) { + for(auto& t : g.tensors) + { + if(t->uid <= O_UID) + { + t->dims[3] = 96; + } + } + }, + "head_size"}, + {"block size 8", + decode, + [](d::GraphT& g) { + find(g, K_UID).dims[2] = 8; + find(g, V_UID).dims[2] = 8; + }, + "block_size"}, + {"K and V block sizes differ, each with its own table (cuDNN's form)", + decode, + [](d::GraphT& g) { + useSeparateVTable( + g, {BATCH, 1, MAX_BLOCKS / 2, 1}, {MAX_BLOCKS / 2, MAX_BLOCKS / 2, 1, 1}); + attrs(g).max_seq_len_kv = flatbuffers::nullopt; + find(g, V_UID).dims[2] = 2 * BLOCK_SIZE; + }, + "block_size"}, + {"K and V block sizes differ over one table", + decode, + [](d::GraphT& g) { + attrs(g).max_seq_len_kv = flatbuffers::nullopt; + find(g, V_UID).dims[2] = 2 * BLOCK_SIZE; + }, + "block_size"}, + {"gqa 3", + decode, + [](d::GraphT& g) { + find(g, K_UID).dims[1] = 4; + find(g, V_UID).dims[1] = 4; + find(g, Q_UID).dims[1] = 12; + find(g, O_UID).dims[1] = 12; + }, + "gqa"}, + {"unequal K/V strides", + decode, + [](d::GraphT& g) { + find(g, V_UID).strides = packed({NUM_BLOCKS, KV_HEADS, BLOCK_SIZE, HEAD_SIZE}); + }, + "kv_layout"}, + {"misaligned K token stride", + decode, + [](d::GraphT& g) { + find(g, K_UID).strides[2] = 2 * HEAD_SIZE + 4; + find(g, V_UID).strides[2] = 2 * HEAD_SIZE + 4; + }, + "kv_layout"}, + {"misaligned Q head stride", + decode, + [](d::GraphT& g) { find(g, Q_UID).strides[1] = HEAD_SIZE + 4; }, + "layout"}, + {"no seq_len_kv", + decode, + [](d::GraphT& g) { attrs(g).seq_len_kv_tensor_uid = flatbuffers::nullopt; }, + "seq_len_kv"}, + {"seq_len_kv shape", + decode, + [](d::GraphT& g) { find(g, SEQ_LEN_KV_UID).dims = {1, BATCH, 1, 1}; }, + "seq_len_kv"}, + {"no seq_len_q (a paged graph carries both lengths)", + decode, + [](d::GraphT& g) { attrs(g).seq_len_q_tensor_uid = flatbuffers::nullopt; }, + "seq_len_q"}, + {"seq_len_q shape", + decode, + [](d::GraphT& g) { find(g, SEQ_LEN_Q_UID).dims = {1, BATCH, 1, 1}; }, + "seq_len_q"}, + {"no seq_len_q on a ragged Q", + ragged, + [](d::GraphT& g) { attrs(g).seq_len_q_tensor_uid = flatbuffers::nullopt; }, + "seq_len_q"}, + {"ragged Q only", + ragged, + [](d::GraphT& g) { find(g, O_UID).ragged_offset_tensor_uid = flatbuffers::nullopt; }, + "ragged"}, + {"int64 offsets", + ragged, + [](d::GraphT& g) { find(g, RAGGED_OFFSET_UID).data_type = d::DataType::INT64; }, + "ragged"}, + {"misaligned multiplier", + ragged, + [](d::GraphT& g) { find(g, Q_UID).ragged_offset_multiplier = 4100; }, + "layout"}, + {"zero multiplier", + ragged, + [](d::GraphT& g) { + find(g, Q_UID).ragged_offset_multiplier = 0; + find(g, O_UID).ragged_offset_multiplier = 0; + }, + "layout"}, + // RFC 0014 allows offsets in other units than tokens; the kernel reads them as + // token counts, so a multiplier other than the token stride is declined. + {"Q offsets in half-token units", + ragged, + [](d::GraphT& g) { + auto& q = find(g, Q_UID); + q.ragged_offset_multiplier = q.strides[2] / 2; + }, + "ragged"}, + {"O offsets in two-token units", + ragged, + [](d::GraphT& g) { + auto& o = find(g, O_UID); + o.ragged_offset_multiplier = o.strides[2] * 2; + }, + "ragged"}, + {"ragged K", + ragged, + [](d::GraphT& g) { find(g, K_UID).ragged_offset_tensor_uid = RAGGED_OFFSET_UID; }, + "ragged"}, + {"ragged V", + ragged, + [](d::GraphT& g) { find(g, V_UID).ragged_offset_tensor_uid = RAGGED_OFFSET_UID; }, + "ragged"}, + {"B offsets instead of B+1", + ragged, + [](d::GraphT& g) { find(g, RAGGED_OFFSET_UID).dims[0] = BATCH; }, + "ragged"}, + {"K/V block span past the buffer range", + decode, + [](d::GraphT& g) { + // (Hkv - 1) * head stride elements: within int32 strides, past 0x7FFF0000 + // bytes for one block. + find(g, K_UID).strides[1] = 0x10000000; + find(g, V_UID).strides[1] = 0x10000000; + }, + "size_limit"}, + {"page table past its buffer range", + decode, + [](d::GraphT& g) { + // (B - 1) * stride + M entries: within int32, past 0x7FFF0000 bytes. + find(g, PAGE_TABLE_UID).strides[0] = 0x0B000000; + }, + "size_limit"}, + {"top-left causal", + decode, + [](d::GraphT& g) { attrs(g).diagonal_alignment = d::DiagonalAlignment::TOP_LEFT; }, + "mask"}, + {"no mask", + decode, + [](d::GraphT& g) { attrs(g).right_bound = flatbuffers::nullopt; }, + "mask"}, + {"left bound 0 (outside hipDNN's band domain)", + decode, + [](d::GraphT& g) { attrs(g).left_bound = 0; }, + "mask"}, + {"right bound 2", decode, [](d::GraphT& g) { attrs(g).right_bound = 2; }, "mask"}, + {"sinks", + decode, + [](d::GraphT& g) { attrs(g).sink_token_tensor_uid = EXTRA_UID; }, + "sinks"}, + {"alibi", decode, [](d::GraphT& g) { attrs(g).alibi_mask = true; }, "alibi_mask"}, + {"fp8 descale", + decode, + [](d::GraphT& g) { attrs(g).descale_k_tensor_uid = EXTRA_UID; }, + "fp8"}, + {"stats", decode, [](d::GraphT& g) { attrs(g).generate_stats = true; }, "stats"}, + {"dropout", decode, [](d::GraphT& g) { attrs(g).dropout_probability = 0.1F; }, "dropout"}, + {"bias", + decode, + [](d::GraphT& g) { attrs(g).attn_mask_tensor_uid = EXTRA_UID; }, + "attn_mask"}, + {"scale tensor", + decode, + [](d::GraphT& g) { attrs(g).scale_tensor_uid = EXTRA_UID; }, + "scale_tensor"}, + {"block mask", + decode, + [](d::GraphT& g) { attrs(g).block_mask_tensor_uid = EXTRA_UID; }, + "block_mask"}, + {"implementation", + decode, + [](d::GraphT& g) { attrs(g).implementation = d::AttentionImplementation::COMPOSITE; }, + "implementation"}, + {"override shapes", + decode, + [](d::GraphT& g) { g.is_override_shape_enabled = true; }, + "node"}, + {"virtual K", decode, [](d::GraphT& g) { find(g, K_UID).virtual_ = true; }, "operand"}, + }; + for(const auto& testCase : cases) + { + SCOPED_TRACE(testCase.name); + const auto decline = loggedDecline(testCase.graph(), testCase.change); + EXPECT_EQ(decline.cause, testCase.cause) << decline.detail; + EXPECT_FALSE(decline.detail.empty()); + } +} + +/// Sets @p uid's declared device-pointer alignment to @p bytes. +Mutation declaringAlignment(int64_t uid, int64_t bytes) +{ + return [uid, bytes](d::GraphT& g) { find(g, uid).alignment = bytes; }; +} + +// The kernels load Q / K / V / O as 16-byte vectors and the INT32 operands as 4-byte +// words. A graph may declare a lower pointer alignment (engine API 1.3.0, which the +// engine's 1.4.0 admits); the matcher declines it with its cause, so hipDNN can pick +// another engine at plan time instead of the plan failing at execute. +TEST(TestAttentionPagedUnifiedMatchers, DeclinesOperandsDeclaringLessThanTheKernelsLoad) +{ + const auto decode = [] { return decodeGraph(); }; + const auto ragged = [] { return raggedGraph(); }; + const auto separate = [] { + auto g = decodeGraph(); + useSeparateVTable(g); + return g; + }; + const std::vector>> graphs + = {{"decode", decode}, {"ragged", ragged}, {"separate V table", separate}}; + + // A wider declaration than the kernels load is served. + for(const auto& [name, graph] : graphs) + { + SCOPED_TRACE(name); + EXPECT_TRUE(match(graph(), [](d::GraphT& g) { + for(auto& t : g.tensors) + { + t->alignment = t->data_type == d::DataType::INT32 ? 4 : 32; + } + }).has_value()); + } + + for(const int64_t uid : {Q_UID, K_UID, V_UID, O_UID}) + { + for(const int64_t bytes : {8, 24}) + { + for(const auto& [name, graph] : graphs) + { + SCOPED_TRACE(std::string(name) + ", uid " + std::to_string(uid) + ", " + + std::to_string(bytes) + " bytes"); + const auto decline = loggedDecline(graph(), declaringAlignment(uid, bytes)); + EXPECT_EQ(decline.cause, "alignment") << decline.detail; + EXPECT_NE(decline.detail.find("declares a " + std::to_string(bytes) + "-byte"), + std::string::npos) + << decline.detail; + } + } + } + + struct WordCase + { + const char* role; + std::function graph; + int64_t uid; + }; + const std::vector words = {{"page_table_k", decode, PAGE_TABLE_UID}, + {"page_table_v", separate, EXTRA_UID}, + {"seq_len_kv", decode, SEQ_LEN_KV_UID}, + {"seq_len_q", decode, SEQ_LEN_Q_UID}, + {"ragged_offset", ragged, RAGGED_OFFSET_UID}}; + for(const auto& word : words) + { + SCOPED_TRACE(word.role); + const auto decline = loggedDecline(word.graph(), declaringAlignment(word.uid, 2)); + EXPECT_EQ(decline.cause, "alignment") << decline.detail; + EXPECT_NE(decline.detail.find(std::string(word.role) + " declares a 2-byte alignment"), + std::string::npos) + << decline.detail; + } +} + +/// The kernel reads stored offsets as token counts, so a ragged Q or O whose offsets +/// are in other units (RFC 0014's ragged_offset_multiplier != token stride) is declined, +/// and the log names the multiplier. vLLM's multiplier is the token stride, which matches. +TEST(TestAttentionPagedUnifiedMatchers, DeclinesARaggedMultiplierOtherThanTheTokenStride) +{ + const auto decline = loggedDecline(raggedGraph(), [](d::GraphT& g) { + for(const auto uid : {Q_UID, O_UID}) + { + auto& t = find(g, uid); + t.ragged_offset_multiplier = t.strides[2] / 4; + } + }); + EXPECT_EQ(decline.cause, "ragged") << decline.detail; + EXPECT_NE(decline.detail.find("ragged_offset_multiplier"), std::string::npos) << decline.detail; + EXPECT_NE(decline.detail.find("token"), std::string::npos) << decline.detail; +} + +TEST(TestAttentionPagedUnifiedMatchers, LogsNoDeclineForAGraphItServes) +{ + const auto recorder + = hipdnn_test_sdk::utilities::SharedLogRecorder::withOverrideLevel(HIPDNN_SEV_INFO); + EXPECT_TRUE(match(decodeGraph()).has_value()); + EXPECT_TRUE(match(raggedGraph()).has_value()); + EXPECT_FALSE(recorder.hasLogContaining(std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + + " declined the graph")); +} + +} // namespace +} // namespace hip_kernel_provider::kernel_ingestor_engine::testing + +#endif // HIPDNN_ENABLE_KERNEL_INGESTOR diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp new file mode 100644 index 000000000000..7d104f0d1784 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp @@ -0,0 +1,519 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#ifdef HIPDNN_ENABLE_KERNEL_INGESTOR + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "engines/kernel_ingestor_engine/IngestorPacks.hpp" +#include "engines/kernel_ingestor_engine/KernelIngestorEngine.hpp" + +/** + * @file TestAttentionPagedUnifiedPacks.cpp + * @brief A census of what hipkernel:AttentionPagedUnified actually loads, read through + * hip_kernel_provider::kernel_ingestor_engine::discoverDescriptorSets(), + * which runs the provider's real typed registration before validating and + * loading, so a pack whose native symbols do not register drops out here + * rather than at first dispatch on a device. + * + * The expectations are rendered from the finalized emitted-bundle inventory -- the + * documents this run wrote, after metadata resolution, the resolved-knob check and + * engine-wide de-duplication -- not from the authored config, whose pack file stems are + * not the pack names the loader reports. + * + * This file belongs to the census binary, hip_kernel_provider_census_tests, not to the + * ordinary unit binary: every case below needs a descriptor shard and the census + * environment. The generated matcher test is the one that stays in + * hip_kernel_provider_tests. + * + * Register one entry with hkp_register_census_tests(), which documents its own + * arguments, in src/tests/CMakeLists.txt beside hkp_verify_embedded_sources(). + * + * Generated by IngestorGenerator. + */ +namespace +{ + +using namespace hip_kernel_provider::kernel_ingestor_engine; +namespace ingestor = hipdnn_plugin_sdk::ingestor; + +/// One architecture's row of the emitted inventory. +struct ExpectedInventory +{ + std::set packNames; + std::set kernelNames; +}; + +/// Wildcard key: descriptors naming no architecture ship for every device, so they +/// cannot be filed under a concrete id. +constexpr const char* ARCH_WILDCARD = "*"; + +/// The emitted inventory, keyed by architecture. +const std::map& expectedByArch() +{ + static const std::map s_expected = { + {"gfx942", + ExpectedInventory{ + { + "hipkernel:attention_paged_unified_gfx942", + }, + { + "paged_unified.bf16_d128_bs16_g1.gfx942", + "paged_unified.bf16_d128_bs16_g16.gfx942", + "paged_unified.bf16_d128_bs16_g2.gfx942", + "paged_unified.bf16_d128_bs16_g4.gfx942", + "paged_unified.bf16_d128_bs16_g5.gfx942", + "paged_unified.bf16_d128_bs16_g6.gfx942", + "paged_unified.bf16_d128_bs16_g7.gfx942", + "paged_unified.bf16_d128_bs16_g8.gfx942", + "paged_unified.bf16_d128_bs32_g1.gfx942", + "paged_unified.bf16_d128_bs32_g16.gfx942", + "paged_unified.bf16_d128_bs32_g2.gfx942", + "paged_unified.bf16_d128_bs32_g4.gfx942", + "paged_unified.bf16_d128_bs32_g5.gfx942", + "paged_unified.bf16_d128_bs32_g6.gfx942", + "paged_unified.bf16_d128_bs32_g7.gfx942", + "paged_unified.bf16_d128_bs32_g8.gfx942", + "paged_unified.bf16_d128_bs64_g1.gfx942", + "paged_unified.bf16_d128_bs64_g16.gfx942", + "paged_unified.bf16_d128_bs64_g2.gfx942", + "paged_unified.bf16_d128_bs64_g4.gfx942", + "paged_unified.bf16_d128_bs64_g5.gfx942", + "paged_unified.bf16_d128_bs64_g6.gfx942", + "paged_unified.bf16_d128_bs64_g7.gfx942", + "paged_unified.bf16_d128_bs64_g8.gfx942", + "paged_unified.bf16_d256_bs16_g1.gfx942", + "paged_unified.bf16_d256_bs16_g16.gfx942", + "paged_unified.bf16_d256_bs16_g2.gfx942", + "paged_unified.bf16_d256_bs16_g4.gfx942", + "paged_unified.bf16_d256_bs16_g5.gfx942", + "paged_unified.bf16_d256_bs16_g6.gfx942", + "paged_unified.bf16_d256_bs16_g7.gfx942", + "paged_unified.bf16_d256_bs16_g8.gfx942", + "paged_unified.bf16_d256_bs32_g1.gfx942", + "paged_unified.bf16_d256_bs32_g16.gfx942", + "paged_unified.bf16_d256_bs32_g2.gfx942", + "paged_unified.bf16_d256_bs32_g4.gfx942", + "paged_unified.bf16_d256_bs32_g5.gfx942", + "paged_unified.bf16_d256_bs32_g6.gfx942", + "paged_unified.bf16_d256_bs32_g7.gfx942", + "paged_unified.bf16_d256_bs32_g8.gfx942", + "paged_unified.bf16_d256_bs64_g1.gfx942", + "paged_unified.bf16_d256_bs64_g16.gfx942", + "paged_unified.bf16_d256_bs64_g2.gfx942", + "paged_unified.bf16_d256_bs64_g4.gfx942", + "paged_unified.bf16_d256_bs64_g5.gfx942", + "paged_unified.bf16_d256_bs64_g6.gfx942", + "paged_unified.bf16_d256_bs64_g7.gfx942", + "paged_unified.bf16_d256_bs64_g8.gfx942", + "paged_unified.bf16_d64_bs16_g1.gfx942", + "paged_unified.bf16_d64_bs16_g16.gfx942", + "paged_unified.bf16_d64_bs16_g2.gfx942", + "paged_unified.bf16_d64_bs16_g4.gfx942", + "paged_unified.bf16_d64_bs16_g5.gfx942", + "paged_unified.bf16_d64_bs16_g6.gfx942", + "paged_unified.bf16_d64_bs16_g7.gfx942", + "paged_unified.bf16_d64_bs16_g8.gfx942", + "paged_unified.bf16_d64_bs32_g1.gfx942", + "paged_unified.bf16_d64_bs32_g16.gfx942", + "paged_unified.bf16_d64_bs32_g2.gfx942", + "paged_unified.bf16_d64_bs32_g4.gfx942", + "paged_unified.bf16_d64_bs32_g5.gfx942", + "paged_unified.bf16_d64_bs32_g6.gfx942", + "paged_unified.bf16_d64_bs32_g7.gfx942", + "paged_unified.bf16_d64_bs32_g8.gfx942", + "paged_unified.bf16_d64_bs64_g1.gfx942", + "paged_unified.bf16_d64_bs64_g16.gfx942", + "paged_unified.bf16_d64_bs64_g2.gfx942", + "paged_unified.bf16_d64_bs64_g4.gfx942", + "paged_unified.bf16_d64_bs64_g5.gfx942", + "paged_unified.bf16_d64_bs64_g6.gfx942", + "paged_unified.bf16_d64_bs64_g7.gfx942", + "paged_unified.bf16_d64_bs64_g8.gfx942", + "paged_unified.fp16_d128_bs16_g1.gfx942", + "paged_unified.fp16_d128_bs16_g16.gfx942", + "paged_unified.fp16_d128_bs16_g2.gfx942", + "paged_unified.fp16_d128_bs16_g4.gfx942", + "paged_unified.fp16_d128_bs16_g5.gfx942", + "paged_unified.fp16_d128_bs16_g6.gfx942", + "paged_unified.fp16_d128_bs16_g7.gfx942", + "paged_unified.fp16_d128_bs16_g8.gfx942", + "paged_unified.fp16_d128_bs32_g1.gfx942", + "paged_unified.fp16_d128_bs32_g16.gfx942", + "paged_unified.fp16_d128_bs32_g2.gfx942", + "paged_unified.fp16_d128_bs32_g4.gfx942", + "paged_unified.fp16_d128_bs32_g5.gfx942", + "paged_unified.fp16_d128_bs32_g6.gfx942", + "paged_unified.fp16_d128_bs32_g7.gfx942", + "paged_unified.fp16_d128_bs32_g8.gfx942", + "paged_unified.fp16_d128_bs64_g1.gfx942", + "paged_unified.fp16_d128_bs64_g16.gfx942", + "paged_unified.fp16_d128_bs64_g2.gfx942", + "paged_unified.fp16_d128_bs64_g4.gfx942", + "paged_unified.fp16_d128_bs64_g5.gfx942", + "paged_unified.fp16_d128_bs64_g6.gfx942", + "paged_unified.fp16_d128_bs64_g7.gfx942", + "paged_unified.fp16_d128_bs64_g8.gfx942", + "paged_unified.fp16_d256_bs16_g1.gfx942", + "paged_unified.fp16_d256_bs16_g16.gfx942", + "paged_unified.fp16_d256_bs16_g2.gfx942", + "paged_unified.fp16_d256_bs16_g4.gfx942", + "paged_unified.fp16_d256_bs16_g5.gfx942", + "paged_unified.fp16_d256_bs16_g6.gfx942", + "paged_unified.fp16_d256_bs16_g7.gfx942", + "paged_unified.fp16_d256_bs16_g8.gfx942", + "paged_unified.fp16_d256_bs32_g1.gfx942", + "paged_unified.fp16_d256_bs32_g16.gfx942", + "paged_unified.fp16_d256_bs32_g2.gfx942", + "paged_unified.fp16_d256_bs32_g4.gfx942", + "paged_unified.fp16_d256_bs32_g5.gfx942", + "paged_unified.fp16_d256_bs32_g6.gfx942", + "paged_unified.fp16_d256_bs32_g7.gfx942", + "paged_unified.fp16_d256_bs32_g8.gfx942", + "paged_unified.fp16_d256_bs64_g1.gfx942", + "paged_unified.fp16_d256_bs64_g16.gfx942", + "paged_unified.fp16_d256_bs64_g2.gfx942", + "paged_unified.fp16_d256_bs64_g4.gfx942", + "paged_unified.fp16_d256_bs64_g5.gfx942", + "paged_unified.fp16_d256_bs64_g6.gfx942", + "paged_unified.fp16_d256_bs64_g7.gfx942", + "paged_unified.fp16_d256_bs64_g8.gfx942", + "paged_unified.fp16_d64_bs16_g1.gfx942", + "paged_unified.fp16_d64_bs16_g16.gfx942", + "paged_unified.fp16_d64_bs16_g2.gfx942", + "paged_unified.fp16_d64_bs16_g4.gfx942", + "paged_unified.fp16_d64_bs16_g5.gfx942", + "paged_unified.fp16_d64_bs16_g6.gfx942", + "paged_unified.fp16_d64_bs16_g7.gfx942", + "paged_unified.fp16_d64_bs16_g8.gfx942", + "paged_unified.fp16_d64_bs32_g1.gfx942", + "paged_unified.fp16_d64_bs32_g16.gfx942", + "paged_unified.fp16_d64_bs32_g2.gfx942", + "paged_unified.fp16_d64_bs32_g4.gfx942", + "paged_unified.fp16_d64_bs32_g5.gfx942", + "paged_unified.fp16_d64_bs32_g6.gfx942", + "paged_unified.fp16_d64_bs32_g7.gfx942", + "paged_unified.fp16_d64_bs32_g8.gfx942", + "paged_unified.fp16_d64_bs64_g1.gfx942", + "paged_unified.fp16_d64_bs64_g16.gfx942", + "paged_unified.fp16_d64_bs64_g2.gfx942", + "paged_unified.fp16_d64_bs64_g4.gfx942", + "paged_unified.fp16_d64_bs64_g5.gfx942", + "paged_unified.fp16_d64_bs64_g6.gfx942", + "paged_unified.fp16_d64_bs64_g7.gfx942", + "paged_unified.fp16_d64_bs64_g8.gfx942", + }, + }}, + {"gfx950", + ExpectedInventory{ + { + "hipkernel:attention_paged_unified_gfx950", + }, + { + "paged_unified.bf16_d128_bs16_g1.gfx950", + "paged_unified.bf16_d128_bs16_g16.gfx950", + "paged_unified.bf16_d128_bs16_g2.gfx950", + "paged_unified.bf16_d128_bs16_g4.gfx950", + "paged_unified.bf16_d128_bs16_g5.gfx950", + "paged_unified.bf16_d128_bs16_g6.gfx950", + "paged_unified.bf16_d128_bs16_g7.gfx950", + "paged_unified.bf16_d128_bs16_g8.gfx950", + "paged_unified.bf16_d128_bs32_g1.gfx950", + "paged_unified.bf16_d128_bs32_g16.gfx950", + "paged_unified.bf16_d128_bs32_g2.gfx950", + "paged_unified.bf16_d128_bs32_g4.gfx950", + "paged_unified.bf16_d128_bs32_g5.gfx950", + "paged_unified.bf16_d128_bs32_g6.gfx950", + "paged_unified.bf16_d128_bs32_g7.gfx950", + "paged_unified.bf16_d128_bs32_g8.gfx950", + "paged_unified.bf16_d128_bs64_g1.gfx950", + "paged_unified.bf16_d128_bs64_g16.gfx950", + "paged_unified.bf16_d128_bs64_g2.gfx950", + "paged_unified.bf16_d128_bs64_g4.gfx950", + "paged_unified.bf16_d128_bs64_g5.gfx950", + "paged_unified.bf16_d128_bs64_g6.gfx950", + "paged_unified.bf16_d128_bs64_g7.gfx950", + "paged_unified.bf16_d128_bs64_g8.gfx950", + "paged_unified.bf16_d256_bs16_g1.gfx950", + "paged_unified.bf16_d256_bs16_g16.gfx950", + "paged_unified.bf16_d256_bs16_g2.gfx950", + "paged_unified.bf16_d256_bs16_g4.gfx950", + "paged_unified.bf16_d256_bs16_g5.gfx950", + "paged_unified.bf16_d256_bs16_g6.gfx950", + "paged_unified.bf16_d256_bs16_g7.gfx950", + "paged_unified.bf16_d256_bs16_g8.gfx950", + "paged_unified.bf16_d256_bs32_g1.gfx950", + "paged_unified.bf16_d256_bs32_g16.gfx950", + "paged_unified.bf16_d256_bs32_g2.gfx950", + "paged_unified.bf16_d256_bs32_g4.gfx950", + "paged_unified.bf16_d256_bs32_g5.gfx950", + "paged_unified.bf16_d256_bs32_g6.gfx950", + "paged_unified.bf16_d256_bs32_g7.gfx950", + "paged_unified.bf16_d256_bs32_g8.gfx950", + "paged_unified.bf16_d256_bs64_g1.gfx950", + "paged_unified.bf16_d256_bs64_g16.gfx950", + "paged_unified.bf16_d256_bs64_g2.gfx950", + "paged_unified.bf16_d256_bs64_g4.gfx950", + "paged_unified.bf16_d256_bs64_g5.gfx950", + "paged_unified.bf16_d256_bs64_g6.gfx950", + "paged_unified.bf16_d256_bs64_g7.gfx950", + "paged_unified.bf16_d256_bs64_g8.gfx950", + "paged_unified.bf16_d64_bs16_g1.gfx950", + "paged_unified.bf16_d64_bs16_g16.gfx950", + "paged_unified.bf16_d64_bs16_g2.gfx950", + "paged_unified.bf16_d64_bs16_g4.gfx950", + "paged_unified.bf16_d64_bs16_g5.gfx950", + "paged_unified.bf16_d64_bs16_g6.gfx950", + "paged_unified.bf16_d64_bs16_g7.gfx950", + "paged_unified.bf16_d64_bs16_g8.gfx950", + "paged_unified.bf16_d64_bs32_g1.gfx950", + "paged_unified.bf16_d64_bs32_g16.gfx950", + "paged_unified.bf16_d64_bs32_g2.gfx950", + "paged_unified.bf16_d64_bs32_g4.gfx950", + "paged_unified.bf16_d64_bs32_g5.gfx950", + "paged_unified.bf16_d64_bs32_g6.gfx950", + "paged_unified.bf16_d64_bs32_g7.gfx950", + "paged_unified.bf16_d64_bs32_g8.gfx950", + "paged_unified.bf16_d64_bs64_g1.gfx950", + "paged_unified.bf16_d64_bs64_g16.gfx950", + "paged_unified.bf16_d64_bs64_g2.gfx950", + "paged_unified.bf16_d64_bs64_g4.gfx950", + "paged_unified.bf16_d64_bs64_g5.gfx950", + "paged_unified.bf16_d64_bs64_g6.gfx950", + "paged_unified.bf16_d64_bs64_g7.gfx950", + "paged_unified.bf16_d64_bs64_g8.gfx950", + "paged_unified.fp16_d128_bs16_g1.gfx950", + "paged_unified.fp16_d128_bs16_g16.gfx950", + "paged_unified.fp16_d128_bs16_g2.gfx950", + "paged_unified.fp16_d128_bs16_g4.gfx950", + "paged_unified.fp16_d128_bs16_g5.gfx950", + "paged_unified.fp16_d128_bs16_g6.gfx950", + "paged_unified.fp16_d128_bs16_g7.gfx950", + "paged_unified.fp16_d128_bs16_g8.gfx950", + "paged_unified.fp16_d128_bs32_g1.gfx950", + "paged_unified.fp16_d128_bs32_g16.gfx950", + "paged_unified.fp16_d128_bs32_g2.gfx950", + "paged_unified.fp16_d128_bs32_g4.gfx950", + "paged_unified.fp16_d128_bs32_g5.gfx950", + "paged_unified.fp16_d128_bs32_g6.gfx950", + "paged_unified.fp16_d128_bs32_g7.gfx950", + "paged_unified.fp16_d128_bs32_g8.gfx950", + "paged_unified.fp16_d128_bs64_g1.gfx950", + "paged_unified.fp16_d128_bs64_g16.gfx950", + "paged_unified.fp16_d128_bs64_g2.gfx950", + "paged_unified.fp16_d128_bs64_g4.gfx950", + "paged_unified.fp16_d128_bs64_g5.gfx950", + "paged_unified.fp16_d128_bs64_g6.gfx950", + "paged_unified.fp16_d128_bs64_g7.gfx950", + "paged_unified.fp16_d128_bs64_g8.gfx950", + "paged_unified.fp16_d256_bs16_g1.gfx950", + "paged_unified.fp16_d256_bs16_g16.gfx950", + "paged_unified.fp16_d256_bs16_g2.gfx950", + "paged_unified.fp16_d256_bs16_g4.gfx950", + "paged_unified.fp16_d256_bs16_g5.gfx950", + "paged_unified.fp16_d256_bs16_g6.gfx950", + "paged_unified.fp16_d256_bs16_g7.gfx950", + "paged_unified.fp16_d256_bs16_g8.gfx950", + "paged_unified.fp16_d256_bs32_g1.gfx950", + "paged_unified.fp16_d256_bs32_g16.gfx950", + "paged_unified.fp16_d256_bs32_g2.gfx950", + "paged_unified.fp16_d256_bs32_g4.gfx950", + "paged_unified.fp16_d256_bs32_g5.gfx950", + "paged_unified.fp16_d256_bs32_g6.gfx950", + "paged_unified.fp16_d256_bs32_g7.gfx950", + "paged_unified.fp16_d256_bs32_g8.gfx950", + "paged_unified.fp16_d256_bs64_g1.gfx950", + "paged_unified.fp16_d256_bs64_g16.gfx950", + "paged_unified.fp16_d256_bs64_g2.gfx950", + "paged_unified.fp16_d256_bs64_g4.gfx950", + "paged_unified.fp16_d256_bs64_g5.gfx950", + "paged_unified.fp16_d256_bs64_g6.gfx950", + "paged_unified.fp16_d256_bs64_g7.gfx950", + "paged_unified.fp16_d256_bs64_g8.gfx950", + "paged_unified.fp16_d64_bs16_g1.gfx950", + "paged_unified.fp16_d64_bs16_g16.gfx950", + "paged_unified.fp16_d64_bs16_g2.gfx950", + "paged_unified.fp16_d64_bs16_g4.gfx950", + "paged_unified.fp16_d64_bs16_g5.gfx950", + "paged_unified.fp16_d64_bs16_g6.gfx950", + "paged_unified.fp16_d64_bs16_g7.gfx950", + "paged_unified.fp16_d64_bs16_g8.gfx950", + "paged_unified.fp16_d64_bs32_g1.gfx950", + "paged_unified.fp16_d64_bs32_g16.gfx950", + "paged_unified.fp16_d64_bs32_g2.gfx950", + "paged_unified.fp16_d64_bs32_g4.gfx950", + "paged_unified.fp16_d64_bs32_g5.gfx950", + "paged_unified.fp16_d64_bs32_g6.gfx950", + "paged_unified.fp16_d64_bs32_g7.gfx950", + "paged_unified.fp16_d64_bs32_g8.gfx950", + "paged_unified.fp16_d64_bs64_g1.gfx950", + "paged_unified.fp16_d64_bs64_g16.gfx950", + "paged_unified.fp16_d64_bs64_g2.gfx950", + "paged_unified.fp16_d64_bs64_g4.gfx950", + "paged_unified.fp16_d64_bs64_g5.gfx950", + "paged_unified.fp16_d64_bs64_g6.gfx950", + "paged_unified.fp16_d64_bs64_g7.gfx950", + "paged_unified.fp16_d64_bs64_g8.gfx950", + }, + }}, + }; + return s_expected; +} + +/// The runtime source kind every kernel must declare at the loader. A packaged bundle +/// is lowered to a kpack archive first, so the authored builder kind is not what +/// arrives. +constexpr ingestor::KernelSourceKind EXPECTED_SOURCE_KIND = ingestor::KernelSourceKind::KPACK; + +class TestAttentionPagedUnifiedPacks : public ::testing::Test +{ +protected: + void SetUp() override + { + _arch = hipdnn_data_sdk::utilities::getEnv("HIPDNN_TEST_EXPECTED_ARCH"); + ASSERT_FALSE(_arch.empty()) + << "HIPDNN_TEST_EXPECTED_ARCH is unset, so this census has no expectation to " + "check against. The architecture is supplied explicitly by the caller; it " + "is never detected from a device and never taken from the descriptors " + "being censused."; + + const auto& table = expectedByArch(); + auto row = table.find(_arch); + if(row == table.end()) + { + row = table.find(ARCH_WILDCARD); + } + ASSERT_NE(row, table.end()) + << "this bundle emitted no descriptors for architecture '" << _arch + << "' and no architecture-independent ones either, so there is no expected " + "identity to check. Either the wrong architecture was requested or the " + "generation that produced this bundle did not cover it."; + _expected = &row->second; + + const auto& sets = discoverDescriptorSets(); + const auto match = std::find_if(sets.begin(), sets.end(), [](const auto& set) { + return set.engine.name == ATTENTION_PAGED_UNIFIED_ENGINE_NAME; + }); + ASSERT_NE(match, sets.end()) + << "descriptor set '" << ATTENTION_PAGED_UNIFIED_ENGINE_NAME + << "' did not load. Either its descriptors were never installed under the tree " + "this binary reads, its UED declares a different engine name than " + "ATTENTION_PAGED_UNIFIED_ENGINE_NAME, or its pack failed to register its " + "native symbols and every descriptor naming one of them was dropped."; + _set = &*match; + } + + std::string _arch; + const ExpectedInventory* _expected = nullptr; + const ingestor::DescriptorSet* _set = nullptr; +}; + +TEST_F(TestAttentionPagedUnifiedPacks, LoadsExactlyTheEmittedPacks) +{ + std::set loaded; + for(const auto& pack : _set->packs) + { + loaded.insert(pack.name); + } + // Set equality, not a count: a missing pack and an extra one cancel in a count. + EXPECT_EQ(loaded, _expected->packNames); +} + +TEST_F(TestAttentionPagedUnifiedPacks, LoadsExactlyTheEmittedKernels) +{ + std::set loaded; + for(const auto& pack : _set->packs) + { + for(const auto& kernel : pack.kernels) + { + loaded.insert(kernel.name); + } + } + EXPECT_EQ(loaded, _expected->kernelNames); +} + +TEST_F(TestAttentionPagedUnifiedPacks, EveryLoadedDescriptorCoversTheRequestedArch) +{ + for(const auto& pack : _set->packs) + { + EXPECT_TRUE(ingestor::archSupports(pack.arch, _arch)) + << "pack '" << pack.name << "' does not cover '" << _arch + << "', so this is not that architecture's shard"; + for(const auto& kernel : pack.kernels) + { + EXPECT_TRUE(ingestor::archSupports(kernel.arch, _arch)) + << "kernel '" << kernel.name << "' does not cover '" << _arch << "'"; + } + } +} + +TEST_F(TestAttentionPagedUnifiedPacks, EveryKernelDeclaresTheEmittedRuntimeSourceKind) +{ + for(const auto& pack : _set->packs) + { + for(const auto& kernel : pack.kernels) + { + EXPECT_EQ(kernel.source.kind, EXPECTED_SOURCE_KIND) + << "kernel '" << kernel.name << "' reached the loader as a different " + << "source kind than this bundle ships"; + } + } +} + +TEST_F(TestAttentionPagedUnifiedPacks, DeclaresTheConfiguredSdkVersion) +{ + EXPECT_EQ(_set->engine.sdkVersion, hipdnn_data_sdk::utilities::Version{std::string("1.4.0")}); +} + +TEST_F(TestAttentionPagedUnifiedPacks, ExposesTheConfiguredKnobs) +{ + ASSERT_EQ(_set->engine.knobs.size(), 0U); +} + +/// heuristic: none. The engine ranks on priority then descriptor id, so it ships no UHD +/// and registers no score symbol. Loading cannot show the second half, so the registry +/// is asked directly. +TEST_F(TestAttentionPagedUnifiedPacks, ShipsNoHeuristicAndRegistersNoScoreSymbol) +{ + EXPECT_FALSE(_set->heuristic.has_value()); + EXPECT_FALSE(ingestor::ScoreRegistry::isRegistered("hipkernel.attention_paged_unified.score")); +} + +/// UMD policy, this engine's shape: a MULTI-pack engine carries one graph-scoped +/// operation matcher per pack, on top of the one shared kernel-scoped matcher. +TEST_F(TestAttentionPagedUnifiedPacks, CarriesOneGraphScopedMatcherPerPack) +{ + const auto graphScoped + = std::count_if(_set->matchers.begin(), _set->matchers.end(), [](const auto& matcher) { + return matcher.scope == ingestor::MatchScope::GRAPH; + }); + EXPECT_EQ(static_cast(graphScoped), _expected->packNames.size()); +} + +TEST_F(TestAttentionPagedUnifiedPacks, CarriesExactlyOneSharedKernelScopedMatcher) +{ + const auto kernelScoped + = std::count_if(_set->matchers.begin(), _set->matchers.end(), [](const auto& matcher) { + return matcher.scope == ingestor::MatchScope::KERNEL; + }); + EXPECT_EQ(kernelScoped, 1); +} + +} // namespace + +#endif // HIPDNN_ENABLE_KERNEL_INGESTOR diff --git a/dnn-providers/integration-tests/docs/file-formats.md b/dnn-providers/integration-tests/docs/file-formats.md index 548c253124f6..48901f89dd68 100644 --- a/dnn-providers/integration-tests/docs/file-formats.md +++ b/dnn-providers/integration-tests/docs/file-formats.md @@ -599,7 +599,7 @@ Do not confuse them: | `dnn-providers/integration-tests/test_categories.yaml` | This project's own binaries `hipdnn_integration_tests_unit_tests` and `hipdnn_golden_data_tests` | | `dnn-providers/integration-tests/test_categories_gpu_ref.yaml` | `hipdnn_gpu_ref_tests`. Quick is an fp32 smoke run; reduced-precision and mixed-type cases are in standard | | `dnn-providers/integration-tests/test_categories_external.yaml` | Pre-registered non-GTest CTest tests (the Python verifiers, test-name validation) | -| `dnn-providers//test_categories_integration.yaml` (hip-kernel-provider: `HIP_MLOPS_ENGINE_test_categories_integration.yaml`, `ASM_SDPA_ENGINE_test_categories_integration.yaml`, `hipkernel_Gfx950Attention_test_categories_integration.yaml`, `hipkernel_Gfx942AttentionUnified3d_test_categories_integration.yaml`, `hipkernel_Gfx942AttentionDense_test_categories_integration.yaml`, `hipkernel_flydsl_sdpa_test_categories_integration.yaml`, `hipkernel_flydsl_rmsnorm_test_categories_integration.yaml`, `hipkernel_flydsl_rmsnorm_bwd_test_categories_integration.yaml`) | `hipdnn_integration_tests` **run against that provider's engine** — the lane's bundle suites | +| `dnn-providers//test_categories_integration.yaml` (hip-kernel-provider keeps one per engine lane, `_test_categories_integration.yaml`: `HIP_MLOPS_ENGINE`, `ASM_SDPA_ENGINE`, `hipkernel_Gfx950Attention`, `hipkernel_Gfx942AttentionUnified3d`, `hipkernel_Gfx942AttentionDense`, `hipkernel_AttentionPagedUnified`, `hipkernel_flydsl_rmsnorm`, `hipkernel_flydsl_rmsnorm_bwd`, `hipkernel_flydsl_sdpa`) | `hipdnn_integration_tests` **run against that provider's engine** — the lane's bundle suites | A provider's own `test_categories.yaml` governs its native `*_plugin_tests` binaries, not the shared suite. diff --git a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd128_causal_paged/Decode/Decode.support.json b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd128_causal_paged/Decode/Decode.support.json index 42566e269577..9cb9ed1e55c0 100644 --- a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd128_causal_paged/Decode/Decode.support.json +++ b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd128_causal_paged/Decode/Decode.support.json @@ -1,4 +1,13 @@ { - "claims": {}, + "claims": { + "hipkernel:AttentionPagedUnified": { + "gfx942": [ + "linux" + ], + "gfx950": [ + "linux" + ] + } + }, "version": 1 } diff --git a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_causal_paged/SpecDecode/SpecDecode.support.json b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_causal_paged/SpecDecode/SpecDecode.support.json index 42566e269577..9cb9ed1e55c0 100644 --- a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_causal_paged/SpecDecode/SpecDecode.support.json +++ b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_causal_paged/SpecDecode/SpecDecode.support.json @@ -1,4 +1,13 @@ { - "claims": {}, + "claims": { + "hipkernel:AttentionPagedUnified": { + "gfx942": [ + "linux" + ], + "gfx950": [ + "linux" + ] + } + }, "version": 1 } diff --git a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_window_ragged_paged/Mixed/Mixed.support.json b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_window_ragged_paged/Mixed/Mixed.support.json index 42566e269577..9cb9ed1e55c0 100644 --- a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_window_ragged_paged/Mixed/Mixed.support.json +++ b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/fp16/hd64_window_ragged_paged/Mixed/Mixed.support.json @@ -1,4 +1,13 @@ { - "claims": {}, + "claims": { + "hipkernel:AttentionPagedUnified": { + "gfx942": [ + "linux" + ], + "gfx950": [ + "linux" + ] + } + }, "version": 1 } diff --git a/projects/hipdnn/tools/IngestorGenerator/README.md b/projects/hipdnn/tools/IngestorGenerator/README.md index 78d74ab28192..3fe131da2659 100644 --- a/projects/hipdnn/tools/IngestorGenerator/README.md +++ b/projects/hipdnn/tools/IngestorGenerator/README.md @@ -843,6 +843,7 @@ There is no packaging `--profile`, CMake `PROFILES` or external root manifest. | `configs/axes_example.yaml` | Pack-level `axes`: one `kernel_template` crossed with value lists, expanded at load time | | `configs/variants_example.yaml` | Pack-level `variants`: a shape list crossed per-shape with a named knob set (below) | | `configs/gfx1151_wmma_attention.yaml` | The shipped `hipkernel:Gfx1151WmmaAttention` catalog: packaged rocKE runtime-shape kernels under `rocKE/gfx1151_wmma_attention` | +| `configs/attention_paged_unified.yaml` | The shipped `hipkernel:AttentionPagedUnified` catalog: packaged rocKE tiled 2D `runtime_layout` kernels for gfx942 and gfx950 under `rocKE/attention_paged_unified` | ## Generated variant sets: `variants` diff --git a/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml b/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml new file mode 100644 index 000000000000..5883329b53e5 --- /dev/null +++ b/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml @@ -0,0 +1,333 @@ +# Source of truth for the shipped hipkernel:AttentionPagedUnified catalog. +# +# The kernels are rocKE's tiled 2D unified-attention builders +# (kernels/{gfx942,gfx950}/attention_tiled_2d.py, build_unified_attention_2d_tiled) in +# their runtime_layout form: Q/O/K/V strides, the query head count, the sliding window, +# the batch size and whether Q is dense or ragged are launch arguments, and the page +# table and sequence lengths are read on the device. Every object is built with +# num_kv_heads = 1, so num_query_heads is the GQA ratio (query heads per KV head), +# which with the head size, the paged-KV block size and the dtype fixes the kernel. +# +# The native matcher (packs/AttentionPagedUnifiedNative.cpp) serves cuDNN paged +# attention: paged K/V containers with arbitrary strides (including the interleaved +# K|V view of one cache allocation), INT32 page tables (one tensor for K and V, or +# separate K and V tables with the same width and batch stride), INT32 +# sequence lengths, dense or ragged Q, and bottom-right causal masking with an optional +# left bound. +# +# sdk_version 1.4.0: ragged Q/O (1.3.0) with a token-unit ragged_offset_multiplier +# (1.4.0). The matcher declines override-shape graphs (1.1.0). +# +# Geometry per arch is rocKE's runtime_layout_catalog_spec() in each builder module +# (num_warps, and on gfx942 sub-block tile_size where the LDS budget needs it); the +# engine launches num_warps * 64 threads with BLOCK_Q = 16 * num_warps // num_query_heads. + +dialect: packaged +authored_subpath: rocKE/attention_paged_unified +engine: + name: hipkernel:AttentionPagedUnified + census_name_symbol: ATTENTION_PAGED_UNIFIED_ENGINE_NAME + sdk_version: 1.4.0 + knobs: [] + heuristic: none + +kmd_fields: +- name: dtype + type: string +- name: head_size + type: int +- name: block_size + type: int +- name: num_query_heads + type: int +- name: num_kv_heads + type: int + default_value: 1 +- name: num_warps + type: int + default_value: 1 +- name: block_m_per_warp + type: int + default_value: 16 + +specialization: + metadata_fields: + - dtype + - head_size + - block_size + - num_query_heads + - num_kv_heads + - num_warps + - block_m_per_warp + matcher_only_fields: [] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + bindings: + dtype: {field: dtype} + head_size: {field: head_size} + block_size: {field: block_size} + num_query_heads: {field: num_query_heads} + num_kv_heads: {field: num_kv_heads} + num_warps: {field: num_warps} + block_m_per_warp: {field: block_m_per_warp} + +# One pack per architecture (each builder module is arch-specific); each pack's +# discriminator names its graph-scoped criterion, which admits the pack only on its +# own architecture. +graph_match: + shape: shared_shape + discriminator: none + +kernel_source_kind: rocke +workspace_policy: none +packs: +- name: gfx942 + arch: [gfx942] + discriminator: gfx942 + kernel_defaults: + kind: rocke + source: kernels/gfx942/attention_tiled_2d.py + builder: build_unified_attention_2d_tiled + variants: + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 4 + block_m_per_warp: 16 + runtime_layout: true + shape_axes: + dtype: [fp16, bf16] + head_size: [64] + block_size: [16, 32, 64] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 4 + block_m_per_warp: 16 + runtime_layout: true + shape_axes: + dtype: [fp16, bf16] + head_size: [128] + block_size: [16, 32] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout, tile_size] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 4 + block_m_per_warp: 16 + runtime_layout: true + tile_size: 32 + shape_axes: + dtype: [fp16, bf16] + head_size: [128] + block_size: [64] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 2 + block_m_per_warp: 16 + runtime_layout: true + shape_axes: + dtype: [fp16, bf16] + head_size: [256] + block_size: [16] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout, tile_size] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 2 + block_m_per_warp: 16 + runtime_layout: true + tile_size: 16 + shape_axes: + dtype: [fp16, bf16] + head_size: [256] + block_size: [32, 64] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} +- name: gfx950 + arch: [gfx950] + discriminator: gfx950 + kernel_defaults: + kind: rocke + source: kernels/gfx950/attention_tiled_2d.py + builder: build_unified_attention_2d_tiled + variants: + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx950 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 2 + block_m_per_warp: 16 + runtime_layout: true + shape_axes: + dtype: [fp16, bf16] + head_size: [64] + block_size: [16] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx950 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 4 + block_m_per_warp: 16 + runtime_layout: true + shape_axes: + dtype: [fp16, bf16] + head_size: [64] + block_size: [32, 64] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx950 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + vocabulary: + dtype: {bf16: BF16, fp16: FP16} + spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] + spec_defaults: + num_kv_heads: 1 + use_sinks: false + sliding_window: 0 + has_softcap: false + num_warps: 4 + block_m_per_warp: 16 + runtime_layout: true + shape_axes: + dtype: [fp16, bf16] + head_size: [128, 256] + block_size: [16, 32, 64] + knob_sets: + gqa: + - {num_query_heads: 1} + - {num_query_heads: 2} + - {num_query_heads: 4} + - {num_query_heads: 5} + - {num_query_heads: 6} + - {num_query_heads: 7} + - {num_query_heads: 8} + - {num_query_heads: 16} + shapes: + - {knobs: gqa} From 6114fe07c41a0056309e27db76bca84491483e6f Mon Sep 17 00:00:00 2001 From: David Peabody Date: Thu, 22 Oct 2026 12:29:26 -0600 Subject: [PATCH 03/22] feat(rocke): attention sinks in the gfx942/gfx950 tiled 2D runtime_layout mode runtime_layout now composes with use_sinks. The sink init bounds the query head with the runtime num_query_heads kernarg, as every tiled 2D body does, so heads of KV head > 0 keep their sink; the head index is the same kv_head * qpk + row % qpk mapping the Q/O accesses use. runtime_layout_catalog_spec takes use_sinks (default False). Non-RTL emission is unchanged. Adds spec-acceptance tests and GPU numerics with sinks and two KV heads against an fp32 reference. The representative-IR golden (rocke_representative_ir_sha256/attention.json) pins three runtime_layout objects per architecture at llvm20/22/23/24: one without sinks and two with them (D128 and D256, the latter the gfx942 2-warp body). --- .../kernels/gfx942/attention_tiled_2d.py | 4 +- .../kernels/gfx950/attention_tiled_2d.py | 10 +- .../parity/gfx942_attention_tiled_2d_emit.c | 33 ++- .../parity/gfx942_attention_tiled_2d_emit.py | 17 +- .../parity/gfx950_attention_tiled_2d_emit.c | 34 +++- .../parity/gfx950_attention_tiled_2d_emit.py | 18 +- ...ttention_tiled_2d_runtime_layout_gfx950.py | 91 ++++++++- .../test_gfx942_attention_runtime_layout.py | 82 +++++++- .../attention_tiled_parity_configs.py | 22 +- .../instances/gfx942/attention_tiled_2d.cpp | 2 - .../attention.json | 192 ++++++++++++++++++ .../differential/golden/llvm_gfx_all.json | 100 ++++++++- .../instances/rocke_ir_parity_harness.py | 65 ++++++ 13 files changed, 628 insertions(+), 42 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py index 70a07e8cf29c..c3ec34c215d9 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py @@ -1116,7 +1116,6 @@ def kernel_name(self) -> str: # Spec flags that bake a layout, need per-head side inputs, or select a # non-default pipeline; runtime_layout supports none of them. _RTL_INCOMPATIBLE_FLAGS = ( - "use_sinks", "has_softcap", "use_alibi", "use_qq_bias", @@ -1256,6 +1255,7 @@ def runtime_layout_catalog_spec( block_size: int, num_queries_per_kv: int, arch: str = "gfx942", + use_sinks: bool = False, ) -> UnifiedAttention2DTiledSpec: """The catalog spec for one (dtype, head_size, block_size, QPK) object.""" geom = runtime_layout_geometry(head_size, block_size, arch=arch) @@ -1271,7 +1271,7 @@ def runtime_layout_catalog_spec( num_query_heads=num_queries_per_kv, num_kv_heads=1, dtype=dtype, - use_sinks=False, + use_sinks=use_sinks, sliding_window=0, has_softcap=False, num_warps=num_warps, diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index b3c28f7e63ba..4f361aac6515 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -1078,7 +1078,6 @@ def _runtime_layout_reject_reason(spec: "UnifiedAttention2DTiledSpec") -> Option "spec sliding_window must be 0" ) features = { - "use_sinks": spec.use_sinks, "has_softcap": spec.has_softcap, "use_alibi": spec.use_alibi, "use_qq_bias": spec.use_qq_bias, @@ -1160,7 +1159,12 @@ def runtime_layout_num_warps(head_size: int, block_size: int) -> int: def runtime_layout_catalog_spec( - *, dtype: str, head_size: int, block_size: int, num_queries_per_kv: int + *, + dtype: str, + head_size: int, + block_size: int, + num_queries_per_kv: int, + use_sinks: bool = False, ) -> "UnifiedAttention2DTiledSpec": """The runtime-layout spec the hipDNN catalog compiles for one combination.""" return UnifiedAttention2DTiledSpec( @@ -1169,7 +1173,7 @@ def runtime_layout_catalog_spec( num_query_heads=num_queries_per_kv, num_kv_heads=1, dtype=dtype, - use_sinks=False, + use_sinks=use_sinks, sliding_window=0, has_softcap=False, num_warps=runtime_layout_num_warps(head_size, block_size), diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c index 4c8be79d202c..192006eb8c94 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.c @@ -347,9 +347,9 @@ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) s->use_conflict_free_v_store = true; s->use_i64_kv_addr = (idx == 19); break; - /* --- idx20-29: runtime_layout, every catalog (head_size, block_size) cell - * with its catalog num_warps / tile_size, GQA 1-16 and one - * num_kv_heads > 1 spec (lockstep with the Python _rtl rows). */ + /* --- idx20-38: runtime_layout, every catalog (head_size, block_size) cell + * with its catalog num_warps / tile_size, GQA 1-16, one num_kv_heads > 1 + * spec, then the sink variants (lockstep with the Python _rtl rows). */ case 20: rtl_spec(s, 64, 16, 1, 1, "fp16", false, 4, 0); break; @@ -380,6 +380,33 @@ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) case 29: rtl_spec(s, 128, 32, 16, 4, "bf16", false, 4, 0); break; + case 30: + rtl_spec(s, 64, 16, 2, 1, "bf16", true, 4, 0); + break; + case 31: + rtl_spec(s, 64, 32, 5, 1, "fp16", true, 4, 0); + break; + case 32: + rtl_spec(s, 64, 64, 7, 1, "bf16", true, 4, 0); + break; + case 33: + rtl_spec(s, 128, 16, 16, 1, "fp16", true, 4, 0); + break; + case 34: + rtl_spec(s, 128, 32, 2, 1, "bf16", true, 4, 0); + break; + case 35: + rtl_spec(s, 128, 64, 5, 1, "fp16", true, 4, 32); + break; + case 36: + rtl_spec(s, 256, 16, 7, 1, "bf16", true, 2, 0); + break; + case 37: + rtl_spec(s, 256, 32, 16, 1, "fp16", true, 2, 16); + break; + case 38: + rtl_spec(s, 256, 64, 2, 1, "bf16", true, 2, 16); + break; default: return -1; } diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py index 83704264449c..87823ed2467b 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx942_attention_tiled_2d_emit.py @@ -363,12 +363,12 @@ def _rtl( return cfg -# --- idx20-29: runtime_layout (hipDNN paged/ragged engine). Every catalog +# --- idx20-38: runtime_layout (hipDNN paged/ragged engine). Every catalog # (head_size, block_size) cell with its catalog num_warps / tile_size # (sub-block tiles at d128/b64 and d256/b32-64), fp16 and bf16, GQA ratios -# 1-16 (6 leaves VALID_ROWS < BLOCK_M), and one num_kv_heads > 1 spec. -# Dense or ragged Q, the window and the Q/O/KV strides are kernel -# arguments, so every config emits all of them. +# 1-16 (5, 6 and 7 leave VALID_ROWS < BLOCK_M), one num_kv_heads > 1 spec, +# then the sink variants (idx30-38). Dense or ragged Q, the window and the +# Q/O/KV strides are kernel arguments, so every config emits all of them. _CONFIGS[20] = _rtl(64, 16, 1, "fp16") _CONFIGS[21] = _rtl(64, 32, 4, "bf16") _CONFIGS[22] = _rtl(64, 64, 6, "fp16") @@ -379,6 +379,15 @@ def _rtl( _CONFIGS[27] = _rtl(256, 32, 8, "bf16", num_warps=2, tile_size=16) _CONFIGS[28] = _rtl(256, 64, 1, "fp16", num_warps=2, tile_size=16) _CONFIGS[29] = _rtl(128, 32, 16, "bf16", num_kv_heads=4) +_CONFIGS[30] = _rtl(64, 16, 2, "bf16", use_sinks=True) +_CONFIGS[31] = _rtl(64, 32, 5, "fp16", use_sinks=True) +_CONFIGS[32] = _rtl(64, 64, 7, "bf16", use_sinks=True) +_CONFIGS[33] = _rtl(128, 16, 16, "fp16", use_sinks=True) +_CONFIGS[34] = _rtl(128, 32, 2, "bf16", use_sinks=True) +_CONFIGS[35] = _rtl(128, 64, 5, "fp16", use_sinks=True, tile_size=32) +_CONFIGS[36] = _rtl(256, 16, 7, "bf16", use_sinks=True, num_warps=2) +_CONFIGS[37] = _rtl(256, 32, 16, "fp16", use_sinks=True, num_warps=2, tile_size=16) +_CONFIGS[38] = _rtl(256, 64, 2, "bf16", use_sinks=True, num_warps=2, tile_size=16) def _kernel(idx: int): diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c index ce8687af90b9..f6665ceb8886 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.c @@ -1227,9 +1227,9 @@ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) s->tile_size = 32; break; - /* --- idx72-81: runtime_layout, every catalog (head_size, block_size) cell - * with its catalog num_warps, GQA 1-16 and one num_kv_heads > 1 spec - * (lockstep with the Python _rtl rows). */ + /* --- idx72-90: runtime_layout, every catalog (head_size, block_size) cell + * with its catalog num_warps, GQA 1-16, one num_kv_heads > 1 spec, then + * the sink variants (lockstep with the Python _rtl rows). */ case 72: rtl_spec(s, 64, 16, 1, 1, "fp16", false, 2); break; @@ -1260,6 +1260,34 @@ static int make_spec(int idx, rocke_attention_tiled_2d_spec_t* s) case 81: rtl_spec(s, 128, 32, 16, 4, "bf16", false, 4); break; + /* idx82-90: the sink variants. */ + case 82: + rtl_spec(s, 64, 16, 2, 1, "bf16", true, 2); + break; + case 83: + rtl_spec(s, 64, 32, 5, 1, "fp16", true, 4); + break; + case 84: + rtl_spec(s, 64, 64, 7, 1, "bf16", true, 4); + break; + case 85: + rtl_spec(s, 128, 16, 16, 1, "fp16", true, 4); + break; + case 86: + rtl_spec(s, 128, 32, 2, 1, "bf16", true, 4); + break; + case 87: + rtl_spec(s, 128, 64, 5, 1, "fp16", true, 4); + break; + case 88: + rtl_spec(s, 256, 16, 7, 1, "bf16", true, 4); + break; + case 89: + rtl_spec(s, 256, 32, 16, 1, "fp16", true, 4); + break; + case 90: + rtl_spec(s, 256, 64, 2, 1, "bf16", true, 4); + break; default: return -1; } diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py index deb90dd65240..075263f0ebb3 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/gfx950_attention_tiled_2d_emit.py @@ -1185,11 +1185,12 @@ def _rtl( ) -# --- idx72-81: runtime_layout (hipDNN paged/ragged engine). Every catalog +# --- idx72-90: runtime_layout (hipDNN paged/ragged engine). Every catalog # (head_size, block_size) cell with its catalog num_warps (2 at d64/b16), -# fp16 and bf16, GQA ratios 1-16 (6 leaves VALID_ROWS < BLOCK_M), and -# one num_kv_heads > 1 spec. Dense or ragged Q, the window and the Q/O/KV -# strides are kernel arguments, so every config emits all of them. +# fp16 and bf16, GQA ratios 1-16 (5, 6 and 7 leave VALID_ROWS < BLOCK_M), +# one num_kv_heads > 1 spec, then the sink variants (idx82-90). Dense or +# ragged Q, the window and the Q/O/KV strides are kernel arguments, so every +# config emits all of them. _CONFIGS[72] = _rtl(64, 16, 1, "fp16", num_warps=2) _CONFIGS[73] = _rtl(64, 32, 4, "bf16") _CONFIGS[74] = _rtl(64, 64, 6, "fp16") @@ -1200,6 +1201,15 @@ def _rtl( _CONFIGS[79] = _rtl(256, 32, 8, "bf16") _CONFIGS[80] = _rtl(256, 64, 1, "fp16") _CONFIGS[81] = _rtl(128, 32, 16, "bf16", num_kv_heads=4) +_CONFIGS[82] = _rtl(64, 16, 2, "bf16", use_sinks=True, num_warps=2) +_CONFIGS[83] = _rtl(64, 32, 5, "fp16", use_sinks=True) +_CONFIGS[84] = _rtl(64, 64, 7, "bf16", use_sinks=True) +_CONFIGS[85] = _rtl(128, 16, 16, "fp16", use_sinks=True) +_CONFIGS[86] = _rtl(128, 32, 2, "bf16", use_sinks=True) +_CONFIGS[87] = _rtl(128, 64, 5, "fp16", use_sinks=True) +_CONFIGS[88] = _rtl(256, 16, 7, "bf16", use_sinks=True) +_CONFIGS[89] = _rtl(256, 32, 16, "fp16", use_sinks=True) +_CONFIGS[90] = _rtl(256, 64, 2, "bf16", use_sinks=True) def _spec(idx: int) -> UnifiedAttention2DTiledSpec: diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py index 9a7cb4406d42..6209171829fc 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py @@ -188,8 +188,10 @@ def _kernel_cases(): _LAUNCHERS: dict = {} -def _launcher(dtype: str, head_size: int, block_size: int, qpk: int): - key = (dtype, head_size, block_size, qpk) +def _launcher( + dtype: str, head_size: int, block_size: int, qpk: int, use_sinks: bool = False +): + key = (dtype, head_size, block_size, qpk, use_sinks) if key not in _LAUNCHERS: from kernels.gfx950.attention_tiled_2d import ( UnifiedAttention2DTiledSpec, @@ -206,6 +208,7 @@ def _launcher(dtype: str, head_size: int, block_size: int, qpk: int): head_size=head_size, block_size=block_size, num_queries_per_kv=qpk, + use_sinks=use_sinks, ) ok, why = supports_tiled_2d_spec(spec, arch="gfx950") assert ok, why @@ -277,11 +280,13 @@ def _reference( qpk: int, window: int, scale: float, + sinks: Optional[np.ndarray] = None, ) -> np.ndarray: """Bottom-right causal (+ window) attention of one sequence, fp32. ``q`` is ``[q_len, Hq, D]``; ``k``/``v`` are the gathered ``[seq_len, Hkv, D]`` - live tokens. Rows with no visible key are zero. + live tokens. ``sinks`` ([Hq] logits, not scaled) join the softmax max and + denominator. Rows with no visible key are zero. """ hq, d = q.shape[1], q.shape[2] out = np.zeros((q_len, hq, d), dtype=np.float32) @@ -296,8 +301,12 @@ def _reference( s = np.where(visible, s, -np.inf) row_max = np.max(s, axis=1, initial=-np.inf, where=visible) has_key = np.isfinite(row_max) + if sinks is not None: + row_max = np.where(has_key, np.maximum(row_max, sinks[h]), row_max) p = np.where(visible, np.exp(s - np.where(has_key, row_max, 0.0)[:, None]), 0.0) denom = p.sum(axis=1) + if sinks is not None: + denom = denom + np.where(has_key, np.exp(sinks[h] - row_max), 0.0) o = p @ v[:, kvh, :] out[:, h, :] = np.where( has_key[:, None], o / np.where(has_key, denom, 1.0)[:, None], 0.0 @@ -305,14 +314,23 @@ def _reference( return out -def _run(dtype: str, head_size: int, block_size: int, qpk: int, sc: Scenario): +def _run( + dtype: str, + head_size: int, + block_size: int, + qpk: int, + sc: Scenario, + use_sinks: bool = False, +): from rocke.runtime.hip_module import Runtime from rocke.runtime.host_buffers import as_u8_buffer from rocke.runtime.launcher import DeviceMem, LaunchConfig - spec, launcher = _launcher(dtype, head_size, block_size, qpk) + spec, launcher = _launcher(dtype, head_size, block_size, qpk, use_sinks) rng = np.random.default_rng( - zlib.crc32(f"{dtype}/{head_size}/{block_size}/{qpk}/{sc.name}".encode()) + zlib.crc32( + f"{dtype}/{head_size}/{block_size}/{qpk}/{sc.name}/{use_sinks}".encode() + ) ) D, BS = head_size, block_size hkv = NUM_KV_HEADS @@ -433,12 +451,20 @@ def upload(a: np.ndarray) -> DeviceMem: k_ptr, v_ptr = cache_dev.ptr(), cache_dev.ptr() + D * 2 else: k_ptr, v_ptr = upload(k_cache).ptr(), upload(v_cache).ptr() + # Sinks in the I/O dtype, spread from negligible to row-dominating so a head + # that loses (or reads another head's) sink fails the comparison. + sinks_view = None + sink_ptr = 0 + if use_sinks: + sinks_host = _encode(rng.uniform(-4.0, 6.0, hq).astype(np.float32), dtype) + sinks_view = _decode(sinks_host, dtype) + sink_ptr = upload(sinks_host) values = { "output_ptr": o_dev.ptr() + GUARD * 2, "query_ptr": q_dev, "key_cache_ptr": k_ptr, "value_cache_ptr": v_ptr, - "sink_ptr": 0, + "sink_ptr": sink_ptr, "block_tables_ptr": bt_dev, "seq_lens_ptr": seq_lens_dev, "alibi_slopes_ptr": 0, @@ -488,7 +514,15 @@ def upload(a: np.ndarray) -> DeviceMem: rows = int(starts[b]) + np.arange(ql) kf, vf = gathered[b] ref = _reference( - q_view[rows], kf, vf, int(seq_lens[b]), ql, qpk, sc.window, scale + q_view[rows], + kf, + vf, + int(seq_lens[b]), + ql, + qpk, + sc.window, + scale, + sinks_view, ) idx = ( GUARD @@ -540,6 +574,47 @@ def test_runtime_layout_matches_reference(dtype, head_size, block_size, qpk, sc) _run(dtype, head_size, block_size, qpk, sc) +# Sink objects with NUM_KV_HEADS=2: heads of KV head 1 need the runtime query-head +# bound and mapping to find their sink. +_SINK_KERNEL_CASES = ( + ("bf16", 64, 16, 1), + ("bf16", 128, 32, 4), + ("fp16", 128, 64, 5), + ("bf16", 256, 16, 8), + ("fp16", 64, 32, 8), +) + + +@pytest.mark.gpu +@_NEEDS_GFX950 +@pytest.mark.parametrize("sc", SCENARIOS, ids=lambda s: s.name) +@pytest.mark.parametrize( + "dtype,head_size,block_size,qpk", _SINK_KERNEL_CASES, ids=lambda v: str(v) +) +def test_runtime_layout_sinks_match_reference(dtype, head_size, block_size, qpk, sc): + _run(dtype, head_size, block_size, qpk, sc, use_sinks=True) + + +def test_runtime_layout_sinks_accepted(): + """runtime_layout composes with use_sinks; the object keeps ``sink_ptr``.""" + from kernels.gfx950.attention_tiled_2d import ( + build_unified_attention_2d_tiled, + runtime_layout_catalog_spec, + supports_tiled_2d_spec, + ) + + spec = runtime_layout_catalog_spec( + dtype="bf16", head_size=128, block_size=32, num_queries_per_kv=4, use_sinks=True + ) + ok, why = supports_tiled_2d_spec(spec, arch="gfx950") + assert ok, why + assert spec.use_sinks + assert "sinks" in spec.kernel_name() + assert spec.kernel_name().endswith("_rtl") + kernel = build_unified_attention_2d_tiled(spec) + assert "sink_ptr" in [p.name.lstrip("%") for p in kernel.params] + + def test_runtime_layout_appends_v_block_table(): """V's block table is the first appended kernarg, after the 18 fixed ones and the runtime shape kernargs.""" diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py index d61364d8c0a0..09884a3ae745 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -83,7 +83,6 @@ def _rtl_spec(**overrides): _REJECTED = [ - (dict(use_sinks=True), "use_sinks"), (dict(has_softcap=True), "has_softcap"), (dict(use_alibi=True), "use_alibi"), (dict(use_qq_bias=True), "use_qq_bias"), @@ -120,6 +119,22 @@ def test_4warp_gqa_builder_refuses_runtime_layout(): build_gfx942_4warp_gqa(spec) +def test_sinks_accepted_with_runtime_layout(): + spec = UnifiedAttention2DTiledSpec(**_rtl_spec(use_sinks=True)) + ok, why = supports_tiled_2d_spec(spec, arch="gfx942") + assert ok, why + catalog = runtime_layout_catalog_spec( + dtype="bf16", head_size=128, block_size=32, num_queries_per_kv=4, use_sinks=True + ) + assert catalog.use_sinks + assert "sinks" in catalog.kernel_name() + assert catalog.kernel_name().endswith("_rtl") + kernel = build_unified_attention_2d_tiled(catalog, arch="gfx942") + names = [p.name.lstrip("%") for p in kernel.params] + assert "sink_ptr" in names + assert names[21:] == [n for n, _ in RUNTIME_LAYOUT_EXTRA_ARGS] + + # D256, 64-token tile, 4 warps: 2*64*256*2 + 64*264*2 + 64*72*2 + 64*256*2 # = 141312 B, over gfx942's 65536 B. _OVER_LDS = dict(head_size=256, block_size=64) @@ -381,11 +396,23 @@ def _scenarios(bs): def _reference( - q_rows, k_logical, v_logical, table, seq_lens, q_lens, qpk, bs, window, v_table=None + q_rows, + k_logical, + v_logical, + table, + seq_lens, + q_lens, + qpk, + bs, + window, + sinks=None, + v_table=None, ): """fp32 gather-then-dense attention. Returns {(seq, s): [Hq, D]}. - V pages through ``v_table`` when given, else through ``table``. + ``sinks`` ([Hq] logits, not scaled) join the softmax max and denominator; + rows with no visible key stay zero. V pages through ``v_table`` when given, + else through ``table``. """ hq = q_rows[0].shape[1] if q_rows else 0 v_table = table if v_table is None else v_table @@ -415,8 +442,10 @@ def _reference( sc = (k[vis, kv_h] @ q_rows[b][s, h]) / math.sqrt( q_rows[b].shape[2] ) - p = np.exp(sc - sc.max()) - res[h] = (p @ v[vis, kv_h]) / p.sum() + m = sc.max() if sinks is None else max(sc.max(), sinks[h]) + p = np.exp(sc - m) + denom = p.sum() + (0.0 if sinks is None else np.exp(sinks[h] - m)) + res[h] = (p @ v[vis, kv_h]) / denom out[(b, s)] = res return out @@ -544,6 +573,17 @@ def upload(a): kv_block_stride, kv_tok_stride, kv_head_stride = strides span_bytes = ((_HKV - 1) * kv_head_stride + (bs - 1) * kv_tok_stride + hd) * 2 + # ---- sinks (I/O dtype, one per query head) ---- + sinks_np = None + sink_ptr = 0 + if spec.use_sinks: + # Spread from "negligible" to "dominates the row" so a head that loses + # (or reads another head's) sink fails the comparison. + sinks_host = rng.uniform(-4.0, 6.0, hq).astype(np.float32) + sinks_raw = _encode(sinks_host, dt) + sinks_np = _decode(sinks_raw, dt) + sink_ptr = upload(sinks_raw) + # ---- output with sentinel guards ---- o_tok = hq * hd + sc["o_pad"] o_elems = max(total_tok, 1) * o_tok @@ -573,7 +613,7 @@ def upload(a): query_ptr=q_ptr, key_cache_ptr=k_ptr, value_cache_ptr=v_ptr, - sink_ptr=0, + sink_ptr=sink_ptr, block_tables_ptr=table_dev, seq_lens_ptr=seq_lens_dev, alibi_slopes_ptr=0, @@ -625,6 +665,7 @@ def upload(a): qpk, bs, window if window is not None else _NO_WINDOW, + sinks_np, v_table, ) written = np.zeros(got.shape, bool) @@ -681,3 +722,32 @@ def test_runtime_layout_numerics(dtype, head_size, block_size, qpk): ) for sc in _scenarios(block_size): _run_case(spec, sc, rng) + + +# Sink objects: _HKV=2 KV heads, so query heads of KV head 1 (h >= qpk) need +# the runtime query-head bound and mapping to find their sink. +_GPU_SINK_KERNELS = [ + ("bf16", 64, 16, 1), + ("bf16", 128, 32, 4), + ("fp16", 128, 64, 5), + ("bf16", 256, 16, 8), + ("fp16", 64, 32, 8), +] + + +@pytest.mark.gpu +@requires_gfx942_gpu +@pytest.mark.parametrize("dtype,head_size,block_size,qpk", _GPU_SINK_KERNELS) +def test_runtime_layout_sinks_numerics(dtype, head_size, block_size, qpk): + spec = runtime_layout_catalog_spec( + dtype=dtype, + head_size=head_size, + block_size=block_size, + num_queries_per_kv=qpk, + use_sinks=True, + ) + rng = np.random.default_rng( + zlib.crc32(f"sinks:{dtype}:{head_size}:{block_size}:{qpk}".encode()) + ) + for sc in _scenarios(block_size): + _run_case(spec, sc, rng) diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py index fd08399749fd..95f16e4a056e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/bindings/attention_tiled_parity_configs.py @@ -329,7 +329,7 @@ def _rtl( }, ] -# idx20-29: runtime_layout (catalog geometry). +# idx20-38: runtime_layout (catalog geometry; idx30-38 carry sinks). GFX942_ATTENTION_TILED_2D += [ _rtl(64, 16, 1, "fp16"), _rtl(64, 32, 4, "bf16"), @@ -341,6 +341,15 @@ def _rtl( _rtl(256, 32, 8, "bf16", num_warps=2, tile_size=16), _rtl(256, 64, 1, "fp16", num_warps=2, tile_size=16), _rtl(128, 32, 16, "bf16", num_kv_heads=4), + _rtl(64, 16, 2, "bf16", use_sinks=True), + _rtl(64, 32, 5, "fp16", use_sinks=True), + _rtl(64, 64, 7, "bf16", use_sinks=True), + _rtl(128, 16, 16, "fp16", use_sinks=True), + _rtl(128, 32, 2, "bf16", use_sinks=True), + _rtl(128, 64, 5, "fp16", use_sinks=True, tile_size=32), + _rtl(256, 16, 7, "bf16", use_sinks=True, num_warps=2), + _rtl(256, 32, 16, "fp16", use_sinks=True, num_warps=2, tile_size=16), + _rtl(256, 64, 2, "bf16", use_sinks=True, num_warps=2, tile_size=16), ] GFX950_ATTENTION_TILED_2D = [ @@ -1425,7 +1434,7 @@ def _rtl( }, ] -# idx72-81 of the emitters: runtime_layout (catalog geometry). +# idx72-90 of the emitters: runtime_layout (catalog geometry; idx82-90 carry sinks). GFX950_ATTENTION_TILED_2D += [ _rtl(64, 16, 1, "fp16", num_warps=2), _rtl(64, 32, 4, "bf16"), @@ -1437,6 +1446,15 @@ def _rtl( _rtl(256, 32, 8, "bf16"), _rtl(256, 64, 1, "fp16"), _rtl(128, 32, 16, "bf16", num_kv_heads=4), + _rtl(64, 16, 2, "bf16", use_sinks=True, num_warps=2), + _rtl(64, 32, 5, "fp16", use_sinks=True), + _rtl(64, 64, 7, "bf16", use_sinks=True), + _rtl(128, 16, 16, "fp16", use_sinks=True), + _rtl(128, 32, 2, "bf16", use_sinks=True), + _rtl(128, 64, 5, "fp16", use_sinks=True), + _rtl(256, 16, 7, "bf16", use_sinks=True), + _rtl(256, 32, 16, "fp16", use_sinks=True), + _rtl(256, 64, 2, "bf16", use_sinks=True), ] GFX942_ATTENTION_TILED_3D = [ diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp index 8fcbe92d272e..d5edc8fbbf8f 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp @@ -165,7 +165,6 @@ bool rocke_gfx942_attention_tiled_2d_runtime_layout_reject_reason( if(s == NULL || !s->runtime_layout) return false; const rocke_attn2d_rtl_flag_t flags[] = { - {"use_sinks", s->use_sinks}, {"has_softcap", s->has_softcap}, {"use_alibi", s->use_alibi}, {"use_qq_bias", s->use_qq_bias}, @@ -256,7 +255,6 @@ bool rocke_gfx950_attention_tiled_2d_runtime_layout_reject_reason( return true; } const rocke_attn2d_rtl_flag_t features[] = { - {"use_sinks", s->use_sinks}, {"has_softcap", s->has_softcap}, {"use_alibi", s->use_alibi}, {"use_qq_bias", s->use_qq_bias}, diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json index 65e2fb652e1b..9cb465ab75ed 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json @@ -51,6 +51,30 @@ "sha256": "27c4214a59e53bcfcc30a9f02c1a20727c449ab2ece75c3f32b8a931f6518551", "status": "ok" }, + "attention/gfx942/2d_rtl_bf16_d128_b16": { + "arch": "gfx942", + "bytes": 105940, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "8f42c5eb0bf9b30f7df0f860edcb2ee681676355c4e9f2ccc61df5e79e2f375a", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { + "arch": "gfx942", + "bytes": 202510, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", + "sha256": "2a2807332de61d5bf596dc864fcfab6fbac8242c2848daf15cb02de837e1c043", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx942", + "bytes": 105230, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "b69e9abd141e02319af2a51e645ce59260eaa11a2dcc293a6d38238ad2934608", + "status": "ok" + }, "attention/gfx942/3d_bf16_d128_b64": { "arch": "gfx942", "bytes": 358681, @@ -243,6 +267,30 @@ "sha256": "38b1d7f491d94811aaa3896b9f9af52514ca18b0ea5f0e44907bfeb9f8eaaf21", "status": "ok" }, + "attention/gfx950/2d_rtl_bf16_d128_b16": { + "arch": "gfx950", + "bytes": 81439, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "54544b94041b9e2b3dba2408e88cc34e421b3d41ff81b9fca35dfa10d0a626b0", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { + "arch": "gfx950", + "bytes": 236088, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", + "sha256": "09dd73b05261cd4e526a5477f07b6bee9b1429fba92908626d7957346879215e", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx950", + "bytes": 82278, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "9c7ca81cd3dfe6a32e65ff6f852f9501c8827689cd36a9cfd992fc76f9d93237", + "status": "ok" + }, "attention/gfx950/3d_bf16_d128_b64": { "arch": "gfx950", "bytes": 163351, @@ -432,6 +480,30 @@ "sha256": "a9dbaec67c78fcb6c6c76534dc8b04ac846f42b208ab11c310fd3ec4bb058151", "status": "ok" }, + "attention/gfx942/2d_rtl_bf16_d128_b16": { + "arch": "gfx942", + "bytes": 106262, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "a89724e214221d6bd23c09b2a1aa51517bc8e8246b9e7ed7d6b25726453a915f", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { + "arch": "gfx942", + "bytes": 202821, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", + "sha256": "0cd8e9464042eb8a77fc08ec46ef2bf3eb2d3a528e98df09e769897d80c8e004", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx942", + "bytes": 105541, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "65a395020a203de61cee6894dd6919206a59ddcedd361487cdf1c87088355f81", + "status": "ok" + }, "attention/gfx942/3d_bf16_d128_b64": { "arch": "gfx942", "bytes": 358781, @@ -624,6 +696,30 @@ "sha256": "93bd2edc732ca53cd5e117784d69a00f546afde218e90ebfa4ea10d620cb33ba", "status": "ok" }, + "attention/gfx950/2d_rtl_bf16_d128_b16": { + "arch": "gfx950", + "bytes": 81664, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "69638ff6a45e11a355075f13ec4952cac7bb671412c96b168b62d8f23cad528e", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { + "arch": "gfx950", + "bytes": 236313, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", + "sha256": "c3a52861ef72092fd0f50416e83cfc1423a093e268e4468f546bc219ace6674e", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx950", + "bytes": 82503, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "5d6efc63b830cbd1f4ea9a164fa9a9c419f37d669d9920487971296e95018d3a", + "status": "ok" + }, "attention/gfx950/3d_bf16_d128_b64": { "arch": "gfx950", "bytes": 163447, @@ -813,6 +909,30 @@ "sha256": "3ac893853f42bfd8d5e49b6a101a80e0ac5b180dfff3684dace64cd2b3bd04f7", "status": "ok" }, + "attention/gfx942/2d_rtl_bf16_d128_b16": { + "arch": "gfx942", + "bytes": 106326, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { + "arch": "gfx942", + "bytes": 202885, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", + "sha256": "a774126e35f62ff4a39930a55f49dbc991ac7c958eb513ae154ecb63f5389ca6", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx942", + "bytes": 105605, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "5063eaaf732ce50d3ed0705bc14785d4acb930e6985c9c881642ccc49edadf31", + "status": "ok" + }, "attention/gfx942/3d_bf16_d128_b64": { "arch": "gfx942", "bytes": 358845, @@ -1005,6 +1125,30 @@ "sha256": "364a9ed632be83a20cff8147f4cc1e66ead3ad5f5f0da3ab171dd8adbcacce8a", "status": "ok" }, + "attention/gfx950/2d_rtl_bf16_d128_b16": { + "arch": "gfx950", + "bytes": 81728, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { + "arch": "gfx950", + "bytes": 236377, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", + "sha256": "5dfd50625325c524b73d9e04df1de934a528c3742648e71f2e988171e04528af", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx950", + "bytes": 82567, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "4b53df96d25d325a39dff797d287b9bbb1fe44bad1d4309f930fae70785e6198", + "status": "ok" + }, "attention/gfx950/3d_bf16_d128_b64": { "arch": "gfx950", "bytes": 163511, @@ -1194,6 +1338,30 @@ "sha256": "3ac893853f42bfd8d5e49b6a101a80e0ac5b180dfff3684dace64cd2b3bd04f7", "status": "ok" }, + "attention/gfx942/2d_rtl_bf16_d128_b16": { + "arch": "gfx942", + "bytes": 106326, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { + "arch": "gfx942", + "bytes": 202885, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", + "sha256": "a774126e35f62ff4a39930a55f49dbc991ac7c958eb513ae154ecb63f5389ca6", + "status": "ok" + }, + "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx942", + "bytes": 105605, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "5063eaaf732ce50d3ed0705bc14785d4acb930e6985c9c881642ccc49edadf31", + "status": "ok" + }, "attention/gfx942/3d_bf16_d128_b64": { "arch": "gfx942", "bytes": 358845, @@ -1386,6 +1554,30 @@ "sha256": "364a9ed632be83a20cff8147f4cc1e66ead3ad5f5f0da3ab171dd8adbcacce8a", "status": "ok" }, + "attention/gfx950/2d_rtl_bf16_d128_b16": { + "arch": "gfx950", + "bytes": 81728, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", + "sha256": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { + "arch": "gfx950", + "bytes": 236377, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", + "sha256": "5dfd50625325c524b73d9e04df1de934a528c3742648e71f2e988171e04528af", + "status": "ok" + }, + "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { + "arch": "gfx950", + "bytes": 82567, + "family": "attention", + "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", + "sha256": "4b53df96d25d325a39dff797d287b9bbb1fe44bad1d4309f930fae70785e6198", + "status": "ok" + }, "attention/gfx950/3d_bf16_d128_b64": { "arch": "gfx950", "bytes": 163511, diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json index e2f8c0d56458..181f1e0dd7d1 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json @@ -1375,6 +1375,15 @@ "28": "70641ee085d38835020d7e8681ed04ae085e909ebb28210646d3fc6aff508f11", "29": "6e4f5b4d2bfe3d7866077ae463a7eccc0b4066fd3160e75568eb45fe5fa27a3c", "3": "b364ec606939a153220377511d8bb21345bf28f998a41c1f8e3b0d96cac6c4a8", + "30": "866171f3d8994ab5e108a021802871a072d0fe23b2ad978e000fc1ae6f8fad88", + "31": "576b6aba324763dfb744f7bc4b2d25fcb93f8fbf585b5f8a76ef9ed98a8ef242", + "32": "af4031604abcf4ff6ccc1c0c5b20092e7be1b230112cc8599c9fad95be4ad81e", + "33": "db1e6218a2fbf0f336649852e3f1df2da7379ce8ea440cdb710f9ec8596d7bab", + "34": "633be65fd33fb20fbd454f6bae07a0958a9813ffbca836be0a9dcaa33656de4f", + "35": "511b5c0c74e9a8e7c142f3a67576729d72c45edce8c89273cfaa2c37873bb235", + "36": "ca120317512e687e21ea79df7b093ac15ac8ac14266ff77cc747f7b7f05e6546", + "37": "d0d24908b2657ee6f11c14b15e674f472b23f4bdd21b1989af948d16a55aca63", + "38": "d1989c8414580ae3259b908df889d5fd2c78a5f68362016217106552bbeee586", "4": "66849d43bf1485879bcf1c5f173d72862cca98a1985d0d2d0ef824fba8c5cbe6", "5": "e9427bcb1fe7b9bfe568b7451b9f6ccd770c9399ff05deae35775479e13a407b", "6": "4337bae9b89e2794112a158ead6c4f06c3c86d992046ba3902496ddc4f940b07", @@ -1551,7 +1560,16 @@ "8": "f4f0267af6f85a06591533f53a3cc74339723fa2e33c5f68e5fcd1b1ac4a6520", "80": "5e0743eb0be9c60c86567fc1b1a12d24f63351282852ac6c0d67aa522728fb59", "81": "a4ab530ee81f1480733c390b3e62add7ba94a40d58e32e65643b3cd7fee98d73", - "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25" + "82": "46e0e63b208ca20392ad494a2637dd30aa95d08d3482ed8fd100b12be1e52b62", + "83": "2781af8e584afd78567a74bea9cc50827fed7ecb8442af323d469dfba6db7f2a", + "84": "d3e861d6ede760cb88ac006e557f70a0da2034625d0378224638f3dc9f5d336a", + "85": "e1711a898fc515fa3328cbe6357c4fa03261861c676636e4004942845562018e", + "86": "a059f21190198fc779b91c748cd37145ef35b6724fe0c1abb3dd7b655ca14f92", + "87": "6c0e71fe2691ce540ff756d13fcfaf458dfef6e0db6c33bad22290cb884dfc36", + "88": "5506596f31e8c1564799495c47b88e88f4b1ba4b111b1c37a4b97629b706cf0a", + "89": "91c7aeb7dd6a251458c9485559a8385cb03abbab1d19359b44ccb35746b371d0", + "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25", + "90": "cb49636a4e30e6bddc791e02cc00c012028e7ef51684af0f4adf69334a22ff7f" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "d21a86dc7cd4b574b7c58faad7dff5e113e6ad5fd5739abed3d049e27de730fa", @@ -3240,6 +3258,15 @@ "28": "57481c929026e8b74c8eea29eb92223201498193b20a110acb6a0238a4c18645", "29": "5dd25528c8f42ac34bf4e92d996df104de0ec6f648b135593288afe871031c0f", "3": "bd9164bfbcff6da42e08428ca167eeb648967f4c40c019f79ef435be664b0d6a", + "30": "fc6c7e58cc1f5a6117069cd4ea7be75b9d07b1cdbbaeb55715cae7af7c4a0715", + "31": "2c93e74a2abbe2e2aca310941bfa3f41bd63ce7b4aba1ab4df463fe3877e9022", + "32": "0b465cb3154883a09e10326623f891be99297430ea7a9a24d24af436d2dc4ce5", + "33": "bec1760aff6e1e1d22904bfdb02038214b8d6e868506d16d1d912c65cab19eee", + "34": "f67725e8c3ff89eb603ff96fb792ddefddea8dc2cec4009cc5350f26280a7007", + "35": "524ae8f18c0c8885b4ed5756507b014d4fe09633498341af9c8d58b1ee61c421", + "36": "8e9f0c37cb7be107d5f87b0ada13f8e5830eee850ef43c3e02770fb68715e753", + "37": "0fbc6efbbc9f5ac2cbb615b83e23b3c782121b513b800602f12658765ae593f3", + "38": "df7b2882fb0933d2158fbe8badf373935d492a84ee21584b600b661b49a3bbf9", "4": "1b04fa2470af0aa59452389cb41125418154ab3939758ed4a38789ce290b33ab", "5": "f6e5cf8a0392c1bce3fd7d9ce4d0eccf9d39fe29f02ab9bcf5c342152eba4ffb", "6": "c5ef7876d05cc7b9ea1fd4a8fe807c660bb1102a5f198790aecfff165b017c28", @@ -3416,7 +3443,16 @@ "8": "436a62f0670b97e464439f466724c5d911a96b10e4bb035429b37d5be8d85243", "80": "6fdaac51b884fbbdbdd1e01ee5afce4c334fc1c203836842c6f91ae4196086a5", "81": "7be0d9f0c4e9b40c65b962ee1e0e7611517f838d1b6b7d08f4a77694c1b70c76", - "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9" + "82": "7e7c405e62a024d1704e21a371be6ea45c8ea187150d0bd2af73bb4484f4c7d7", + "83": "02669a17688d7203b3ac0322868d11a8836d694860e8e8246005c1ec5c94202a", + "84": "0e3e23d752dae8ebd6384661e7df5aec1b7246001114e04183a53c391bf78be0", + "85": "22c29d1bc0470751d76e96c07aeddd8e9cf4e7d28a9b617344cad8884b3a1a93", + "86": "b365c033a778d95309bfd13977bf10739ec6d29f3b10a880cbc1bbd90948a61b", + "87": "3830ed3ec13f6311ebde80539b568de035cc4ad83caa8576808fbc0e40dcad99", + "88": "cc8b31817e81c453c87898973559820297ca8a3478195c904e2178b5ab8aa3f7", + "89": "1935d741923dd4a591778c366724a945a6dd367ea43448400d6eb7d08218d883", + "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9", + "90": "3498134cf5b592c98e08b3a22095f1b079eaa913bb6ac04cef235c323b9d0b60" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "52fef7be3f5b5752f4d62e09b0c9296df1abdaba39cc1d360d05e41e0b70edb3", @@ -5104,6 +5140,15 @@ "28": "1a15806eeb788f57adc4b2f71223f50f15b3d632d3d17fd8140c26fe15110d07", "29": "940d064ac0ec9ba66eac1bb0b1fe71cb27d13325d4843f1654a86bc52785455c", "3": "04366ee133dbfc67fba244a8d80ef386386c288436c373fd2ba3fb34581287e7", + "30": "57ee817fa673ca055216d3fda7891ef5738b0d73c53ac26b7cbab6ebfa63ab23", + "31": "980fbdc1b97b5456850d6cc94c703bef9856c9e29e2bb55c3a5423817fdcdc09", + "32": "12e212bfd76862b05de34f55527246f9a4d1555e0934971003dcbd4f9d533c40", + "33": "494181a2a483168df1810295064ed62c5ad9af4f8fadc912b6c02717f5d74356", + "34": "4ead2bb421eaf455e56533f8274e7beaa5606c99ae6b7c8fe1f43bf94d103b2c", + "35": "3bdf72527ca314e2e753990025d6bfb7a9567d47271f04f92f7d3736db3b41ff", + "36": "e9b7879e54f0a493405adb3edbed29fc84a5241eb3ba0d027089224b3cecc13b", + "37": "e105747a45e35637abaa7df6f8e210903a4a6c5a4ef8f665226d90203558ce95", + "38": "5a915c91641043c6284b1a6c544ecfc2ea61020cf2c53831fd0073c31deaf34b", "4": "f7627f88969eff7df1add5b6a54937fff1c2eb1f869cf4db71f51ab1657c72f8", "5": "3b8b9c52b4b74d31c9be73c6d0ba0c5e7549a0015ff4e3fffb86fa16968912e4", "6": "a42abe98ff959a8fec3fa4e6d733b7a7382fb99212f6c25846d80aa3fd6e734f", @@ -5280,7 +5325,16 @@ "8": "7d827babcb8192445726b06e4250deb674158b5a77d87ecdd9e873118dc0ec93", "80": "67dbe9c3dc6e3d01481ef6916ec6133cf0af5337a5463c3ac49c6975e09a2129", "81": "a21cc72c28178f143ca1fdd2c3d81e5cebe4b18e5c5004af5553a4c9da5591a3", - "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0" + "82": "85bbf23e240650688c03029d4c624c6929e31980797c809a9dd923c4b205c9a0", + "83": "a201c530909742c2a7034ee3b48a812bc4b9657c5f6b8cab80d24b0aa8dfb705", + "84": "d3c73804384e2d530f137d3e6f8469d1bcef46edbcf960611ccf7dd966515748", + "85": "bf950f025325be33161c13a8ce6382d017ae6b42ff7f57610aa62d1418f581f4", + "86": "f32161f66ba28212d0b599336cabd2c62127957a5b5de4fdb554b5d5c8a13c50", + "87": "a810cb1a1d64ee12853965833059ab5af8e24681b4caa9f275759aaf12458e58", + "88": "cbea7bbc58914d0dfcf53f3aec3349f754c63b1f094db98c6ae25bcafb2b49ed", + "89": "9350c73c9af128189caabd0fa5ded414e8f9b1994e24d2edaaed32022c83cd8f", + "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0", + "90": "4e6ef62cc0b8c6086fd5ce70e716fcacb7bd3b4b82e9025abc4d441269b1efa5" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "6f9c1088480f429bc5f275eac443b8bdeeb1bedc8113b3984c4abc00054969a1", @@ -7122,6 +7176,15 @@ "28": "0f86e62577b31c17dd6541a1481587dd76a7c96d5ded6d3d1844621e04d1cd50", "29": "8f9a60a9d1695a7b971b5ccdc559cae67c20ba8e33db7817171c9329024f4996", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", + "30": "f3aee49ba3ded3161a25a1a17683b344532aeeb6af5906e4ab64850067831d6a", + "31": "9970054b580619fd6316bbc34b6e377cad793703dc8ef17ebec3729830339321", + "32": "85504ed1d9cd7af35cecddbfe7205d82f32cc23516cb656f7449e02f23054238", + "33": "4dd9b75561ae9f6914387c875c18e9fb5dd1c2328d7f241774d6c13f1d5f54d7", + "34": "8530f615d6d5cd0365460a7bf93681f658725128963437a8b2e5a6f13a88620f", + "35": "1f7a0a2091f8c84959f25697daa2b79d6cf25b0d4d9d2b91ab5f04cddffccbd4", + "36": "fe0f4e2722b539734cffac16f786b56fad7d1855bb017828c08fbaafc1732ccb", + "37": "a81931ee9941f9fcebe923057133ebff55fc01e3b46636df9c33a88109fb824f", + "38": "4bfc89e833c54655f339616126dc026c8bbe85793a04674efb64ee25d9c4e659", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -7298,7 +7361,16 @@ "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", "80": "67aee1395648bf72d013d292201b336b6607d73b5974c2e82848c36b210e92b5", "81": "2dcfe01e3dd46e0569097c2f72b071691fffa702195e42dced454017aaa1ea99", - "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07" + "82": "214592b414935eba99ce00dd524ee74a99c0052f76ccd0b4fec463128bb8f26a", + "83": "bcbe8b80f4146053cf0985f842df04914244dcf05aaac8a21aef735eaa8fe453", + "84": "d28a01c3e5eff2323aa21d52e748c1a7ac38e44b9b8f454c3763c60e34f0bee4", + "85": "26a25170e935e15012639a90284c8f0c4e1844dc6c8744285208b3a408187f06", + "86": "67bf5a562ed09fdf64310cfa10cecaf390b0bcedb4a18ef1360ffcf7ef398d5e", + "87": "c08176a0ef6ca39ecb30ad2bfda80d8642c54ad7264b08b052d2a7c9ac74ab73", + "88": "ce427f1304101e31eabf170c8dcba33c5bc249fe49a13aec8806ca075eb3fa3f", + "89": "0031410567582d31be1b28312607003a5c4e3be63270970766c993dc2129c3aa", + "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", + "90": "d1b3c31e36ae7a62a45fed9c1fd45ce6ab832c082777ab2e30296eeda53e5b3d" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", @@ -9447,6 +9519,15 @@ "28": "0f86e62577b31c17dd6541a1481587dd76a7c96d5ded6d3d1844621e04d1cd50", "29": "8f9a60a9d1695a7b971b5ccdc559cae67c20ba8e33db7817171c9329024f4996", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", + "30": "f3aee49ba3ded3161a25a1a17683b344532aeeb6af5906e4ab64850067831d6a", + "31": "9970054b580619fd6316bbc34b6e377cad793703dc8ef17ebec3729830339321", + "32": "85504ed1d9cd7af35cecddbfe7205d82f32cc23516cb656f7449e02f23054238", + "33": "4dd9b75561ae9f6914387c875c18e9fb5dd1c2328d7f241774d6c13f1d5f54d7", + "34": "8530f615d6d5cd0365460a7bf93681f658725128963437a8b2e5a6f13a88620f", + "35": "1f7a0a2091f8c84959f25697daa2b79d6cf25b0d4d9d2b91ab5f04cddffccbd4", + "36": "fe0f4e2722b539734cffac16f786b56fad7d1855bb017828c08fbaafc1732ccb", + "37": "a81931ee9941f9fcebe923057133ebff55fc01e3b46636df9c33a88109fb824f", + "38": "4bfc89e833c54655f339616126dc026c8bbe85793a04674efb64ee25d9c4e659", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -9623,7 +9704,16 @@ "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", "80": "67aee1395648bf72d013d292201b336b6607d73b5974c2e82848c36b210e92b5", "81": "2dcfe01e3dd46e0569097c2f72b071691fffa702195e42dced454017aaa1ea99", - "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07" + "82": "214592b414935eba99ce00dd524ee74a99c0052f76ccd0b4fec463128bb8f26a", + "83": "bcbe8b80f4146053cf0985f842df04914244dcf05aaac8a21aef735eaa8fe453", + "84": "d28a01c3e5eff2323aa21d52e748c1a7ac38e44b9b8f454c3763c60e34f0bee4", + "85": "26a25170e935e15012639a90284c8f0c4e1844dc6c8744285208b3a408187f06", + "86": "67bf5a562ed09fdf64310cfa10cecaf390b0bcedb4a18ef1360ffcf7ef398d5e", + "87": "c08176a0ef6ca39ecb30ad2bfda80d8642c54ad7264b08b052d2a7c9ac74ab73", + "88": "ce427f1304101e31eabf170c8dcba33c5bc249fe49a13aec8806ca075eb3fa3f", + "89": "0031410567582d31be1b28312607003a5c4e3be63270970766c993dc2129c3aa", + "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", + "90": "d1b3c31e36ae7a62a45fed9c1fd45ce6ab832c082777ab2e30296eeda53e5b3d" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/rocke_ir_parity_harness.py b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/rocke_ir_parity_harness.py index f5c3de96ff18..cc693b447c66 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/rocke_ir_parity_harness.py +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/rocke_ir_parity_harness.py @@ -3738,6 +3738,34 @@ def add(family, case_id, arch, build): **_branch_kw, ), ) + # runtime_layout tiled 2D (the hipkernel:AttentionPagedUnified objects). + # Dense or ragged Q and Q-dtype or fp32 sinks are kernargs, so one object + # per case covers both layouts and both sink forms. + for _case, _kw in ( + ("2d_rtl_bf16_d128_b16", dict(head_size=128, block_size=16, dtype="bf16")), + ( + "2d_rtl_sinks_fp16_d128_b16", + dict(head_size=128, block_size=16, dtype="fp16", use_sinks=True), + ), + ( + "2d_rtl_sinks_bf16_d256_b64", + dict(head_size=256, block_size=64, dtype="bf16", use_sinks=True), + ), + ): + add( + "attention", + f"attention/gfx950/{_case}", + "gfx950", + build_attention_2d( + f"irhash_attn_950_{_case}", + "gfx950", + num_query_heads=8, + num_kv_heads=1, + num_warps=4, + runtime_layout=True, + **_kw, + ), + ) add( "attention", "attention/gfx942/2d_fp16_d128_b64", @@ -3818,6 +3846,43 @@ def add(family, case_id, arch, build): **_branch_kw, ), ) + # runtime_layout tiled 2D, as on gfx950; d256 runs the 2-warp body. + for _case, _kw in ( + ( + "2d_rtl_bf16_d128_b16", + dict(head_size=128, block_size=16, dtype="bf16", num_warps=4), + ), + ( + "2d_rtl_sinks_fp16_d128_b16", + dict( + head_size=128, block_size=16, dtype="fp16", num_warps=4, use_sinks=True + ), + ), + ( + "2d_rtl_sinks_bf16_d256_b64_w2", + dict( + head_size=256, + block_size=64, + dtype="bf16", + num_warps=2, + tile_size=16, + use_sinks=True, + ), + ), + ): + add( + "attention", + f"attention/gfx942/{_case}", + "gfx942", + build_attention_2d( + f"irhash_attn_942_{_case}", + "gfx942", + num_query_heads=8, + num_kv_heads=1, + runtime_layout=True, + **_kw, + ), + ) add( "attention", "attention/gfx942/3d_fp16_d128_b64", From 709240cdb41712e2991ae07b00f9639402211710 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Thu, 22 Oct 2026 12:33:24 -0600 Subject: [PATCH 04/22] feat(hip-kernel-provider): AttentionPagedUnified sink objects Every shipped (arch, dtype, head size, block size, GQA ratio) object now also ships with use_sinks (name suffix _sinks), distinguished by a new KMD field use_sinks (int, default 0). 144 -> 288 objects per arch (288 -> 576 total). Descriptors regenerated with IngestorGenerator; retained documents and kernel entries keep their ids. The pack census lists the new objects. --- .../attention_paged_unified.kmd.json | 5 + .../attention_paged_unified_gfx942.kdp.json | 6464 +++++++++++++++-- .../attention_paged_unified_gfx950.kdp.json | 6294 ++++++++++++++-- .../packs/TestAttentionPagedUnifiedPacks.cpp | 288 + .../configs/attention_paged_unified.yaml | 123 +- 5 files changed, 11846 insertions(+), 1328 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json index ee5f4f2652bc..fc8d9092254d 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified.kmd.json @@ -33,6 +33,11 @@ "name": "block_m_per_warp", "type": "int", "default_value": 16 + }, + { + "name": "use_sinks", + "type": "int", + "default_value": 0 } ] } diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json index dd459c7ef65a..3aa8a625f610 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx942.kdp.json @@ -22,7 +22,8 @@ "num_query_heads", "num_kv_heads", "num_warps", - "block_m_per_warp" + "block_m_per_warp", + "use_sinks" ], "matcher_only_fields": [], "bindings": { @@ -46,6 +47,9 @@ }, "block_m_per_warp": { "field": "block_m_per_warp" + }, + "use_sinks": { + "field": "use_sinks" } }, "vocabulary": { @@ -88,7 +92,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -121,7 +126,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -154,7 +160,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -187,7 +194,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -220,7 +228,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -253,7 +262,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -286,7 +296,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -319,7 +330,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -352,7 +364,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -385,7 +398,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -418,7 +432,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -451,7 +466,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -484,7 +500,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -517,7 +534,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -550,7 +568,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -583,7 +602,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -616,7 +636,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -649,7 +670,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -682,7 +704,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -715,7 +738,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -748,7 +772,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -781,7 +806,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -814,7 +840,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -847,7 +874,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -880,7 +908,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -913,7 +942,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -946,7 +976,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -979,7 +1010,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1012,7 +1044,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1045,7 +1078,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1078,7 +1112,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1111,7 +1146,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1144,7 +1180,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1177,7 +1214,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1210,7 +1248,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1243,7 +1282,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1276,7 +1316,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1309,7 +1350,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1342,7 +1384,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1375,7 +1418,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1408,7 +1452,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1441,7 +1486,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1474,7 +1520,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1507,7 +1554,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1540,7 +1588,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1573,7 +1622,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1606,7 +1656,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -1639,25 +1690,26 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "701f27e2-1560-46bf-bf5c-0f4859384cfe", - "name": "paged_unified.fp16_d128_bs16_g1.gfx942", + "id": "edea0288-803a-4df7-a716-fc82de61f3e5", + "name": "paged_unified.fp16_d64_bs16_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1667,30 +1719,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d50f33f2-58d5-4081-8936-4865bb8634cf", - "name": "paged_unified.fp16_d128_bs16_g2.gfx942", + "id": "efd0c742-f53b-4d4f-9c0c-9789c02513f1", + "name": "paged_unified.fp16_d64_bs16_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1700,30 +1753,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "fd7b7e40-e45a-42bc-bae7-b88fc6cf68e1", - "name": "paged_unified.fp16_d128_bs16_g4.gfx942", + "id": "fa893f71-fc0c-42da-8687-267bed9c0b27", + "name": "paged_unified.fp16_d64_bs16_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1733,30 +1787,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "80f7dd0d-aa5b-4f56-b4e5-5348fbe2938d", - "name": "paged_unified.fp16_d128_bs16_g5.gfx942", + "id": "e507356f-6d1b-422f-b5af-9e3ba120e7d3", + "name": "paged_unified.fp16_d64_bs16_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1766,30 +1821,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6e936022-555f-4ba7-82ef-6aaef6e28aaa", - "name": "paged_unified.fp16_d128_bs16_g6.gfx942", + "id": "ce6b284d-cd6c-40cf-b84b-5e49277cc8db", + "name": "paged_unified.fp16_d64_bs16_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1799,30 +1855,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "44491d76-6096-47a4-94e2-ede91b0df490", - "name": "paged_unified.fp16_d128_bs16_g7.gfx942", + "id": "0b396c1e-f4f8-49ce-a4ae-3c0acf1f0487", + "name": "paged_unified.fp16_d64_bs16_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1832,30 +1889,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "cfccbc6b-ee3b-49ae-9600-cc202f29a4a9", - "name": "paged_unified.fp16_d128_bs16_g8.gfx942", + "id": "8f9993eb-8728-4f27-bf8b-ff42c84dc3e3", + "name": "paged_unified.fp16_d64_bs16_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1865,30 +1923,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "88a19b4b-4564-408c-8abb-9327a3974cdd", - "name": "paged_unified.fp16_d128_bs16_g16.gfx942", + "id": "68cbfa56-e167-4d71-bbe3-1f32e3e81fb3", + "name": "paged_unified.fp16_d64_bs16_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1898,30 +1957,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a641185b-5f20-4091-8a82-6c296b90b609", - "name": "paged_unified.fp16_d128_bs32_g1.gfx942", + "id": "98dbd3cf-8f48-4fb8-85ba-d1269cc62fd9", + "name": "paged_unified.fp16_d64_bs32_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1931,30 +1991,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "9f5a1fd7-3694-47cf-972c-2b2cb2a4f534", - "name": "paged_unified.fp16_d128_bs32_g2.gfx942", + "id": "2f131e74-5d36-43fe-87c8-596e3d235316", + "name": "paged_unified.fp16_d64_bs32_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1964,30 +2025,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "75312411-5fc9-42e4-a32a-e053d0b49c30", - "name": "paged_unified.fp16_d128_bs32_g4.gfx942", + "id": "2be8a4b5-ad22-45e0-bdcf-8012721e0b7c", + "name": "paged_unified.fp16_d64_bs32_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1997,30 +2059,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "88678d21-5e9b-4ad1-aaa5-88ab75c79f36", - "name": "paged_unified.fp16_d128_bs32_g5.gfx942", + "id": "06891651-7658-4fe3-9aac-2ccc8275f5cb", + "name": "paged_unified.fp16_d64_bs32_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2030,30 +2093,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d8044804-2395-4d7f-aced-613dbb18a5e5", - "name": "paged_unified.fp16_d128_bs32_g6.gfx942", + "id": "705add03-e92b-48ca-a7ee-a018aea49629", + "name": "paged_unified.fp16_d64_bs32_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2063,30 +2127,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6d889bb3-3530-421e-9bfb-99caed2a2129", - "name": "paged_unified.fp16_d128_bs32_g7.gfx942", + "id": "11a4a13b-c395-4331-8963-b5116a76e907", + "name": "paged_unified.fp16_d64_bs32_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2096,30 +2161,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4641983e-55ea-430e-b3c2-1efc43b63c99", - "name": "paged_unified.fp16_d128_bs32_g8.gfx942", + "id": "597ab83d-b9ec-409c-a5e9-17e9ddf99e23", + "name": "paged_unified.fp16_d64_bs32_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2129,30 +2195,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4e2c8d14-471d-4073-bf96-fcfa50b41d15", - "name": "paged_unified.fp16_d128_bs32_g16.gfx942", + "id": "cae125c6-a501-4f05-b163-02e3dbec6316", + "name": "paged_unified.fp16_d64_bs32_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2162,30 +2229,31 @@ }, "metadata": { "dtype": "FP16", - "head_size": 128, + "head_size": 64, "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "09069d51-a53b-42e0-868d-5c988d6ad258", - "name": "paged_unified.bf16_d128_bs16_g1.gfx942", + "id": "56d06e87-fa3d-4cee-8277-03a17af619a3", + "name": "paged_unified.fp16_d64_bs64_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2194,31 +2262,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "97a2206e-6618-4bcf-8fb8-f7f50d4f1647", - "name": "paged_unified.bf16_d128_bs16_g2.gfx942", + "id": "ce57492c-6860-4323-96a8-48d0b682c81a", + "name": "paged_unified.fp16_d64_bs64_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2227,31 +2296,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "514bc828-2d04-4a1f-abbf-275299038ffd", - "name": "paged_unified.bf16_d128_bs16_g4.gfx942", + "id": "bfe09b21-3f69-4bee-a7b8-8981e83e344b", + "name": "paged_unified.fp16_d64_bs64_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2260,31 +2330,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "0dd22a87-666c-4908-9043-1f336f4572be", - "name": "paged_unified.bf16_d128_bs16_g5.gfx942", + "id": "ed65bc94-03ec-4d6b-9d31-f0a7ec8e7c17", + "name": "paged_unified.fp16_d64_bs64_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2293,31 +2364,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6807f611-dabe-43c2-90e4-9ad2d554d3f4", - "name": "paged_unified.bf16_d128_bs16_g6.gfx942", + "id": "917d3b03-da13-4eb6-838e-2b326c467274", + "name": "paged_unified.fp16_d64_bs64_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2326,31 +2398,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "c12fe6fe-7ff6-4dab-932a-0785c62eacf0", - "name": "paged_unified.bf16_d128_bs16_g7.gfx942", + "id": "fcd8c1ec-fc63-415e-be0b-4ae896d4aad2", + "name": "paged_unified.fp16_d64_bs64_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2359,31 +2432,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "b2c33dd4-1a94-4ff5-b608-d542c8ac86aa", - "name": "paged_unified.bf16_d128_bs16_g8.gfx942", + "id": "2814bb22-431b-450b-b920-f24d1542fb02", + "name": "paged_unified.fp16_d64_bs64_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2392,31 +2466,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "175c08b0-a170-41d3-83c9-792e4a52b548", - "name": "paged_unified.bf16_d128_bs16_g16.gfx942", + "id": "b359048d-2224-4718-9374-053cf31b0f45", + "name": "paged_unified.fp16_d64_bs64_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 16, + "head_size": 64, + "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, - "dtype": "bf16", - "use_sinks": false, + "dtype": "fp16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2425,31 +2500,32 @@ } }, "metadata": { - "dtype": "BF16", - "head_size": 128, - "block_size": 16, + "dtype": "FP16", + "head_size": 64, + "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "b411a49c-412c-4e06-a800-f12dc574f857", - "name": "paged_unified.bf16_d128_bs32_g1.gfx942", + "id": "48c39822-7bf3-40dc-bbcb-b3dc7097b84d", + "name": "paged_unified.bf16_d64_bs16_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2459,30 +2535,31 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "ed58e83c-f25f-4e65-b538-b0770e25a349", - "name": "paged_unified.bf16_d128_bs32_g2.gfx942", + "id": "4ce28d1c-58e7-4930-b426-f5fa4cd96155", + "name": "paged_unified.bf16_d64_bs16_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2492,30 +2569,31 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "c63de556-8f99-450c-b314-70a06e5ed83c", - "name": "paged_unified.bf16_d128_bs32_g4.gfx942", + "id": "6d25df23-7e6e-47b2-8cce-8ce35aa827bc", + "name": "paged_unified.bf16_d64_bs16_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2525,30 +2603,31 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2260732c-5eed-40b9-9ef7-efb5aba4fe69", - "name": "paged_unified.bf16_d128_bs32_g5.gfx942", + "id": "5f2ed1f6-ede2-47a9-b4a2-d8feb1cc78be", + "name": "paged_unified.bf16_d64_bs16_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2558,30 +2637,31 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d67f5676-606a-4806-83ca-d38332f1ae7f", - "name": "paged_unified.bf16_d128_bs32_g6.gfx942", + "id": "ecb3c36a-2c57-46b0-9da3-0f840bf07d75", + "name": "paged_unified.bf16_d64_bs16_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2591,30 +2671,31 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a913addc-0225-4271-b72e-450296107b78", - "name": "paged_unified.bf16_d128_bs32_g7.gfx942", + "id": "4d8c7fd7-e8e7-484d-9091-21e0290ccb31", + "name": "paged_unified.bf16_d64_bs16_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2624,30 +2705,31 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5e7109ba-5996-4a22-b50f-76ac74bc4bdd", - "name": "paged_unified.bf16_d128_bs32_g8.gfx942", + "id": "a6cb055b-f7fb-49d7-98d5-2465db2a1ec8", + "name": "paged_unified.bf16_d64_bs16_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2657,30 +2739,31 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6177c073-1d67-48e2-b1bf-2276ca576323", - "name": "paged_unified.bf16_d128_bs32_g16.gfx942", + "id": "c004bfa1-ff65-4ff3-b549-c5faa7ba6ad7", + "name": "paged_unified.bf16_d64_bs16_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2690,569 +2773,570 @@ }, "metadata": { "dtype": "BF16", - "head_size": 128, - "block_size": 32, + "head_size": 64, + "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "86747b15-9cd1-4100-b342-b141cfb866c7", - "name": "paged_unified.fp16_d128_bs64_g1.gfx942", + "id": "2935d6be-76f2-430d-9cbb-1a9e7f614a7f", + "name": "paged_unified.bf16_d64_bs32_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 1, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4e370ce1-dd0a-4007-adce-f60fca42798a", - "name": "paged_unified.fp16_d128_bs64_g2.gfx942", + "id": "fa828605-a4cc-47d6-94d6-04a1a34ccb5a", + "name": "paged_unified.bf16_d64_bs32_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 2, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "f0f1bcaa-d60a-4cce-aa9d-da0fce673723", - "name": "paged_unified.fp16_d128_bs64_g4.gfx942", + "id": "948abe50-9c07-4e81-9037-25c69300d1ba", + "name": "paged_unified.bf16_d64_bs32_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 4, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "1b5aa6c7-c2e9-48bc-8a21-730cbff8931d", - "name": "paged_unified.fp16_d128_bs64_g5.gfx942", + "id": "980ce7b6-b49d-42cf-84ba-813fadc7b610", + "name": "paged_unified.bf16_d64_bs32_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "293e79fa-4d2e-4217-b958-85eac443ae20", - "name": "paged_unified.fp16_d128_bs64_g6.gfx942", + "id": "473ea40b-be27-4b10-bec3-7732a2a4cb82", + "name": "paged_unified.bf16_d64_bs32_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "e65ad64f-8be5-4ed7-9581-6dc36ee21a37", - "name": "paged_unified.fp16_d128_bs64_g7.gfx942", + "id": "a9cb25f6-0425-4f89-80b3-30f91c9850d2", + "name": "paged_unified.bf16_d64_bs32_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "0f5fdc64-0bca-4f70-8eaf-34b354ab515f", - "name": "paged_unified.fp16_d128_bs64_g8.gfx942", + "id": "fb1472e9-fdd2-4a4a-949f-d5d225ec6eae", + "name": "paged_unified.bf16_d64_bs32_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "66eb77a7-9294-4c39-942f-7450b1c6ce57", - "name": "paged_unified.fp16_d128_bs64_g16.gfx942", + "id": "6aa4f2c7-aa20-476e-b8db-72a392bba49e", + "name": "paged_unified.bf16_d64_bs32_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, - "block_size": 64, + "head_size": 64, + "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { - "dtype": "FP16", - "head_size": 128, - "block_size": 64, + "dtype": "BF16", + "head_size": 64, + "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "7b25d583-ad68-46c3-879a-16bbc173e263", - "name": "paged_unified.bf16_d128_bs64_g1.gfx942", + "id": "29b6f77f-01f7-4a52-987c-16c1be9eb3e1", + "name": "paged_unified.bf16_d64_bs64_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "1db67e22-b005-4897-a718-dcf582a9ff52", - "name": "paged_unified.bf16_d128_bs64_g2.gfx942", + "id": "e55989c5-7a1c-4ff7-ab34-a8b59f91d66d", + "name": "paged_unified.bf16_d64_bs64_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "c5dc14ec-03ed-4856-a5ec-712f5cf89c3b", - "name": "paged_unified.bf16_d128_bs64_g4.gfx942", + "id": "ea40284c-94cf-4f2d-92cf-209410d4918b", + "name": "paged_unified.bf16_d64_bs64_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4e7b3dd7-efb8-48b4-86f5-3531a252ab39", - "name": "paged_unified.bf16_d128_bs64_g5.gfx942", + "id": "ca6be064-a1f3-4a94-abde-aec7d0d690d9", + "name": "paged_unified.bf16_d64_bs64_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6c694e99-03a7-45e5-9784-aec50b7f3dca", - "name": "paged_unified.bf16_d128_bs64_g6.gfx942", + "id": "34ae8ffa-93f1-43e3-aa1d-cab33b54c08f", + "name": "paged_unified.bf16_d64_bs64_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6a0be8fc-a18a-4394-8d6c-44fb1f635aba", - "name": "paged_unified.bf16_d128_bs64_g7.gfx942", + "id": "341c1a1d-3303-4fe1-b7dd-5b3208bd63a0", + "name": "paged_unified.bf16_d64_bs64_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "7d25615f-88ce-4c94-ac3e-700adc1203ca", - "name": "paged_unified.bf16_d128_bs64_g8.gfx942", + "id": "4d5233e6-7332-48d5-a572-fdfac3a5c090", + "name": "paged_unified.bf16_d64_bs64_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "1988811f-6442-4704-bfed-87152b891790", - "name": "paged_unified.bf16_d128_bs64_g16.gfx942", + "id": "9dd43587-9687-48c2-91b3-ba7e30e9ade8", + "name": "paged_unified.bf16_d64_bs64_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, "block_m_per_warp": 16, - "runtime_layout": true, - "tile_size": 32 + "runtime_layout": true } }, "metadata": { "dtype": "BF16", - "head_size": 128, + "head_size": 64, "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5c514c06-d72c-447a-b40b-d91c24f311ad", - "name": "paged_unified.fp16_d256_bs16_g1.gfx942", + "id": "701f27e2-1560-46bf-bf5c-0f4859384cfe", + "name": "paged_unified.fp16_d128_bs16_g1.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 256, + "head_size": 128, "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, @@ -3260,32 +3344,33 @@ "use_sinks": false, "sliding_window": 0, "has_softcap": false, - "num_warps": 2, + "num_warps": 4, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { "dtype": "FP16", - "head_size": 256, + "head_size": 128, "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, - "num_warps": 2, - "block_m_per_warp": 16 + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "cebbdb37-ba3d-4768-8603-922559efb84b", - "name": "paged_unified.fp16_d256_bs16_g2.gfx942", + "id": "d50f33f2-58d5-4081-8936-4865bb8634cf", + "name": "paged_unified.fp16_d128_bs16_g2.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 256, + "head_size": 128, "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, @@ -3293,32 +3378,33 @@ "use_sinks": false, "sliding_window": 0, "has_softcap": false, - "num_warps": 2, + "num_warps": 4, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { "dtype": "FP16", - "head_size": 256, + "head_size": 128, "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, - "num_warps": 2, - "block_m_per_warp": 16 + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "5179bd59-7ad4-459d-8670-252529f6e40f", - "name": "paged_unified.fp16_d256_bs16_g4.gfx942", + "id": "fd7b7e40-e45a-42bc-bae7-b88fc6cf68e1", + "name": "paged_unified.fp16_d128_bs16_g4.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 256, + "head_size": 128, "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, @@ -3326,198 +3412,5156 @@ "use_sinks": false, "sliding_window": 0, "has_softcap": false, - "num_warps": 2, + "num_warps": 4, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { "dtype": "FP16", - "head_size": 256, + "head_size": 128, "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, - "num_warps": 2, - "block_m_per_warp": 16 + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "abb8d874-4c87-47dd-8b55-1a9123fc0b52", - "name": "paged_unified.fp16_d256_bs16_g5.gfx942", + "id": "80f7dd0d-aa5b-4f56-b4e5-5348fbe2938d", + "name": "paged_unified.fp16_d128_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6e936022-555f-4ba7-82ef-6aaef6e28aaa", + "name": "paged_unified.fp16_d128_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "44491d76-6096-47a4-94e2-ede91b0df490", + "name": "paged_unified.fp16_d128_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cfccbc6b-ee3b-49ae-9600-cc202f29a4a9", + "name": "paged_unified.fp16_d128_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "88a19b4b-4564-408c-8abb-9327a3974cdd", + "name": "paged_unified.fp16_d128_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a641185b-5f20-4091-8a82-6c296b90b609", + "name": "paged_unified.fp16_d128_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9f5a1fd7-3694-47cf-972c-2b2cb2a4f534", + "name": "paged_unified.fp16_d128_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "75312411-5fc9-42e4-a32a-e053d0b49c30", + "name": "paged_unified.fp16_d128_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "88678d21-5e9b-4ad1-aaa5-88ab75c79f36", + "name": "paged_unified.fp16_d128_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d8044804-2395-4d7f-aced-613dbb18a5e5", + "name": "paged_unified.fp16_d128_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6d889bb3-3530-421e-9bfb-99caed2a2129", + "name": "paged_unified.fp16_d128_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4641983e-55ea-430e-b3c2-1efc43b63c99", + "name": "paged_unified.fp16_d128_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4e2c8d14-471d-4073-bf96-fcfa50b41d15", + "name": "paged_unified.fp16_d128_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "09069d51-a53b-42e0-868d-5c988d6ad258", + "name": "paged_unified.bf16_d128_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "97a2206e-6618-4bcf-8fb8-f7f50d4f1647", + "name": "paged_unified.bf16_d128_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "514bc828-2d04-4a1f-abbf-275299038ffd", + "name": "paged_unified.bf16_d128_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0dd22a87-666c-4908-9043-1f336f4572be", + "name": "paged_unified.bf16_d128_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6807f611-dabe-43c2-90e4-9ad2d554d3f4", + "name": "paged_unified.bf16_d128_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c12fe6fe-7ff6-4dab-932a-0785c62eacf0", + "name": "paged_unified.bf16_d128_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b2c33dd4-1a94-4ff5-b608-d542c8ac86aa", + "name": "paged_unified.bf16_d128_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "175c08b0-a170-41d3-83c9-792e4a52b548", + "name": "paged_unified.bf16_d128_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b411a49c-412c-4e06-a800-f12dc574f857", + "name": "paged_unified.bf16_d128_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ed58e83c-f25f-4e65-b538-b0770e25a349", + "name": "paged_unified.bf16_d128_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c63de556-8f99-450c-b314-70a06e5ed83c", + "name": "paged_unified.bf16_d128_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2260732c-5eed-40b9-9ef7-efb5aba4fe69", + "name": "paged_unified.bf16_d128_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d67f5676-606a-4806-83ca-d38332f1ae7f", + "name": "paged_unified.bf16_d128_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a913addc-0225-4271-b72e-450296107b78", + "name": "paged_unified.bf16_d128_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5e7109ba-5996-4a22-b50f-76ac74bc4bdd", + "name": "paged_unified.bf16_d128_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6177c073-1d67-48e2-b1bf-2276ca576323", + "name": "paged_unified.bf16_d128_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "83dcfc4d-8e09-424d-b8a1-67c66f18d9e6", + "name": "paged_unified.fp16_d128_bs16_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "efdfd402-dab8-46ff-baa7-fc7323af17c2", + "name": "paged_unified.fp16_d128_bs16_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8798d5a9-c166-420b-9912-1cd029e68a18", + "name": "paged_unified.fp16_d128_bs16_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "48072aa3-cc2e-43d2-8d09-95bcba27ebbb", + "name": "paged_unified.fp16_d128_bs16_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b91951f0-1603-474d-b29a-5645e4777630", + "name": "paged_unified.fp16_d128_bs16_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7eb41725-63cc-4e52-8664-c80cb62cc81c", + "name": "paged_unified.fp16_d128_bs16_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "40994238-8d4f-4845-b5a4-632f95e149a1", + "name": "paged_unified.fp16_d128_bs16_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "15f4a6d8-1fa2-469a-a8a5-0f91df50806e", + "name": "paged_unified.fp16_d128_bs16_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "01927d50-aaa5-4434-85f6-f884ff321af6", + "name": "paged_unified.fp16_d128_bs32_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "369c4d85-25ca-4cc2-aa8c-1b730cf18a88", + "name": "paged_unified.fp16_d128_bs32_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d136107-bb4c-4336-8716-4130ac94ddae", + "name": "paged_unified.fp16_d128_bs32_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f825b9ce-a1f5-4354-9476-fdbda9b3012a", + "name": "paged_unified.fp16_d128_bs32_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9464eeee-a045-41ed-9843-767a330aaed7", + "name": "paged_unified.fp16_d128_bs32_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "afb03fcc-1f07-4779-a24f-0d7c83ea2723", + "name": "paged_unified.fp16_d128_bs32_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0905886e-3652-45d8-9aab-3698abd7a195", + "name": "paged_unified.fp16_d128_bs32_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9e55cd05-209b-4ec6-8dcd-608c083e709a", + "name": "paged_unified.fp16_d128_bs32_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "09e8181e-e9b7-4cef-af3c-3b5dab814c66", + "name": "paged_unified.bf16_d128_bs16_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "463add6f-1c12-4aeb-821c-f26c0888ba07", + "name": "paged_unified.bf16_d128_bs16_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "54d4c8b3-3bce-49f2-8977-911747a734f4", + "name": "paged_unified.bf16_d128_bs16_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2243d4c4-92a6-4305-a53e-e1e6b8e835e0", + "name": "paged_unified.bf16_d128_bs16_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "95246058-6f92-47ee-83f1-343788cd48d0", + "name": "paged_unified.bf16_d128_bs16_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "44a9e913-e160-485c-b299-eb3c1007af7d", + "name": "paged_unified.bf16_d128_bs16_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "80b3c220-0fbe-420b-b973-12873de73007", + "name": "paged_unified.bf16_d128_bs16_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f40569e6-b774-4908-be41-b085f57241f5", + "name": "paged_unified.bf16_d128_bs16_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1b72b6ec-c94e-4cde-8b94-640b69f9e2c8", + "name": "paged_unified.bf16_d128_bs32_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "022ac29c-cf0f-4f36-bf6a-9eceb14337c9", + "name": "paged_unified.bf16_d128_bs32_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b7b5365b-3d1d-4dd3-bc1e-d4462a6449b4", + "name": "paged_unified.bf16_d128_bs32_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cdf7c7b8-368b-41f7-af3d-7c03b22ab4b3", + "name": "paged_unified.bf16_d128_bs32_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "22559312-ed9c-47e0-9379-566b909ccd2c", + "name": "paged_unified.bf16_d128_bs32_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "66530765-d0e0-4b51-9261-d395722353a6", + "name": "paged_unified.bf16_d128_bs32_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "993fdedb-9d58-43c1-89ca-8248081f48ad", + "name": "paged_unified.bf16_d128_bs32_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2752284a-7165-42a6-bb04-ac37d92654ac", + "name": "paged_unified.bf16_d128_bs32_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "86747b15-9cd1-4100-b342-b141cfb866c7", + "name": "paged_unified.fp16_d128_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4e370ce1-dd0a-4007-adce-f60fca42798a", + "name": "paged_unified.fp16_d128_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f0f1bcaa-d60a-4cce-aa9d-da0fce673723", + "name": "paged_unified.fp16_d128_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1b5aa6c7-c2e9-48bc-8a21-730cbff8931d", + "name": "paged_unified.fp16_d128_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "293e79fa-4d2e-4217-b958-85eac443ae20", + "name": "paged_unified.fp16_d128_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e65ad64f-8be5-4ed7-9581-6dc36ee21a37", + "name": "paged_unified.fp16_d128_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0f5fdc64-0bca-4f70-8eaf-34b354ab515f", + "name": "paged_unified.fp16_d128_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "66eb77a7-9294-4c39-942f-7450b1c6ce57", + "name": "paged_unified.fp16_d128_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7b25d583-ad68-46c3-879a-16bbc173e263", + "name": "paged_unified.bf16_d128_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1db67e22-b005-4897-a718-dcf582a9ff52", + "name": "paged_unified.bf16_d128_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c5dc14ec-03ed-4856-a5ec-712f5cf89c3b", + "name": "paged_unified.bf16_d128_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4e7b3dd7-efb8-48b4-86f5-3531a252ab39", + "name": "paged_unified.bf16_d128_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6c694e99-03a7-45e5-9784-aec50b7f3dca", + "name": "paged_unified.bf16_d128_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6a0be8fc-a18a-4394-8d6c-44fb1f635aba", + "name": "paged_unified.bf16_d128_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7d25615f-88ce-4c94-ac3e-700adc1203ca", + "name": "paged_unified.bf16_d128_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1988811f-6442-4704-bfed-87152b891790", + "name": "paged_unified.bf16_d128_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b868eee8-08ce-4b80-9c38-c3132f9a66ab", + "name": "paged_unified.fp16_d128_bs64_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6b41e98a-7939-47e7-a954-14541ff5f5f2", + "name": "paged_unified.fp16_d128_bs64_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0662ca6f-9198-4414-9aca-713f88d2aca6", + "name": "paged_unified.fp16_d128_bs64_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8288266c-185a-4825-a46a-400c98639ad6", + "name": "paged_unified.fp16_d128_bs64_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ecaa4f99-0cd8-4906-a3cd-0860373c17f5", + "name": "paged_unified.fp16_d128_bs64_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b7e52113-ec03-4963-a78a-38c5f56f275c", + "name": "paged_unified.fp16_d128_bs64_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0bd871cd-e78f-4b35-8c63-c4dcc7d8f59d", + "name": "paged_unified.fp16_d128_bs64_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d28d80c-4033-4594-8fc8-6aedc37a7d0b", + "name": "paged_unified.fp16_d128_bs64_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "fe6a9848-1731-4d8e-bdda-a313fe5b06e8", + "name": "paged_unified.bf16_d128_bs64_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "dd540b67-0b13-4bf2-9d5a-86a315117ecb", + "name": "paged_unified.bf16_d128_bs64_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a3a1e898-74c5-4649-8c3b-21c628834ecc", + "name": "paged_unified.bf16_d128_bs64_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "032af522-35f4-40ba-8868-fceb21a2f56f", + "name": "paged_unified.bf16_d128_bs64_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d742b875-a839-4967-9f4d-c2a5b3d8778a", + "name": "paged_unified.bf16_d128_bs64_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "db83fb90-d971-4227-8396-6ba7f4369ff3", + "name": "paged_unified.bf16_d128_bs64_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "578083f5-f71c-418c-a340-691f8b5a4efb", + "name": "paged_unified.bf16_d128_bs64_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f0748b99-db7a-48a2-984f-b7959e082f3c", + "name": "paged_unified.bf16_d128_bs64_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 32 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5c514c06-d72c-447a-b40b-d91c24f311ad", + "name": "paged_unified.fp16_d256_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cebbdb37-ba3d-4768-8603-922559efb84b", + "name": "paged_unified.fp16_d256_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5179bd59-7ad4-459d-8670-252529f6e40f", + "name": "paged_unified.fp16_d256_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "abb8d874-4c87-47dd-8b55-1a9123fc0b52", + "name": "paged_unified.fp16_d256_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e2fa0990-75a3-4348-9bc3-8a38348bb4dd", + "name": "paged_unified.fp16_d256_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b673c8ea-17e8-4582-9959-755b90c78c56", + "name": "paged_unified.fp16_d256_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8006a158-39f9-4c23-8d69-7dc7a9815665", + "name": "paged_unified.fp16_d256_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "18035187-7ead-4e13-8f04-d426787f774d", + "name": "paged_unified.fp16_d256_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "61554637-a037-4334-87bd-7590768fdd36", + "name": "paged_unified.bf16_d256_bs16_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "64b4aff1-dc26-4529-9858-6c332be5a7a6", + "name": "paged_unified.bf16_d256_bs16_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b0b6dde0-c33a-4412-9c48-ed3f53db151c", + "name": "paged_unified.bf16_d256_bs16_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a07594c6-c531-4de9-a665-ad71aaeea49a", + "name": "paged_unified.bf16_d256_bs16_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "20aedd92-dfac-42ec-be28-52d8c42eb69a", + "name": "paged_unified.bf16_d256_bs16_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d85f359-75dd-4491-9ed1-0bc53aadcad9", + "name": "paged_unified.bf16_d256_bs16_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cdbf067b-17a1-45de-839d-a9354959a517", + "name": "paged_unified.bf16_d256_bs16_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8d2b1838-4a4c-44bb-896a-1ce30a4c5c5a", + "name": "paged_unified.bf16_d256_bs16_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3d079a25-6d13-41e5-8ae3-c6fd9d54b53b", + "name": "paged_unified.fp16_d256_bs16_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "57b6c52f-ae9f-4f5b-b361-b22014dbafe8", + "name": "paged_unified.fp16_d256_bs16_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "625ec71d-71a9-4890-94a7-82e8126a6d36", + "name": "paged_unified.fp16_d256_bs16_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9c567671-1352-4273-bb4b-475cef864c72", + "name": "paged_unified.fp16_d256_bs16_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "409765d8-8991-4516-adba-ae12fcf3c78c", + "name": "paged_unified.fp16_d256_bs16_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "168b66a0-b4c7-4e9a-a0d2-31a702cf66f1", + "name": "paged_unified.fp16_d256_bs16_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "31de36e4-191f-44eb-be4f-a79b278312e7", + "name": "paged_unified.fp16_d256_bs16_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "89501484-f75f-4119-9ec0-e86d90d1f49a", + "name": "paged_unified.fp16_d256_bs16_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8b65cc04-ab1a-469a-9e49-09c80d47a2ac", + "name": "paged_unified.bf16_d256_bs16_g1_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ba76172b-9478-4618-8a32-4bbb85f70c9f", + "name": "paged_unified.bf16_d256_bs16_g2_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2f2abd72-29cc-44f5-b881-e1c8fef4ec71", + "name": "paged_unified.bf16_d256_bs16_g4_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "395c1213-e35d-4a9f-a219-b29e423dd85a", + "name": "paged_unified.bf16_d256_bs16_g5_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "66bbad55-aee2-4373-8bd6-aa43e2bf2063", + "name": "paged_unified.bf16_d256_bs16_g6_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "808485f9-732e-4c35-ae64-d9c0bbf3a32a", + "name": "paged_unified.bf16_d256_bs16_g7_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4567a03b-496d-4ef6-8341-2c2b0529111e", + "name": "paged_unified.bf16_d256_bs16_g8_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "739e5047-23cd-45a7-a897-fea7ea8bf04e", + "name": "paged_unified.bf16_d256_bs16_g16_sinks.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6cc3a1e4-015e-4b86-a948-e319eaeb7ad8", + "name": "paged_unified.fp16_d256_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "78ad1dc2-4990-4d20-8a11-ad65c2cc6fa7", + "name": "paged_unified.fp16_d256_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ab7ccf3c-6f0a-4473-add0-841dfe04d594", + "name": "paged_unified.fp16_d256_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f12530ae-4c7e-4d4e-90e8-d846b8c9ea03", + "name": "paged_unified.fp16_d256_bs32_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "187fcb77-6d3e-45dc-8f7a-7ecabd9bf22f", + "name": "paged_unified.fp16_d256_bs32_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1539cfde-01d5-48f1-9e3e-51ccce665c7d", + "name": "paged_unified.fp16_d256_bs32_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a3962ed8-48c3-4040-b2d5-46ada767c728", + "name": "paged_unified.fp16_d256_bs32_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3e4d2855-4f32-4cd6-92f2-bbdc792ceadf", + "name": "paged_unified.fp16_d256_bs32_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6b178d54-2b96-4643-88f1-26780eeb1813", + "name": "paged_unified.fp16_d256_bs64_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "07f693c9-03f5-494f-83a0-b2481c44fad3", + "name": "paged_unified.fp16_d256_bs64_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "234d4c84-c735-4db1-9ddb-9c84da40b0c4", + "name": "paged_unified.fp16_d256_bs64_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "87d08061-89b3-4209-8ebb-ff0eaa9e0753", + "name": "paged_unified.fp16_d256_bs64_g5.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "758eec60-0f53-4755-a860-ed7eea5b2b93", + "name": "paged_unified.fp16_d256_bs64_g6.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b998310a-e62b-414f-8a93-1494caf207fb", + "name": "paged_unified.fp16_d256_bs64_g7.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9e5eb0bd-5f29-4d73-b4d5-d28947f4b9ea", + "name": "paged_unified.fp16_d256_bs64_g8.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b488e074-e8a6-472f-95f9-729f4a462ba8", + "name": "paged_unified.fp16_d256_bs64_g16.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "da969a4d-689d-4180-8d48-406c9fc00ba7", + "name": "paged_unified.bf16_d256_bs32_g1.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "adf8af59-6f60-4030-9463-4e16d8903f8a", + "name": "paged_unified.bf16_d256_bs32_g2.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2a09f9a3-39fb-40ae-b1f9-204d94180745", + "name": "paged_unified.bf16_d256_bs32_g4.gfx942", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx942/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 2, + "block_m_per_warp": 16, + "runtime_layout": true, + "tile_size": 16 + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e64a72c8-3a9c-46ef-a26f-3a2bfd6df039", + "name": "paged_unified.bf16_d256_bs32_g5.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, - "dtype": "fp16", + "dtype": "bf16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "e2fa0990-75a3-4348-9bc3-8a38348bb4dd", - "name": "paged_unified.fp16_d256_bs16_g6.gfx942", + "id": "9d505e57-3cec-45c1-8321-8f0161440b3f", + "name": "paged_unified.bf16_d256_bs32_g6.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, - "dtype": "fp16", + "dtype": "bf16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "b673c8ea-17e8-4582-9959-755b90c78c56", - "name": "paged_unified.fp16_d256_bs16_g7.gfx942", + "id": "d6010192-7a8d-478d-887f-ebeb51098cf7", + "name": "paged_unified.bf16_d256_bs32_g7.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, - "dtype": "fp16", + "dtype": "bf16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "8006a158-39f9-4c23-8d69-7dc7a9815665", - "name": "paged_unified.fp16_d256_bs16_g8.gfx942", + "id": "23ec2d33-8201-42a4-b218-5863ad63979e", + "name": "paged_unified.bf16_d256_bs32_g8.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, - "dtype": "fp16", + "dtype": "bf16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "18035187-7ead-4e13-8f04-d426787f774d", - "name": "paged_unified.fp16_d256_bs16_g16.gfx942", + "id": "d7c30411-7e7d-42f0-95dd-3db195b79e67", + "name": "paged_unified.bf16_d256_bs32_g16.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, - "dtype": "fp16", + "dtype": "bf16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "61554637-a037-4334-87bd-7590768fdd36", - "name": "paged_unified.bf16_d256_bs16_g1.gfx942", + "id": "4cb9a5a8-f644-4a31-8bde-83745097f756", + "name": "paged_unified.bf16_d256_bs64_g1.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", @@ -3526,31 +8570,33 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "64b4aff1-dc26-4529-9858-6c332be5a7a6", - "name": "paged_unified.bf16_d256_bs16_g2.gfx942", + "id": "481b8d6e-1b0e-4a1c-99cd-80242ce47f87", + "name": "paged_unified.bf16_d256_bs64_g2.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", @@ -3559,31 +8605,33 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "b0b6dde0-c33a-4412-9c48-ed3f53db151c", - "name": "paged_unified.bf16_d256_bs16_g4.gfx942", + "id": "f8c079c8-4ffa-4712-acfe-48aa868670c4", + "name": "paged_unified.bf16_d256_bs64_g4.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", @@ -3592,31 +8640,33 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "a07594c6-c531-4de9-a665-ad71aaeea49a", - "name": "paged_unified.bf16_d256_bs16_g5.gfx942", + "id": "cc5c8c01-c52f-4dae-a16e-4bca837e9632", + "name": "paged_unified.bf16_d256_bs64_g5.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", @@ -3625,31 +8675,33 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "20aedd92-dfac-42ec-be28-52d8c42eb69a", - "name": "paged_unified.bf16_d256_bs16_g6.gfx942", + "id": "be5c397d-609a-4b96-92dd-b996bb385694", + "name": "paged_unified.bf16_d256_bs64_g6.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", @@ -3658,31 +8710,33 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "1d85f359-75dd-4491-9ed1-0bc53aadcad9", - "name": "paged_unified.bf16_d256_bs16_g7.gfx942", + "id": "636cfdbc-7fcd-4a0d-93d4-69ec63cd2eb1", + "name": "paged_unified.bf16_d256_bs64_g7.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", @@ -3691,31 +8745,33 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "cdbf067b-17a1-45de-839d-a9354959a517", - "name": "paged_unified.bf16_d256_bs16_g8.gfx942", + "id": "2323658c-2c4a-4095-9d60-56d95d8cc4af", + "name": "paged_unified.bf16_d256_bs64_g8.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", @@ -3724,31 +8780,33 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "8d2b1838-4a4c-44bb-896a-1ce30a4c5c5a", - "name": "paged_unified.bf16_d256_bs16_g16.gfx942", + "id": "c9b1aa2c-b30c-4cc4-84c8-e4e63e62da99", + "name": "paged_unified.bf16_d256_bs64_g16.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", @@ -3757,24 +8815,26 @@ "has_softcap": false, "num_warps": 2, "block_m_per_warp": 16, - "runtime_layout": true + "runtime_layout": true, + "tile_size": 16 } }, "metadata": { "dtype": "BF16", "head_size": 256, - "block_size": 16, + "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "6cc3a1e4-015e-4b86-a948-e319eaeb7ad8", - "name": "paged_unified.fp16_d256_bs32_g1.gfx942", + "id": "60f12e0c-d0be-4f84-8205-4e06370d342f", + "name": "paged_unified.fp16_d256_bs32_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -3785,7 +8845,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -3801,14 +8861,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "78ad1dc2-4990-4d20-8a11-ad65c2cc6fa7", - "name": "paged_unified.fp16_d256_bs32_g2.gfx942", + "id": "13831b06-cd98-4077-93c5-efe932189aa8", + "name": "paged_unified.fp16_d256_bs32_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -3819,7 +8880,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -3835,14 +8896,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "ab7ccf3c-6f0a-4473-add0-841dfe04d594", - "name": "paged_unified.fp16_d256_bs32_g4.gfx942", + "id": "d1fb61e6-062d-467e-bfea-2fc24740fde6", + "name": "paged_unified.fp16_d256_bs32_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -3853,7 +8915,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -3869,14 +8931,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "f12530ae-4c7e-4d4e-90e8-d846b8c9ea03", - "name": "paged_unified.fp16_d256_bs32_g5.gfx942", + "id": "4e2d1803-b424-4de4-b592-395abd0a9d61", + "name": "paged_unified.fp16_d256_bs32_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -3887,7 +8950,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -3903,14 +8966,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "187fcb77-6d3e-45dc-8f7a-7ecabd9bf22f", - "name": "paged_unified.fp16_d256_bs32_g6.gfx942", + "id": "68687aaf-bee0-4c2b-9d1f-32adcdea43ac", + "name": "paged_unified.fp16_d256_bs32_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -3921,7 +8985,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -3937,14 +9001,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "1539cfde-01d5-48f1-9e3e-51ccce665c7d", - "name": "paged_unified.fp16_d256_bs32_g7.gfx942", + "id": "f32b9835-26ed-48de-9c87-9e9ec8ab76f4", + "name": "paged_unified.fp16_d256_bs32_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -3955,7 +9020,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -3971,14 +9036,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a3962ed8-48c3-4040-b2d5-46ada767c728", - "name": "paged_unified.fp16_d256_bs32_g8.gfx942", + "id": "da4bddd4-b97a-4301-a54b-ec7d50ac8fdf", + "name": "paged_unified.fp16_d256_bs32_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -3989,7 +9055,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4005,14 +9071,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "3e4d2855-4f32-4cd6-92f2-bbdc792ceadf", - "name": "paged_unified.fp16_d256_bs32_g16.gfx942", + "id": "cbe1f815-b0e1-4c24-9894-c24201cfb3f8", + "name": "paged_unified.fp16_d256_bs32_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4023,7 +9090,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4039,14 +9106,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6b178d54-2b96-4643-88f1-26780eeb1813", - "name": "paged_unified.fp16_d256_bs64_g1.gfx942", + "id": "a6e86f72-a23f-4abc-90c1-ccdfed220a30", + "name": "paged_unified.fp16_d256_bs64_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4057,7 +9125,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4073,14 +9141,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "07f693c9-03f5-494f-83a0-b2481c44fad3", - "name": "paged_unified.fp16_d256_bs64_g2.gfx942", + "id": "c1712291-e00f-4945-befb-a74401645980", + "name": "paged_unified.fp16_d256_bs64_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4091,7 +9160,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4107,14 +9176,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "234d4c84-c735-4db1-9ddb-9c84da40b0c4", - "name": "paged_unified.fp16_d256_bs64_g4.gfx942", + "id": "14e3055b-da30-4dba-ae65-8b04ea4ccd54", + "name": "paged_unified.fp16_d256_bs64_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4125,7 +9195,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4141,14 +9211,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "87d08061-89b3-4209-8ebb-ff0eaa9e0753", - "name": "paged_unified.fp16_d256_bs64_g5.gfx942", + "id": "bb62b9ba-dc14-4726-a6ee-38ed29a21832", + "name": "paged_unified.fp16_d256_bs64_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4159,7 +9230,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4175,14 +9246,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "758eec60-0f53-4755-a860-ed7eea5b2b93", - "name": "paged_unified.fp16_d256_bs64_g6.gfx942", + "id": "0f235e89-7caf-4273-adf2-54c089d42a16", + "name": "paged_unified.fp16_d256_bs64_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4193,7 +9265,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4209,14 +9281,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "b998310a-e62b-414f-8a93-1494caf207fb", - "name": "paged_unified.fp16_d256_bs64_g7.gfx942", + "id": "0ea29c1b-3fad-4760-b3ac-6ec294f3398a", + "name": "paged_unified.fp16_d256_bs64_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4227,7 +9300,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4243,14 +9316,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "9e5eb0bd-5f29-4d73-b4d5-d28947f4b9ea", - "name": "paged_unified.fp16_d256_bs64_g8.gfx942", + "id": "b71299ad-d1d5-4bf2-9a86-3fea42dc0f90", + "name": "paged_unified.fp16_d256_bs64_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4261,7 +9335,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4277,14 +9351,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "b488e074-e8a6-472f-95f9-729f4a462ba8", - "name": "paged_unified.fp16_d256_bs64_g16.gfx942", + "id": "20482e0f-fda9-4bb4-8394-e545c00d1cd1", + "name": "paged_unified.fp16_d256_bs64_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4295,7 +9370,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4311,14 +9386,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "da969a4d-689d-4180-8d48-406c9fc00ba7", - "name": "paged_unified.bf16_d256_bs32_g1.gfx942", + "id": "957c9bee-7547-4bab-b506-140abbc9468f", + "name": "paged_unified.bf16_d256_bs32_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4329,7 +9405,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4345,14 +9421,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "adf8af59-6f60-4030-9463-4e16d8903f8a", - "name": "paged_unified.bf16_d256_bs32_g2.gfx942", + "id": "3c9931f9-21d0-428d-8f76-e32dc037f437", + "name": "paged_unified.bf16_d256_bs32_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4363,7 +9440,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4379,14 +9456,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2a09f9a3-39fb-40ae-b1f9-204d94180745", - "name": "paged_unified.bf16_d256_bs32_g4.gfx942", + "id": "c6315d7c-ffeb-4044-bb2d-70f1750caaac", + "name": "paged_unified.bf16_d256_bs32_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4397,7 +9475,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4413,14 +9491,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "e64a72c8-3a9c-46ef-a26f-3a2bfd6df039", - "name": "paged_unified.bf16_d256_bs32_g5.gfx942", + "id": "24066c6c-3d0d-4f2b-a0b6-dc1e4d5bfda7", + "name": "paged_unified.bf16_d256_bs32_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4431,7 +9510,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4447,14 +9526,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "9d505e57-3cec-45c1-8321-8f0161440b3f", - "name": "paged_unified.bf16_d256_bs32_g6.gfx942", + "id": "5ca2be3a-e5f8-4648-87d9-99d6ff67f1ed", + "name": "paged_unified.bf16_d256_bs32_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4465,7 +9545,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4481,14 +9561,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d6010192-7a8d-478d-887f-ebeb51098cf7", - "name": "paged_unified.bf16_d256_bs32_g7.gfx942", + "id": "ab04096b-f010-48b3-b36e-8627c8886cca", + "name": "paged_unified.bf16_d256_bs32_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4499,7 +9580,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4515,14 +9596,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "23ec2d33-8201-42a4-b218-5863ad63979e", - "name": "paged_unified.bf16_d256_bs32_g8.gfx942", + "id": "af225ce0-ffb2-49f1-89a1-d7ba16860dde", + "name": "paged_unified.bf16_d256_bs32_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4533,7 +9615,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4549,14 +9631,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d7c30411-7e7d-42f0-95dd-3db195b79e67", - "name": "paged_unified.bf16_d256_bs32_g16.gfx942", + "id": "2dd351a5-423b-4df1-8336-4ecc03eda518", + "name": "paged_unified.bf16_d256_bs32_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4567,7 +9650,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4583,14 +9666,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4cb9a5a8-f644-4a31-8bde-83745097f756", - "name": "paged_unified.bf16_d256_bs64_g1.gfx942", + "id": "9ec7fce1-7e8e-4620-9d39-58294f3ef76e", + "name": "paged_unified.bf16_d256_bs64_g1_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4601,7 +9685,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4617,14 +9701,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "481b8d6e-1b0e-4a1c-99cd-80242ce47f87", - "name": "paged_unified.bf16_d256_bs64_g2.gfx942", + "id": "6fbd0ca5-d80c-4adc-813f-298f0ca90aa9", + "name": "paged_unified.bf16_d256_bs64_g2_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4635,7 +9720,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4651,14 +9736,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "f8c079c8-4ffa-4712-acfe-48aa868670c4", - "name": "paged_unified.bf16_d256_bs64_g4.gfx942", + "id": "bbdc3177-e6cf-4507-8117-3dd832e73e05", + "name": "paged_unified.bf16_d256_bs64_g4_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4669,7 +9755,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4685,14 +9771,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "cc5c8c01-c52f-4dae-a16e-4bca837e9632", - "name": "paged_unified.bf16_d256_bs64_g5.gfx942", + "id": "8e8abb1b-d313-4222-9573-aad474735301", + "name": "paged_unified.bf16_d256_bs64_g5_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4703,7 +9790,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4719,14 +9806,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "be5c397d-609a-4b96-92dd-b996bb385694", - "name": "paged_unified.bf16_d256_bs64_g6.gfx942", + "id": "33c3dd51-9d4e-428c-ac4d-0781e2df8ee7", + "name": "paged_unified.bf16_d256_bs64_g6_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4737,7 +9825,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4753,14 +9841,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "636cfdbc-7fcd-4a0d-93d4-69ec63cd2eb1", - "name": "paged_unified.bf16_d256_bs64_g7.gfx942", + "id": "f210241a-ec69-405c-b20e-646faf09133b", + "name": "paged_unified.bf16_d256_bs64_g7_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4771,7 +9860,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4787,14 +9876,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2323658c-2c4a-4095-9d60-56d95d8cc4af", - "name": "paged_unified.bf16_d256_bs64_g8.gfx942", + "id": "435a5457-0d89-4fef-926b-cdb0cc4640a7", + "name": "paged_unified.bf16_d256_bs64_g8_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4805,7 +9895,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4821,14 +9911,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "c9b1aa2c-b30c-4cc4-84c8-e4e63e62da99", - "name": "paged_unified.bf16_d256_bs64_g16.gfx942", + "id": "ec227a8a-458e-4e01-b910-e09326ff5aa1", + "name": "paged_unified.bf16_d256_bs64_g16_sinks.gfx942", "kernel_source": { "kind": "rocke", "source": "kernels/gfx942/attention_tiled_2d.py", @@ -4839,7 +9930,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 2, @@ -4855,7 +9946,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 } diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json index caa4ea849069..ca27d765af80 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/attention_paged_unified_gfx950.kdp.json @@ -22,7 +22,8 @@ "num_query_heads", "num_kv_heads", "num_warps", - "block_m_per_warp" + "block_m_per_warp", + "use_sinks" ], "matcher_only_fields": [], "bindings": { @@ -46,6 +47,9 @@ }, "block_m_per_warp": { "field": "block_m_per_warp" + }, + "use_sinks": { + "field": "use_sinks" } }, "vocabulary": { @@ -88,7 +92,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -121,7 +126,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -154,7 +160,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -187,7 +194,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -220,7 +228,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -253,7 +262,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -286,7 +296,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -319,7 +330,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -352,7 +364,8 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -385,7 +398,8 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -418,7 +432,8 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -451,7 +466,8 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -484,7 +500,8 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -517,7 +534,8 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -550,7 +568,8 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, @@ -583,28 +602,29 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 2, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "3c57294e-aa86-4d8e-a977-63836834b3fb", - "name": "paged_unified.fp16_d64_bs32_g1.gfx950", + "id": "0dc1d99a-8b5b-4396-bc60-4dd900b5cabc", + "name": "paged_unified.fp16_d64_bs16_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -612,32 +632,33 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6d50865e-ec9f-47af-b1d9-e3cea05e075b", - "name": "paged_unified.fp16_d64_bs32_g2.gfx950", + "id": "6721915b-23ff-4d3d-8bc4-78d898b1bbb8", + "name": "paged_unified.fp16_d64_bs16_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -645,32 +666,33 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "96ce9b03-3d22-4075-82c4-8c6f470308dd", - "name": "paged_unified.fp16_d64_bs32_g4.gfx950", + "id": "60435a64-58df-4444-be9e-4956666465e8", + "name": "paged_unified.fp16_d64_bs16_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -678,32 +700,33 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "32dc0320-1390-4058-a5aa-7b41a4feb34c", - "name": "paged_unified.fp16_d64_bs32_g5.gfx950", + "id": "50043cfa-6593-4dc0-a67d-39b6ea771e88", + "name": "paged_unified.fp16_d64_bs16_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -711,32 +734,33 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "7b80b955-5731-42b9-a50f-b0b818068b6c", - "name": "paged_unified.fp16_d64_bs32_g6.gfx950", + "id": "e3c36f8e-b1ef-4a6f-bcb0-4ec6dc588edd", + "name": "paged_unified.fp16_d64_bs16_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -744,32 +768,33 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "388eb1ae-26dc-445d-b7c4-beb93c5d24ce", - "name": "paged_unified.fp16_d64_bs32_g7.gfx950", + "id": "b6ec1435-4eef-43c5-b599-50e4044baf39", + "name": "paged_unified.fp16_d64_bs16_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -777,32 +802,33 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a5b94936-29d4-4677-88df-ee64c61c9e33", - "name": "paged_unified.fp16_d64_bs32_g8.gfx950", + "id": "528241bd-ae98-41c8-9011-3b28ec72cd14", + "name": "paged_unified.fp16_d64_bs16_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -810,32 +836,33 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a8c9b734-110c-4002-b81d-abdcd80a726c", - "name": "paged_unified.fp16_d64_bs32_g16.gfx950", + "id": "692a90ba-fbac-4c64-b803-98f244797fa4", + "name": "paged_unified.fp16_d64_bs16_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } @@ -843,282 +870,291 @@ "metadata": { "dtype": "FP16", "head_size": 64, - "block_size": 32, + "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "8b8b5d9f-a4a6-4419-b898-e1a989bfebaa", - "name": "paged_unified.fp16_d64_bs64_g1.gfx950", + "id": "f20f88c7-5c44-449d-a624-5499255bdcbd", + "name": "paged_unified.bf16_d64_bs16_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 1, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5876e267-e08f-43f1-b288-86674bc939f1", - "name": "paged_unified.fp16_d64_bs64_g2.gfx950", + "id": "5e8f2219-c1d7-4949-8d05-9c988cfdfd53", + "name": "paged_unified.bf16_d64_bs16_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 2, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2705c668-49f4-436e-8ef4-1bf57fba9cbf", - "name": "paged_unified.fp16_d64_bs64_g4.gfx950", + "id": "f27f04ea-f95d-45b3-b158-e812b10ec53e", + "name": "paged_unified.bf16_d64_bs16_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 4, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "141b573a-62cd-4771-a286-3df9c4632638", - "name": "paged_unified.fp16_d64_bs64_g5.gfx950", + "id": "4e9c0516-1cf8-40f1-8c79-f74fe6d7d099", + "name": "paged_unified.bf16_d64_bs16_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 5, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "c65accd0-999f-4a35-a81b-771ca9be1828", - "name": "paged_unified.fp16_d64_bs64_g6.gfx950", + "id": "6afe0a80-9307-4d72-bf0d-a14d57c13fef", + "name": "paged_unified.bf16_d64_bs16_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 6, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "7f6021f2-0ff2-4688-8ecd-5c483823108a", - "name": "paged_unified.fp16_d64_bs64_g7.gfx950", + "id": "1370a25c-e31d-47df-b0f6-d1e7fbb01495", + "name": "paged_unified.bf16_d64_bs16_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 7, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "e46d369e-a7d1-40c2-9cce-d54036c0aeda", - "name": "paged_unified.fp16_d64_bs64_g8.gfx950", + "id": "ee476170-632d-46f0-aaef-f8021427eb16", + "name": "paged_unified.bf16_d64_bs16_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 8, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "720796fa-4f4a-4f8e-bdbc-c09578cf37b1", - "name": "paged_unified.fp16_d64_bs64_g16.gfx950", + "id": "c765aaec-68ed-4d2f-b0ba-7fed96c2c7ae", + "name": "paged_unified.bf16_d64_bs16_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, - "dtype": "fp16", - "use_sinks": false, + "dtype": "bf16", + "use_sinks": true, "sliding_window": 0, "has_softcap": false, - "num_warps": 4, + "num_warps": 2, "block_m_per_warp": 16, "runtime_layout": true } }, "metadata": { - "dtype": "FP16", + "dtype": "BF16", "head_size": 64, - "block_size": 64, + "block_size": 16, "num_query_heads": 16, "num_kv_heads": 1, - "num_warps": 4, - "block_m_per_warp": 16 + "num_warps": 2, + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d3673551-1e87-4273-a6bc-7f3a03d7075a", - "name": "paged_unified.bf16_d64_bs32_g1.gfx950", + "id": "3c57294e-aa86-4d8e-a977-63836834b3fb", + "name": "paged_unified.fp16_d64_bs32_g1.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1128,7 +1164,7 @@ "block_size": 32, "num_query_heads": 1, "num_kv_heads": 1, - "dtype": "bf16", + "dtype": "fp16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, @@ -1138,20 +1174,21 @@ } }, "metadata": { - "dtype": "BF16", + "dtype": "FP16", "head_size": 64, "block_size": 32, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "41e45ba3-2cf2-464c-b0fe-0fc90cb08c1a", - "name": "paged_unified.bf16_d64_bs32_g2.gfx950", + "id": "6d50865e-ec9f-47af-b1d9-e3cea05e075b", + "name": "paged_unified.fp16_d64_bs32_g2.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1161,7 +1198,7 @@ "block_size": 32, "num_query_heads": 2, "num_kv_heads": 1, - "dtype": "bf16", + "dtype": "fp16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, @@ -1171,20 +1208,21 @@ } }, "metadata": { - "dtype": "BF16", + "dtype": "FP16", "head_size": 64, "block_size": 32, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "12aba46e-ebf1-4731-8bef-bf89e65e1d18", - "name": "paged_unified.bf16_d64_bs32_g4.gfx950", + "id": "96ce9b03-3d22-4075-82c4-8c6f470308dd", + "name": "paged_unified.fp16_d64_bs32_g4.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1194,7 +1232,7 @@ "block_size": 32, "num_query_heads": 4, "num_kv_heads": 1, - "dtype": "bf16", + "dtype": "fp16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, @@ -1204,20 +1242,21 @@ } }, "metadata": { - "dtype": "BF16", + "dtype": "FP16", "head_size": 64, "block_size": 32, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "b9217fa4-ff5e-4047-a4c3-dda52c8b0396", - "name": "paged_unified.bf16_d64_bs32_g5.gfx950", + "id": "32dc0320-1390-4058-a5aa-7b41a4feb34c", + "name": "paged_unified.fp16_d64_bs32_g5.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1227,7 +1266,7 @@ "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, - "dtype": "bf16", + "dtype": "fp16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, @@ -1237,20 +1276,21 @@ } }, "metadata": { - "dtype": "BF16", + "dtype": "FP16", "head_size": 64, "block_size": 32, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "6b4bfb42-5697-4ade-85d9-27f0d9ff6afd", - "name": "paged_unified.bf16_d64_bs32_g6.gfx950", + "id": "7b80b955-5731-42b9-a50f-b0b818068b6c", + "name": "paged_unified.fp16_d64_bs32_g6.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1260,7 +1300,7 @@ "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, - "dtype": "bf16", + "dtype": "fp16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, @@ -1270,20 +1310,21 @@ } }, "metadata": { - "dtype": "BF16", + "dtype": "FP16", "head_size": 64, "block_size": 32, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "d1529ffe-c165-4d07-8a38-9fcdd1192965", - "name": "paged_unified.bf16_d64_bs32_g7.gfx950", + "id": "388eb1ae-26dc-445d-b7c4-beb93c5d24ce", + "name": "paged_unified.fp16_d64_bs32_g7.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1293,7 +1334,7 @@ "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, - "dtype": "bf16", + "dtype": "fp16", "use_sinks": false, "sliding_window": 0, "has_softcap": false, @@ -1303,26 +1344,4923 @@ } }, "metadata": { - "dtype": "BF16", + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a5b94936-29d4-4677-88df-ee64c61c9e33", + "name": "paged_unified.fp16_d64_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a8c9b734-110c-4002-b81d-abdcd80a726c", + "name": "paged_unified.fp16_d64_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8b8b5d9f-a4a6-4419-b898-e1a989bfebaa", + "name": "paged_unified.fp16_d64_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5876e267-e08f-43f1-b288-86674bc939f1", + "name": "paged_unified.fp16_d64_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2705c668-49f4-436e-8ef4-1bf57fba9cbf", + "name": "paged_unified.fp16_d64_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "141b573a-62cd-4771-a286-3df9c4632638", + "name": "paged_unified.fp16_d64_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c65accd0-999f-4a35-a81b-771ca9be1828", + "name": "paged_unified.fp16_d64_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7f6021f2-0ff2-4688-8ecd-5c483823108a", + "name": "paged_unified.fp16_d64_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e46d369e-a7d1-40c2-9cce-d54036c0aeda", + "name": "paged_unified.fp16_d64_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "720796fa-4f4a-4f8e-bdbc-c09578cf37b1", + "name": "paged_unified.fp16_d64_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d3673551-1e87-4273-a6bc-7f3a03d7075a", + "name": "paged_unified.bf16_d64_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "41e45ba3-2cf2-464c-b0fe-0fc90cb08c1a", + "name": "paged_unified.bf16_d64_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "12aba46e-ebf1-4731-8bef-bf89e65e1d18", + "name": "paged_unified.bf16_d64_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b9217fa4-ff5e-4047-a4c3-dda52c8b0396", + "name": "paged_unified.bf16_d64_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6b4bfb42-5697-4ade-85d9-27f0d9ff6afd", + "name": "paged_unified.bf16_d64_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d1529ffe-c165-4d07-8a38-9fcdd1192965", + "name": "paged_unified.bf16_d64_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b463eb65-5f6d-4e68-bcbb-2ac01cb2fcca", + "name": "paged_unified.bf16_d64_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f707aade-0291-4874-9333-40f9057b901d", + "name": "paged_unified.bf16_d64_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "63085891-7778-4a61-94c3-e0a9fa74c121", + "name": "paged_unified.bf16_d64_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3b13cc9c-d7d0-4c09-b93d-1626e8afac0e", + "name": "paged_unified.bf16_d64_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f0caa26e-b447-4500-8178-5cc1e2198662", + "name": "paged_unified.bf16_d64_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0800e3b4-a7a8-480c-aed3-637c9678fbd1", + "name": "paged_unified.bf16_d64_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e73b9c43-0b14-42b8-941f-bbd12be9c1c7", + "name": "paged_unified.bf16_d64_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0552bb5f-565d-4691-beee-8bb13599a25c", + "name": "paged_unified.bf16_d64_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "20a29bf6-de20-4f06-8738-dffd43a0e8dc", + "name": "paged_unified.bf16_d64_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d53a6276-2868-496f-a389-9b4859449ac2", + "name": "paged_unified.bf16_d64_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "12440317-17f1-44cc-a36d-8b8cd4f0c589", + "name": "paged_unified.fp16_d64_bs32_g1_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c32349f5-7e93-42fb-8fd4-917b8de4f7ee", + "name": "paged_unified.fp16_d64_bs32_g2_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "dae6804e-3cbe-4e1a-8384-c9e0e1650d46", + "name": "paged_unified.fp16_d64_bs32_g4_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "82c95ba0-cf52-4926-8eb1-ee91b075b9de", + "name": "paged_unified.fp16_d64_bs32_g5_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8a30ef36-9daf-4f40-b49d-56c227211a65", + "name": "paged_unified.fp16_d64_bs32_g6_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0d5b980a-58c9-458f-b760-a5ae9b821f15", + "name": "paged_unified.fp16_d64_bs32_g7_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "03b5ed00-5aa4-48c8-be5e-fcf8b677fe59", + "name": "paged_unified.fp16_d64_bs32_g8_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d453e07-4586-4470-b253-b1bde75cd50b", + "name": "paged_unified.fp16_d64_bs32_g16_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6b34a6c1-7855-431f-a68c-791bc81365ad", + "name": "paged_unified.fp16_d64_bs64_g1_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "da88c112-cc64-4b05-9710-11e0a66adcba", + "name": "paged_unified.fp16_d64_bs64_g2_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "52d11c06-3bc7-4821-93c9-80d8d08ded00", + "name": "paged_unified.fp16_d64_bs64_g4_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "64613671-244b-45d7-9a7b-05907369f51a", + "name": "paged_unified.fp16_d64_bs64_g5_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ea1565f5-86b2-4507-a9d3-ee8185a20b57", + "name": "paged_unified.fp16_d64_bs64_g6_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "b7b9bd84-74d7-4b74-8e1f-114e6d59b741", + "name": "paged_unified.fp16_d64_bs64_g7_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1315548b-e4f5-4f34-b17c-f5afe22f3179", + "name": "paged_unified.fp16_d64_bs64_g8_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f1be7408-f2d4-4681-87c2-cabeaee2d3c2", + "name": "paged_unified.fp16_d64_bs64_g16_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d0d8ab86-561d-4b4d-b359-1613b63b349e", + "name": "paged_unified.bf16_d64_bs32_g1_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4c643ea9-c4fa-43f2-81ae-fb780a8c0f1d", + "name": "paged_unified.bf16_d64_bs32_g2_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a6b9c014-208d-4263-b610-eb4f972e78f6", + "name": "paged_unified.bf16_d64_bs32_g4_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4e9d9f7d-247b-4d55-b384-4674e6ad7135", + "name": "paged_unified.bf16_d64_bs32_g5_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e028f825-139a-4940-bb87-06ad23ca9c0b", + "name": "paged_unified.bf16_d64_bs32_g6_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ada2a3ba-43e7-4917-9428-8899fa9e4e9c", + "name": "paged_unified.bf16_d64_bs32_g7_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2719d454-ce48-4c71-863b-a318584d121f", + "name": "paged_unified.bf16_d64_bs32_g8_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6aee8414-a24e-483f-82a9-de969e66723b", + "name": "paged_unified.bf16_d64_bs32_g16_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "706d75d8-3574-4ffd-8dfb-15a55c43df43", + "name": "paged_unified.bf16_d64_bs64_g1_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "809ceef2-bba9-4d43-970f-444d9d09254d", + "name": "paged_unified.bf16_d64_bs64_g2_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d5591bc-f11a-4211-98fc-40f1e2f60172", + "name": "paged_unified.bf16_d64_bs64_g4_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ba7d5232-990a-4f40-8e1d-14523f65deaa", + "name": "paged_unified.bf16_d64_bs64_g5_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a47d6581-b8f6-405b-9611-c5aa3c5ce052", + "name": "paged_unified.bf16_d64_bs64_g6_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "84955a53-4042-4a65-bfc2-dca1f57c3290", + "name": "paged_unified.bf16_d64_bs64_g7_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4105ca31-7086-45b2-8223-3213976ebd20", + "name": "paged_unified.bf16_d64_bs64_g8_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0c40b142-92e7-4e46-baa8-4f334b7a284b", + "name": "paged_unified.bf16_d64_bs64_g16_sinks.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": true, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 64, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 1 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5cdd41ab-3aef-45bb-8703-9dcb85cab0ca", + "name": "paged_unified.fp16_d128_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6cc64843-166e-4bd8-8fbd-51f0d4151236", + "name": "paged_unified.fp16_d128_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "91d01894-8216-428d-8530-839baaba14a7", + "name": "paged_unified.fp16_d128_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0a4f89b0-b385-4fe7-93b3-3795d358b0aa", + "name": "paged_unified.fp16_d128_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ab8c2b08-e5e9-4808-b440-34c73fb76857", + "name": "paged_unified.fp16_d128_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1d446be9-dce1-44f7-a4a1-f1f763e5a473", + "name": "paged_unified.fp16_d128_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "58e82185-fdd9-4cd8-b5e5-bef8a18c6184", + "name": "paged_unified.fp16_d128_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "fe2be135-c4e3-4c31-a7a1-1ce826615e97", + "name": "paged_unified.fp16_d128_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ae667f2a-398f-4756-8c1c-dab9ec357ae5", + "name": "paged_unified.fp16_d128_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2acc9f68-9c32-46b3-8a24-7fe02eece8b3", + "name": "paged_unified.fp16_d128_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "50eb5d30-b66a-4c8d-b81d-514109d4ede7", + "name": "paged_unified.fp16_d128_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c6c5da58-a5a3-4701-bc0d-45893fcf857f", + "name": "paged_unified.fp16_d128_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "615b49c5-95fc-465d-bf1f-adcbb6897c23", + "name": "paged_unified.fp16_d128_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6a72e374-f7f0-4271-8d77-4c824a839da9", + "name": "paged_unified.fp16_d128_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d9c89124-2bd0-4bef-b164-4820bc78dcf5", + "name": "paged_unified.fp16_d128_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6fe2e2b2-9ba0-47a9-a771-312e8c42443d", + "name": "paged_unified.fp16_d128_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a8658448-58d9-4a21-af14-c772630b7af5", + "name": "paged_unified.fp16_d128_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ce4906d8-b10e-4883-9703-d033c650dfcd", + "name": "paged_unified.fp16_d128_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "65e687fa-7307-47aa-8450-91c648ff04a3", + "name": "paged_unified.fp16_d128_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "32ef65bd-0c74-406b-8579-4443d1b9ecf5", + "name": "paged_unified.fp16_d128_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "81ad98d6-542d-4954-aaf2-c4778b6c1a18", + "name": "paged_unified.fp16_d128_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "87d0050b-4319-4163-9c72-a277e38ec71a", + "name": "paged_unified.fp16_d128_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "345d5868-b3ec-43e8-bea0-7d21920607da", + "name": "paged_unified.fp16_d128_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2bdc88d4-6288-4ce6-be67-c264a7c7f416", + "name": "paged_unified.fp16_d128_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "212e2c5b-a4fa-49be-8591-01bad9ce2e51", + "name": "paged_unified.fp16_d256_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0e0716c8-916e-4662-8740-8b8f12c7156e", + "name": "paged_unified.fp16_d256_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "c8776003-b78a-49ce-9984-72bf5539347d", + "name": "paged_unified.fp16_d256_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "12d560a0-3087-4e3e-b463-a534c1144c20", + "name": "paged_unified.fp16_d256_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3a950075-7baa-4a59-b8b2-2e040fe7726a", + "name": "paged_unified.fp16_d256_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "57a3c2ca-aefc-4c8c-a82a-805d9d045179", + "name": "paged_unified.fp16_d256_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cd5fe387-1c55-4259-81f8-96b92fc6dfcf", + "name": "paged_unified.fp16_d256_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "74c22353-32ce-4987-91d3-f5f93c483290", + "name": "paged_unified.fp16_d256_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e71e3205-6ddd-4c48-acdc-abdee8ef25a6", + "name": "paged_unified.fp16_d256_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "83f435ff-c4e1-41eb-b181-653964b5e0a7", + "name": "paged_unified.fp16_d256_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1211fee3-7b28-4b3f-8281-59a2e8b2e72f", + "name": "paged_unified.fp16_d256_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "35d744c2-bb64-4b18-a676-ced7fed9c37b", + "name": "paged_unified.fp16_d256_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "80787923-e0e5-4c81-83dd-9bf0e6bd5245", + "name": "paged_unified.fp16_d256_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e0250241-14e3-4afe-9b93-a177b9463e72", + "name": "paged_unified.fp16_d256_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6ea257a0-cb99-4a9a-aeff-25c711d35c1f", + "name": "paged_unified.fp16_d256_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2abafb51-1dc8-477b-8590-3d3da623682c", + "name": "paged_unified.fp16_d256_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "367682ef-d49d-402a-8fc5-5c2a8c62ccf3", + "name": "paged_unified.fp16_d256_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "02811807-31c2-4dde-bd76-a115cad59a14", + "name": "paged_unified.fp16_d256_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8feb86cd-9438-4df6-b54f-9cf25fa3f61d", + "name": "paged_unified.fp16_d256_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5fa6ab9c-3b33-4f72-8c20-8f6f71e5cc7b", + "name": "paged_unified.fp16_d256_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "bc333d48-114b-4562-bbe1-300e2c7546a7", + "name": "paged_unified.fp16_d256_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "e17f0c38-26ee-4ef8-8696-a39b1358ece8", + "name": "paged_unified.fp16_d256_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "93e6c2ec-1223-44a2-b0f1-a376dda4f3f4", + "name": "paged_unified.fp16_d256_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5e25702f-6c55-42f8-bdf6-2762c9751a29", + "name": "paged_unified.fp16_d256_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "fp16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "FP16", + "head_size": 256, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "258b21d7-84f6-4763-8456-a9f5eef1f0f9", + "name": "paged_unified.bf16_d128_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7da0b28b-d3e1-42b2-b639-4e6d68a9edfd", + "name": "paged_unified.bf16_d128_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "ed30ea7f-e65a-4cfd-ab85-59f6f434bc4c", + "name": "paged_unified.bf16_d128_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7edd94cf-1bc0-4ebe-9119-690a7c220a69", + "name": "paged_unified.bf16_d128_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "cba0a8fa-bedf-4fab-b897-e6ec325982a1", + "name": "paged_unified.bf16_d128_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "0ec0503d-7072-4601-a1f3-4f3d9f034adc", + "name": "paged_unified.bf16_d128_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "9bf7d181-7aad-4890-be52-98717c69a02c", + "name": "paged_unified.bf16_d128_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "82f69d9c-31ef-48d2-bd8c-0a3222e0f44a", + "name": "paged_unified.bf16_d128_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "699fd5c5-2c5f-4bdc-aa76-a358ef187fea", + "name": "paged_unified.bf16_d128_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a7662c5f-4864-4eae-a627-96016eeae194", + "name": "paged_unified.bf16_d128_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2ee0cd45-4b51-4727-98b0-b9dbefe6ee38", + "name": "paged_unified.bf16_d128_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4b724bcf-57ef-43e2-9033-106094af8a8c", + "name": "paged_unified.bf16_d128_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "24b9c183-75d9-48bd-8ffe-c30558a6e6a7", + "name": "paged_unified.bf16_d128_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5fccd6f1-e517-40f9-bdcd-68d19f1413f1", + "name": "paged_unified.bf16_d128_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8d227a60-c5c8-461a-9199-06b114559418", + "name": "paged_unified.bf16_d128_bs32_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "69e2888d-bf79-4b0f-9ced-9b1b5bcde74b", + "name": "paged_unified.bf16_d128_bs32_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 32, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "075fcfd4-a09d-4e07-8ada-d25091b84ec0", + "name": "paged_unified.bf16_d128_bs64_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2247b974-9cc4-4acb-9541-b891a71001fb", + "name": "paged_unified.bf16_d128_bs64_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "3d9e1e93-287c-43b8-8ae0-0288c521457d", + "name": "paged_unified.bf16_d128_bs64_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6ff9caa4-a548-4a28-8c36-20b79334724e", + "name": "paged_unified.bf16_d128_bs64_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "2ff04cdc-827b-4bdb-80bf-1b1f00381986", + "name": "paged_unified.bf16_d128_bs64_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "02f9702a-a0df-4acf-93f6-cea88ee1d62e", + "name": "paged_unified.bf16_d128_bs64_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a97cf320-07f7-45f4-8ec7-b5e43dfb5494", + "name": "paged_unified.bf16_d128_bs64_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "4aa3f44b-7d26-4570-b0d0-56af35a46aa0", + "name": "paged_unified.bf16_d128_bs64_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 128, + "block_size": 64, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5dcbc493-fd56-4e70-8d1b-8be3578d0a64", + "name": "paged_unified.bf16_d256_bs16_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "1b167790-ad72-43e9-b69d-39d2d03e2982", + "name": "paged_unified.bf16_d256_bs16_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "43259880-c763-4787-8c99-e7c97cab2ed1", + "name": "paged_unified.bf16_d256_bs16_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "eb8c6681-9561-454c-a31c-aac0af6afea3", + "name": "paged_unified.bf16_d256_bs16_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "d19948cb-313c-4c5a-b955-456dd822405b", + "name": "paged_unified.bf16_d256_bs16_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "a08db64c-9962-4abc-87b6-00f8fc3073a0", + "name": "paged_unified.bf16_d256_bs16_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 7, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "f635af58-729f-4c9f-b8ed-70c4857378e8", + "name": "paged_unified.bf16_d256_bs16_g8.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 8, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "7e358fe4-43f0-46d7-8be0-4660c77247b0", + "name": "paged_unified.bf16_d256_bs16_g16.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 16, + "num_query_heads": 16, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "8352754f-ece1-4ba6-9c35-398768cf41b7", + "name": "paged_unified.bf16_d256_bs32_g1.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 1, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5885853c-e7c6-4834-b065-25d49a139056", + "name": "paged_unified.bf16_d256_bs32_g2.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 2, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "6729cecc-1077-4605-9695-b8dfb3843526", + "name": "paged_unified.bf16_d256_bs32_g4.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 4, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "45eae18e-aac5-460b-a1dd-615b433ca8eb", + "name": "paged_unified.bf16_d256_bs32_g5.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 5, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "723d1174-3d03-4a21-98aa-4d4c3cc5fabc", + "name": "paged_unified.bf16_d256_bs32_g6.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, + "block_size": 32, + "num_query_heads": 6, + "num_kv_heads": 1, + "num_warps": 4, + "block_m_per_warp": 16, + "use_sinks": 0 + }, + "priority": 0 + }, + { + "version": "1.0", + "id": "5c4e2d08-0659-4131-8125-b217367e338a", + "name": "paged_unified.bf16_d256_bs32_g7.gfx950", + "kernel_source": { + "kind": "rocke", + "source": "kernels/gfx950/attention_tiled_2d.py", + "builder": "build_unified_attention_2d_tiled", + "spec": { + "head_size": 256, + "block_size": 32, + "num_query_heads": 7, + "num_kv_heads": 1, + "dtype": "bf16", + "use_sinks": false, + "sliding_window": 0, + "has_softcap": false, + "num_warps": 4, + "block_m_per_warp": 16, + "runtime_layout": true + } + }, + "metadata": { + "dtype": "BF16", + "head_size": 256, "block_size": 32, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "b463eb65-5f6d-4e68-bcbb-2ac01cb2fcca", - "name": "paged_unified.bf16_d64_bs32_g8.gfx950", + "id": "2aab1fe6-4b4a-4e67-972f-cad674985bc4", + "name": "paged_unified.bf16_d256_bs32_g8.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, @@ -1337,25 +6275,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 32, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "f707aade-0291-4874-9333-40f9057b901d", - "name": "paged_unified.bf16_d64_bs32_g16.gfx950", + "id": "de53e03a-fbcc-405a-84f8-a42f071fe89c", + "name": "paged_unified.bf16_d256_bs32_g16.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, @@ -1370,25 +6309,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 32, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "63085891-7778-4a61-94c3-e0a9fa74c121", - "name": "paged_unified.bf16_d64_bs64_g1.gfx950", + "id": "b553b247-2f2b-4b24-8d18-2e038d353462", + "name": "paged_unified.bf16_d256_bs64_g1.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, @@ -1403,25 +6343,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "3b13cc9c-d7d0-4c09-b93d-1626e8afac0e", - "name": "paged_unified.bf16_d64_bs64_g2.gfx950", + "id": "e666ef18-dfd2-4112-8859-b78f0c2a47e0", + "name": "paged_unified.bf16_d256_bs64_g2.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, @@ -1436,25 +6377,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "f0caa26e-b447-4500-8178-5cc1e2198662", - "name": "paged_unified.bf16_d64_bs64_g4.gfx950", + "id": "3ccdbb49-02c7-4f0d-a20d-d50f31a01528", + "name": "paged_unified.bf16_d256_bs64_g4.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, @@ -1469,25 +6411,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "0800e3b4-a7a8-480c-aed3-637c9678fbd1", - "name": "paged_unified.bf16_d64_bs64_g5.gfx950", + "id": "9564ff74-d7b3-452d-bfa1-1098adbdf84c", + "name": "paged_unified.bf16_d256_bs64_g5.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, @@ -1502,25 +6445,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "e73b9c43-0b14-42b8-941f-bbd12be9c1c7", - "name": "paged_unified.bf16_d64_bs64_g6.gfx950", + "id": "4718b8a9-1eaa-46f9-a7ef-906f07358d1b", + "name": "paged_unified.bf16_d256_bs64_g6.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, @@ -1535,25 +6479,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "0552bb5f-565d-4691-beee-8bb13599a25c", - "name": "paged_unified.bf16_d64_bs64_g7.gfx950", + "id": "914620ee-0cbe-48c2-8b89-946a28cdfe47", + "name": "paged_unified.bf16_d256_bs64_g7.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, @@ -1568,25 +6513,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "20a29bf6-de20-4f06-8738-dffd43a0e8dc", - "name": "paged_unified.bf16_d64_bs64_g8.gfx950", + "id": "d7d550e4-1012-4034-9dda-0cd4f82a4f60", + "name": "paged_unified.bf16_d256_bs64_g8.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, @@ -1601,25 +6547,26 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "d53a6276-2868-496f-a389-9b4859449ac2", - "name": "paged_unified.bf16_d64_bs64_g16.gfx950", + "id": "5fe3a4a9-7cdc-4855-bf39-7c0b3a1aff30", + "name": "paged_unified.bf16_d256_bs64_g16.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", "builder": "build_unified_attention_2d_tiled", "spec": { - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, @@ -1634,19 +6581,20 @@ }, "metadata": { "dtype": "BF16", - "head_size": 64, + "head_size": 256, "block_size": 64, "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 0 }, "priority": 0 }, { "version": "1.0", - "id": "5cdd41ab-3aef-45bb-8703-9dcb85cab0ca", - "name": "paged_unified.fp16_d128_bs16_g1.gfx950", + "id": "e844e222-fda1-4e63-9167-3df83a93b6dc", + "name": "paged_unified.fp16_d128_bs16_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1657,7 +6605,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1672,14 +6620,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6cc64843-166e-4bd8-8fbd-51f0d4151236", - "name": "paged_unified.fp16_d128_bs16_g2.gfx950", + "id": "9a9a95dc-5691-4491-b4d5-85b16f639ec8", + "name": "paged_unified.fp16_d128_bs16_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1690,7 +6639,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1705,14 +6654,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "91d01894-8216-428d-8530-839baaba14a7", - "name": "paged_unified.fp16_d128_bs16_g4.gfx950", + "id": "af215415-ea10-48b1-b328-2cb6b2f711fd", + "name": "paged_unified.fp16_d128_bs16_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1723,7 +6673,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1738,14 +6688,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "0a4f89b0-b385-4fe7-93b3-3795d358b0aa", - "name": "paged_unified.fp16_d128_bs16_g5.gfx950", + "id": "56629518-d001-462b-b4cb-0c285e6d591b", + "name": "paged_unified.fp16_d128_bs16_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1756,7 +6707,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1771,14 +6722,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "ab8c2b08-e5e9-4808-b440-34c73fb76857", - "name": "paged_unified.fp16_d128_bs16_g6.gfx950", + "id": "ae440598-438f-4e6e-b6a8-74ab902eb334", + "name": "paged_unified.fp16_d128_bs16_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1789,7 +6741,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1804,14 +6756,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "1d446be9-dce1-44f7-a4a1-f1f763e5a473", - "name": "paged_unified.fp16_d128_bs16_g7.gfx950", + "id": "116b9d24-bac6-4c20-ab81-eefa0ea7d4c5", + "name": "paged_unified.fp16_d128_bs16_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1822,7 +6775,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1837,14 +6790,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "58e82185-fdd9-4cd8-b5e5-bef8a18c6184", - "name": "paged_unified.fp16_d128_bs16_g8.gfx950", + "id": "ff96e248-2cfc-4f38-99db-cd428ba4657e", + "name": "paged_unified.fp16_d128_bs16_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1855,7 +6809,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1870,14 +6824,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "fe2be135-c4e3-4c31-a7a1-1ce826615e97", - "name": "paged_unified.fp16_d128_bs16_g16.gfx950", + "id": "e1342693-4a88-46be-8653-b2a55a936173", + "name": "paged_unified.fp16_d128_bs16_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1888,7 +6843,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1903,14 +6858,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "ae667f2a-398f-4756-8c1c-dab9ec357ae5", - "name": "paged_unified.fp16_d128_bs32_g1.gfx950", + "id": "eb0eb5ff-b6b9-4fa5-9995-e5ac7627af0c", + "name": "paged_unified.fp16_d128_bs32_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1921,7 +6877,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1936,14 +6892,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2acc9f68-9c32-46b3-8a24-7fe02eece8b3", - "name": "paged_unified.fp16_d128_bs32_g2.gfx950", + "id": "91ab8558-57cb-4a4d-866e-b362d35463d3", + "name": "paged_unified.fp16_d128_bs32_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1954,7 +6911,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -1969,14 +6926,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "50eb5d30-b66a-4c8d-b81d-514109d4ede7", - "name": "paged_unified.fp16_d128_bs32_g4.gfx950", + "id": "83e1a4af-8251-4b50-a65c-f2f2fd73aea2", + "name": "paged_unified.fp16_d128_bs32_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -1987,7 +6945,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2002,14 +6960,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "c6c5da58-a5a3-4701-bc0d-45893fcf857f", - "name": "paged_unified.fp16_d128_bs32_g5.gfx950", + "id": "4e4c8aa2-a935-4588-9490-9d505090aa25", + "name": "paged_unified.fp16_d128_bs32_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2020,7 +6979,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2035,14 +6994,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "615b49c5-95fc-465d-bf1f-adcbb6897c23", - "name": "paged_unified.fp16_d128_bs32_g6.gfx950", + "id": "ad864973-ec16-442f-b4f4-f9c983e05f02", + "name": "paged_unified.fp16_d128_bs32_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2053,7 +7013,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2068,14 +7028,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6a72e374-f7f0-4271-8d77-4c824a839da9", - "name": "paged_unified.fp16_d128_bs32_g7.gfx950", + "id": "efe6bd36-41ba-4956-944d-101d1a45cba9", + "name": "paged_unified.fp16_d128_bs32_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2086,7 +7047,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2101,14 +7062,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d9c89124-2bd0-4bef-b164-4820bc78dcf5", - "name": "paged_unified.fp16_d128_bs32_g8.gfx950", + "id": "40a66932-a4a5-4ca5-871f-7f8c62606555", + "name": "paged_unified.fp16_d128_bs32_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2119,7 +7081,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2134,14 +7096,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6fe2e2b2-9ba0-47a9-a771-312e8c42443d", - "name": "paged_unified.fp16_d128_bs32_g16.gfx950", + "id": "11f74e11-5f00-46ab-97af-5ef67f6c3f00", + "name": "paged_unified.fp16_d128_bs32_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2152,7 +7115,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2167,14 +7130,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a8658448-58d9-4a21-af14-c772630b7af5", - "name": "paged_unified.fp16_d128_bs64_g1.gfx950", + "id": "a2fbc98a-99f3-4060-a752-c01bd931e0db", + "name": "paged_unified.fp16_d128_bs64_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2185,7 +7149,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2200,14 +7164,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "ce4906d8-b10e-4883-9703-d033c650dfcd", - "name": "paged_unified.fp16_d128_bs64_g2.gfx950", + "id": "0f775342-3bcb-4ec5-b685-4a26de6bb2bf", + "name": "paged_unified.fp16_d128_bs64_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2218,7 +7183,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2233,14 +7198,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "65e687fa-7307-47aa-8450-91c648ff04a3", - "name": "paged_unified.fp16_d128_bs64_g4.gfx950", + "id": "e934153b-b5ce-41c6-985d-c2313557d519", + "name": "paged_unified.fp16_d128_bs64_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2251,7 +7217,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2266,14 +7232,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "32ef65bd-0c74-406b-8579-4443d1b9ecf5", - "name": "paged_unified.fp16_d128_bs64_g5.gfx950", + "id": "6c6261b6-e36e-42ca-8543-69f42d74ee3f", + "name": "paged_unified.fp16_d128_bs64_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2284,7 +7251,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2299,14 +7266,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "81ad98d6-542d-4954-aaf2-c4778b6c1a18", - "name": "paged_unified.fp16_d128_bs64_g6.gfx950", + "id": "938c45a1-54da-4ad5-abbe-abd43ab819ab", + "name": "paged_unified.fp16_d128_bs64_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2317,7 +7285,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2332,14 +7300,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "87d0050b-4319-4163-9c72-a277e38ec71a", - "name": "paged_unified.fp16_d128_bs64_g7.gfx950", + "id": "b4707cf4-f401-4ea3-8e0a-17222e3030a3", + "name": "paged_unified.fp16_d128_bs64_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2350,7 +7319,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2365,14 +7334,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "345d5868-b3ec-43e8-bea0-7d21920607da", - "name": "paged_unified.fp16_d128_bs64_g8.gfx950", + "id": "0c00339e-79d0-47d4-9fa3-b1763f27c77f", + "name": "paged_unified.fp16_d128_bs64_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2383,7 +7353,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2398,14 +7368,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2bdc88d4-6288-4ce6-be67-c264a7c7f416", - "name": "paged_unified.fp16_d128_bs64_g16.gfx950", + "id": "baa29877-ec6e-4735-ba2f-f54a97b5702e", + "name": "paged_unified.fp16_d128_bs64_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2416,7 +7387,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2431,14 +7402,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "212e2c5b-a4fa-49be-8591-01bad9ce2e51", - "name": "paged_unified.fp16_d256_bs16_g1.gfx950", + "id": "c7608c8e-a07b-481a-bd07-ba030694903c", + "name": "paged_unified.fp16_d256_bs16_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2449,7 +7421,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2464,14 +7436,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "0e0716c8-916e-4662-8740-8b8f12c7156e", - "name": "paged_unified.fp16_d256_bs16_g2.gfx950", + "id": "e100047c-b226-450d-a5d6-a167c9eefaa4", + "name": "paged_unified.fp16_d256_bs16_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2482,7 +7455,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2497,14 +7470,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "c8776003-b78a-49ce-9984-72bf5539347d", - "name": "paged_unified.fp16_d256_bs16_g4.gfx950", + "id": "035a6305-9244-427a-85fb-dee1510ff99a", + "name": "paged_unified.fp16_d256_bs16_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2515,7 +7489,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2530,14 +7504,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "12d560a0-3087-4e3e-b463-a534c1144c20", - "name": "paged_unified.fp16_d256_bs16_g5.gfx950", + "id": "db233623-3387-4578-a817-2640f2bdc45d", + "name": "paged_unified.fp16_d256_bs16_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2548,7 +7523,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2563,14 +7538,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "3a950075-7baa-4a59-b8b2-2e040fe7726a", - "name": "paged_unified.fp16_d256_bs16_g6.gfx950", + "id": "1c0bce3e-305c-4734-866f-0b289a6d3fea", + "name": "paged_unified.fp16_d256_bs16_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2581,7 +7557,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2596,14 +7572,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "57a3c2ca-aefc-4c8c-a82a-805d9d045179", - "name": "paged_unified.fp16_d256_bs16_g7.gfx950", + "id": "64a69a8b-861b-407e-b04d-eb18d27a2d53", + "name": "paged_unified.fp16_d256_bs16_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2614,7 +7591,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2629,14 +7606,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "cd5fe387-1c55-4259-81f8-96b92fc6dfcf", - "name": "paged_unified.fp16_d256_bs16_g8.gfx950", + "id": "ec18c330-c4a4-4d1a-8850-0ad1af4b8cdd", + "name": "paged_unified.fp16_d256_bs16_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2647,7 +7625,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2662,14 +7640,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "74c22353-32ce-4987-91d3-f5f93c483290", - "name": "paged_unified.fp16_d256_bs16_g16.gfx950", + "id": "9c3ce9d0-761d-402a-a26b-49381c0ea255", + "name": "paged_unified.fp16_d256_bs16_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2680,7 +7659,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2695,14 +7674,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "e71e3205-6ddd-4c48-acdc-abdee8ef25a6", - "name": "paged_unified.fp16_d256_bs32_g1.gfx950", + "id": "38079942-e482-4e7d-b533-a27995b2919c", + "name": "paged_unified.fp16_d256_bs32_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2713,7 +7693,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2728,14 +7708,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "83f435ff-c4e1-41eb-b181-653964b5e0a7", - "name": "paged_unified.fp16_d256_bs32_g2.gfx950", + "id": "72d24053-faa4-4161-8632-110da1f8fab3", + "name": "paged_unified.fp16_d256_bs32_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2746,7 +7727,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2761,14 +7742,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "1211fee3-7b28-4b3f-8281-59a2e8b2e72f", - "name": "paged_unified.fp16_d256_bs32_g4.gfx950", + "id": "6750c8f4-3551-4f28-a728-ee4fad0f5eb1", + "name": "paged_unified.fp16_d256_bs32_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2779,7 +7761,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2794,14 +7776,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "35d744c2-bb64-4b18-a676-ced7fed9c37b", - "name": "paged_unified.fp16_d256_bs32_g5.gfx950", + "id": "3d9b40ff-9d64-4b19-9635-6dfc8e0c9969", + "name": "paged_unified.fp16_d256_bs32_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2812,7 +7795,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2827,14 +7810,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "80787923-e0e5-4c81-83dd-9bf0e6bd5245", - "name": "paged_unified.fp16_d256_bs32_g6.gfx950", + "id": "1e601534-84ab-4fd2-a572-1fca16c855c0", + "name": "paged_unified.fp16_d256_bs32_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2845,7 +7829,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2860,14 +7844,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "e0250241-14e3-4afe-9b93-a177b9463e72", - "name": "paged_unified.fp16_d256_bs32_g7.gfx950", + "id": "bc9ae7fc-59a6-40bb-b53b-24221cec3694", + "name": "paged_unified.fp16_d256_bs32_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2878,7 +7863,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2893,14 +7878,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6ea257a0-cb99-4a9a-aeff-25c711d35c1f", - "name": "paged_unified.fp16_d256_bs32_g8.gfx950", + "id": "f66b49ea-06ed-484b-8879-6756d6ce50ba", + "name": "paged_unified.fp16_d256_bs32_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2911,7 +7897,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2926,14 +7912,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2abafb51-1dc8-477b-8590-3d3da623682c", - "name": "paged_unified.fp16_d256_bs32_g16.gfx950", + "id": "b94c3cf2-fe26-41ec-8269-ce61965f4529", + "name": "paged_unified.fp16_d256_bs32_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2944,7 +7931,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2959,14 +7946,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "367682ef-d49d-402a-8fc5-5c2a8c62ccf3", - "name": "paged_unified.fp16_d256_bs64_g1.gfx950", + "id": "18211d4f-d439-4218-afbb-fddfb986df70", + "name": "paged_unified.fp16_d256_bs64_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -2977,7 +7965,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -2992,14 +7980,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "02811807-31c2-4dde-bd76-a115cad59a14", - "name": "paged_unified.fp16_d256_bs64_g2.gfx950", + "id": "8ca864ed-4047-484d-aed7-de8cb63e1381", + "name": "paged_unified.fp16_d256_bs64_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3010,7 +7999,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3025,14 +8014,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "8feb86cd-9438-4df6-b54f-9cf25fa3f61d", - "name": "paged_unified.fp16_d256_bs64_g4.gfx950", + "id": "e99d93ec-eae0-4399-8492-0f167cc16c04", + "name": "paged_unified.fp16_d256_bs64_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3043,7 +8033,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3058,14 +8048,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5fa6ab9c-3b33-4f72-8c20-8f6f71e5cc7b", - "name": "paged_unified.fp16_d256_bs64_g5.gfx950", + "id": "3c1f8de5-bc59-4e3b-860f-7aaea7a20491", + "name": "paged_unified.fp16_d256_bs64_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3076,7 +8067,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3091,14 +8082,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "bc333d48-114b-4562-bbe1-300e2c7546a7", - "name": "paged_unified.fp16_d256_bs64_g6.gfx950", + "id": "442764ad-1c9e-431e-9a77-efeba4ca5c19", + "name": "paged_unified.fp16_d256_bs64_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3109,7 +8101,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3124,14 +8116,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "e17f0c38-26ee-4ef8-8696-a39b1358ece8", - "name": "paged_unified.fp16_d256_bs64_g7.gfx950", + "id": "9b5b7968-735f-44f4-9b0b-32b500c64791", + "name": "paged_unified.fp16_d256_bs64_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3142,7 +8135,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3157,14 +8150,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "93e6c2ec-1223-44a2-b0f1-a376dda4f3f4", - "name": "paged_unified.fp16_d256_bs64_g8.gfx950", + "id": "b4f828e0-bee7-47ca-ac3f-d07cf14800f6", + "name": "paged_unified.fp16_d256_bs64_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3175,7 +8169,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3190,14 +8184,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5e25702f-6c55-42f8-bdf6-2762c9751a29", - "name": "paged_unified.fp16_d256_bs64_g16.gfx950", + "id": "c082ece0-0195-4fa8-8475-f4f06c289c17", + "name": "paged_unified.fp16_d256_bs64_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3208,7 +8203,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "fp16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3223,14 +8218,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "258b21d7-84f6-4763-8456-a9f5eef1f0f9", - "name": "paged_unified.bf16_d128_bs16_g1.gfx950", + "id": "05c0b2eb-1dc1-49e0-86b8-30f14ac50e70", + "name": "paged_unified.bf16_d128_bs16_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3241,7 +8237,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3256,14 +8252,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "7da0b28b-d3e1-42b2-b639-4e6d68a9edfd", - "name": "paged_unified.bf16_d128_bs16_g2.gfx950", + "id": "f041932d-1319-46ee-b849-ac998b968549", + "name": "paged_unified.bf16_d128_bs16_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3274,7 +8271,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3289,14 +8286,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "ed30ea7f-e65a-4cfd-ab85-59f6f434bc4c", - "name": "paged_unified.bf16_d128_bs16_g4.gfx950", + "id": "c0f349ee-2312-4f91-b1c9-2aa87b91c9b6", + "name": "paged_unified.bf16_d128_bs16_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3307,7 +8305,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3322,14 +8320,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "7edd94cf-1bc0-4ebe-9119-690a7c220a69", - "name": "paged_unified.bf16_d128_bs16_g5.gfx950", + "id": "1b81da4f-a2b3-499f-9cb7-314e66a8f4e9", + "name": "paged_unified.bf16_d128_bs16_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3340,7 +8339,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3355,14 +8354,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "cba0a8fa-bedf-4fab-b897-e6ec325982a1", - "name": "paged_unified.bf16_d128_bs16_g6.gfx950", + "id": "b98c4db3-d791-4ca0-b36f-e5e552bad295", + "name": "paged_unified.bf16_d128_bs16_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3373,7 +8373,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3388,14 +8388,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "0ec0503d-7072-4601-a1f3-4f3d9f034adc", - "name": "paged_unified.bf16_d128_bs16_g7.gfx950", + "id": "8888ed47-a2f5-43e0-83c9-93d0cde5abc9", + "name": "paged_unified.bf16_d128_bs16_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3406,7 +8407,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3421,14 +8422,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "9bf7d181-7aad-4890-be52-98717c69a02c", - "name": "paged_unified.bf16_d128_bs16_g8.gfx950", + "id": "23b957b9-0932-4cd8-9170-20eb7c27990b", + "name": "paged_unified.bf16_d128_bs16_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3439,7 +8441,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3454,14 +8456,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "82f69d9c-31ef-48d2-bd8c-0a3222e0f44a", - "name": "paged_unified.bf16_d128_bs16_g16.gfx950", + "id": "51a39f22-fc1c-4104-a40b-8500de70e7f9", + "name": "paged_unified.bf16_d128_bs16_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3472,7 +8475,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3487,14 +8490,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "699fd5c5-2c5f-4bdc-aa76-a358ef187fea", - "name": "paged_unified.bf16_d128_bs32_g1.gfx950", + "id": "f12100e9-808a-4b74-8101-b57d755f3a4e", + "name": "paged_unified.bf16_d128_bs32_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3505,7 +8509,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3520,14 +8524,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a7662c5f-4864-4eae-a627-96016eeae194", - "name": "paged_unified.bf16_d128_bs32_g2.gfx950", + "id": "b1996edd-e76f-4fc8-8f6a-ae121dc1eee8", + "name": "paged_unified.bf16_d128_bs32_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3538,7 +8543,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3553,14 +8558,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2ee0cd45-4b51-4727-98b0-b9dbefe6ee38", - "name": "paged_unified.bf16_d128_bs32_g4.gfx950", + "id": "9328c68e-1736-4f89-bf6f-d280475c4dac", + "name": "paged_unified.bf16_d128_bs32_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3571,7 +8577,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3586,14 +8592,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4b724bcf-57ef-43e2-9033-106094af8a8c", - "name": "paged_unified.bf16_d128_bs32_g5.gfx950", + "id": "87bdccca-234d-4870-8b6d-ba51b425fbf6", + "name": "paged_unified.bf16_d128_bs32_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3604,7 +8611,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3619,14 +8626,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "24b9c183-75d9-48bd-8ffe-c30558a6e6a7", - "name": "paged_unified.bf16_d128_bs32_g6.gfx950", + "id": "d8940312-3258-4fac-9b66-a37f1f51b082", + "name": "paged_unified.bf16_d128_bs32_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3637,7 +8645,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3652,14 +8660,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5fccd6f1-e517-40f9-bdcd-68d19f1413f1", - "name": "paged_unified.bf16_d128_bs32_g7.gfx950", + "id": "ccc90587-5fc9-416f-9619-9a9d766833b4", + "name": "paged_unified.bf16_d128_bs32_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3670,7 +8679,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3685,14 +8694,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "8d227a60-c5c8-461a-9199-06b114559418", - "name": "paged_unified.bf16_d128_bs32_g8.gfx950", + "id": "1d92b44a-3e12-4961-939e-9773abfca8c8", + "name": "paged_unified.bf16_d128_bs32_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3703,7 +8713,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3718,14 +8728,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "69e2888d-bf79-4b0f-9ced-9b1b5bcde74b", - "name": "paged_unified.bf16_d128_bs32_g16.gfx950", + "id": "20251b39-b963-407b-98f7-3ec2158a2bdf", + "name": "paged_unified.bf16_d128_bs32_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3736,7 +8747,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3751,14 +8762,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "075fcfd4-a09d-4e07-8ada-d25091b84ec0", - "name": "paged_unified.bf16_d128_bs64_g1.gfx950", + "id": "449fa76d-deca-41b2-8526-f24aee541ece", + "name": "paged_unified.bf16_d128_bs64_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3769,7 +8781,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3784,14 +8796,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2247b974-9cc4-4acb-9541-b891a71001fb", - "name": "paged_unified.bf16_d128_bs64_g2.gfx950", + "id": "7ec7bb17-b972-4c19-abe6-206d7bc80ec7", + "name": "paged_unified.bf16_d128_bs64_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3802,7 +8815,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3817,14 +8830,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "3d9e1e93-287c-43b8-8ae0-0288c521457d", - "name": "paged_unified.bf16_d128_bs64_g4.gfx950", + "id": "6e96ab15-b837-4ee3-a346-2f4c58fde7f1", + "name": "paged_unified.bf16_d128_bs64_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3835,7 +8849,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3850,14 +8864,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6ff9caa4-a548-4a28-8c36-20b79334724e", - "name": "paged_unified.bf16_d128_bs64_g5.gfx950", + "id": "5c5a7183-8fe6-4dc7-b15a-02ba113761ba", + "name": "paged_unified.bf16_d128_bs64_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3868,7 +8883,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3883,14 +8898,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2ff04cdc-827b-4bdb-80bf-1b1f00381986", - "name": "paged_unified.bf16_d128_bs64_g6.gfx950", + "id": "0d659623-8134-424e-bbdd-5ac14cfd3e07", + "name": "paged_unified.bf16_d128_bs64_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3901,7 +8917,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3916,14 +8932,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "02f9702a-a0df-4acf-93f6-cea88ee1d62e", - "name": "paged_unified.bf16_d128_bs64_g7.gfx950", + "id": "d6d448f1-2cd5-477b-9170-14c7d3924297", + "name": "paged_unified.bf16_d128_bs64_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3934,7 +8951,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3949,14 +8966,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a97cf320-07f7-45f4-8ec7-b5e43dfb5494", - "name": "paged_unified.bf16_d128_bs64_g8.gfx950", + "id": "52c3f980-f84f-4d74-b97c-fe937c96e945", + "name": "paged_unified.bf16_d128_bs64_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -3967,7 +8985,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -3982,14 +9000,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4aa3f44b-7d26-4570-b0d0-56af35a46aa0", - "name": "paged_unified.bf16_d128_bs64_g16.gfx950", + "id": "1a4eea2d-de9e-40e9-ba93-23fb844b4786", + "name": "paged_unified.bf16_d128_bs64_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4000,7 +9019,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4015,14 +9034,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5dcbc493-fd56-4e70-8d1b-8be3578d0a64", - "name": "paged_unified.bf16_d256_bs16_g1.gfx950", + "id": "4983b6c1-6cfc-4420-99b8-8c4a05aa3c55", + "name": "paged_unified.bf16_d256_bs16_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4033,7 +9053,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4048,14 +9068,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "1b167790-ad72-43e9-b69d-39d2d03e2982", - "name": "paged_unified.bf16_d256_bs16_g2.gfx950", + "id": "44d7e2ff-cbb5-4de5-b7b6-f593b19e269d", + "name": "paged_unified.bf16_d256_bs16_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4066,7 +9087,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4081,14 +9102,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "43259880-c763-4787-8c99-e7c97cab2ed1", - "name": "paged_unified.bf16_d256_bs16_g4.gfx950", + "id": "86dc3722-d408-48ee-ba54-d4fb42ceb8af", + "name": "paged_unified.bf16_d256_bs16_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4099,7 +9121,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4114,14 +9136,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "eb8c6681-9561-454c-a31c-aac0af6afea3", - "name": "paged_unified.bf16_d256_bs16_g5.gfx950", + "id": "2c17aca7-9c7a-4c44-96c8-f1d16c295f98", + "name": "paged_unified.bf16_d256_bs16_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4132,7 +9155,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4147,14 +9170,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d19948cb-313c-4c5a-b955-456dd822405b", - "name": "paged_unified.bf16_d256_bs16_g6.gfx950", + "id": "fd400ebf-7d25-4d57-b55d-9564765d2160", + "name": "paged_unified.bf16_d256_bs16_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4165,7 +9189,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4180,14 +9204,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "a08db64c-9962-4abc-87b6-00f8fc3073a0", - "name": "paged_unified.bf16_d256_bs16_g7.gfx950", + "id": "4f5c6fac-da5c-409c-942b-1aa1d8d40284", + "name": "paged_unified.bf16_d256_bs16_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4198,7 +9223,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4213,14 +9238,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "f635af58-729f-4c9f-b8ed-70c4857378e8", - "name": "paged_unified.bf16_d256_bs16_g8.gfx950", + "id": "d3b041b7-a683-402e-87b4-536cfbd76251", + "name": "paged_unified.bf16_d256_bs16_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4231,7 +9257,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4246,14 +9272,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "7e358fe4-43f0-46d7-8be0-4660c77247b0", - "name": "paged_unified.bf16_d256_bs16_g16.gfx950", + "id": "04efc7d1-010e-45d3-9e88-52d7c308d32e", + "name": "paged_unified.bf16_d256_bs16_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4264,7 +9291,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4279,14 +9306,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "8352754f-ece1-4ba6-9c35-398768cf41b7", - "name": "paged_unified.bf16_d256_bs32_g1.gfx950", + "id": "90b6f347-cd9d-4d91-90a3-dc7592012943", + "name": "paged_unified.bf16_d256_bs32_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4297,7 +9325,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4312,14 +9340,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5885853c-e7c6-4834-b065-25d49a139056", - "name": "paged_unified.bf16_d256_bs32_g2.gfx950", + "id": "faeb0789-8146-431c-880f-1aaa920f69d0", + "name": "paged_unified.bf16_d256_bs32_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4330,7 +9359,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4345,14 +9374,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "6729cecc-1077-4605-9695-b8dfb3843526", - "name": "paged_unified.bf16_d256_bs32_g4.gfx950", + "id": "64eabbc8-a1c6-42ec-8dcb-746357fff8de", + "name": "paged_unified.bf16_d256_bs32_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4363,7 +9393,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4378,14 +9408,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "45eae18e-aac5-460b-a1dd-615b433ca8eb", - "name": "paged_unified.bf16_d256_bs32_g5.gfx950", + "id": "38271b5f-95df-4fab-b408-b57da2dad248", + "name": "paged_unified.bf16_d256_bs32_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4396,7 +9427,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4411,14 +9442,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "723d1174-3d03-4a21-98aa-4d4c3cc5fabc", - "name": "paged_unified.bf16_d256_bs32_g6.gfx950", + "id": "84cb5767-354a-4469-92ba-433d377fc427", + "name": "paged_unified.bf16_d256_bs32_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4429,7 +9461,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4444,14 +9476,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5c4e2d08-0659-4131-8125-b217367e338a", - "name": "paged_unified.bf16_d256_bs32_g7.gfx950", + "id": "e1a5e31e-63dd-473d-9426-75f08c9ddafd", + "name": "paged_unified.bf16_d256_bs32_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4462,7 +9495,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4477,14 +9510,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "2aab1fe6-4b4a-4e67-972f-cad674985bc4", - "name": "paged_unified.bf16_d256_bs32_g8.gfx950", + "id": "5c8c48bd-25cd-42b7-96a5-adb3eb23b218", + "name": "paged_unified.bf16_d256_bs32_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4495,7 +9529,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4510,14 +9544,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "de53e03a-fbcc-405a-84f8-a42f071fe89c", - "name": "paged_unified.bf16_d256_bs32_g16.gfx950", + "id": "0aca895c-33a5-49c9-b89c-ab279aa89f14", + "name": "paged_unified.bf16_d256_bs32_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4528,7 +9563,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4543,14 +9578,15 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "b553b247-2f2b-4b24-8d18-2e038d353462", - "name": "paged_unified.bf16_d256_bs64_g1.gfx950", + "id": "fb665e60-5533-4fee-8740-807de889385e", + "name": "paged_unified.bf16_d256_bs64_g1_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4561,7 +9597,7 @@ "num_query_heads": 1, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4576,14 +9612,15 @@ "num_query_heads": 1, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "e666ef18-dfd2-4112-8859-b78f0c2a47e0", - "name": "paged_unified.bf16_d256_bs64_g2.gfx950", + "id": "4aab3b6f-6a75-4672-8cca-894a31e8fe00", + "name": "paged_unified.bf16_d256_bs64_g2_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4594,7 +9631,7 @@ "num_query_heads": 2, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4609,14 +9646,15 @@ "num_query_heads": 2, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "3ccdbb49-02c7-4f0d-a20d-d50f31a01528", - "name": "paged_unified.bf16_d256_bs64_g4.gfx950", + "id": "45b49374-8789-4eaa-b8a6-bdc54886e62b", + "name": "paged_unified.bf16_d256_bs64_g4_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4627,7 +9665,7 @@ "num_query_heads": 4, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4642,14 +9680,15 @@ "num_query_heads": 4, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "9564ff74-d7b3-452d-bfa1-1098adbdf84c", - "name": "paged_unified.bf16_d256_bs64_g5.gfx950", + "id": "90e10f52-50b3-482e-bcda-a3c66d039186", + "name": "paged_unified.bf16_d256_bs64_g5_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4660,7 +9699,7 @@ "num_query_heads": 5, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4675,14 +9714,15 @@ "num_query_heads": 5, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "4718b8a9-1eaa-46f9-a7ef-906f07358d1b", - "name": "paged_unified.bf16_d256_bs64_g6.gfx950", + "id": "fa7370b2-51e0-4be3-b225-98e9c5bd0969", + "name": "paged_unified.bf16_d256_bs64_g6_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4693,7 +9733,7 @@ "num_query_heads": 6, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4708,14 +9748,15 @@ "num_query_heads": 6, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "914620ee-0cbe-48c2-8b89-946a28cdfe47", - "name": "paged_unified.bf16_d256_bs64_g7.gfx950", + "id": "7b822301-b1b5-4a2a-b86d-f0aabcd8d63f", + "name": "paged_unified.bf16_d256_bs64_g7_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4726,7 +9767,7 @@ "num_query_heads": 7, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4741,14 +9782,15 @@ "num_query_heads": 7, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "d7d550e4-1012-4034-9dda-0cd4f82a4f60", - "name": "paged_unified.bf16_d256_bs64_g8.gfx950", + "id": "66d52692-5429-41ad-bb0e-56eb2f5d2511", + "name": "paged_unified.bf16_d256_bs64_g8_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4759,7 +9801,7 @@ "num_query_heads": 8, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4774,14 +9816,15 @@ "num_query_heads": 8, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 }, { "version": "1.0", - "id": "5fe3a4a9-7cdc-4855-bf39-7c0b3a1aff30", - "name": "paged_unified.bf16_d256_bs64_g16.gfx950", + "id": "212cd820-c660-4500-a8ac-bcf127682126", + "name": "paged_unified.bf16_d256_bs64_g16_sinks.gfx950", "kernel_source": { "kind": "rocke", "source": "kernels/gfx950/attention_tiled_2d.py", @@ -4792,7 +9835,7 @@ "num_query_heads": 16, "num_kv_heads": 1, "dtype": "bf16", - "use_sinks": false, + "use_sinks": true, "sliding_window": 0, "has_softcap": false, "num_warps": 4, @@ -4807,7 +9850,8 @@ "num_query_heads": 16, "num_kv_heads": 1, "num_warps": 4, - "block_m_per_warp": 16 + "block_m_per_warp": 16, + "use_sinks": 1 }, "priority": 0 } diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp index 7d104f0d1784..9e6571917f63 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedPacks.cpp @@ -75,148 +75,292 @@ const std::map& expectedByArch() { "paged_unified.bf16_d128_bs16_g1.gfx942", "paged_unified.bf16_d128_bs16_g16.gfx942", + "paged_unified.bf16_d128_bs16_g16_sinks.gfx942", + "paged_unified.bf16_d128_bs16_g1_sinks.gfx942", "paged_unified.bf16_d128_bs16_g2.gfx942", + "paged_unified.bf16_d128_bs16_g2_sinks.gfx942", "paged_unified.bf16_d128_bs16_g4.gfx942", + "paged_unified.bf16_d128_bs16_g4_sinks.gfx942", "paged_unified.bf16_d128_bs16_g5.gfx942", + "paged_unified.bf16_d128_bs16_g5_sinks.gfx942", "paged_unified.bf16_d128_bs16_g6.gfx942", + "paged_unified.bf16_d128_bs16_g6_sinks.gfx942", "paged_unified.bf16_d128_bs16_g7.gfx942", + "paged_unified.bf16_d128_bs16_g7_sinks.gfx942", "paged_unified.bf16_d128_bs16_g8.gfx942", + "paged_unified.bf16_d128_bs16_g8_sinks.gfx942", "paged_unified.bf16_d128_bs32_g1.gfx942", "paged_unified.bf16_d128_bs32_g16.gfx942", + "paged_unified.bf16_d128_bs32_g16_sinks.gfx942", + "paged_unified.bf16_d128_bs32_g1_sinks.gfx942", "paged_unified.bf16_d128_bs32_g2.gfx942", + "paged_unified.bf16_d128_bs32_g2_sinks.gfx942", "paged_unified.bf16_d128_bs32_g4.gfx942", + "paged_unified.bf16_d128_bs32_g4_sinks.gfx942", "paged_unified.bf16_d128_bs32_g5.gfx942", + "paged_unified.bf16_d128_bs32_g5_sinks.gfx942", "paged_unified.bf16_d128_bs32_g6.gfx942", + "paged_unified.bf16_d128_bs32_g6_sinks.gfx942", "paged_unified.bf16_d128_bs32_g7.gfx942", + "paged_unified.bf16_d128_bs32_g7_sinks.gfx942", "paged_unified.bf16_d128_bs32_g8.gfx942", + "paged_unified.bf16_d128_bs32_g8_sinks.gfx942", "paged_unified.bf16_d128_bs64_g1.gfx942", "paged_unified.bf16_d128_bs64_g16.gfx942", + "paged_unified.bf16_d128_bs64_g16_sinks.gfx942", + "paged_unified.bf16_d128_bs64_g1_sinks.gfx942", "paged_unified.bf16_d128_bs64_g2.gfx942", + "paged_unified.bf16_d128_bs64_g2_sinks.gfx942", "paged_unified.bf16_d128_bs64_g4.gfx942", + "paged_unified.bf16_d128_bs64_g4_sinks.gfx942", "paged_unified.bf16_d128_bs64_g5.gfx942", + "paged_unified.bf16_d128_bs64_g5_sinks.gfx942", "paged_unified.bf16_d128_bs64_g6.gfx942", + "paged_unified.bf16_d128_bs64_g6_sinks.gfx942", "paged_unified.bf16_d128_bs64_g7.gfx942", + "paged_unified.bf16_d128_bs64_g7_sinks.gfx942", "paged_unified.bf16_d128_bs64_g8.gfx942", + "paged_unified.bf16_d128_bs64_g8_sinks.gfx942", "paged_unified.bf16_d256_bs16_g1.gfx942", "paged_unified.bf16_d256_bs16_g16.gfx942", + "paged_unified.bf16_d256_bs16_g16_sinks.gfx942", + "paged_unified.bf16_d256_bs16_g1_sinks.gfx942", "paged_unified.bf16_d256_bs16_g2.gfx942", + "paged_unified.bf16_d256_bs16_g2_sinks.gfx942", "paged_unified.bf16_d256_bs16_g4.gfx942", + "paged_unified.bf16_d256_bs16_g4_sinks.gfx942", "paged_unified.bf16_d256_bs16_g5.gfx942", + "paged_unified.bf16_d256_bs16_g5_sinks.gfx942", "paged_unified.bf16_d256_bs16_g6.gfx942", + "paged_unified.bf16_d256_bs16_g6_sinks.gfx942", "paged_unified.bf16_d256_bs16_g7.gfx942", + "paged_unified.bf16_d256_bs16_g7_sinks.gfx942", "paged_unified.bf16_d256_bs16_g8.gfx942", + "paged_unified.bf16_d256_bs16_g8_sinks.gfx942", "paged_unified.bf16_d256_bs32_g1.gfx942", "paged_unified.bf16_d256_bs32_g16.gfx942", + "paged_unified.bf16_d256_bs32_g16_sinks.gfx942", + "paged_unified.bf16_d256_bs32_g1_sinks.gfx942", "paged_unified.bf16_d256_bs32_g2.gfx942", + "paged_unified.bf16_d256_bs32_g2_sinks.gfx942", "paged_unified.bf16_d256_bs32_g4.gfx942", + "paged_unified.bf16_d256_bs32_g4_sinks.gfx942", "paged_unified.bf16_d256_bs32_g5.gfx942", + "paged_unified.bf16_d256_bs32_g5_sinks.gfx942", "paged_unified.bf16_d256_bs32_g6.gfx942", + "paged_unified.bf16_d256_bs32_g6_sinks.gfx942", "paged_unified.bf16_d256_bs32_g7.gfx942", + "paged_unified.bf16_d256_bs32_g7_sinks.gfx942", "paged_unified.bf16_d256_bs32_g8.gfx942", + "paged_unified.bf16_d256_bs32_g8_sinks.gfx942", "paged_unified.bf16_d256_bs64_g1.gfx942", "paged_unified.bf16_d256_bs64_g16.gfx942", + "paged_unified.bf16_d256_bs64_g16_sinks.gfx942", + "paged_unified.bf16_d256_bs64_g1_sinks.gfx942", "paged_unified.bf16_d256_bs64_g2.gfx942", + "paged_unified.bf16_d256_bs64_g2_sinks.gfx942", "paged_unified.bf16_d256_bs64_g4.gfx942", + "paged_unified.bf16_d256_bs64_g4_sinks.gfx942", "paged_unified.bf16_d256_bs64_g5.gfx942", + "paged_unified.bf16_d256_bs64_g5_sinks.gfx942", "paged_unified.bf16_d256_bs64_g6.gfx942", + "paged_unified.bf16_d256_bs64_g6_sinks.gfx942", "paged_unified.bf16_d256_bs64_g7.gfx942", + "paged_unified.bf16_d256_bs64_g7_sinks.gfx942", "paged_unified.bf16_d256_bs64_g8.gfx942", + "paged_unified.bf16_d256_bs64_g8_sinks.gfx942", "paged_unified.bf16_d64_bs16_g1.gfx942", "paged_unified.bf16_d64_bs16_g16.gfx942", + "paged_unified.bf16_d64_bs16_g16_sinks.gfx942", + "paged_unified.bf16_d64_bs16_g1_sinks.gfx942", "paged_unified.bf16_d64_bs16_g2.gfx942", + "paged_unified.bf16_d64_bs16_g2_sinks.gfx942", "paged_unified.bf16_d64_bs16_g4.gfx942", + "paged_unified.bf16_d64_bs16_g4_sinks.gfx942", "paged_unified.bf16_d64_bs16_g5.gfx942", + "paged_unified.bf16_d64_bs16_g5_sinks.gfx942", "paged_unified.bf16_d64_bs16_g6.gfx942", + "paged_unified.bf16_d64_bs16_g6_sinks.gfx942", "paged_unified.bf16_d64_bs16_g7.gfx942", + "paged_unified.bf16_d64_bs16_g7_sinks.gfx942", "paged_unified.bf16_d64_bs16_g8.gfx942", + "paged_unified.bf16_d64_bs16_g8_sinks.gfx942", "paged_unified.bf16_d64_bs32_g1.gfx942", "paged_unified.bf16_d64_bs32_g16.gfx942", + "paged_unified.bf16_d64_bs32_g16_sinks.gfx942", + "paged_unified.bf16_d64_bs32_g1_sinks.gfx942", "paged_unified.bf16_d64_bs32_g2.gfx942", + "paged_unified.bf16_d64_bs32_g2_sinks.gfx942", "paged_unified.bf16_d64_bs32_g4.gfx942", + "paged_unified.bf16_d64_bs32_g4_sinks.gfx942", "paged_unified.bf16_d64_bs32_g5.gfx942", + "paged_unified.bf16_d64_bs32_g5_sinks.gfx942", "paged_unified.bf16_d64_bs32_g6.gfx942", + "paged_unified.bf16_d64_bs32_g6_sinks.gfx942", "paged_unified.bf16_d64_bs32_g7.gfx942", + "paged_unified.bf16_d64_bs32_g7_sinks.gfx942", "paged_unified.bf16_d64_bs32_g8.gfx942", + "paged_unified.bf16_d64_bs32_g8_sinks.gfx942", "paged_unified.bf16_d64_bs64_g1.gfx942", "paged_unified.bf16_d64_bs64_g16.gfx942", + "paged_unified.bf16_d64_bs64_g16_sinks.gfx942", + "paged_unified.bf16_d64_bs64_g1_sinks.gfx942", "paged_unified.bf16_d64_bs64_g2.gfx942", + "paged_unified.bf16_d64_bs64_g2_sinks.gfx942", "paged_unified.bf16_d64_bs64_g4.gfx942", + "paged_unified.bf16_d64_bs64_g4_sinks.gfx942", "paged_unified.bf16_d64_bs64_g5.gfx942", + "paged_unified.bf16_d64_bs64_g5_sinks.gfx942", "paged_unified.bf16_d64_bs64_g6.gfx942", + "paged_unified.bf16_d64_bs64_g6_sinks.gfx942", "paged_unified.bf16_d64_bs64_g7.gfx942", + "paged_unified.bf16_d64_bs64_g7_sinks.gfx942", "paged_unified.bf16_d64_bs64_g8.gfx942", + "paged_unified.bf16_d64_bs64_g8_sinks.gfx942", "paged_unified.fp16_d128_bs16_g1.gfx942", "paged_unified.fp16_d128_bs16_g16.gfx942", + "paged_unified.fp16_d128_bs16_g16_sinks.gfx942", + "paged_unified.fp16_d128_bs16_g1_sinks.gfx942", "paged_unified.fp16_d128_bs16_g2.gfx942", + "paged_unified.fp16_d128_bs16_g2_sinks.gfx942", "paged_unified.fp16_d128_bs16_g4.gfx942", + "paged_unified.fp16_d128_bs16_g4_sinks.gfx942", "paged_unified.fp16_d128_bs16_g5.gfx942", + "paged_unified.fp16_d128_bs16_g5_sinks.gfx942", "paged_unified.fp16_d128_bs16_g6.gfx942", + "paged_unified.fp16_d128_bs16_g6_sinks.gfx942", "paged_unified.fp16_d128_bs16_g7.gfx942", + "paged_unified.fp16_d128_bs16_g7_sinks.gfx942", "paged_unified.fp16_d128_bs16_g8.gfx942", + "paged_unified.fp16_d128_bs16_g8_sinks.gfx942", "paged_unified.fp16_d128_bs32_g1.gfx942", "paged_unified.fp16_d128_bs32_g16.gfx942", + "paged_unified.fp16_d128_bs32_g16_sinks.gfx942", + "paged_unified.fp16_d128_bs32_g1_sinks.gfx942", "paged_unified.fp16_d128_bs32_g2.gfx942", + "paged_unified.fp16_d128_bs32_g2_sinks.gfx942", "paged_unified.fp16_d128_bs32_g4.gfx942", + "paged_unified.fp16_d128_bs32_g4_sinks.gfx942", "paged_unified.fp16_d128_bs32_g5.gfx942", + "paged_unified.fp16_d128_bs32_g5_sinks.gfx942", "paged_unified.fp16_d128_bs32_g6.gfx942", + "paged_unified.fp16_d128_bs32_g6_sinks.gfx942", "paged_unified.fp16_d128_bs32_g7.gfx942", + "paged_unified.fp16_d128_bs32_g7_sinks.gfx942", "paged_unified.fp16_d128_bs32_g8.gfx942", + "paged_unified.fp16_d128_bs32_g8_sinks.gfx942", "paged_unified.fp16_d128_bs64_g1.gfx942", "paged_unified.fp16_d128_bs64_g16.gfx942", + "paged_unified.fp16_d128_bs64_g16_sinks.gfx942", + "paged_unified.fp16_d128_bs64_g1_sinks.gfx942", "paged_unified.fp16_d128_bs64_g2.gfx942", + "paged_unified.fp16_d128_bs64_g2_sinks.gfx942", "paged_unified.fp16_d128_bs64_g4.gfx942", + "paged_unified.fp16_d128_bs64_g4_sinks.gfx942", "paged_unified.fp16_d128_bs64_g5.gfx942", + "paged_unified.fp16_d128_bs64_g5_sinks.gfx942", "paged_unified.fp16_d128_bs64_g6.gfx942", + "paged_unified.fp16_d128_bs64_g6_sinks.gfx942", "paged_unified.fp16_d128_bs64_g7.gfx942", + "paged_unified.fp16_d128_bs64_g7_sinks.gfx942", "paged_unified.fp16_d128_bs64_g8.gfx942", + "paged_unified.fp16_d128_bs64_g8_sinks.gfx942", "paged_unified.fp16_d256_bs16_g1.gfx942", "paged_unified.fp16_d256_bs16_g16.gfx942", + "paged_unified.fp16_d256_bs16_g16_sinks.gfx942", + "paged_unified.fp16_d256_bs16_g1_sinks.gfx942", "paged_unified.fp16_d256_bs16_g2.gfx942", + "paged_unified.fp16_d256_bs16_g2_sinks.gfx942", "paged_unified.fp16_d256_bs16_g4.gfx942", + "paged_unified.fp16_d256_bs16_g4_sinks.gfx942", "paged_unified.fp16_d256_bs16_g5.gfx942", + "paged_unified.fp16_d256_bs16_g5_sinks.gfx942", "paged_unified.fp16_d256_bs16_g6.gfx942", + "paged_unified.fp16_d256_bs16_g6_sinks.gfx942", "paged_unified.fp16_d256_bs16_g7.gfx942", + "paged_unified.fp16_d256_bs16_g7_sinks.gfx942", "paged_unified.fp16_d256_bs16_g8.gfx942", + "paged_unified.fp16_d256_bs16_g8_sinks.gfx942", "paged_unified.fp16_d256_bs32_g1.gfx942", "paged_unified.fp16_d256_bs32_g16.gfx942", + "paged_unified.fp16_d256_bs32_g16_sinks.gfx942", + "paged_unified.fp16_d256_bs32_g1_sinks.gfx942", "paged_unified.fp16_d256_bs32_g2.gfx942", + "paged_unified.fp16_d256_bs32_g2_sinks.gfx942", "paged_unified.fp16_d256_bs32_g4.gfx942", + "paged_unified.fp16_d256_bs32_g4_sinks.gfx942", "paged_unified.fp16_d256_bs32_g5.gfx942", + "paged_unified.fp16_d256_bs32_g5_sinks.gfx942", "paged_unified.fp16_d256_bs32_g6.gfx942", + "paged_unified.fp16_d256_bs32_g6_sinks.gfx942", "paged_unified.fp16_d256_bs32_g7.gfx942", + "paged_unified.fp16_d256_bs32_g7_sinks.gfx942", "paged_unified.fp16_d256_bs32_g8.gfx942", + "paged_unified.fp16_d256_bs32_g8_sinks.gfx942", "paged_unified.fp16_d256_bs64_g1.gfx942", "paged_unified.fp16_d256_bs64_g16.gfx942", + "paged_unified.fp16_d256_bs64_g16_sinks.gfx942", + "paged_unified.fp16_d256_bs64_g1_sinks.gfx942", "paged_unified.fp16_d256_bs64_g2.gfx942", + "paged_unified.fp16_d256_bs64_g2_sinks.gfx942", "paged_unified.fp16_d256_bs64_g4.gfx942", + "paged_unified.fp16_d256_bs64_g4_sinks.gfx942", "paged_unified.fp16_d256_bs64_g5.gfx942", + "paged_unified.fp16_d256_bs64_g5_sinks.gfx942", "paged_unified.fp16_d256_bs64_g6.gfx942", + "paged_unified.fp16_d256_bs64_g6_sinks.gfx942", "paged_unified.fp16_d256_bs64_g7.gfx942", + "paged_unified.fp16_d256_bs64_g7_sinks.gfx942", "paged_unified.fp16_d256_bs64_g8.gfx942", + "paged_unified.fp16_d256_bs64_g8_sinks.gfx942", "paged_unified.fp16_d64_bs16_g1.gfx942", "paged_unified.fp16_d64_bs16_g16.gfx942", + "paged_unified.fp16_d64_bs16_g16_sinks.gfx942", + "paged_unified.fp16_d64_bs16_g1_sinks.gfx942", "paged_unified.fp16_d64_bs16_g2.gfx942", + "paged_unified.fp16_d64_bs16_g2_sinks.gfx942", "paged_unified.fp16_d64_bs16_g4.gfx942", + "paged_unified.fp16_d64_bs16_g4_sinks.gfx942", "paged_unified.fp16_d64_bs16_g5.gfx942", + "paged_unified.fp16_d64_bs16_g5_sinks.gfx942", "paged_unified.fp16_d64_bs16_g6.gfx942", + "paged_unified.fp16_d64_bs16_g6_sinks.gfx942", "paged_unified.fp16_d64_bs16_g7.gfx942", + "paged_unified.fp16_d64_bs16_g7_sinks.gfx942", "paged_unified.fp16_d64_bs16_g8.gfx942", + "paged_unified.fp16_d64_bs16_g8_sinks.gfx942", "paged_unified.fp16_d64_bs32_g1.gfx942", "paged_unified.fp16_d64_bs32_g16.gfx942", + "paged_unified.fp16_d64_bs32_g16_sinks.gfx942", + "paged_unified.fp16_d64_bs32_g1_sinks.gfx942", "paged_unified.fp16_d64_bs32_g2.gfx942", + "paged_unified.fp16_d64_bs32_g2_sinks.gfx942", "paged_unified.fp16_d64_bs32_g4.gfx942", + "paged_unified.fp16_d64_bs32_g4_sinks.gfx942", "paged_unified.fp16_d64_bs32_g5.gfx942", + "paged_unified.fp16_d64_bs32_g5_sinks.gfx942", "paged_unified.fp16_d64_bs32_g6.gfx942", + "paged_unified.fp16_d64_bs32_g6_sinks.gfx942", "paged_unified.fp16_d64_bs32_g7.gfx942", + "paged_unified.fp16_d64_bs32_g7_sinks.gfx942", "paged_unified.fp16_d64_bs32_g8.gfx942", + "paged_unified.fp16_d64_bs32_g8_sinks.gfx942", "paged_unified.fp16_d64_bs64_g1.gfx942", "paged_unified.fp16_d64_bs64_g16.gfx942", + "paged_unified.fp16_d64_bs64_g16_sinks.gfx942", + "paged_unified.fp16_d64_bs64_g1_sinks.gfx942", "paged_unified.fp16_d64_bs64_g2.gfx942", + "paged_unified.fp16_d64_bs64_g2_sinks.gfx942", "paged_unified.fp16_d64_bs64_g4.gfx942", + "paged_unified.fp16_d64_bs64_g4_sinks.gfx942", "paged_unified.fp16_d64_bs64_g5.gfx942", + "paged_unified.fp16_d64_bs64_g5_sinks.gfx942", "paged_unified.fp16_d64_bs64_g6.gfx942", + "paged_unified.fp16_d64_bs64_g6_sinks.gfx942", "paged_unified.fp16_d64_bs64_g7.gfx942", + "paged_unified.fp16_d64_bs64_g7_sinks.gfx942", "paged_unified.fp16_d64_bs64_g8.gfx942", + "paged_unified.fp16_d64_bs64_g8_sinks.gfx942", }, }}, {"gfx950", @@ -227,148 +371,292 @@ const std::map& expectedByArch() { "paged_unified.bf16_d128_bs16_g1.gfx950", "paged_unified.bf16_d128_bs16_g16.gfx950", + "paged_unified.bf16_d128_bs16_g16_sinks.gfx950", + "paged_unified.bf16_d128_bs16_g1_sinks.gfx950", "paged_unified.bf16_d128_bs16_g2.gfx950", + "paged_unified.bf16_d128_bs16_g2_sinks.gfx950", "paged_unified.bf16_d128_bs16_g4.gfx950", + "paged_unified.bf16_d128_bs16_g4_sinks.gfx950", "paged_unified.bf16_d128_bs16_g5.gfx950", + "paged_unified.bf16_d128_bs16_g5_sinks.gfx950", "paged_unified.bf16_d128_bs16_g6.gfx950", + "paged_unified.bf16_d128_bs16_g6_sinks.gfx950", "paged_unified.bf16_d128_bs16_g7.gfx950", + "paged_unified.bf16_d128_bs16_g7_sinks.gfx950", "paged_unified.bf16_d128_bs16_g8.gfx950", + "paged_unified.bf16_d128_bs16_g8_sinks.gfx950", "paged_unified.bf16_d128_bs32_g1.gfx950", "paged_unified.bf16_d128_bs32_g16.gfx950", + "paged_unified.bf16_d128_bs32_g16_sinks.gfx950", + "paged_unified.bf16_d128_bs32_g1_sinks.gfx950", "paged_unified.bf16_d128_bs32_g2.gfx950", + "paged_unified.bf16_d128_bs32_g2_sinks.gfx950", "paged_unified.bf16_d128_bs32_g4.gfx950", + "paged_unified.bf16_d128_bs32_g4_sinks.gfx950", "paged_unified.bf16_d128_bs32_g5.gfx950", + "paged_unified.bf16_d128_bs32_g5_sinks.gfx950", "paged_unified.bf16_d128_bs32_g6.gfx950", + "paged_unified.bf16_d128_bs32_g6_sinks.gfx950", "paged_unified.bf16_d128_bs32_g7.gfx950", + "paged_unified.bf16_d128_bs32_g7_sinks.gfx950", "paged_unified.bf16_d128_bs32_g8.gfx950", + "paged_unified.bf16_d128_bs32_g8_sinks.gfx950", "paged_unified.bf16_d128_bs64_g1.gfx950", "paged_unified.bf16_d128_bs64_g16.gfx950", + "paged_unified.bf16_d128_bs64_g16_sinks.gfx950", + "paged_unified.bf16_d128_bs64_g1_sinks.gfx950", "paged_unified.bf16_d128_bs64_g2.gfx950", + "paged_unified.bf16_d128_bs64_g2_sinks.gfx950", "paged_unified.bf16_d128_bs64_g4.gfx950", + "paged_unified.bf16_d128_bs64_g4_sinks.gfx950", "paged_unified.bf16_d128_bs64_g5.gfx950", + "paged_unified.bf16_d128_bs64_g5_sinks.gfx950", "paged_unified.bf16_d128_bs64_g6.gfx950", + "paged_unified.bf16_d128_bs64_g6_sinks.gfx950", "paged_unified.bf16_d128_bs64_g7.gfx950", + "paged_unified.bf16_d128_bs64_g7_sinks.gfx950", "paged_unified.bf16_d128_bs64_g8.gfx950", + "paged_unified.bf16_d128_bs64_g8_sinks.gfx950", "paged_unified.bf16_d256_bs16_g1.gfx950", "paged_unified.bf16_d256_bs16_g16.gfx950", + "paged_unified.bf16_d256_bs16_g16_sinks.gfx950", + "paged_unified.bf16_d256_bs16_g1_sinks.gfx950", "paged_unified.bf16_d256_bs16_g2.gfx950", + "paged_unified.bf16_d256_bs16_g2_sinks.gfx950", "paged_unified.bf16_d256_bs16_g4.gfx950", + "paged_unified.bf16_d256_bs16_g4_sinks.gfx950", "paged_unified.bf16_d256_bs16_g5.gfx950", + "paged_unified.bf16_d256_bs16_g5_sinks.gfx950", "paged_unified.bf16_d256_bs16_g6.gfx950", + "paged_unified.bf16_d256_bs16_g6_sinks.gfx950", "paged_unified.bf16_d256_bs16_g7.gfx950", + "paged_unified.bf16_d256_bs16_g7_sinks.gfx950", "paged_unified.bf16_d256_bs16_g8.gfx950", + "paged_unified.bf16_d256_bs16_g8_sinks.gfx950", "paged_unified.bf16_d256_bs32_g1.gfx950", "paged_unified.bf16_d256_bs32_g16.gfx950", + "paged_unified.bf16_d256_bs32_g16_sinks.gfx950", + "paged_unified.bf16_d256_bs32_g1_sinks.gfx950", "paged_unified.bf16_d256_bs32_g2.gfx950", + "paged_unified.bf16_d256_bs32_g2_sinks.gfx950", "paged_unified.bf16_d256_bs32_g4.gfx950", + "paged_unified.bf16_d256_bs32_g4_sinks.gfx950", "paged_unified.bf16_d256_bs32_g5.gfx950", + "paged_unified.bf16_d256_bs32_g5_sinks.gfx950", "paged_unified.bf16_d256_bs32_g6.gfx950", + "paged_unified.bf16_d256_bs32_g6_sinks.gfx950", "paged_unified.bf16_d256_bs32_g7.gfx950", + "paged_unified.bf16_d256_bs32_g7_sinks.gfx950", "paged_unified.bf16_d256_bs32_g8.gfx950", + "paged_unified.bf16_d256_bs32_g8_sinks.gfx950", "paged_unified.bf16_d256_bs64_g1.gfx950", "paged_unified.bf16_d256_bs64_g16.gfx950", + "paged_unified.bf16_d256_bs64_g16_sinks.gfx950", + "paged_unified.bf16_d256_bs64_g1_sinks.gfx950", "paged_unified.bf16_d256_bs64_g2.gfx950", + "paged_unified.bf16_d256_bs64_g2_sinks.gfx950", "paged_unified.bf16_d256_bs64_g4.gfx950", + "paged_unified.bf16_d256_bs64_g4_sinks.gfx950", "paged_unified.bf16_d256_bs64_g5.gfx950", + "paged_unified.bf16_d256_bs64_g5_sinks.gfx950", "paged_unified.bf16_d256_bs64_g6.gfx950", + "paged_unified.bf16_d256_bs64_g6_sinks.gfx950", "paged_unified.bf16_d256_bs64_g7.gfx950", + "paged_unified.bf16_d256_bs64_g7_sinks.gfx950", "paged_unified.bf16_d256_bs64_g8.gfx950", + "paged_unified.bf16_d256_bs64_g8_sinks.gfx950", "paged_unified.bf16_d64_bs16_g1.gfx950", "paged_unified.bf16_d64_bs16_g16.gfx950", + "paged_unified.bf16_d64_bs16_g16_sinks.gfx950", + "paged_unified.bf16_d64_bs16_g1_sinks.gfx950", "paged_unified.bf16_d64_bs16_g2.gfx950", + "paged_unified.bf16_d64_bs16_g2_sinks.gfx950", "paged_unified.bf16_d64_bs16_g4.gfx950", + "paged_unified.bf16_d64_bs16_g4_sinks.gfx950", "paged_unified.bf16_d64_bs16_g5.gfx950", + "paged_unified.bf16_d64_bs16_g5_sinks.gfx950", "paged_unified.bf16_d64_bs16_g6.gfx950", + "paged_unified.bf16_d64_bs16_g6_sinks.gfx950", "paged_unified.bf16_d64_bs16_g7.gfx950", + "paged_unified.bf16_d64_bs16_g7_sinks.gfx950", "paged_unified.bf16_d64_bs16_g8.gfx950", + "paged_unified.bf16_d64_bs16_g8_sinks.gfx950", "paged_unified.bf16_d64_bs32_g1.gfx950", "paged_unified.bf16_d64_bs32_g16.gfx950", + "paged_unified.bf16_d64_bs32_g16_sinks.gfx950", + "paged_unified.bf16_d64_bs32_g1_sinks.gfx950", "paged_unified.bf16_d64_bs32_g2.gfx950", + "paged_unified.bf16_d64_bs32_g2_sinks.gfx950", "paged_unified.bf16_d64_bs32_g4.gfx950", + "paged_unified.bf16_d64_bs32_g4_sinks.gfx950", "paged_unified.bf16_d64_bs32_g5.gfx950", + "paged_unified.bf16_d64_bs32_g5_sinks.gfx950", "paged_unified.bf16_d64_bs32_g6.gfx950", + "paged_unified.bf16_d64_bs32_g6_sinks.gfx950", "paged_unified.bf16_d64_bs32_g7.gfx950", + "paged_unified.bf16_d64_bs32_g7_sinks.gfx950", "paged_unified.bf16_d64_bs32_g8.gfx950", + "paged_unified.bf16_d64_bs32_g8_sinks.gfx950", "paged_unified.bf16_d64_bs64_g1.gfx950", "paged_unified.bf16_d64_bs64_g16.gfx950", + "paged_unified.bf16_d64_bs64_g16_sinks.gfx950", + "paged_unified.bf16_d64_bs64_g1_sinks.gfx950", "paged_unified.bf16_d64_bs64_g2.gfx950", + "paged_unified.bf16_d64_bs64_g2_sinks.gfx950", "paged_unified.bf16_d64_bs64_g4.gfx950", + "paged_unified.bf16_d64_bs64_g4_sinks.gfx950", "paged_unified.bf16_d64_bs64_g5.gfx950", + "paged_unified.bf16_d64_bs64_g5_sinks.gfx950", "paged_unified.bf16_d64_bs64_g6.gfx950", + "paged_unified.bf16_d64_bs64_g6_sinks.gfx950", "paged_unified.bf16_d64_bs64_g7.gfx950", + "paged_unified.bf16_d64_bs64_g7_sinks.gfx950", "paged_unified.bf16_d64_bs64_g8.gfx950", + "paged_unified.bf16_d64_bs64_g8_sinks.gfx950", "paged_unified.fp16_d128_bs16_g1.gfx950", "paged_unified.fp16_d128_bs16_g16.gfx950", + "paged_unified.fp16_d128_bs16_g16_sinks.gfx950", + "paged_unified.fp16_d128_bs16_g1_sinks.gfx950", "paged_unified.fp16_d128_bs16_g2.gfx950", + "paged_unified.fp16_d128_bs16_g2_sinks.gfx950", "paged_unified.fp16_d128_bs16_g4.gfx950", + "paged_unified.fp16_d128_bs16_g4_sinks.gfx950", "paged_unified.fp16_d128_bs16_g5.gfx950", + "paged_unified.fp16_d128_bs16_g5_sinks.gfx950", "paged_unified.fp16_d128_bs16_g6.gfx950", + "paged_unified.fp16_d128_bs16_g6_sinks.gfx950", "paged_unified.fp16_d128_bs16_g7.gfx950", + "paged_unified.fp16_d128_bs16_g7_sinks.gfx950", "paged_unified.fp16_d128_bs16_g8.gfx950", + "paged_unified.fp16_d128_bs16_g8_sinks.gfx950", "paged_unified.fp16_d128_bs32_g1.gfx950", "paged_unified.fp16_d128_bs32_g16.gfx950", + "paged_unified.fp16_d128_bs32_g16_sinks.gfx950", + "paged_unified.fp16_d128_bs32_g1_sinks.gfx950", "paged_unified.fp16_d128_bs32_g2.gfx950", + "paged_unified.fp16_d128_bs32_g2_sinks.gfx950", "paged_unified.fp16_d128_bs32_g4.gfx950", + "paged_unified.fp16_d128_bs32_g4_sinks.gfx950", "paged_unified.fp16_d128_bs32_g5.gfx950", + "paged_unified.fp16_d128_bs32_g5_sinks.gfx950", "paged_unified.fp16_d128_bs32_g6.gfx950", + "paged_unified.fp16_d128_bs32_g6_sinks.gfx950", "paged_unified.fp16_d128_bs32_g7.gfx950", + "paged_unified.fp16_d128_bs32_g7_sinks.gfx950", "paged_unified.fp16_d128_bs32_g8.gfx950", + "paged_unified.fp16_d128_bs32_g8_sinks.gfx950", "paged_unified.fp16_d128_bs64_g1.gfx950", "paged_unified.fp16_d128_bs64_g16.gfx950", + "paged_unified.fp16_d128_bs64_g16_sinks.gfx950", + "paged_unified.fp16_d128_bs64_g1_sinks.gfx950", "paged_unified.fp16_d128_bs64_g2.gfx950", + "paged_unified.fp16_d128_bs64_g2_sinks.gfx950", "paged_unified.fp16_d128_bs64_g4.gfx950", + "paged_unified.fp16_d128_bs64_g4_sinks.gfx950", "paged_unified.fp16_d128_bs64_g5.gfx950", + "paged_unified.fp16_d128_bs64_g5_sinks.gfx950", "paged_unified.fp16_d128_bs64_g6.gfx950", + "paged_unified.fp16_d128_bs64_g6_sinks.gfx950", "paged_unified.fp16_d128_bs64_g7.gfx950", + "paged_unified.fp16_d128_bs64_g7_sinks.gfx950", "paged_unified.fp16_d128_bs64_g8.gfx950", + "paged_unified.fp16_d128_bs64_g8_sinks.gfx950", "paged_unified.fp16_d256_bs16_g1.gfx950", "paged_unified.fp16_d256_bs16_g16.gfx950", + "paged_unified.fp16_d256_bs16_g16_sinks.gfx950", + "paged_unified.fp16_d256_bs16_g1_sinks.gfx950", "paged_unified.fp16_d256_bs16_g2.gfx950", + "paged_unified.fp16_d256_bs16_g2_sinks.gfx950", "paged_unified.fp16_d256_bs16_g4.gfx950", + "paged_unified.fp16_d256_bs16_g4_sinks.gfx950", "paged_unified.fp16_d256_bs16_g5.gfx950", + "paged_unified.fp16_d256_bs16_g5_sinks.gfx950", "paged_unified.fp16_d256_bs16_g6.gfx950", + "paged_unified.fp16_d256_bs16_g6_sinks.gfx950", "paged_unified.fp16_d256_bs16_g7.gfx950", + "paged_unified.fp16_d256_bs16_g7_sinks.gfx950", "paged_unified.fp16_d256_bs16_g8.gfx950", + "paged_unified.fp16_d256_bs16_g8_sinks.gfx950", "paged_unified.fp16_d256_bs32_g1.gfx950", "paged_unified.fp16_d256_bs32_g16.gfx950", + "paged_unified.fp16_d256_bs32_g16_sinks.gfx950", + "paged_unified.fp16_d256_bs32_g1_sinks.gfx950", "paged_unified.fp16_d256_bs32_g2.gfx950", + "paged_unified.fp16_d256_bs32_g2_sinks.gfx950", "paged_unified.fp16_d256_bs32_g4.gfx950", + "paged_unified.fp16_d256_bs32_g4_sinks.gfx950", "paged_unified.fp16_d256_bs32_g5.gfx950", + "paged_unified.fp16_d256_bs32_g5_sinks.gfx950", "paged_unified.fp16_d256_bs32_g6.gfx950", + "paged_unified.fp16_d256_bs32_g6_sinks.gfx950", "paged_unified.fp16_d256_bs32_g7.gfx950", + "paged_unified.fp16_d256_bs32_g7_sinks.gfx950", "paged_unified.fp16_d256_bs32_g8.gfx950", + "paged_unified.fp16_d256_bs32_g8_sinks.gfx950", "paged_unified.fp16_d256_bs64_g1.gfx950", "paged_unified.fp16_d256_bs64_g16.gfx950", + "paged_unified.fp16_d256_bs64_g16_sinks.gfx950", + "paged_unified.fp16_d256_bs64_g1_sinks.gfx950", "paged_unified.fp16_d256_bs64_g2.gfx950", + "paged_unified.fp16_d256_bs64_g2_sinks.gfx950", "paged_unified.fp16_d256_bs64_g4.gfx950", + "paged_unified.fp16_d256_bs64_g4_sinks.gfx950", "paged_unified.fp16_d256_bs64_g5.gfx950", + "paged_unified.fp16_d256_bs64_g5_sinks.gfx950", "paged_unified.fp16_d256_bs64_g6.gfx950", + "paged_unified.fp16_d256_bs64_g6_sinks.gfx950", "paged_unified.fp16_d256_bs64_g7.gfx950", + "paged_unified.fp16_d256_bs64_g7_sinks.gfx950", "paged_unified.fp16_d256_bs64_g8.gfx950", + "paged_unified.fp16_d256_bs64_g8_sinks.gfx950", "paged_unified.fp16_d64_bs16_g1.gfx950", "paged_unified.fp16_d64_bs16_g16.gfx950", + "paged_unified.fp16_d64_bs16_g16_sinks.gfx950", + "paged_unified.fp16_d64_bs16_g1_sinks.gfx950", "paged_unified.fp16_d64_bs16_g2.gfx950", + "paged_unified.fp16_d64_bs16_g2_sinks.gfx950", "paged_unified.fp16_d64_bs16_g4.gfx950", + "paged_unified.fp16_d64_bs16_g4_sinks.gfx950", "paged_unified.fp16_d64_bs16_g5.gfx950", + "paged_unified.fp16_d64_bs16_g5_sinks.gfx950", "paged_unified.fp16_d64_bs16_g6.gfx950", + "paged_unified.fp16_d64_bs16_g6_sinks.gfx950", "paged_unified.fp16_d64_bs16_g7.gfx950", + "paged_unified.fp16_d64_bs16_g7_sinks.gfx950", "paged_unified.fp16_d64_bs16_g8.gfx950", + "paged_unified.fp16_d64_bs16_g8_sinks.gfx950", "paged_unified.fp16_d64_bs32_g1.gfx950", "paged_unified.fp16_d64_bs32_g16.gfx950", + "paged_unified.fp16_d64_bs32_g16_sinks.gfx950", + "paged_unified.fp16_d64_bs32_g1_sinks.gfx950", "paged_unified.fp16_d64_bs32_g2.gfx950", + "paged_unified.fp16_d64_bs32_g2_sinks.gfx950", "paged_unified.fp16_d64_bs32_g4.gfx950", + "paged_unified.fp16_d64_bs32_g4_sinks.gfx950", "paged_unified.fp16_d64_bs32_g5.gfx950", + "paged_unified.fp16_d64_bs32_g5_sinks.gfx950", "paged_unified.fp16_d64_bs32_g6.gfx950", + "paged_unified.fp16_d64_bs32_g6_sinks.gfx950", "paged_unified.fp16_d64_bs32_g7.gfx950", + "paged_unified.fp16_d64_bs32_g7_sinks.gfx950", "paged_unified.fp16_d64_bs32_g8.gfx950", + "paged_unified.fp16_d64_bs32_g8_sinks.gfx950", "paged_unified.fp16_d64_bs64_g1.gfx950", "paged_unified.fp16_d64_bs64_g16.gfx950", + "paged_unified.fp16_d64_bs64_g16_sinks.gfx950", + "paged_unified.fp16_d64_bs64_g1_sinks.gfx950", "paged_unified.fp16_d64_bs64_g2.gfx950", + "paged_unified.fp16_d64_bs64_g2_sinks.gfx950", "paged_unified.fp16_d64_bs64_g4.gfx950", + "paged_unified.fp16_d64_bs64_g4_sinks.gfx950", "paged_unified.fp16_d64_bs64_g5.gfx950", + "paged_unified.fp16_d64_bs64_g5_sinks.gfx950", "paged_unified.fp16_d64_bs64_g6.gfx950", + "paged_unified.fp16_d64_bs64_g6_sinks.gfx950", "paged_unified.fp16_d64_bs64_g7.gfx950", + "paged_unified.fp16_d64_bs64_g7_sinks.gfx950", "paged_unified.fp16_d64_bs64_g8.gfx950", + "paged_unified.fp16_d64_bs64_g8_sinks.gfx950", }, }}, }; diff --git a/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml b/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml index 5883329b53e5..f4c0a65a49eb 100644 --- a/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml +++ b/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml @@ -13,7 +13,11 @@ # K|V view of one cache allocation), INT32 page tables (one tensor for K and V, or # separate K and V tables with the same width and batch stride), INT32 # sequence lengths, dense or ragged Q, and bottom-right causal masking with an optional -# left bound. +# left bound, optionally with a per-query-head attention sink (sink_token). +# +# Every object ships twice: without sinks, and with use_sinks (name suffix _sinks, +# KMD use_sinks = 1), which loads one sink logit per query head from sink_ptr in the +# I/O dtype and joins it to the softmax max and denominator. # # sdk_version 1.4.0: ragged Q/O (1.3.0) with a token-unit ragged_offset_multiplier # (1.4.0). The matcher declines override-shape graphs (1.1.0). @@ -49,6 +53,9 @@ kmd_fields: - name: block_m_per_warp type: int default_value: 16 +- name: use_sinks + type: int + default_value: 0 specialization: metadata_fields: @@ -59,6 +66,7 @@ specialization: - num_kv_heads - num_warps - block_m_per_warp + - use_sinks matcher_only_fields: [] vocabulary: dtype: {bf16: BF16, fp16: FP16} @@ -70,6 +78,7 @@ specialization: num_kv_heads: {field: num_kv_heads} num_warps: {field: num_warps} block_m_per_warp: {field: block_m_per_warp} + use_sinks: {field: use_sinks} # One pack per architecture (each builder module is arch-specific); each pack's # discriminator names its graph-scoped criterion, which admits the pack only on its @@ -89,8 +98,8 @@ packs: source: kernels/gfx942/attention_tiled_2d.py builder: build_unified_attention_2d_tiled variants: - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] @@ -116,10 +125,20 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - {knobs: gqa_sinks} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] @@ -145,10 +164,20 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - {knobs: gqa_sinks} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout, tile_size] @@ -175,10 +204,20 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - {knobs: gqa_sinks} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] @@ -204,10 +243,20 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx942 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - {knobs: gqa_sinks} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx942 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout, tile_size] @@ -234,8 +283,18 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} + - {knobs: gqa_sinks} - name: gfx950 arch: [gfx950] discriminator: gfx950 @@ -244,8 +303,8 @@ packs: source: kernels/gfx950/attention_tiled_2d.py builder: build_unified_attention_2d_tiled variants: - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx950 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx950 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] @@ -271,10 +330,20 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx950 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - {knobs: gqa_sinks} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx950 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] @@ -300,10 +369,20 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} - - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}.gfx950 - metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp] + - {knobs: gqa_sinks} + - name: paged_unified.{dtype}_d{head_size}_bs{block_size}_g{num_query_heads}_{tag}.gfx950 + metadata: [dtype, head_size, block_size, num_query_heads, num_kv_heads, num_warps, block_m_per_warp, use_sinks] vocabulary: dtype: {bf16: BF16, fp16: FP16} spec_order: [head_size, block_size, num_query_heads, num_kv_heads, dtype, use_sinks, sliding_window, has_softcap, num_warps, block_m_per_warp, runtime_layout] @@ -329,5 +408,15 @@ packs: - {num_query_heads: 7} - {num_query_heads: 8} - {num_query_heads: 16} + gqa_sinks: + - {num_query_heads: 1, use_sinks: true, tag: sinks} + - {num_query_heads: 2, use_sinks: true, tag: sinks} + - {num_query_heads: 4, use_sinks: true, tag: sinks} + - {num_query_heads: 5, use_sinks: true, tag: sinks} + - {num_query_heads: 6, use_sinks: true, tag: sinks} + - {num_query_heads: 7, use_sinks: true, tag: sinks} + - {num_query_heads: 8, use_sinks: true, tag: sinks} + - {num_query_heads: 16, use_sinks: true, tag: sinks} shapes: - {knobs: gqa} + - {knobs: gqa_sinks} From b50c3518dda0c6d1f0016a74dbab383fda63bd5f Mon Sep 17 00:00:00 2001 From: David Peabody Date: Tue, 3 Nov 2026 13:43:34 -0600 Subject: [PATCH 05/22] feat(hip-kernel-provider): attention sinks in hipkernel:AttentionPagedUnified graph_match accepts sink_token [1, Hq, 1, 1] in the Q data type with a unit head stride, declines FLOAT sinks, other shapes and strided heads with cause sinks, and declines a sink declaring less than a 16-byte alignment with cause alignment; kernel_match selects the use_sinks objects exactly when the graph has a sink; execute passes the sink buffer as sink_ptr. The Q-dtype sink is a hipDNN extension of cuDNN's FLOAT sink_token: vLLM keeps sinks in the model dtype. Matcher unit tests for the accept/select/decline cases, GPU integration tests with sinks (dense GQA decode, ragged Q with a window) against the gather-then-dense reference and hipDNN's CPU SDPA reference (FLOAT sink of the same values), README. A frontend that accepts only FLOAT sinks rejects these graphs, so the sink integration tests skip with that reason there. --- .../rocKE/attention_paged_unified/README.md | 26 ++++- .../packs/AttentionPagedUnifiedNative.cpp | 86 ++++++++++++-- .../IntegrationGpuAttentionPagedUnified.cpp | 101 +++++++++++++++-- .../TestAttentionPagedUnifiedMatchers.cpp | 107 +++++++++++++++++- 4 files changed, 292 insertions(+), 28 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md index 98f7deac4426..a4313dd89278 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md @@ -18,6 +18,7 @@ padding, SEM-009 paged K/V, SEM-010 empty rows), one SDPA-forward node, compute | page tables | `[B, 1, M, 1]` INT32 | `page_table_k` and `page_table_v`: one tensor for both, or two tensors with the same `M` and batch stride; unit stride along M; not packed | | `seq_len_q`, `seq_len_kv` | `[B,1,1,1]` INT32 | both required, as for every paged graph | | `max_seq_len_kv` | | set or unset; unset is inferred as `M * block_size` | +| `sink_token` | `[1, Hq, 1, 1]` | optional; the Q/K/V/O data type (FP16 or BF16, not FLOAT) and a unit head stride (see [Attention sinks](#attention-sinks)) | - Head size 64, 128 or 256; block size 16, 32 or 64; `Hq / Hkv` in {1, 2, 4, 5, 6, 7, 8, 16}. - Masking: bottom-right causal (`right_bound` 0), optionally with a `left_bound` L, which @@ -30,7 +31,7 @@ A dense Q's rows past `seq_len_q[b]` (up to `Sq`) are padding and get O = 0. A r writes only its live rows, the first `seq_len_q[b]` rows from its origin: rows of the offset block past them belong to no sequence (RFC 0014), so the kernel leaves them untouched and never writes past the last live row. A live row with no visible key, including every row -of a sequence with `seq_len_kv == 0`, also gets O = 0. The kernel never +of a sequence with `seq_len_kv == 0`, also gets O = 0, with or without a sink. The kernel never loads K/V past `seq_len_kv` nor page-table entries past `ceil(seq_len_kv / block_size)`, so unused entries may hold anything (`-1`, a null block). K pages through `page_table_k` and V through `page_table_v`, so with two tables V may sit in other blocks than K. @@ -59,13 +60,14 @@ hipDNN graphs this kernel cannot read: | `not_paged` | neither K nor V paged | | `one_sided_paging` | only K or only V paged | | `page_table` | K and V page tables of different widths `M` or batch strides, a packed table (with a ragged offset), a table that is not INT32 `[B, 1, M, 1]` with a unit entry stride | -| `alignment` | a declared tensor `alignment` (engine API 1.3.0) below what the kernels load: Q, K, V or O not a multiple of 16 bytes (16-byte vectors), or a page table, `seq_len_q`, `seq_len_kv` or ragged offset not a multiple of 4 bytes (INT32 words) | +| `alignment` | a declared tensor `alignment` (engine API 1.3.0) below what the kernels load: Q, K, V, O or `sink_token` not a multiple of 16 bytes (16-byte vectors), or a page table, `seq_len_q`, `seq_len_kv` or ragged offset not a multiple of 4 bytes (INT32 words) | | `block_size` | K and V block sizes differ, or a block size outside 16/32/64 | | `seq_len_q`, `seq_len_kv` | a missing or malformed length tensor | | `ragged` | a ragged Q/O whose `ragged_offset_multiplier` is not its token (sequence-axis) stride, i.e. offsets stored in other units than tokens (RFC 0014 allows them; the kernel reads offsets as token counts); a ragged K or V; Q and O not ragged through one offset tensor; an offset tensor that is not INT32 `[B+1, 1, 1, 1]` | | `mask` | no causal mask, top-left alignment, a right bound other than 0, `left_bound = 0` | +| `sinks` | a `sink_token` that is not `[1, Hq, 1, 1]`, a FLOAT sink (cuDNN's form; the kernels load the sink in the I/O dtype), or a sink without a unit head stride | -Other causes: `sinks`, `alibi_mask`, `fp8`, `stats`, `dropout`, `attn_mask`, +Other causes: `alibi_mask`, `fp8`, `stats`, `dropout`, `attn_mask`, `scale_tensor`, `block_mask`, `implementation`, `gqa`, `head_size`, `kv_layout`, `layout`, `size_limit`, `operand`, `node`, `compute_data_type`, `shape`, `mma_core_mode`, `scale`. @@ -76,7 +78,10 @@ and no allocation, so after a first (warm-up) execution on a device, which loads module, a plan can be captured into a HIP graph and replayed with new lengths, block ids and data (`IntegrationGpuAttentionPagedUnified.HipGraphCaptureReplaysWithChangedLengthsAndBlocks`). -Each kernel is one object per (arch, dtype, head size, block size, GQA ratio). The grid +Each kernel is one object per (arch, dtype, head size, block size, GQA ratio, sinks): every +combination ships twice, as `paged_unified._d_bs_g.` and as +`..._g_sinks.` (KMD `use_sinks` 1), which the matcher selects exactly when the +graph has a `sink_token`. The grid is `(Hkv, q_block_grid)` with `num_warps * 64` threads; query blocks are walked by a grid-stride loop, so a ragged batch whose total token count exceeds `Sq` is still covered. K and V are read through one 64-bit buffer resource per page; K's page ids come from @@ -120,3 +125,16 @@ live batch carry `seq_len_q = seq_len_kv = 0` and their rows come back zero. For the cache's K and V halves as two containers over one allocation, its `block_table` as both page tables (one tensor, `[B, 1, max_blocks, 1]`), `seq_lens` as `seq_len_kv`, the query lengths as `seq_len_q`, and `query_start_loc` as the ragged offset of Q and O. + +## Attention sinks + +`sink_token` adds one logit per query head to the softmax max and denominator, with no value +row and no `attn_scale` (SdpaSemanticsRegister SEM-022); a row with no visible key still gets +O = 0. cuDNN and the hipDNN frontend take it as FLOAT `[1, Hq, 1, 1]`. This engine reads it in +the Q data type instead (FP16 or BF16), because vLLM keeps sinks in the model dtype +(`layer.sinks`, a `[Hq]` tensor of raw logits): bind it without a copy as the view +`[1, Hq, 1, 1]` with strides `[Hq, 1, 1, 1]`. The buffer must be 16-byte aligned; a graph +declaring a smaller `alignment` for it is declined with cause `alignment`. FLOAT sinks +are declined with cause `sinks`. Graphs with a Q-dtype sink need a frontend that accepts that +data type, which is still to be agreed with the hipDNN team; until then the sink integration +tests skip with that reason. diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index 3a482c9466ae..e48ff8406cfc 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -77,12 +77,15 @@ * Q's rows past seq_len_q[b] get O = 0, and a ragged Q writes only its live rows; * - `max_seq_len_kv` set or unset: the kernel reads only seq_len_kv, and the extent cuDNN * infers for an unset one (M * block_size) bounds it the same way; - * - bottom-right causal masking with an optional left bound (sliding window). + * - bottom-right causal masking with an optional left bound (sliding window); + * - an optional attention sink `sink_token` `[1, Hq, 1, 1]` in the Q/K/V/O data type + * with a unit head stride, served by the use_sinks objects. This is a hipDNN extension + * of cuDNN's FLOAT sink (vLLM keeps sinks in the model dtype); FLOAT sinks are declined. * * One-sided paging, K and V page tables of different widths or batch strides, differing * K and V block sizes, packed page tables and a declared alignment below what the kernels - * load (16 bytes for Q/K/V/O, 4 for the INT32 operands) are valid graphs that this engine - * declines with a logged cause. + * load (16 bytes for Q/K/V/O and the sink, 4 for the INT32 operands) are valid graphs that + * this engine declines with a logged cause. */ namespace hip_kernel_provider::kernel_ingestor_engine { @@ -109,6 +112,8 @@ constexpr std::string_view NUM_QUERY_HEADS_FIELD = "num_query_heads"; constexpr std::string_view NUM_KV_HEADS_FIELD = "num_kv_heads"; constexpr std::string_view NUM_WARPS_FIELD = "num_warps"; constexpr std::string_view BLOCK_M_PER_WARP_FIELD = "block_m_per_warp"; +/// 1 for an object built with use_sinks (it reads sink_ptr), 0 (the KMD default) otherwise. +constexpr std::string_view USE_SINKS_FIELD = "use_sinks"; // Bound tokens. constexpr std::string_view Q_TOKEN = "attention_paged_unified.q.uid"; @@ -123,6 +128,8 @@ constexpr std::string_view SEQ_LEN_KV_TOKEN = "attention_paged_unified.seq_len_k constexpr std::string_view SEQ_LEN_Q_TOKEN = "attention_paged_unified.seq_len_q.uid"; /// UID of the ragged offset table Q and O share, or NO_UID for a dense Q. constexpr std::string_view RAGGED_OFFSET_TOKEN = "attention_paged_unified.ragged_offset.uid"; +/// UID of the sink_token tensor, or NO_UID. +constexpr std::string_view SINK_TOKEN = "attention_paged_unified.sink.uid"; constexpr std::string_view SCALE_BITS_TOKEN = "attention_paged_unified.scale_bits"; /// The kernel's sliding_window argument: `d - k < window` keeps key k for diagonal d. constexpr std::string_view WINDOW_TOKEN = "attention_paged_unified.window"; @@ -851,12 +858,56 @@ std::optional graphMatches(const MatchContext& context) { return decline("block_mask", reason("a block mask is not supported")); } + // A sink is one logit per query head, which the use_sinks kernels load from sink_ptr + // at index `query head` in the I/O dtype. + int64_t sinkUid = NO_UID; if(attributes.sink_token_tensor_uid().has_value()) { - return decline("sinks", - reason("attention sinks are not supported until hipDNN defines " - "sink_token semantics (per-head logit in the softmax " - "denominator, as gpt-oss uses)")); + sinkUid = *attributes.sink_token_tensor_uid(); + const auto* sink = findTensor(context, sinkUid); + if(sink == nullptr || !isWellFormedRank4(*sink)) + { + return decline("sinks", + reason("sink_token is missing, virtual, pass-by-value, not rank 4, or " + "has a non-positive extent or negative stride")); + } + if(sink->ragged_offset_tensor_uid().has_value() || dim(*sink, BATCH_AXIS) != 1 + || dim(*sink, HEAD_AXIS) != numQueryHeads || dim(*sink, SEQ_AXIS) != 1 + || dim(*sink, HEAD_SIZE_AXIS) != 1) + { + return decline("sinks", + reason(describeOperand("sink_token", *sink), + " must be [1, ", + numQueryHeads, + ", 1, 1] (one logit per query head)")); + } + if(sink->data_type() != q->data_type()) + { + return decline("sinks", + reason("sink_token data type ", + sink->data_type(), + " differs from Q's ", + q->data_type(), + ": the kernels load the sink in the I/O data type, so FLOAT " + "sinks are not served")); + } + if(numQueryHeads > 1 && sink->strides()->Get(HEAD_AXIS) != 1) + { + return decline("sinks", + reason(describeOperand("sink_token", *sink), + " needs a unit head stride; the kernels index the sink by " + "query head")); + } + // The use_sinks kernels declare sink_ptr 16-byte aligned, as they do Q/K/V/O, and + // launch() checks it the same way. + if(!declaresAlignment(*sink, static_cast(VECTOR_BYTES))) + { + return decline("alignment", + reason("sink_token declares a ", + sink->alignment(), + "-byte alignment; the use_sinks kernels take sink_ptr as a " + "16-byte-aligned pointer, like Q, K, V and O")); + } } if(attributes.descale_q_tensor_uid().has_value() || attributes.descale_k_tensor_uid().has_value() @@ -914,6 +965,7 @@ std::optional graphMatches(const MatchContext& context) bound[std::string(SEQ_LEN_KV_TOKEN)] = *seqLenKvUid; bound[std::string(SEQ_LEN_Q_TOKEN)] = *seqLenQUid; bound[std::string(RAGGED_OFFSET_TOKEN)] = raggedOffsetUid; + bound[std::string(SINK_TOKEN)] = sinkUid; int32_t scaleBits = 0; static_assert(sizeof(scaleBits) == sizeof(scale), "float must be 32-bit to round-trip"); std::memcpy(&scaleBits, &scale, sizeof(scale)); @@ -1017,7 +1069,8 @@ std::optional candidateGeometry(const KernelDefinition& kerne /** * @brief Kernel-scoped applicability: the candidate was built for this graph's dtype, - * head size, block size and GQA ratio, with one KV head (runtime head counts). + * head size, block size and GQA ratio, with one KV head (runtime head counts), and + * with use_sinks exactly when the graph has a sink_token. */ bool kernelMatches(const MatchContext& /*context*/, const BoundTokens& bound, @@ -1027,15 +1080,21 @@ bool kernelMatches(const MatchContext& /*context*/, const auto headSize = tryGetBoundInt(bound, HEAD_SIZE_TOKEN); const auto blockSize = tryGetBoundInt(bound, BLOCK_SIZE_TOKEN); const auto queriesPerKv = tryGetBoundInt(bound, QUERIES_PER_KV_TOKEN); + const auto sinkUid = tryGetBoundInt(bound, SINK_TOKEN); if(!dtype.has_value() || !headSize.has_value() || !blockSize.has_value() - || !queriesPerKv.has_value() || !candidateGeometry(kernel).has_value()) + || !queriesPerKv.has_value() || !sinkUid.has_value() + || !candidateGeometry(kernel).has_value()) { return false; } + // An absent use_sinks is the KMD default 0. A sink object without a sink would read + // a null sink_ptr; a plain object with a sink would drop it. + const int64_t wantSinks = *sinkUid != NO_UID ? 1 : 0; return stringMetadata(kernel, DTYPE_FIELD) == std::string(dataTypeName(*dtype)) && integerMetadata(kernel, HEAD_SIZE_FIELD) == *headSize && integerMetadata(kernel, BLOCK_SIZE_FIELD) == *blockSize - && integerMetadata(kernel, NUM_QUERY_HEADS_FIELD) == *queriesPerKv; + && integerMetadata(kernel, NUM_QUERY_HEADS_FIELD) == *queriesPerKv + && integerMetadata(kernel, USE_SINKS_FIELD).value_or(0) == wantSinks; } // --------------------------------------------------------------------------- @@ -1100,6 +1159,7 @@ struct BoundUids int64_t seqLenKv = 0; int64_t seqLenQ = 0; int64_t raggedOffset = NO_UID; + int64_t sink = NO_UID; }; class PreparedAttentionPagedUnified : public PreparedDispatch @@ -1199,6 +1259,7 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler queryLengths; std::vector offsets; ///< ragged token offsets [B+1] int64_t qTokens = 0; ///< tokens of the Q/O storage + std::vector sinks; ///< [Hq] sink logits (p.sinks only) }; /// seq_len_q[b]: the live query rows of sequence b. @@ -279,12 +281,24 @@ HostState makeState(const Problem& p, uint32_t seed) } } } + if(p.sinks) + { + // From negligible to row-dominating, so a head that loses its sink, or reads + // another head's, fails the comparison. + std::uniform_real_distribution logit(-4.0F, 6.0F); + s.sinks.resize(static_cast(p.queryHeads)); + for(auto& x : s.sinks) + { + x = toBits(logit(rng), p.type); + } + } return s; } /// fp32 gather-then-dense reference: for each sequence, gather its K and V through their /// page tables into dense rows, then bottom-right causal (plus window) softmax attention. -/// Rows past seq_len_q and rows with no visible key stay zero. +/// A sink joins the row max and the denominator. Rows past seq_len_q and rows with no +/// visible key stay zero. std::vector reference(const Problem& p, const HostState& s, float scale) { const int64_t d = p.headSize; @@ -335,8 +349,14 @@ std::vector reference(const Problem& p, const HostState& s, float scale) { continue; // no visible key: zeros } - const float maximum = *std::max_element(scores.begin(), scores.end()); - float sum = 0.0F; + float maximum = *std::max_element(scores.begin(), scores.end()); + const float sink + = p.sinks ? fromBits(s.sinks[static_cast(h)], p.type) : 0.0F; + if(p.sinks) + { + maximum = std::max(maximum, sink); + } + float sum = p.sinks ? std::exp(sink - maximum) : 0.0F; for(auto& x : scores) { x = std::exp(x - maximum); @@ -424,6 +444,17 @@ std::vector hipdnnReferenceAs(const Problem& p, HostState s, float scale) .setScale(scale) .setBand(p.leftBound, 0, false) .setSeqLens(&qLengths, &kvLengths); + // The reference takes cuDNN's FLOAT sink; the Q-dtype values upcast exactly. + Tensor sink({1, p.queryHeads, 1, 1}); + if(p.sinks) + { + for(int64_t h = 0; h < p.queryHeads; ++h) + { + sink.setHostValue(fromBits(s.sinks[static_cast(h)], p.type), + std::vector{0, h, 0, 0}); + } + options.setSink(&sink); + } CpuFpReferenceSdpa::forward(q, k, v, o, options); std::vector out(static_cast(tokens * p.queryHeads * d), 0.0F); @@ -537,6 +568,7 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test SEQ_LEN_KV = 6, SEQ_LEN_Q = 7, OFFSETS = 8, + SINK = 9, PAGE_TABLE_V = 10 }; @@ -603,6 +635,11 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test { attributes.set_diagonal_band_left_bound(p.leftBound); } + if(p.sinks) + { + attributes.set_sink_token( + make(SINK, p.type, {1, p.queryHeads, 1, 1}, {p.queryHeads, 1, 1, 1})); + } auto o = graph.sdpa(q, k, v, attributes)[0]; o->set_uid(O) .set_output(true) @@ -613,7 +650,20 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test { o->set_ragged_offset(offsets).set_ragged_offset_multiplier(p.queryHeads * d); } - ASSERT_TRUE(ok(graph.validate())); + // The engine reads sinks in the I/O dtype (vLLM keeps them in the model dtype). A + // frontend that accepts only cuDNN's FLOAT sink_token rejects that graph before any + // engine sees it, so the sink cases skip there instead of failing. Only that data + // type rejection skips; any other validate() error fails. + const auto validated = graph.validate(); + if(p.sinks && validated.code != ErrorCode::OK + && validated.err_msg.find("sink_token must have FLOAT data type") != std::string::npos) + { + GTEST_SKIP() << "the hipDNN frontend rejects a sink_token in the Q data type (" + << validated.err_msg << "); " << ENGINE + << " serves only Q-dtype sinks, so this case needs a frontend that " + "accepts them"; + } + ASSERT_TRUE(ok(validated)); ASSERT_TRUE(ok(graph.build_operation_graph(_handle))); ASSERT_TRUE(ok(graph.create_execution_plan_ext( hipdnn_data_sdk::utilities::engineNameToId(ENGINE), {}))); @@ -645,6 +695,10 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test { built.buffers[OFFSETS] = built.memory.allocate(static_cast((batch + 1) * 4)); } + if(p.sinks) + { + built.buffers[SINK] = built.memory.allocate(static_cast(p.queryHeads * 2)); + } } /// Uploads @p s and poisons O with SENTINEL (stream-ordered). @@ -666,6 +720,10 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test { copy(built.buffers[OFFSETS], s.offsets.data(), s.offsets.size() * 4); } + if(p.sinks) + { + copy(built.buffers[SINK], s.sinks.data(), s.sinks.size() * 2); + } std::vector poison(built.oBytes / 2, SENTINEL); copy(built.buffers[O], poison.data(), built.oBytes); } @@ -683,7 +741,8 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test ASSERT_EQ(hipStreamSynchronize(_stream), hipSuccess); const auto expected = reference(p, s, built.scale); // hipDNN's CPU SDPA reference on the same inputs: the test's own gather-then-dense - // reference must agree with it. + // reference must agree with it. The reference takes the sink as FLOAT; the + // engine's Q-dtype sink values upcast exactly. const auto contract = hipdnnReference(p, s, built.scale); const int64_t d = p.headSize; std::vector written(built.oBytes / 2 / static_cast(p.queryHeads * d), false); @@ -741,7 +800,7 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test { Built built; build(p, built); - if(::testing::Test::HasFatalFailure()) + if(::testing::Test::HasFatalFailure() || ::testing::Test::IsSkipped()) { return; } @@ -919,6 +978,24 @@ TEST_F(IntegrationGpuAttentionPagedUnified, SeparateKAndVPageTablesRaggedWithWin p.setMaxSeqLenKv = false; run(p); } + +/// gpt-oss style sinks with GQA (8 KV heads): every query head's sink, including those +/// of KV heads past the first, must reach the softmax; keyless rows stay zero. +TEST_F(IntegrationGpuAttentionPagedUnified, DecodeWithAttentionSinksBf16) +{ + Problem p = decodeProblem(DataType::BFLOAT16); + p.sinks = true; + run(p); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryWithAttentionSinksAndWindowHalf) +{ + Problem p = mixedProblem(DataType::HALF); + p.sinks = true; + p.leftBound = 32; + run(p); +} + /// One plan, captured once into a HIP graph and replayed with new lengths, new block ids /// and new data: the engine reads all of them from device memory, so the replay must /// match a fresh reference every time. diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp index bfc6105419b3..ee795fd3e2ef 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp @@ -58,6 +58,7 @@ constexpr int64_t SEQ_LEN_KV_UID = 6; constexpr int64_t SEQ_LEN_Q_UID = 7; constexpr int64_t RAGGED_OFFSET_UID = 8; constexpr int64_t EXTRA_UID = 9; +constexpr int64_t SINK_UID = 10; constexpr int64_t BATCH = 4; constexpr int64_t QUERY_HEADS = 32; @@ -160,6 +161,17 @@ d::GraphT raggedGraph() return g; } +/// The decode graph with a gpt-oss attention sink: one BF16 logit per query head, +/// `[1, Hq, 1, 1]` packed. +d::GraphT sinkGraph() +{ + auto g = decodeGraph(); + g.tensors.push_back(tensor( + SINK_UID, d::DataType::BFLOAT16, {1, QUERY_HEADS, 1, 1}, packed({1, QUERY_HEADS, 1, 1}))); + g.nodes[0]->attributes.AsSdpaAttributes()->sink_token_tensor_uid = SINK_UID; + return g; +} + DeviceProperties deviceProperties() { DeviceProperties properties; @@ -253,6 +265,15 @@ KernelDefinition kernel(const std::string& dtype, return k; } +/// A candidate built with use_sinks. +KernelDefinition + sinkKernel(const std::string& dtype, int64_t headSize, int64_t blockSize, int64_t queriesPerKv) +{ + auto k = kernel(dtype, headSize, blockSize, queriesPerKv); + k.metadata[std::string("use_sinks")] = int64_t{1}; + return k; +} + bool kernelMatches(const d::GraphT& g, const KernelDefinition& candidate) { registerNativeIngestorSymbols(); @@ -439,6 +460,48 @@ TEST(TestAttentionPagedUnifiedMatchers, MatchesOnlyTheCandidateBuiltForTheGraph) EXPECT_FALSE(kernelMatches(decodeGraph(), incomplete)); } +TEST(TestAttentionPagedUnifiedMatchers, ServesAnAttentionSinkInTheIoDataType) +{ + const auto bound = match(sinkGraph()); + ASSERT_TRUE(bound.has_value()); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.sink.uid"), SINK_UID); + EXPECT_EQ(tryGetBoundInt(*match(decodeGraph()), "attention_paged_unified.sink.uid"), -1); + // FP16 graph with an FP16 sink; a ragged Q with a sink. + EXPECT_TRUE(match(decodeGraph(d::DataType::HALF), [](d::GraphT& g) { + g.tensors.push_back(tensor(SINK_UID, + d::DataType::HALF, + {1, QUERY_HEADS, 1, 1}, + packed({1, QUERY_HEADS, 1, 1}))); + attrs(g).sink_token_tensor_uid = SINK_UID; + }).has_value()); + EXPECT_TRUE(match(raggedGraph(), [](d::GraphT& g) { + g.tensors.push_back(tensor(SINK_UID, + d::DataType::BFLOAT16, + {1, QUERY_HEADS, 1, 1}, + packed({1, QUERY_HEADS, 1, 1}))); + attrs(g).sink_token_tensor_uid = SINK_UID; + }).has_value()); + // Only the head stride matters: the other axes have unit extent. + EXPECT_TRUE(match(sinkGraph(), [](d::GraphT& g) { + find(g, SINK_UID).strides = {7, 1, 5, 3}; + }).has_value()); +} + +TEST(TestAttentionPagedUnifiedMatchers, SelectsTheSinkObjectExactlyWhenTheGraphHasASink) +{ + EXPECT_TRUE(kernelMatches(sinkGraph(), sinkKernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4))); + EXPECT_FALSE(kernelMatches(sinkGraph(), kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4))); + EXPECT_FALSE(kernelMatches(decodeGraph(), sinkKernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4))); + // An explicit use_sinks = 0 is the plain object. + KernelDefinition plain = kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4); + plain.metadata[std::string("use_sinks")] = int64_t{0}; + EXPECT_TRUE(kernelMatches(decodeGraph(), plain)); + EXPECT_FALSE(kernelMatches(sinkGraph(), plain)); + // The sink object still matches only its own dtype, head size, block size and ratio. + EXPECT_FALSE(kernelMatches(sinkGraph(), sinkKernel("FP16", HEAD_SIZE, BLOCK_SIZE, 4))); + EXPECT_FALSE(kernelMatches(sinkGraph(), sinkKernel("BF16", HEAD_SIZE, BLOCK_SIZE, 8))); +} + struct DeclineCase { const char* name; @@ -683,7 +746,33 @@ TEST(TestAttentionPagedUnifiedMatchers, DeclinesWithALoggedCause) [](d::GraphT& g) { attrs(g).left_bound = 0; }, "mask"}, {"right bound 2", decode, [](d::GraphT& g) { attrs(g).right_bound = 2; }, "mask"}, - {"sinks", + {"float sink", + [] { return sinkGraph(); }, + [](d::GraphT& g) { find(g, SINK_UID).data_type = d::DataType::FLOAT; }, + "sinks"}, + {"fp16 sink on a bf16 graph", + [] { return sinkGraph(); }, + [](d::GraphT& g) { find(g, SINK_UID).data_type = d::DataType::HALF; }, + "sinks"}, + {"sink per key-value head", + [] { return sinkGraph(); }, + [](d::GraphT& g) { + find(g, SINK_UID).dims = {1, KV_HEADS, 1, 1}; + find(g, SINK_UID).strides = packed({1, KV_HEADS, 1, 1}); + }, + "sinks"}, + {"sink with a sequence axis", + [] { return sinkGraph(); }, + [](d::GraphT& g) { + find(g, SINK_UID).dims = {1, QUERY_HEADS, 2, 1}; + find(g, SINK_UID).strides = packed({1, QUERY_HEADS, 2, 1}); + }, + "sinks"}, + {"sink with a non-unit head stride", + [] { return sinkGraph(); }, + [](d::GraphT& g) { find(g, SINK_UID).strides = {2 * QUERY_HEADS, 2, 1, 1}; }, + "sinks"}, + {"sink tensor missing", decode, [](d::GraphT& g) { attrs(g).sink_token_tensor_uid = EXTRA_UID; }, "sinks"}, @@ -798,6 +887,21 @@ TEST(TestAttentionPagedUnifiedMatchers, DeclinesOperandsDeclaringLessThanTheKern } } +// The use_sinks kernels take sink_ptr as a 16-byte-aligned pointer, like Q / K / V / O. +TEST(TestAttentionPagedUnifiedMatchers, DeclinesASinkDeclaringLessThanSixteenBytes) +{ + EXPECT_TRUE(match(sinkGraph(), declaringAlignment(SINK_UID, 32)).has_value()); + for(const int64_t bytes : {2, 8, 24}) + { + SCOPED_TRACE(std::to_string(bytes) + " bytes"); + const auto decline = loggedDecline(sinkGraph(), declaringAlignment(SINK_UID, bytes)); + EXPECT_EQ(decline.cause, "alignment") << decline.detail; + EXPECT_NE(decline.detail.find("sink_token declares a " + std::to_string(bytes) + "-byte"), + std::string::npos) + << decline.detail; + } +} + /// The kernel reads stored offsets as token counts, so a ragged Q or O whose offsets /// are in other units (RFC 0014's ragged_offset_multiplier != token stride) is declined, /// and the log names the multiplier. vLLM's multiplier is the token stride, which matches. @@ -821,6 +925,7 @@ TEST(TestAttentionPagedUnifiedMatchers, LogsNoDeclineForAGraphItServes) = hipdnn_test_sdk::utilities::SharedLogRecorder::withOverrideLevel(HIPDNN_SEV_INFO); EXPECT_TRUE(match(decodeGraph()).has_value()); EXPECT_TRUE(match(raggedGraph()).has_value()); + EXPECT_TRUE(match(sinkGraph()).has_value()); EXPECT_FALSE(recorder.hasLogContaining(std::string(ATTENTION_PAGED_UNIFIED_ENGINE_NAME) + " declined the graph")); } From 8875897298772f4c929e76786490e09a9d54a386 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Tue, 3 Nov 2026 21:25:58 -0600 Subject: [PATCH 06/22] test(hip-kernel-provider): pin the schema gate in front of hipkernel:Gfx950AttentionDense Gfx950AttentionDense's graph_match checks neither a ragged_offset on Q/K/V/O nor a declared tensor alignment. Since engine plugin API 1.4.0, the only thing keeping such graphs away from it is GenericPlanBuilder::understandsGraph(), which declines a graph whose min_required_engine_api_version (1.3.0 for both features) is above the descriptor's sdk_version (1.0.0). A census suite over the gfx950 product shard builds the engine from the loaded descriptor set, as the provider does, stamps a ragged graph and an 8-byte aligned graph the way hipDNN's GraphDescriptor does, checks the plugin's API version admits them, and requires the schema-gate decline. The control offers the baseline graph and requires the engine to serve it. The suite fails if the gate goes or the descriptor's sdk_version rises to 1.3.0 before the matcher declines both features itself. It registers as a companion suite of the dense engine's HKP_PINNED_ATTENTION_ENGINES row. That census only registers where a build ships the engine for gfx950, so an IngestorGenerator test also pins the sdk_version of the authored config, its engine manifest and the committed UED below 1.3.0 in every build that runs the IngestorGenerator suite. --- .../src/tests/CMakeLists.txt | 12 +- .../kernel_ingestor_engine/CMakeLists.txt | 1 + .../TestGfx950AttentionDenseSchemaGate.cpp | 247 ++++++++++++++++++ ...test_gfx950_attention_dense_schema_gate.py | 72 +++++ 4 files changed, 331 insertions(+), 1 deletion(-) create mode 100644 dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp create mode 100644 projects/hipdnn/tools/IngestorGenerator/tests/test_gfx950_attention_dense_schema_gate.py diff --git a/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt b/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt index 44b8d3531a04..d35d1e2fa96f 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/src/tests/CMakeLists.txt @@ -467,7 +467,13 @@ if(HIPDNN_ENABLE_KERNEL_INGESTOR) # in hkp-unpulled-models.record; the suite tolerates an absent UHD only when that record # names it, and never when HIPKERNELPROVIDER_REQUIRE_DVC_DESCRIPTORS is ON, which it # learns from the compile definition below. - set(_hkp_companion_suites CatalogTiles catalog_tiles ModelBinding model_binding) + # SchemaGate feeds the engine a ragged graph and a graph declaring a non-default + # alignment, both stamped engine API 1.3.0, which GenericPlanBuilder's schema gate + # declines because the descriptor declares sdk_version 1.0.0 and graph_match checks + # neither feature. IngestorGenerator's test_gfx950_attention_dense_schema_gate pins + # the same sdk_version where no gfx950 shard is built. + set(_hkp_companion_suites + CatalogTiles catalog_tiles ModelBinding model_binding SchemaGate schema_gate) set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/engines/kernel_ingestor_engine/packs/TestGfx942AttentionUnified3dModelBinding.cpp" PROPERTIES COMPILE_DEFINITIONS @@ -479,6 +485,10 @@ if(HIPDNN_ENABLE_KERNEL_INGESTOR) EveryShippedKernelsGeometryIsOneTheEngineLaunches EveryEntryLaunchesItsSegmentAndReduceKernels) set(_hkp_catalog_tiles_cases_gfx942_dense EveryShippedKernelsTileIsOneTheEngineLaunches) + set(_hkp_schema_gate_cases_gfx950_dense + DeclinesARaggedGraphAtTheSchemaGate + DeclinesANonDefaultAlignmentGraphAtTheSchemaGate + PassesTheBaselineGraphThroughTheSchemaGate) set(_hkp_model_binding_cases_gfx942_unified_3d TheBoundL2KernelRankerLoads TheBoundL1EnginePredictorLoadsAndMatchesThisBuild) diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt index a804852caab6..956ceb44796d 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt @@ -115,6 +115,7 @@ target_sources(hip_kernel_provider_census_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950AttentionUnified3DCatalogTiles.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx942AttentionDensePacks.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx942AttentionDenseCatalogTiles.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950AttentionDenseSchemaGate.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx1151WmmaAttentionPacks.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx1151WmmaAttentionDecodePacks.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950ConvDgradAotPacks.cpp diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp new file mode 100644 index 000000000000..5d4a1da3d62e --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp @@ -0,0 +1,247 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#ifdef HIPDNN_ENABLE_KERNEL_INGESTOR + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "core/Context.hpp" +#include "core/Handle.hpp" +#include "core/Settings.hpp" +#include "engines/kernel_ingestor_engine/IngestorPacks.hpp" +#include "tests/engines/kernel_ingestor_engine/packs/IngestorPackTestSupport.hpp" + +/** + * @file TestGfx950AttentionDenseSchemaGate.cpp + * @brief The schema gate is what keeps ragged and non-default-alignment SDPA graphs away + * from the shipped hipkernel:Gfx950AttentionDense engine. + * + * The engine's graph_match checks neither a ragged_offset on Q/K/V/O nor a declared + * tensor alignment. Both features need engine API 1.3.0: hipDNN stamps such a graph's + * min_required_engine_api_version 1.3.0, a plugin at API 1.4.0 passes the host's plugin + * filter, and the remaining guard is GenericPlanBuilder::understandsGraph(), which + * declines a graph whose stamp is above the engine descriptor's sdk_version. This suite + * offers both graphs to an engine built from the loaded descriptor set, the way the + * provider builds it, and requires that decline. It fails if the gate goes or the + * descriptor's sdk_version rises to 1.3.0: raise it only once the matcher declines ragged + * operands and a declared alignment it cannot serve itself. + * + * Hand-written, not generated: it belongs to the census binary because it reads the + * shipped descriptor set, and is registered with its own hkp_register_census_tests() call + * in src/tests/CMakeLists.txt. That shard is built only where the engine ships for + * gfx950, so IngestorGenerator's test_gfx950_attention_dense_schema_gate.py pins the + * configured sdk_version below 1.3.0 in every build. + */ +namespace +{ + +using namespace hip_kernel_provider::kernel_ingestor_engine; +using namespace hip_kernel_provider::kernel_ingestor_engine::testing; +namespace d = hipdnn_flatbuffers_sdk::data_objects; +namespace ingestor = hipdnn_plugin_sdk::ingestor; +using hipdnn_data_sdk::utilities::Version; + +constexpr int64_t Q_UID = 1; +constexpr int64_t K_UID = 2; +constexpr int64_t V_UID = 3; +constexpr int64_t O_UID = 4; +constexpr int64_t RAGGED_OFFSET_UID = 5; + +constexpr int64_t BATCH = 2; +constexpr int64_t HEADS = 4; +constexpr int64_t SEQ = 256; +constexpr int64_t HEAD_SIZE = 128; + +/// A device-less gfx950: if the gate let a graph through, the engine's real graph_match +/// would run against the architecture it ships for. +class Gfx950Resolver : public ingestor::IDeviceResolver +{ +public: + ingestor::DeviceId deviceId(const Handle& /*handle*/) const override + { + return 0; + } + + const ingestor::DeviceProperties& + deviceProperties(ingestor::DeviceId /*deviceId*/) const override + { + return _properties; + } + +private: + ingestor::DeviceProperties _properties = [] { + ingestor::DeviceProperties properties; + properties.gcnArchName = "gfx950"; + properties.warpSize = 64; + return properties; + }(); +}; + +std::unique_ptr + tensor(int64_t uid, d::DataType type, std::vector dims, std::vector strides) +{ + auto t = std::make_unique(); + t->uid = uid; + t->data_type = type; + t->dims = std::move(dims); + t->strides = std::move(strides); + return t; +} + +/// The graph Gfx950AttentionDense serves: BF16 BSHD Q/K/V/O `[2, 4, 256, 128]`, top-left +/// causal, compute FLOAT. +d::GraphT denseGraph() +{ + d::GraphT g; + const std::vector dims = {BATCH, HEADS, SEQ, HEAD_SIZE}; + const std::vector bshd = {SEQ * HEADS * HEAD_SIZE, HEAD_SIZE, HEADS * HEAD_SIZE, 1}; + for(const int64_t uid : {Q_UID, K_UID, V_UID, O_UID}) + { + g.tensors.push_back(tensor(uid, d::DataType::BFLOAT16, dims, bshd)); + } + d::SdpaAttributesT a; + a.q_tensor_uid = Q_UID; + a.k_tensor_uid = K_UID; + a.v_tensor_uid = V_UID; + a.o_tensor_uid = O_UID; + a.right_bound = 0; + a.diagonal_alignment = d::DiagonalAlignment::TOP_LEFT; + a.attn_scale_value = 0.08838835F; + auto n = std::make_unique(); + n->compute_data_type = d::DataType::FLOAT; + n->attributes.Set(a); + g.nodes.push_back(std::move(n)); + return g; +} + +/// Q and O ragged at the sequence axis through one INT32 `[B+1, 1, 1, 1]` offset tensor. +d::GraphT raggedGraph() +{ + auto g = denseGraph(); + for(auto& t : g.tensors) + { + if(t->uid == Q_UID || t->uid == O_UID) + { + t->ragged_offset_tensor_uid = RAGGED_OFFSET_UID; + } + } + g.tensors.push_back( + tensor(RAGGED_OFFSET_UID, d::DataType::INT32, {BATCH + 1, 1, 1, 1}, {1, 1, 1, 1})); + return g; +} + +/// Q declaring an 8-byte device-pointer alignment instead of the default 16. +d::GraphT eightByteAlignedGraph() +{ + auto g = denseGraph(); + g.tensors[0]->alignment = 8; + return g; +} + +/// Stamps @p g as hipDNN's GraphDescriptor does: the floor from the shared +/// graph -> version mapping. Returns that floor. +Version stamp(d::GraphT& g, bool ragged, bool nonDefaultAlignment) +{ + const auto& floor = hipdnn_plugin_sdk::computeMinimumEnginePluginApiVersion( + false, false, ragged, nonDefaultAlignment, false); + g.min_required_engine_api_version + = std::make_unique(hipdnn_plugin_sdk::toEngineApiVersion(floor)); + return floor; +} + +/// Offers @p g to an engine built from the loaded Gfx950AttentionDense set, as the +/// provider builds it, and returns whether the engine found it applicable. +bool offer(const d::GraphT& g) +{ + const Gfx950Resolver resolver; + const auto engine = ingestor::makeEngine( + loadedSet(GFX950_ATTENTION_DENSE_ENGINE_NAME), resolver); + flatbuffers::FlatBufferBuilder builder; + builder.Finish(d::Graph::Pack(builder, &g)); + const hipdnn_flatbuffers_sdk::flatbuffer_utilities::GraphWrapper wrapper( + builder.GetBufferPointer(), builder.GetSize()); + Handle handle; + return engine->isApplicable(handle, wrapper); +} + +/// The decline GenericPlanBuilder::understandsGraph() logs for @p floor. +std::string schemaGateDecline(const Version& floor) +{ + const auto& set = loadedSet(GFX950_ATTENTION_DENSE_ENGINE_NAME); + return "ingestor: engine '" + std::string(GFX950_ATTENTION_DENSE_ENGINE_NAME) + + "' declined the graph: it understands graph schema " + set.engine.sdkVersion.str() + + " but this graph requires " + floor.str(); +} + +/// hip_kernel_provider's advertised engine plugin API version, which the host compares +/// with the stamp before any engine sees the graph. +Version pluginApiVersion() +{ + const char* version = nullptr; + EXPECT_EQ(hipdnnPluginGetApiVersion(&version), HIPDNN_PLUGIN_STATUS_SUCCESS); + return Version{std::string(version != nullptr ? version : "0.0.0")}; +} + +TEST(TestGfx950AttentionDenseSchemaGate, DeclinesARaggedGraphAtTheSchemaGate) +{ + auto g = raggedGraph(); + const auto floor = stamp(g, true, false); + ASSERT_EQ(floor.str(), "1.3.0"); + // The plugin passes the host's filter, so only the engine's gate is left. + ASSERT_TRUE(pluginApiVersion() >= floor) << pluginApiVersion().str(); + + const auto recorder + = hipdnn_test_sdk::utilities::SharedLogRecorder::withOverrideLevel(HIPDNN_SEV_INFO); + EXPECT_FALSE(offer(g)); + EXPECT_TRUE(recorder.hasLogContaining(HIPDNN_SEV_INFO, schemaGateDecline(floor))) + << "expected: " << schemaGateDecline(floor); +} + +TEST(TestGfx950AttentionDenseSchemaGate, DeclinesANonDefaultAlignmentGraphAtTheSchemaGate) +{ + auto g = eightByteAlignedGraph(); + const auto floor = stamp(g, false, true); + ASSERT_EQ(floor.str(), "1.3.0"); + ASSERT_TRUE(pluginApiVersion() >= floor) << pluginApiVersion().str(); + + const auto recorder + = hipdnn_test_sdk::utilities::SharedLogRecorder::withOverrideLevel(HIPDNN_SEV_INFO); + EXPECT_FALSE(offer(g)); + EXPECT_TRUE(recorder.hasLogContaining(HIPDNN_SEV_INFO, schemaGateDecline(floor))) + << "expected: " << schemaGateDecline(floor); +} + +/// Control: the same graph without either feature is stamped at the baseline, passes the +/// gate and is served, so the declines above come from the stamp alone. +TEST(TestGfx950AttentionDenseSchemaGate, PassesTheBaselineGraphThroughTheSchemaGate) +{ + auto g = denseGraph(); + const auto floor = stamp(g, false, false); + ASSERT_EQ(floor.str(), "1.0.0"); + + const auto recorder + = hipdnn_test_sdk::utilities::SharedLogRecorder::withOverrideLevel(HIPDNN_SEV_INFO); + EXPECT_TRUE(offer(g)); + EXPECT_FALSE(recorder.hasLogContaining("understands graph schema")); +} + +} // namespace + +#endif // HIPDNN_ENABLE_KERNEL_INGESTOR diff --git a/projects/hipdnn/tools/IngestorGenerator/tests/test_gfx950_attention_dense_schema_gate.py b/projects/hipdnn/tools/IngestorGenerator/tests/test_gfx950_attention_dense_schema_gate.py new file mode 100644 index 000000000000..155154e7864b --- /dev/null +++ b/projects/hipdnn/tools/IngestorGenerator/tests/test_gfx950_attention_dense_schema_gate.py @@ -0,0 +1,72 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# SPDX-License-Identifier: MIT + +"""hipkernel:Gfx950AttentionDense stays below engine API 1.3.0 until its matcher declines +ragged operands and a declared tensor alignment itself. + +Its native graph_match checks neither a ragged_offset on Q/K/V/O nor a declared +alignment. hipDNN stamps a graph that uses either with min_required_engine_api_version +1.3.0, and GenericPlanBuilder::understandsGraph declines it only while the engine's +sdk_version is lower. The census suite TestGfx950AttentionDenseSchemaGate proves that +decline end to end, but it registers only where a build ships the engine for gfx950. +This pin runs in every build that runs the IngestorGenerator suite: the authored config, +its engine manifest and the committed UED all declare a version below 1.3.0. +""" + +from __future__ import annotations + +import json +from pathlib import Path + +import pytest +import yaml + +_ROOT = Path(__file__).resolve().parents[1] +_REPO = _ROOT.parents[3] +_CONFIGS = _ROOT / "configs" +_UED = ( + _REPO + / "dnn-providers" + / "hip-kernel-provider" + / "src" + / "engines" + / "kernel_ingestor_engine" + / "descriptors" + / "rocKE" + / "gfx950_attention_dense" + / "gfx950_attention_dense.ued.json" +) + +# The engine API level at which hipDNN stamps ragged and non-default-alignment graphs. +_RAGGED_AND_ALIGNMENT_API = (1, 3, 0) + + +def _version(text: str) -> tuple[int, ...]: + return tuple(int(part) for part in str(text).split(".")) + + +def _authored(name: str) -> str: + return yaml.safe_load((_CONFIGS / name).read_text(encoding="utf-8"))["engine"][ + "sdk_version" + ] + + +@pytest.mark.parametrize( + "source", + [ + "configs/gfx950_attention_dense.yaml", + "configs/gfx950_attention_dense.engine.yaml", + "gfx950_attention_dense.ued.json", + ], +) +def test_sdk_version_stays_below_the_ragged_and_alignment_api(source): + if source.endswith(".ued.json"): + declared = json.loads(_UED.read_text(encoding="utf-8"))["sdk_version"] + else: + declared = _authored(Path(source).name) + assert _version(declared) < _RAGGED_AND_ALIGNMENT_API, ( + f"{source} declares sdk_version {declared}: at 1.3.0 or above the schema gate " + "no longer keeps ragged and non-default-alignment SDPA graphs away from " + "hipkernel:Gfx950AttentionDense, whose graph_match checks neither. Raise it only " + "with explicit declines in the matcher." + ) From 2849a8b628afbe793b2309dbb0e9f3e08cf2cc76 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Fri, 6 Nov 2026 22:45:52 -0600 Subject: [PATCH 07/22] refactor(hip-kernel-provider): share the cuDNN paged-graph checks in SdpaGraphMatch.hpp hipkernel:AttentionPagedUnified's graph_match carried its own copies of the SDPA match helpers that packs/SdpaGraphMatch.hpp now shares (findTensor, sdpaNode, hasSdpaForwardNode, describeOperand, the decline head and the axis constants). It now uses the header's, with sdpa_graph::DeclinedBy. The overflow-checked product it shares with hipkernel:Gfx942AttentionUnified3d moves into the header as sdpa_graph::checkedProduct: unlike pack_features::checkedProduct it takes zero factors, which every extent of 1 gives. FlydslSdpaShared.hpp, which already takes computesInFloat from the header, now takes checkedProduct and declaresAlignment from it too instead of keeping identical copies. The stricter operand checks it needs move into the header too (usesOverrideShapes, hasNonNegativeStrides, declaresAlignment, isInt32Vector), together with the cuDNN paged-K/V graph contract checks (SEM-009), so every pack serving a paged graph applies one set of rules with one cause vocabulary, logged with the calling engine's name: - pagesKAndV: one_sided_paging; - pagedContainersAgree: block_size, shape (one block size, one block count; head counts and head sizes stay the engine's to check); - pageTablesFor: page_table (INT32 [B, 1, M, 1], unit entry stride, not packed; separate K and V tables share M and the batch stride); - sequenceLengthsFor: seq_len_kv, seq_len_q (both required, INT32 [B,1,1,1]); - raggedQueryFor, countsOffsetsInTokens: ragged (Q and O through one [B+1,1,1,1] offset table counted in tokens; K/V never ragged); - declaresServedAlignment: alignment (vector operands at the engine's vector width, INT32 operands at 4 bytes); - sinkFor: sinks, and alignment below the engine's own minimum sink alignment (16 bytes for this engine's kernels); - takesNoAttentionMask: attn_mask. The reasons they log are the texts hipkernel:Gfx1151WmmaAttention's paged matcher (#14254) logs for the same rules, so that engine can call these checks without changing what it reports. The decline lines go through HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{...}) << ...): the braces' comma would otherwise split the macro argument. The engine keeps its kernel limits (head and block sizes, GQA ratios, strides and address ranges) and the order of its declines; it checks itself that V has K's head count and head size. A malformed page-table tensor now logs page_table rather than operand. The header's file comment covers paged graphs. --- .../packs/AttentionPagedUnifiedNative.cpp | 440 ++++------------ .../packs/FlydslSdpaShared.hpp | 26 +- .../packs/Gfx942AttentionUnified3dNative.cpp | 15 +- .../packs/SdpaGraphMatch.hpp | 475 +++++++++++++++++- 4 files changed, 569 insertions(+), 387 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index e48ff8406cfc..8131c9e9572a 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -45,6 +45,7 @@ #include "engines/kernel_ingestor_engine/IngestorKernelCode.hpp" #include "engines/kernel_ingestor_engine/IngestorPacks.hpp" #include "engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp" +#include "engines/kernel_ingestor_engine/packs/SdpaGraphMatch.hpp" /** * @file AttentionPagedUnifiedNative.cpp @@ -147,13 +148,14 @@ constexpr int64_t DTYPE_BF16 = 2; /// sequence the int32 positions can describe, so it never masks. constexpr int64_t NO_WINDOW = 0x3FFFFFFF; -/// hipDNN tensor axes. The LOGICAL order is always (B, H, S, D) regardless of layout; a -/// paged container's B axis is the block index and its S axis the token within a block. -constexpr uint32_t BATCH_AXIS = 0; -constexpr uint32_t HEAD_AXIS = 1; -constexpr uint32_t SEQ_AXIS = 2; -constexpr uint32_t HEAD_SIZE_AXIS = 3; -constexpr uint32_t SDPA_RANK = 4; +// hipDNN tensor axes (sdpa_graph): the LOGICAL order is always (B, H, S, D) regardless of +// layout; a paged container's B axis is the block index and its S axis the token within a +// block. +using sdpa_graph::BATCH_AXIS; +using sdpa_graph::HEAD_AXIS; +using sdpa_graph::HEAD_SIZE_AXIS; +using sdpa_graph::SDPA_RANK; +using sdpa_graph::SEQ_AXIS; /// The kernel's vector loads and stores move 8 elements (16 bytes) at a time, so every /// stride of a non-unit axis and every base pointer must keep that alignment. @@ -197,25 +199,11 @@ bool contains(const std::array& values, int64_t value) // Matching helpers // --------------------------------------------------------------------------- -const data_objects::TensorAttributes* findTensor(const MatchContext& context, int64_t uid) -{ - const auto& tensors = context.graph.getTensorMap(); - const auto it = tensors.find(uid); - return it == tensors.end() ? nullptr : it->second; -} - -std::optional checkedProduct(std::initializer_list factors) -{ - int64_t product = 1; - for(const int64_t factor : factors) - { - if(__builtin_mul_overflow(product, factor, &product)) - { - return std::nullopt; - } - } - return product; -} +using sdpa_graph::checkedProduct; +using sdpa_graph::DeclinedBy; +using sdpa_graph::describeOperand; +using sdpa_graph::findTensor; +using sdpa_graph::hasSdpaForwardNode; std::optional checkedSum(std::initializer_list terms) { @@ -230,78 +218,16 @@ std::optional checkedSum(std::initializer_list terms) return sum; } -/// The head of a decline line: " declined the graph []: ". The cause is a -/// stable key per check, for log filters and tests; the text after it is for people. -struct Declined -{ - std::string_view cause; -}; - -std::ostream& operator<<(std::ostream& out, const Declined& declined) -{ - return out << ATTENTION_PAGED_UNIFIED_ENGINE_NAME << " declined the graph [" << declined.cause - << "]: "; -} - -bool hasSdpaForwardNode(const MatchContext& context) -{ - for(const auto& node : context.graph.nodeWrappers()) - { - if(node->attributesType() == data_objects::NodeAttributes::SdpaAttributes) - { - return true; - } - } - return false; -} - -std::string describeOperand(std::string_view role, const data_objects::TensorAttributes& tensor) +constexpr DeclinedBy declined(std::string_view cause) { - using hipdnn_data_sdk::utilities::vecToString; - using hipdnn_flatbuffers_sdk::utilities::convertFlatBufferVectorToStdVector; - std::ostringstream out; - out << role << " (uid " << tensor.uid() << "): dims " - << vecToString(convertFlatBufferVectorToStdVector(tensor.dims())) << ", strides " - << vecToString(convertFlatBufferVectorToStdVector(tensor.strides())); - return out.str(); -} - -/// The single SDPA-forward node, or nullptr. Override-shape graphs (admitted by the -/// 1.4.0 schema floor) are not served: launch arguments come from the built shapes. -const data_objects::SdpaAttributes* sdpaNode(const MatchContext& context) -{ - if(context.graph.nodeCount() != 1 || context.graph.getGraph().is_override_shape_enabled()) - { - return nullptr; - } - const auto& node = context.graph.getNodeWrapper(0); - if(node.attributesType() != data_objects::NodeAttributes::SdpaAttributes) - { - return nullptr; - } - return &node.attributesAs(); + return DeclinedBy{ATTENTION_PAGED_UNIFIED_ENGINE_NAME, cause}; } /// A rank-4 device operand with positive extents and non-negative strides, read /// directly from the variant pack (not virtual, not pass-by-value). bool isWellFormedRank4(const data_objects::TensorAttributes& tensor) { - const auto* dims = tensor.dims(); - const auto* strides = tensor.strides(); - if(dims == nullptr || strides == nullptr || dims->size() != SDPA_RANK - || strides->size() != SDPA_RANK || tensor.virtual_() - || hipdnn_flatbuffers_sdk::utilities::isPassByValueTensor(&tensor)) - { - return false; - } - for(uint32_t i = 0; i < SDPA_RANK; ++i) - { - if(dims->Get(i) <= 0 || strides->Get(i) < 0) - { - return false; - } - } - return true; + return sdpa_graph::isWellFormedOperand(tensor) && sdpa_graph::hasNonNegativeStrides(tensor); } /// Strides with every unit-extent axis set to zero: an index that is always zero makes @@ -334,30 +260,6 @@ bool vectorStridesOk(const std::array& strides, bool include return true; } -/// An INT32 per-sequence vector `[n, 1, 1, 1]` the kernel indexes contiguously. -bool isInt32Vector(const data_objects::TensorAttributes& tensor, int64_t length) -{ - if(!isWellFormedRank4(tensor) || tensor.data_type() != data_objects::DataType::INT32 - || tensor.ragged_offset_tensor_uid().has_value() || dim(tensor, BATCH_AXIS) != length) - { - return false; - } - for(uint32_t axis = HEAD_AXIS; axis < SDPA_RANK; ++axis) - { - if(dim(tensor, axis) != 1) - { - return false; - } - } - return length == 1 || tensor.strides()->Get(BATCH_AXIS) == 1; -} - -/// Whether @p tensor declares a device-pointer alignment that is a multiple of @p bytes. -bool declaresAlignment(const data_objects::TensorAttributes& tensor, int64_t bytes) -{ - return tensor.alignment() >= bytes && tensor.alignment() % bytes == 0; -} - /// The extent of the elements an operand addresses within one sequence (or one block), /// in elements, without its batch axis: the largest within-sequence offset plus one. std::optional innerExtent(const data_objects::TensorAttributes& tensor) @@ -416,7 +318,7 @@ bool queryOperandOk(std::string_view role, const auto strides = effectiveStrides(tensor); if(tensor.strides()->Get(HEAD_SIZE_AXIS) != 1) { - HIPDNN_PLUGIN_LOG_INFO(Declined{"layout"} << describeOperand(role, tensor) + HIPDNN_PLUGIN_LOG_INFO(declined("layout") << describeOperand(role, tensor) << " has a non-unit head-size stride"); return false; } @@ -426,7 +328,7 @@ bool queryOperandOk(std::string_view role, if(!vectorStridesOk(strides, false) || seqStride % VECTOR_ELEMENTS != 0 || seqStride < 0 || (ragged && seqStride == 0) || seqStride > INT32_LIMIT) { - HIPDNN_PLUGIN_LOG_INFO(Declined{"layout"} + HIPDNN_PLUGIN_LOG_INFO(declined("layout") << describeOperand(role, tensor) << (ragged ? " with ragged_offset_multiplier " : " with batch stride ") @@ -435,24 +337,16 @@ bool queryOperandOk(std::string_view role, "and a ragged multiplier must be positive"); return false; } - // The kernel reads offset deltas as token counts: rows per sequence and query-block - // starts come from the stored offsets themselves, and only a sequence's base is - // scaled. So a stored offset must count tokens, i.e. the multiplier is the token - // (sequence-axis) stride. RFC 0014 also allows other units; the ASM SDPA engine - // declines them the same way. - if(ragged && seqStride != tensor.strides()->Get(SEQ_AXIS)) + // The ASM SDPA engine declines offsets in other units the same way. + if(ragged + && !sdpa_graph::countsOffsetsInTokens(ATTENTION_PAGED_UNIFIED_ENGINE_NAME, role, tensor)) { - HIPDNN_PLUGIN_LOG_INFO(Declined{"ragged"} - << describeOperand(role, tensor) << " with ragged_offset_multiplier " - << seqStride - << ": the multiplier must equal the sequence-axis (token) stride; " - "the kernel reads stored offsets as token counts"); return false; } const auto extent = innerExtent(tensor); if(!extent.has_value() || *extent > INT32_LIMIT) { - HIPDNN_PLUGIN_LOG_INFO(Declined{"size_limit"} + HIPDNN_PLUGIN_LOG_INFO(declined("size_limit") << describeOperand(role, tensor) << ": one sequence spans more than 2^31-1 elements"); return false; @@ -463,7 +357,7 @@ bool queryOperandOk(std::string_view role, /// Logs and declines. std::nullopt_t decline(std::string_view cause, const std::string& reason) { - HIPDNN_PLUGIN_LOG_INFO(Declined{cause} << reason); + HIPDNN_PLUGIN_LOG_INFO(declined(cause) << reason); return std::nullopt; } @@ -477,14 +371,15 @@ std::nullopt_t decline(std::string_view cause, const std::string& reason) */ std::optional graphMatches(const MatchContext& context) { - // --- 1. Node shape. - const auto* attributesPtr = sdpaNode(context); - if(attributesPtr == nullptr) + // --- 1. Node shape. Override-shape graphs (admitted by the 1.4.0 schema floor) are + // not served: launch arguments come from the built shapes. + const auto* attributesPtr = sdpa_graph::sdpaNode(context); + if(attributesPtr == nullptr || sdpa_graph::usesOverrideShapes(context)) { if(HIPDNN_PLUGIN_LOG_IS_INFO_ENABLED() && hasSdpaForwardNode(context)) { HIPDNN_PLUGIN_LOG_INFO( - Declined{"node"} + declined("node") << "the graph is not a single SDPA-forward node without override shapes (" << context.graph.nodeCount() << " node(s))"); } @@ -508,21 +403,17 @@ std::optional graphMatches(const MatchContext& context) } // --- 2. Paging. This engine serves paged K and V only, each through its own block - // table (which may be the same tensor). cuDNN also allows K or V paged alone. - const auto pageTableK = attributes.page_table_k_tensor_uid(); - const auto pageTableV = attributes.page_table_v_tensor_uid(); - if(!pageTableK.has_value() && !pageTableV.has_value()) + // table (which may be the same tensor). + if(!attributes.page_table_k_tensor_uid().has_value() + && !attributes.page_table_v_tensor_uid().has_value()) { return decline("not_paged", reason("K/V without page tables (page_table_k/page_table_v) are not " "served; this engine reads paged K/V containers")); } - if(!pageTableK.has_value() || !pageTableV.has_value()) + if(!sdpa_graph::pagesKAndV(ATTENTION_PAGED_UNIFIED_ENGINE_NAME, attributes)) { - return decline("one_sided_paging", - reason("only ", - pageTableK.has_value() ? "K" : "V", - " is paged; the kernel reads both K and V through page tables")); + return std::nullopt; } // --- 3. Operands. @@ -530,15 +421,8 @@ std::optional graphMatches(const MatchContext& context) const auto* k = findTensor(context, attributes.k_tensor_uid()); const auto* v = findTensor(context, attributes.v_tensor_uid()); const auto* o = findTensor(context, attributes.o_tensor_uid()); - const auto* pageTableKTensor = findTensor(context, *pageTableK); - const auto* pageTableVTensor = findTensor(context, *pageTableV); - const std::array, 6> operands - = {{{"Q", q}, - {"K", k}, - {"V", v}, - {"O", o}, - {"page_table_k", pageTableKTensor}, - {"page_table_v", pageTableVTensor}}}; + const std::array, 4> operands + = {{{"Q", q}, {"K", k}, {"V", v}, {"O", o}}}; for(const auto& [role, tensor] : operands) { if(tensor == nullptr || !isWellFormedRank4(*tensor)) @@ -567,27 +451,23 @@ std::optional graphMatches(const MatchContext& context) const int64_t headSize = dim(*q, HEAD_SIZE_AXIS); const int64_t numKvHeads = dim(*k, HEAD_AXIS); const int64_t blockSize = dim(*k, SEQ_AXIS); - if(dim(*v, SEQ_AXIS) != blockSize) + if(!sdpa_graph::pagedContainersAgree(ATTENTION_PAGED_UNIFIED_ENGINE_NAME, *k, *v)) { - return decline("block_size", - reason("K block size ", - blockSize, - " and V block size ", - dim(*v, SEQ_AXIS), - " differ; the kernel pages K and V alike")); + return std::nullopt; + } + // The kernels read K and V with one head count and one head size. + if(dim(*v, HEAD_AXIS) != numKvHeads || dim(*v, HEAD_SIZE_AXIS) != dim(*k, HEAD_SIZE_AXIS)) + { + return decline("shape", + reason(describeOperand("V", *v), " must match ", describeOperand("K", *k))); } for(uint32_t axis = 0; axis < SDPA_RANK; ++axis) { - if(dim(*v, axis) != dim(*k, axis) || dim(*o, axis) != dim(*q, axis)) + if(dim(*o, axis) != dim(*q, axis)) { - return decline("shape", - reason(describeOperand("V", *v), - " must match ", - describeOperand("K", *k), - ", and ", - describeOperand("O", *o), - " must match ", - describeOperand("Q", *q))); + return decline( + "shape", + reason(describeOperand("O", *o), " must match ", describeOperand("Q", *q))); } } if(dim(*k, HEAD_SIZE_AXIS) != headSize) @@ -615,40 +495,14 @@ std::optional graphMatches(const MatchContext& context) const int64_t queriesPerKv = numQueryHeads / numKvHeads; // --- 6. Q/O layout: dense, or ragged through one shared offset table. - const bool qRagged = q->ragged_offset_tensor_uid().has_value(); - const bool oRagged = o->ragged_offset_tensor_uid().has_value(); - if(qRagged != oRagged - || (qRagged && *q->ragged_offset_tensor_uid() != *o->ragged_offset_tensor_uid())) + const auto raggedQuery = sdpa_graph::raggedQueryFor( + ATTENTION_PAGED_UNIFIED_ENGINE_NAME, context, *q, *o, *k, *v, batch); + if(!raggedQuery.has_value()) { - return decline("ragged", - reason("Q and O must both be dense or both ragged through the same " - "ragged_offset tensor")); - } - if(k->ragged_offset_tensor_uid().has_value() || v->ragged_offset_tensor_uid().has_value()) - { - return decline("ragged", reason("ragged K/V containers are not supported")); - } - for(const auto* table : {pageTableKTensor, pageTableVTensor}) - { - if(table->ragged_offset_tensor_uid().has_value()) - { - return decline("page_table", - reason("a packed page table (with a ragged_offset) is not supported; " - "the kernel reads B rows of M entries")); - } - } - int64_t raggedOffsetUid = NO_UID; - if(qRagged) - { - raggedOffsetUid = *q->ragged_offset_tensor_uid(); - const auto* offsets = findTensor(context, raggedOffsetUid); - if(offsets == nullptr || !isInt32Vector(*offsets, batch + 1)) - { - return decline("ragged", - reason("the ragged_offset tensor must be an INT32 [B+1, 1, 1, 1] " - "device vector with unit stride")); - } + return std::nullopt; } + const bool qRagged = raggedQuery->ragged; + const int64_t raggedOffsetUid = qRagged ? raggedQuery->offsetsUid : NO_UID; if(!queryOperandOk("Q", *q, qRagged) || !queryOperandOk("O", *o, qRagged)) { return std::nullopt; @@ -683,44 +537,16 @@ std::optional graphMatches(const MatchContext& context) // --- 8. Page tables INT32 [B, 1, M, 1] with a unit entry stride. Separate K and V // tables share one width M and one batch stride: the kernel takes one // block_table_stride for both. - for(const auto& [role, table] : {std::pair{std::string_view("page_table_k"), pageTableKTensor}, - std::pair{std::string_view("page_table_v"), pageTableVTensor}}) + const auto pageTables = sdpa_graph::pageTablesFor( + ATTENTION_PAGED_UNIFIED_ENGINE_NAME, context, attributes, batch); + if(!pageTables.has_value()) { - if(table->data_type() != data_objects::DataType::INT32 || dim(*table, BATCH_AXIS) != batch - || dim(*table, HEAD_AXIS) != 1 || dim(*table, HEAD_SIZE_AXIS) != 1 - || (dim(*table, SEQ_AXIS) > 1 && table->strides()->Get(SEQ_AXIS) != 1)) - { - return decline("page_table", - reason(describeOperand(role, *table), - " must be INT32 [B, 1, max_blocks, 1] with unit block stride")); - } - } - const auto pageTableStrides = effectiveStrides(*pageTableKTensor); - if(*pageTableV != *pageTableK) - { - if(dim(*pageTableVTensor, SEQ_AXIS) != dim(*pageTableKTensor, SEQ_AXIS)) - { - return decline("page_table", - reason(describeOperand("page_table_k", *pageTableKTensor), - " and ", - describeOperand("page_table_v", *pageTableVTensor), - " differ in width (max_blocks); the kernel reads both with " - "one width")); - } - if(effectiveStrides(*pageTableVTensor)[BATCH_AXIS] != pageTableStrides[BATCH_AXIS]) - { - return decline("page_table", - reason(describeOperand("page_table_k", *pageTableKTensor), - " and ", - describeOperand("page_table_v", *pageTableVTensor), - " differ in batch stride; the kernel takes one " - "block_table_stride for both")); - } + return std::nullopt; } - const auto pageTableExtent - = checkedSum({checkedProduct({batch - 1, pageTableStrides[BATCH_AXIS]}) - .value_or(std::numeric_limits::max()), - dim(*pageTableKTensor, SEQ_AXIS)}); + const auto pageTableStrides = effectiveStrides(*pageTables->k); + const auto rowSpan = checkedProduct({batch - 1, pageTableStrides[BATCH_AXIS]}); + const auto pageTableExtent = checkedSum( + {rowSpan.value_or(std::numeric_limits::max()), dim(*pageTables->k, SEQ_AXIS)}); if(!pageTableExtent.has_value() || *pageTableExtent > MAX_PAGE_TABLE_ENTRIES) { return decline("size_limit", @@ -736,69 +562,28 @@ std::optional graphMatches(const MatchContext& context) // (both tables have the same M), which bounds seq_len_kv the same way, so it is served // either way. A dense Q's rows past seq_len_q[b] (padding) are written as zeros; a // ragged Q writes only its first seq_len_q[b] rows. - const auto seqLenKvUid = attributes.seq_len_kv_tensor_uid(); - if(!seqLenKvUid.has_value()) + const auto lengths = sdpa_graph::sequenceLengthsFor( + ATTENTION_PAGED_UNIFIED_ENGINE_NAME, context, attributes, batch); + if(!lengths.has_value()) { - return decline("seq_len_kv", reason("paged attention needs a seq_len_kv tensor")); - } - const auto* seqLenKv = findTensor(context, *seqLenKvUid); - if(seqLenKv == nullptr || !isInt32Vector(*seqLenKv, batch)) - { - return decline("seq_len_kv", - reason("seq_len_kv must be an INT32 [B, 1, 1, 1] device vector with " - "unit stride")); - } - const auto seqLenQUid = attributes.seq_len_q_tensor_uid(); - if(!seqLenQUid.has_value()) - { - return decline("seq_len_q", reason("paged attention needs a seq_len_q tensor")); - } - const auto* seqLenQTensor = findTensor(context, *seqLenQUid); - if(seqLenQTensor == nullptr || !isInt32Vector(*seqLenQTensor, batch)) - { - return decline("seq_len_q", - reason("seq_len_q must be an INT32 [B, 1, 1, 1] device vector with " - "unit stride")); + return std::nullopt; } // --- 10. Declared alignment. A graph declares each operand's device-pointer alignment // (16 bytes unless set; setting it needs engine API 1.3.0, which this engine's 1.4.0 // admits). The kernels load Q/K/V/O as 16-byte vectors and the INT32 operands as 4-byte - // words, and launch() rejects a pointer short of either, so a graph declaring less is - // declined here, where hipDNN can still pick another engine. - const std::array, 4> - vectorOperands = {{{"Q", q}, {"K", k}, {"V", v}, {"O", o}}}; - for(const auto& [role, tensor] : vectorOperands) + // words, and launch() rejects a pointer short of either. A dense Q has no offset table; + // its entry is null and skipped. + if(!sdpa_graph::declaresServedAlignment(ATTENTION_PAGED_UNIFIED_ENGINE_NAME, + {{"Q", q}, {"K", k}, {"V", v}, {"O", o}}, + static_cast(VECTOR_BYTES), + {{"page_table_k", pageTables->k}, + {"page_table_v", pageTables->v}, + {"seq_len_kv", lengths->kv}, + {"seq_len_q", lengths->q}, + {"ragged_offset", raggedQuery->offsets}})) { - if(!declaresAlignment(*tensor, static_cast(VECTOR_BYTES))) - { - return decline("alignment", - reason(role, - " declares a ", - tensor->alignment(), - "-byte alignment; the kernels load Q, K, V and O as 16-byte " - "vectors, so each must declare a multiple of 16 bytes")); - } - } - // A dense Q has no offset table; its entry is null and skipped. - const auto* raggedOffsets = qRagged ? findTensor(context, raggedOffsetUid) : nullptr; - const std::array, 5> - wordOperands = {{{"page_table_k", pageTableKTensor}, - {"page_table_v", pageTableVTensor}, - {"seq_len_kv", seqLenKv}, - {"seq_len_q", seqLenQTensor}, - {"ragged_offset", raggedOffsets}}}; - for(const auto& [role, tensor] : wordOperands) - { - if(tensor != nullptr && !declaresAlignment(*tensor, int64_t{sizeof(int32_t)})) - { - return decline("alignment", - reason(role, - " declares a ", - tensor->alignment(), - "-byte alignment; the kernels read the INT32 page tables, " - "sequence lengths and ragged offsets as 4-byte words")); - } + return std::nullopt; } // --- 11. Mask: bottom-right causal, optionally with a left bound (sliding window). @@ -838,9 +623,9 @@ std::optional graphMatches(const MatchContext& context) } // --- 12. Every optional attribute the kernel cannot honour. - if(attributes.attn_mask_tensor_uid().has_value()) + if(!sdpa_graph::takesNoAttentionMask(ATTENTION_PAGED_UNIFIED_ENGINE_NAME, attributes)) { - return decline("attn_mask", reason("an additive attention mask is not supported")); + return std::nullopt; } if(attributes.scale_tensor_uid().has_value()) { @@ -859,56 +644,19 @@ std::optional graphMatches(const MatchContext& context) return decline("block_mask", reason("a block mask is not supported")); } // A sink is one logit per query head, which the use_sinks kernels load from sink_ptr - // at index `query head` in the I/O dtype. - int64_t sinkUid = NO_UID; - if(attributes.sink_token_tensor_uid().has_value()) + // at index `query head` in the I/O dtype. They declare sink_ptr 16-byte aligned, as + // they do Q/K/V/O, and launch() checks it the same way. + const auto sink = sdpa_graph::sinkFor(ATTENTION_PAGED_UNIFIED_ENGINE_NAME, + context, + attributes, + numQueryHeads, + q->data_type(), + static_cast(VECTOR_BYTES)); + if(!sink.has_value()) { - sinkUid = *attributes.sink_token_tensor_uid(); - const auto* sink = findTensor(context, sinkUid); - if(sink == nullptr || !isWellFormedRank4(*sink)) - { - return decline("sinks", - reason("sink_token is missing, virtual, pass-by-value, not rank 4, or " - "has a non-positive extent or negative stride")); - } - if(sink->ragged_offset_tensor_uid().has_value() || dim(*sink, BATCH_AXIS) != 1 - || dim(*sink, HEAD_AXIS) != numQueryHeads || dim(*sink, SEQ_AXIS) != 1 - || dim(*sink, HEAD_SIZE_AXIS) != 1) - { - return decline("sinks", - reason(describeOperand("sink_token", *sink), - " must be [1, ", - numQueryHeads, - ", 1, 1] (one logit per query head)")); - } - if(sink->data_type() != q->data_type()) - { - return decline("sinks", - reason("sink_token data type ", - sink->data_type(), - " differs from Q's ", - q->data_type(), - ": the kernels load the sink in the I/O data type, so FLOAT " - "sinks are not served")); - } - if(numQueryHeads > 1 && sink->strides()->Get(HEAD_AXIS) != 1) - { - return decline("sinks", - reason(describeOperand("sink_token", *sink), - " needs a unit head stride; the kernels index the sink by " - "query head")); - } - // The use_sinks kernels declare sink_ptr 16-byte aligned, as they do Q/K/V/O, and - // launch() checks it the same way. - if(!declaresAlignment(*sink, static_cast(VECTOR_BYTES))) - { - return decline("alignment", - reason("sink_token declares a ", - sink->alignment(), - "-byte alignment; the use_sinks kernels take sink_ptr as a " - "16-byte-aligned pointer, like Q, K, V and O")); - } + return std::nullopt; } + const int64_t sinkUid = sink->present ? sink->uid : NO_UID; if(attributes.descale_q_tensor_uid().has_value() || attributes.descale_k_tensor_uid().has_value() || attributes.descale_v_tensor_uid().has_value() @@ -960,10 +708,10 @@ std::optional graphMatches(const MatchContext& context) bound[std::string(K_TOKEN)] = attributes.k_tensor_uid(); bound[std::string(V_TOKEN)] = attributes.v_tensor_uid(); bound[std::string(O_TOKEN)] = attributes.o_tensor_uid(); - bound[std::string(PAGE_TABLE_K_TOKEN)] = *pageTableK; - bound[std::string(PAGE_TABLE_V_TOKEN)] = *pageTableV; - bound[std::string(SEQ_LEN_KV_TOKEN)] = *seqLenKvUid; - bound[std::string(SEQ_LEN_Q_TOKEN)] = *seqLenQUid; + bound[std::string(PAGE_TABLE_K_TOKEN)] = pageTables->kUid; + bound[std::string(PAGE_TABLE_V_TOKEN)] = pageTables->vUid; + bound[std::string(SEQ_LEN_KV_TOKEN)] = lengths->kvUid; + bound[std::string(SEQ_LEN_Q_TOKEN)] = lengths->qUid; bound[std::string(RAGGED_OFFSET_TOKEN)] = raggedOffsetUid; bound[std::string(SINK_TOKEN)] = sinkUid; int32_t scaleBits = 0; diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/FlydslSdpaShared.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/FlydslSdpaShared.hpp index f1b684e04821..569442b9bbc2 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/FlydslSdpaShared.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/FlydslSdpaShared.hpp @@ -89,13 +89,9 @@ inline const data_objects::SdpaAttributes* sdpaNode(const MatchContext& context) return &node.attributesAs(); } -/// Whether @p tensor promises a base pointer aligned to @p bytes. The backend enforces the -/// alignment a graph declares and no more, so a kernel that assumes a wider one must read the -/// declaration: a smaller one would hand it a pointer its vector accesses cannot take. -inline bool declaresAlignment(const data_objects::TensorAttributes& tensor, int64_t bytes) -{ - return tensor.alignment() >= bytes && tensor.alignment() % bytes == 0; -} +/// Whether @p tensor promises a base pointer aligned to @p bytes; sdpa_graph's, shared with +/// the paged attention packs. +using sdpa_graph::declaresAlignment; /// Whether the kernels' arithmetic meets the node's compute type: they compute the softmax, /// accumulate and keep the statistics in f32. @@ -160,20 +156,8 @@ inline bool isServableScaleTensor(const MatchContext& context, int64_t uid) } /// The product of @p factors, or nullopt when it does not fit in int64_t. Every product of -/// graph-controlled extents goes through this: an unchecked one is signed overflow, and a -/// wrapped value can pass a bound it should fail. -inline std::optional checkedProduct(std::initializer_list factors) -{ - int64_t product = 1; - for(const int64_t factor : factors) - { - if(__builtin_mul_overflow(product, factor, &product)) - { - return std::nullopt; - } - } - return product; -} +/// graph-controlled extents goes through this; sdpa_graph's, shared with the attention packs. +using sdpa_graph::checkedProduct; /// Whether no two elements of @p tensor share an address, which an output needs: concurrent /// workgroups writing one location race. Its axes of more than one element, ordered by diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx942AttentionUnified3dNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx942AttentionUnified3dNative.cpp index f8a2332db5ef..3c1418df9784 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx942AttentionUnified3dNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx942AttentionUnified3dNative.cpp @@ -114,6 +114,7 @@ constexpr std::string_view O_TOKEN = "gfx942_attention_unified3d.o.uid"; constexpr std::string_view SCALE_BITS_TOKEN = "gfx942_attention_unified3d.scale_bits"; using sdpa_graph::BATCH_AXIS; +using sdpa_graph::checkedProduct; using sdpa_graph::describeOperand; using sdpa_graph::findTensor; using sdpa_graph::hasSdpaForwardNode; @@ -145,20 +146,6 @@ constexpr int64_t PREFERRED_BLOCK_SIZE = 16; // Matching helpers // --------------------------------------------------------------------------- -/// The product of @p factors, or nullopt when it does not fit in int64_t. -std::optional checkedProduct(std::initializer_list factors) -{ - int64_t product = 1; - for(const int64_t factor : factors) - { - if(__builtin_mul_overflow(product, factor, &product)) - { - return std::nullopt; - } - } - return product; -} - /** * @brief Is this Q or O tensor the contiguous `[B, Hq, D]` rocKE requires? * diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/SdpaGraphMatch.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/SdpaGraphMatch.hpp index 3b6e62e01767..9dab63719d38 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/SdpaGraphMatch.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/SdpaGraphMatch.hpp @@ -4,30 +4,36 @@ #pragma once #include +#include #include #include #include #include #include +#include #include #include #include #include +#include #include +#include #include #include "engines/kernel_ingestor_engine/packs/PackFeatures.hpp" /** * @file SdpaGraphMatch.hpp - * @brief The graph-reading helpers every ingestor pack that serves a single dense BSHD - * SDPA-forward node shares: finding the node and its operands, the operand checks - * made before anything indexes an axis, the problem read from Q and K, the f32 - * compute-type rule for the packs that apply it, and the decline-line head. + * @brief The graph-reading helpers every ingestor pack that serves a single SDPA-forward + * node shares: finding the node and its operands, the operand checks made before + * anything indexes an axis, the problem read from Q and K, the f32 compute-type + * rule for the packs that apply it, the decline-line head, and, for packs serving + * cuDNN's paged-K/V graphs (SEM-009), the paged-graph contract checks with one + * cause vocabulary. * - * Pack-family rules (mask kinds, dtypes, the decode rule) stay with the family, e.g. - * UnifiedAttentionGraphMatch.hpp. + * Pack-family rules (mask kinds, dtypes, the decode rule, kernel limits) stay with the + * family, e.g. UnifiedAttentionGraphMatch.hpp. */ namespace hip_kernel_provider::kernel_ingestor_engine::sdpa_graph { @@ -42,6 +48,24 @@ inline constexpr uint32_t SEQ_AXIS = 2; inline constexpr uint32_t HEAD_SIZE_AXIS = 3; inline constexpr uint32_t SDPA_RANK = 4; +/// The product of @p factors, or nullopt when it does not fit in int64_t. Every product of +/// graph-controlled extents goes through this: an unchecked one is signed overflow, and a +/// wrapped value can pass a bound it should fail. Zero and negative factors are allowed (an +/// extent of 1 contributes (1 - 1) * stride = 0), unlike pack_features::checkedProduct, +/// which refuses non-positive cost features. +inline std::optional checkedProduct(std::initializer_list factors) +{ + int64_t product = 1; + for(const int64_t factor : factors) + { + if(__builtin_mul_overflow(product, factor, &product)) + { + return std::nullopt; + } + } + return product; +} + inline const data_objects::TensorAttributes* findTensor(const MatchContext& context, int64_t uid) { const auto& tensors = context.graph.getTensorMap(); @@ -215,4 +239,443 @@ inline std::string describeOperand(std::string_view role, return out.str(); } +// --------------------------------------------------------------------------- +// Operand checks stricter than isWellFormedOperand +// --------------------------------------------------------------------------- + +/// Whether the graph asks for override shapes (admitted from engine API 1.4.0). A pack +/// that derives its launch arguments from the built shapes declines such a graph. +inline bool usesOverrideShapes(const MatchContext& context) +{ + return context.graph.getGraph().is_override_shape_enabled(); +} + +/// Whether every stride is non-negative. Callers must have checked isWellFormedOperand(). +inline bool hasNonNegativeStrides(const data_objects::TensorAttributes& tensor) +{ + for(const auto stride : *tensor.strides()) + { + if(stride < 0) + { + return false; + } + } + return true; +} + +/// Whether @p tensor promises a base pointer aligned to a multiple of @p bytes. The backend +/// enforces the alignment a graph declares and no more, so a kernel that assumes a wider one +/// must read the declaration: a smaller one would hand it a pointer its vector accesses +/// cannot take. +inline bool declaresAlignment(const data_objects::TensorAttributes& tensor, int64_t bytes) +{ + return tensor.alignment() >= bytes && tensor.alignment() % bytes == 0; +} + +/// An INT32 device vector `[length, 1, 1, 1]` read as v[i]: well formed, non-negative +/// strides, not ragged, and a unit stride along its one non-unit axis. +inline bool isInt32Vector(const data_objects::TensorAttributes& tensor, int64_t length) +{ + if(!isWellFormedOperand(tensor) || !hasNonNegativeStrides(tensor) + || tensor.data_type() != data_objects::DataType::INT32 + || tensor.ragged_offset_tensor_uid().has_value() || tensor.dims()->Get(BATCH_AXIS) != length + || tensor.dims()->Get(HEAD_AXIS) != 1 || tensor.dims()->Get(SEQ_AXIS) != 1 + || tensor.dims()->Get(HEAD_SIZE_AXIS) != 1) + { + return false; + } + return length == 1 || tensor.strides()->Get(BATCH_AXIS) == 1; +} + +// --------------------------------------------------------------------------- +// cuDNN paged-K/V graphs (SdpaSemanticsRegister SEM-009) +// +// The contract checks every pack serving a paged SDPA-forward graph applies, with one +// cause vocabulary. Each logs its decline through DeclinedBy with the calling engine's +// name and returns false (or nullopt); the engine keeps its own kernel limits (block +// sizes, head sizes, address ranges) and calls these in place of its own copies. +// +// Cause keys: one_sided_paging, block_size, shape, page_table, seq_len_kv, seq_len_q, +// ragged, alignment, sinks, attn_mask. +// --------------------------------------------------------------------------- + +/// The paged graph pages both K and V, through page_table_k and page_table_v (which may +/// be one tensor). cuDNN also allows K or V paged alone, which no paged kernel here reads. +inline bool pagesKAndV(std::string_view engine, const data_objects::SdpaAttributes& attributes) +{ + const bool pagedK = attributes.page_table_k_tensor_uid().has_value(); + const bool pagedV = attributes.page_table_v_tensor_uid().has_value(); + if(pagedK && pagedV) + { + return true; + } + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "one_sided_paging"}) + << (pagedK || pagedV ? (pagedK ? "only K is paged" : "only V is paged") + : "neither K nor V is paged") + << "; the kernels page both K and V"); + return false; +} + +/// The paged K and V containers `[num_blocks, H, block_size, D]` share one block size and +/// one block count: the kernels address both with one block size and bound both page ids +/// by one block count. Both must be well formed. Their head counts and head sizes are the +/// engine's to check. +inline bool pagedContainersAgree(std::string_view engine, + const data_objects::TensorAttributes& k, + const data_objects::TensorAttributes& v) +{ + if(v.dims()->Get(SEQ_AXIS) != k.dims()->Get(SEQ_AXIS)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "block_size"}) + << "the K and V containers differ in block size (" + << k.dims()->Get(SEQ_AXIS) << " and " << v.dims()->Get(SEQ_AXIS) + << "); the kernels address both with one"); + return false; + } + if(v.dims()->Get(BATCH_AXIS) != k.dims()->Get(BATCH_AXIS)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "shape"}) + << "the K and V containers differ in page count (" + << k.dims()->Get(BATCH_AXIS) << " and " << v.dims()->Get(BATCH_AXIS) + << "); the kernels bound both page ids by one"); + return false; + } + return true; +} + +/// The two page tables of a paged graph, K's and V's (the same tensor when one pages both). +struct PageTables +{ + int64_t kUid = 0; + int64_t vUid = 0; + const data_objects::TensorAttributes* k = nullptr; + const data_objects::TensorAttributes* v = nullptr; +}; + +/// The page tables: INT32 `[B, 1, M, 1]` with a unit entry stride, not packed (no +/// ragged_offset). Separate K and V tables share one width M and one batch stride: the +/// kernels read both at one row offset. A graph that does not page both K and V is +/// declined through pagesKAndV(). +inline std::optional pageTablesFor(std::string_view engine, + const MatchContext& context, + const data_objects::SdpaAttributes& attributes, + int64_t batch) +{ + if(!pagesKAndV(engine, attributes)) + { + return std::nullopt; + } + PageTables tables; + tables.kUid = *attributes.page_table_k_tensor_uid(); + tables.vUid = *attributes.page_table_v_tensor_uid(); + tables.k = findTensor(context, tables.kUid); + tables.v = findTensor(context, tables.vUid); + for(const auto& [role, table] : {std::pair{std::string_view("page_table_k"), tables.k}, + std::pair{std::string_view("page_table_v"), tables.v}}) + { + if(table == nullptr || !isWellFormedOperand(*table) || !hasNonNegativeStrides(*table)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "page_table"}) + << role + << " is missing, virtual, pass-by-value, not rank 4, or has " + "a non-positive extent or negative stride"); + return std::nullopt; + } + if(table->ragged_offset_tensor_uid().has_value()) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "page_table"}) + << role + << " is packed (has a ragged_offset); the kernels read B rows " + "of M entries"); + return std::nullopt; + } + const auto* dims = table->dims(); + if(table->data_type() != data_objects::DataType::INT32 || dims->Get(BATCH_AXIS) != batch + || dims->Get(HEAD_AXIS) != 1 || dims->Get(HEAD_SIZE_AXIS) != 1 + || (dims->Get(SEQ_AXIS) > 1 && table->strides()->Get(SEQ_AXIS) != 1)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "page_table"}) + << role + << " must be a device INT32 [B, 1, M, 1] tensor with a unit " + "entry stride; got " + << describeOperand(role, *table)); + return std::nullopt; + } + } + if(tables.vUid != tables.kUid) + { + if(tables.v->dims()->Get(SEQ_AXIS) != tables.k->dims()->Get(SEQ_AXIS)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "page_table"}) + << "the K and V page tables differ in width (" + << tables.k->dims()->Get(SEQ_AXIS) << " and " + << tables.v->dims()->Get(SEQ_AXIS) + << "); the kernels read both at one row offset"); + return std::nullopt; + } + if(batch > 1 + && tables.v->strides()->Get(BATCH_AXIS) != tables.k->strides()->Get(BATCH_AXIS)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "page_table"}) + << "the K and V page tables differ in row stride (" + << tables.k->strides()->Get(BATCH_AXIS) << " and " + << tables.v->strides()->Get(BATCH_AXIS) + << "); the kernels read both at one row offset"); + return std::nullopt; + } + } + return tables; +} + +/// seq_len_q and seq_len_kv, which a paged graph carries both of (also for a dense Q). +struct SequenceLengths +{ + int64_t kvUid = 0; + int64_t qUid = 0; + const data_objects::TensorAttributes* kv = nullptr; + const data_objects::TensorAttributes* q = nullptr; +}; + +/// The sequence lengths: INT32 `[B, 1, 1, 1]` device vectors with a unit stride. Checks +/// seq_len_kv first, then seq_len_q. +inline std::optional + sequenceLengthsFor(std::string_view engine, + const MatchContext& context, + const data_objects::SdpaAttributes& attributes, + int64_t batch) +{ + const auto lengthFor = [&](std::string_view role, + const flatbuffers::Optional& uid, + const data_objects::TensorAttributes*& tensor, + int64_t& tensorUid) { + if(!uid.has_value()) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, role}) << "a paged graph needs " << role); + return false; + } + tensor = findTensor(context, *uid); + if(tensor == nullptr || !isInt32Vector(*tensor, batch)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, role}) + << role + << " must be a device INT32 [B, 1, 1, 1] vector with a unit " + "stride"); + return false; + } + tensorUid = *uid; + return true; + }; + SequenceLengths lengths; + if(!lengthFor("seq_len_kv", attributes.seq_len_kv_tensor_uid(), lengths.kv, lengths.kvUid) + || !lengthFor("seq_len_q", attributes.seq_len_q_tensor_uid(), lengths.q, lengths.qUid)) + { + return std::nullopt; + } + return lengths; +} + +/// A ragged Q's offsets (RFC 0014), or none for a dense Q. +struct RaggedQuery +{ + bool ragged = false; + int64_t offsetsUid = 0; + const data_objects::TensorAttributes* offsets = nullptr; +}; + +/// Q and O are both dense, or both ragged at the sequence axis through one INT32 +/// `[B+1, 1, 1, 1]` offset tensor with a unit stride; paged K and V are never ragged. +/// Call with well-formed Q, O, K and V. +inline std::optional raggedQueryFor(std::string_view engine, + const MatchContext& context, + const data_objects::TensorAttributes& q, + const data_objects::TensorAttributes& o, + const data_objects::TensorAttributes& k, + const data_objects::TensorAttributes& v, + int64_t batch) +{ + const auto qOffsets = q.ragged_offset_tensor_uid(); + const auto oOffsets = o.ragged_offset_tensor_uid(); + if(qOffsets.has_value() != oOffsets.has_value() + || (qOffsets.has_value() && *qOffsets != *oOffsets)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "ragged"}) + << "Q and O must both be dense or both ragged through the same " + "ragged_offset tensor"); + return std::nullopt; + } + if(k.ragged_offset_tensor_uid().has_value() || v.ragged_offset_tensor_uid().has_value()) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "ragged"}) + << "ragged K/V containers are not supported; paged K and V are " + "addressed through their page tables"); + return std::nullopt; + } + RaggedQuery query; + if(!qOffsets.has_value()) + { + return query; + } + query.ragged = true; + query.offsetsUid = *qOffsets; + query.offsets = findTensor(context, query.offsetsUid); + if(query.offsets == nullptr || !isInt32Vector(*query.offsets, batch + 1)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "ragged"}) + << "the ragged offsets must be a device INT32 [B+1, 1, 1, 1] " + "vector with a unit stride"); + return std::nullopt; + } + return query; +} + +/// A ragged Q's or O's offsets count tokens: its ragged_offset_multiplier is its token +/// (sequence-axis) stride. The kernels take rows per sequence and query-block starts from +/// the stored offsets themselves and scale only a sequence's base; RFC 0014 also allows +/// other units, which they would misread. +inline bool countsOffsetsInTokens(std::string_view engine, + std::string_view role, + const data_objects::TensorAttributes& tensor) +{ + if(tensor.ragged_offset_multiplier() == tensor.strides()->Get(SEQ_AXIS)) + { + return true; + } + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "ragged"}) + << describeOperand(role, tensor) << " with ragged_offset_multiplier " + << tensor.ragged_offset_multiplier() + << ": the multiplier must equal the sequence-axis (token) stride; " + "the kernels read stored offsets as token counts"); + return false; +} + +/// An operand and the name a decline gives it. +using NamedOperand = std::pair; + +/** + * @brief The declared device-pointer alignments the kernels need (engine API 1.3.0 lets a + * graph declare them; 16 bytes unless set). + * + * The kernels load Q/K/V/O as @p vectorBytes vectors and the INT32 page tables, sequence + * lengths and ragged offsets as 4-byte words, so a graph declaring less for any of them is + * declined here, where hipDNN can still pick another engine, rather than at execute. + * Null operands (absent ones) are skipped. + */ +inline bool declaresServedAlignment(std::string_view engine, + std::initializer_list vectorOperands, + int64_t vectorBytes, + std::initializer_list wordOperands) +{ + for(const auto& [role, tensor] : vectorOperands) + { + if(tensor != nullptr && !declaresAlignment(*tensor, vectorBytes)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "alignment"}) + << role << " declares a " << tensor->alignment() + << "-byte alignment; the kernels load Q, K, V and O as " + << vectorBytes << "-byte vectors, so each must declare a " + << "multiple of " << vectorBytes << " bytes"); + return false; + } + } + for(const auto& [role, tensor] : wordOperands) + { + if(tensor != nullptr && !declaresAlignment(*tensor, int64_t{sizeof(int32_t)})) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "alignment"}) + << role << " declares a " << tensor->alignment() + << "-byte alignment; the kernels read the INT32 page tables, " + "sequence lengths and ragged offsets as 4-byte words"); + return false; + } + } + return true; +} + +/// The graph's attention sink, if it has one. +struct SinkOperand +{ + bool present = false; + int64_t uid = 0; + const data_objects::TensorAttributes* tensor = nullptr; +}; + +/** + * @brief The attention sink (SEM-022): sink_token `[1, Hq, 1, 1]`, one logit per query + * head, which the kernels load at index `query head`. + * + * Served in Q's data type with a unit head stride; cuDNN's FLOAT form is declined (cause + * `sinks`). @p minAlignmentBytes is the calling engine's sink load width: a sink declaring + * less is declined with cause `alignment`. Absent sink: present = false. + */ +inline std::optional sinkFor(std::string_view engine, + const MatchContext& context, + const data_objects::SdpaAttributes& attributes, + int64_t numQueryHeads, + data_objects::DataType queryType, + int64_t minAlignmentBytes) +{ + SinkOperand sink; + const auto uid = attributes.sink_token_tensor_uid(); + if(!uid.has_value()) + { + return sink; + } + sink.present = true; + sink.uid = *uid; + sink.tensor = findTensor(context, sink.uid); + const auto* tensor = sink.tensor; + if(tensor == nullptr || !isWellFormedOperand(*tensor) || !hasNonNegativeStrides(*tensor) + || tensor->ragged_offset_tensor_uid().has_value() || tensor->dims()->Get(BATCH_AXIS) != 1 + || tensor->dims()->Get(HEAD_AXIS) != numQueryHeads || tensor->dims()->Get(SEQ_AXIS) != 1 + || tensor->dims()->Get(HEAD_SIZE_AXIS) != 1) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "sinks"}) + << "sink_token must be a device tensor [1, Hq, 1, 1] (Hq = " + << numQueryHeads << ", one logit per query head)"); + return std::nullopt; + } + if(tensor->data_type() == data_objects::DataType::FLOAT + && queryType != data_objects::DataType::FLOAT) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "sinks"}) + << "a FLOAT sink_token: the kernels load the sink in the Q data " + "type"); + return std::nullopt; + } + if(tensor->data_type() != queryType) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "sinks"}) + << "sink_token's data type is not the Q data type"); + return std::nullopt; + } + if(numQueryHeads > 1 && tensor->strides()->Get(HEAD_AXIS) != 1) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "sinks"}) + << "the kernels read sink_token with a unit head stride"); + return std::nullopt; + } + if(!declaresAlignment(*tensor, minAlignmentBytes)) + { + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "alignment"}) + << "sink_token declares a " << tensor->alignment() + << "-byte alignment; the kernels load the sink with " + << minAlignmentBytes << "-byte alignment"); + return std::nullopt; + } + return sink; +} + +/// No additive attention mask (attn_mask): the paged kernels take no bias input. +inline bool takesNoAttentionMask(std::string_view engine, + const data_objects::SdpaAttributes& attributes) +{ + if(!attributes.attn_mask_tensor_uid().has_value()) + { + return true; + } + HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "attn_mask"}) + << "the paged kernels take no additive attention mask"); + return false; +} + } // namespace hip_kernel_provider::kernel_ingestor_engine::sdpa_graph From 9214c37337db25395e75405ad2cd650abd1f6fc5 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 4 Nov 2026 15:26:43 -0600 Subject: [PATCH 08/22] feat(hip-kernel-provider): save and restore hipkernel:AttentionPagedUnified plans The engine is one kpack launch with no slots and no workspace; lengths, page tables, offsets and sinks are device buffers bound at execute. The prepared dispatch is now an IngestorPreparedDispatch, and the handler saves the bound uids, every by-value kernel argument and the CTA size as typed launch values under hipkernel.attention_paged_unified.dispatch.v1 (registered next to the UDD's unversioned name, same handler). restoreLaunch rebuilds them through restoreIngestorLaunch; prepare() and restore share one function that applies the launch geometry. The reader refuses values outside what the kernel takes. Tests: CPU launch-value round trips for dense, ragged, separate K/V tables and sinks plus refusals; the alias table; a checked-in byte sample of the v1 contract in TestIngestorPlanLaunchContractGoldens (a ragged Q with a sink and separate K and V tables, every value distinct), read back field by field; GPU save/load round trips in a fresh handle, both save forms, bit-identical to the original plan's output. --- .../rocKE/attention_paged_unified/README.md | 19 + .../AttentionPagedUnifiedLaunchValues.hpp | 148 ++++++++ .../packs/AttentionPagedUnifiedNative.cpp | 323 ++++++++++++---- .../IntegrationGpuAttentionPagedUnified.cpp | 154 +++++++- .../kernel_ingestor_engine/CMakeLists.txt | 1 + .../TestAttentionPagedUnifiedLaunchValues.cpp | 357 ++++++++++++++++++ .../TestAttentionPagedUnifiedMatchers.cpp | 22 ++ .../packs/TestIngestorDispatchAliases.cpp | 3 + .../packs/TestPackLaunchValues.cpp | 43 +-- .../IngestorPlanTestUtilities.hpp | 48 +++ .../TestIngestorPlanLaunchContractGoldens.cpp | 218 +++++++++++ 11 files changed, 1217 insertions(+), 119 deletions(-) create mode 100644 dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp create mode 100644 dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md index a4313dd89278..8c1ed4a4aa12 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md @@ -126,6 +126,25 @@ the cache's K and V halves as two containers over one allocation, its `block_tab page tables (one tensor, `[B, 1, max_blocks, 1]`), `seq_lens` as `seq_len_kv`, the query lengths as `seq_len_q`, and `query_start_loc` as the ragged offset of Q and O. +## Saved plans + +The engine reports `SUPPORTS_EXECUTION_PLAN_SERIALIZATION`: a built plan saves with +`to_binary()` or `to_compiled_plan_binary()` and loads into a fresh handle without matching, +descriptor search or archive reads. The payload holds the kernel's code object and, under +the dispatch contract `hipkernel.attention_paged_unified.dispatch.v1` +(`packs/AttentionPagedUnifiedLaunchValues.hpp`), the launch values: the uids of Q, K, V, O, +both page tables, `seq_len_kv`, `seq_len_q`, the ragged offset and the sink (`-1` when +absent), the scale (any finite float, stored exactly as a double), every by-value kernel +argument (`num_seqs`, `block_table_stride`, the head counts, `sliding_window`, +`q_uniform_len` (`Sq` for a dense Q, 0 for a ragged one), the Q/O/KV strides, +`kv_block_span_bytes`, `q_block_grid`) and +`block_threads`. The loaded plan +launches the same grid, `(num_kv_heads, q_block_grid)`, with `block_threads` threads. A load +refuses a value of another type, an extra or missing value, or one outside what the kernel +takes. Lengths, page tables, offsets and sinks stay device buffers bound at execute, so a +loaded plan serves every step just as the original does +(`IntegrationGpuAttentionPagedUnifiedSaveLoad`). + ## Attention sinks `sink_token` adds one logit per query head to the softmax max and denominator, with no value diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp new file mode 100644 index 000000000000..44b966c82970 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp @@ -0,0 +1,148 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#pragma once + +#ifdef HIPDNN_ENABLE_KERNEL_INGESTOR + +#include +#include + +#include +#include + +/** + * @file AttentionPagedUnifiedLaunchValues.hpp + * @brief The launch state of the hipkernel:AttentionPagedUnified pack, and its saved form: + * a versioned dispatch name and the named, typed values the launch is computed from. + * The pack also reads its saved form back into its launch inputs. + * + * The launch is one kernel with no workspace. Lengths, page tables, offsets and sinks are + * device buffers bound by uid at execute, so the uids, the by-value kernel arguments and + * the CTA size are the whole launch state. + * + * The version in the dispatch name identifies the contract between the saved values and + * the launch. Use a new version for a change to any of these: + * - the names, types or meanings of the values. + * - the kernel arguments the launch passes: their order, count, kinds, sizes or meanings. + * - how the launch derives grid or block from the values. + * Keep the handler of the old version registered while plans saved under it must load. + */ +namespace hip_kernel_provider::kernel_ingestor_engine +{ + +/// Contract v1: the runtime_layout tiled 2D kernel signature. New plans are saved under it. +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1 + = "hipkernel.attention_paged_unified.dispatch.v1"; + +/// The uid an absent optional operand (ragged offset, sink) saves as. +inline constexpr int64_t ATTENTION_PAGED_UNIFIED_NO_UID = -1; + +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_UID_VALUE = "q.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_K_UID_VALUE = "k.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_V_UID_VALUE = "v.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_O_UID_VALUE = "o.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_PAGE_TABLE_K_UID_VALUE + = "page_table_k.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_PAGE_TABLE_V_UID_VALUE + = "page_table_v.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SEQ_LEN_KV_UID_VALUE = "seq_len_kv.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SEQ_LEN_Q_UID_VALUE = "seq_len_q.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_RAGGED_OFFSET_UID_VALUE + = "ragged_offset.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SINK_UID_VALUE = "sink.uid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SCALE_VALUE = "scale"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_NUM_SEQS_VALUE = "num_seqs"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_BLOCK_TABLE_STRIDE_VALUE + = "block_table_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_NUM_QUERY_HEADS_VALUE = "num_query_heads"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_NUM_KV_HEADS_VALUE = "num_kv_heads"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SLIDING_WINDOW_VALUE = "sliding_window"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_UNIFORM_LEN_VALUE = "q_uniform_len"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_SEQ_STRIDE_VALUE = "q_seq_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_TOK_STRIDE_VALUE = "q_tok_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_HEAD_STRIDE_VALUE = "q_head_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_O_SEQ_STRIDE_VALUE = "o_seq_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_O_TOK_STRIDE_VALUE = "o_tok_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_O_HEAD_STRIDE_VALUE = "o_head_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_BLOCK_STRIDE_VALUE = "kv_block_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_TOK_STRIDE_VALUE = "kv_tok_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_HEAD_STRIDE_VALUE = "kv_head_stride"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_BLOCK_SPAN_BYTES_VALUE + = "kv_block_span_bytes"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_BLOCK_GRID_VALUE = "q_block_grid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE = "block_threads"; + +/// The tensor uids a launch binds to device buffers. raggedOffset is NO_UID for a dense Q; +/// sink is NO_UID without attention sinks. pageTableK == pageTableV when one table pages +/// both K and V. +struct AttentionPagedUnifiedUids +{ + int64_t q = 0; + int64_t k = 0; + int64_t v = 0; + int64_t o = 0; + int64_t pageTableK = 0; + int64_t pageTableV = 0; + int64_t seqLenKv = 0; + int64_t seqLenQ = 0; + int64_t raggedOffset = ATTENTION_PAGED_UNIFIED_NO_UID; + int64_t sink = ATTENTION_PAGED_UNIFIED_NO_UID; +}; + +/// Q's or O's strides, in elements. seqStride is the batch stride of a dense operand and +/// the ragged-offset multiplier of a ragged one. +struct AttentionPagedUnifiedQueryStrides +{ + int32_t seqStride = 0; + int32_t tokenStride = 0; + int32_t headStride = 0; +}; + +/// Every by-value kernel argument the launch varies. +struct AttentionPagedUnifiedScalars +{ + float scale = 0.0F; + int32_t numSeqs = 0; + int32_t blockTableStride = 0; + int32_t numQueryHeads = 0; + int32_t numKvHeads = 0; + int32_t slidingWindow = 0; + int32_t qUniformLen = 0; ///< query rows per sequence of a dense Q; 0 for a ragged Q + AttentionPagedUnifiedQueryStrides q; + AttentionPagedUnifiedQueryStrides o; + int32_t kvBlockStride = 0; + int32_t kvTokStride = 0; + int32_t kvHeadStride = 0; + int32_t kvBlockSpanBytes = 0; + int32_t qBlockGrid = 0; +}; + +/// Everything a launch is computed from: block = (blockThreads, 1, 1) and +/// grid = (numKvHeads, qBlockGrid, 1). +struct AttentionPagedUnifiedLaunchInputs +{ + AttentionPagedUnifiedUids uids; + AttentionPagedUnifiedScalars scalars; + int32_t blockThreads = 0; +}; + +/// The values of the `hipkernel.attention_paged_unified.dispatch.v1` contract. `scale` is +/// stored as a double, which holds every float exactly; every other value is an int. +hipdnn_plugin_sdk::ingestor::MetadataValues + attentionPagedUnifiedLaunchValues(const AttentionPagedUnifiedLaunchInputs& launch); + +/// Reads the values of the `hipkernel.attention_paged_unified.dispatch.v1` contract. Each +/// value must be in the range the kernel takes (int32, positive where the kernel divides +/// by it or indexes with it), `scale` must be a finite float stored exactly, the head +/// counts must divide, a dense Q needs `q_uniform_len` >= 1 and a ragged one 0, +/// and `block_threads` must be a whole number of waves. +/// +/// @throws HipdnnPluginException with a load refusal when the dispatch name is not the +/// contract, or when a value is missing, extra, of another type or out of range. +AttentionPagedUnifiedLaunchInputs readAttentionPagedUnifiedLaunchInputs( + const hipdnn_plugin_sdk::ingestor::SavedLaunchInputs& inputs); + +} // namespace hip_kernel_provider::kernel_ingestor_engine + +#endif // HIPDNN_ENABLE_KERNEL_INGESTOR diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index 8131c9e9572a..124d3cdcd109 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -43,7 +43,10 @@ #include "core/Handle.hpp" #include "engines/asm_sdpa_engine/plans/SdpaPlanUtils.hpp" #include "engines/kernel_ingestor_engine/IngestorKernelCode.hpp" +#include "engines/kernel_ingestor_engine/IngestorLaunchRestore.hpp" #include "engines/kernel_ingestor_engine/IngestorPacks.hpp" +#include "engines/kernel_ingestor_engine/IngestorPreparedDispatch.hpp" +#include "engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp" #include "engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp" #include "engines/kernel_ingestor_engine/packs/SdpaGraphMatch.hpp" @@ -127,9 +130,10 @@ constexpr std::string_view PAGE_TABLE_V_TOKEN = "attention_paged_unified.page_ta constexpr std::string_view SEQ_LEN_KV_TOKEN = "attention_paged_unified.seq_len_kv.uid"; /// UID of seq_len_q. constexpr std::string_view SEQ_LEN_Q_TOKEN = "attention_paged_unified.seq_len_q.uid"; -/// UID of the ragged offset table Q and O share, or NO_UID for a dense Q. +/// UID of the ragged offset table Q and O share, or ATTENTION_PAGED_UNIFIED_NO_UID for a +/// dense Q. constexpr std::string_view RAGGED_OFFSET_TOKEN = "attention_paged_unified.ragged_offset.uid"; -/// UID of the sink_token tensor, or NO_UID. +/// UID of the sink_token tensor, or ATTENTION_PAGED_UNIFIED_NO_UID. constexpr std::string_view SINK_TOKEN = "attention_paged_unified.sink.uid"; constexpr std::string_view SCALE_BITS_TOKEN = "attention_paged_unified.scale_bits"; /// The kernel's sliding_window argument: `d - k < window` keeps key k for diagonal d. @@ -139,7 +143,6 @@ constexpr std::string_view HEAD_SIZE_TOKEN = "attention_paged_unified.head_size" constexpr std::string_view BLOCK_SIZE_TOKEN = "attention_paged_unified.block_size"; constexpr std::string_view QUERIES_PER_KV_TOKEN = "attention_paged_unified.queries_per_kv"; -constexpr int64_t NO_UID = -1; /// Integer codes for the bound dtype. constexpr int64_t DTYPE_FP16 = 1; constexpr int64_t DTYPE_BF16 = 2; @@ -218,6 +221,13 @@ std::optional checkedSum(std::initializer_list terms) return sum; } +/// The attn_scale values this engine serves: every finite float. graph_match and the +/// saved-plan reader share it, so every plan the engine builds also loads. +bool isServedAttentionScale(float scale) +{ + return std::isfinite(scale); +} + constexpr DeclinedBy declined(std::string_view cause) { return DeclinedBy{ATTENTION_PAGED_UNIFIED_ENGINE_NAME, cause}; @@ -502,7 +512,8 @@ std::optional graphMatches(const MatchContext& context) return std::nullopt; } const bool qRagged = raggedQuery->ragged; - const int64_t raggedOffsetUid = qRagged ? raggedQuery->offsetsUid : NO_UID; + const int64_t raggedOffsetUid + = qRagged ? raggedQuery->offsetsUid : ATTENTION_PAGED_UNIFIED_NO_UID; if(!queryOperandOk("Q", *q, qRagged) || !queryOperandOk("O", *o, qRagged)) { return std::nullopt; @@ -656,7 +667,7 @@ std::optional graphMatches(const MatchContext& context) { return std::nullopt; } - const int64_t sinkUid = sink->present ? sink->uid : NO_UID; + const int64_t sinkUid = sink->present ? sink->uid : ATTENTION_PAGED_UNIFIED_NO_UID; if(attributes.descale_q_tensor_uid().has_value() || attributes.descale_k_tensor_uid().has_value() || attributes.descale_v_tensor_uid().has_value() @@ -692,7 +703,7 @@ std::optional graphMatches(const MatchContext& context) } // Absent attn_scale_value means 1.0 (cuDNN's default). const float scale = attributes.attn_scale_value().value_or(1.0F); - if(!std::isfinite(scale)) + if(!isServedAttentionScale(scale)) { return decline("scale", reason("attn_scale ", scale, " is not finite")); } @@ -837,7 +848,7 @@ bool kernelMatches(const MatchContext& /*context*/, } // An absent use_sinks is the KMD default 0. A sink object without a sink would read // a null sink_ptr; a plain object with a sink would drop it. - const int64_t wantSinks = *sinkUid != NO_UID ? 1 : 0; + const int64_t wantSinks = *sinkUid != ATTENTION_PAGED_UNIFIED_NO_UID ? 1 : 0; return stringMetadata(kernel, DTYPE_FIELD) == std::string(dataTypeName(*dtype)) && integerMetadata(kernel, HEAD_SIZE_FIELD) == *headSize && integerMetadata(kernel, BLOCK_SIZE_FIELD) == *blockSize @@ -877,47 +888,22 @@ std::vector kernelSignature() return signature; } -/// Every by-value launch argument, resolved once at prepare(). -struct LaunchScalars -{ - float scale = 0.0F; - int32_t numSeqs = 0; - int32_t blockTableStride = 0; - int32_t numQueryHeads = 0; - int32_t numKvHeads = 0; - int32_t slidingWindow = 0; - int32_t qUniformLen = 0; - QueryLayout q; - QueryLayout o; - int32_t kvBlockStride = 0; - int32_t kvTokStride = 0; - int32_t kvHeadStride = 0; - int32_t kvBlockSpanBytes = 0; - int32_t qBlockGrid = 0; -}; - -struct BoundUids -{ - int64_t q = 0; - int64_t k = 0; - int64_t v = 0; - int64_t o = 0; - int64_t pageTableK = 0; - int64_t pageTableV = 0; - int64_t seqLenKv = 0; - int64_t seqLenQ = 0; - int64_t raggedOffset = NO_UID; - int64_t sink = NO_UID; -}; +/// Every by-value launch argument, resolved once at prepare() or read from a saved plan. +using LaunchScalars = AttentionPagedUnifiedScalars; +using BoundUids = AttentionPagedUnifiedUids; -class PreparedAttentionPagedUnified : public PreparedDispatch +class PreparedAttentionPagedUnified : public IngestorPreparedDispatch { public: - PreparedAttentionPagedUnified(IngestorKernelCode code, BoundUids uids, LaunchScalars scalars) + PreparedAttentionPagedUnified(IngestorKernelCode code, AttentionPagedUnifiedLaunchInputs launch) : _code(std::move(code)) - , _uids(uids) - , _scalars(scalars) + , _launch(launch) + { + } + + const IngestorKernelCode& kernelCode() const override { + return _code; } compilation::IRunnableKernel& kernelForStream(hipStream_t stream) const @@ -925,22 +911,39 @@ class PreparedAttentionPagedUnified : public PreparedDispatch return _code.kernelForStream(stream); } + const AttentionPagedUnifiedLaunchInputs& launchInputs() const + { + return _launch; + } + const BoundUids& uids() const { - return _uids; + return _launch.uids; } const LaunchScalars& scalars() const { - return _scalars; + return _launch.scalars; } private: IngestorKernelCode _code; - BoundUids _uids; - LaunchScalars _scalars; + AttentionPagedUnifiedLaunchInputs _launch; }; +/// Applies the launch geometry to @p code and builds the prepared dispatch. A plan built +/// from a graph and a plan restored from a saved payload both come through here. +std::unique_ptr + makePreparedAttentionPagedUnified(IngestorKernelCode code, + const AttentionPagedUnifiedLaunchInputs& launch) +{ + code.setBlockSize(static_cast(launch.blockThreads), 1, 1); + code.setGridSize(static_cast(launch.scalars.numKvHeads), + static_cast(launch.scalars.qBlockGrid), + 1); + return std::make_unique(std::move(code), launch); +} + int32_t narrow(int64_t value, std::string_view what) { if(value < std::numeric_limits::min() || value > INT32_LIMIT) @@ -1008,7 +1011,7 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler(std::min(std::max(gridY, 1), MAX_GRID_Y)); auto code = buildIngestorKernelCode(_loader, context, kernel, kernelSignature()); - code.setBlockSize(static_cast(geometry->threads), 1, 1); - code.setGridSize( - static_cast(numKvHeads), static_cast(s.qBlockGrid), 1); - return std::make_unique(std::move(code), uids, s); + return makePreparedAttentionPagedUnified( + std::move(code), + AttentionPagedUnifiedLaunchInputs{ + uids, s, narrow(geometry->threads, "threads per block")}); + } + + std::unique_ptr restoreLaunch(const SavedLaunchInputs& inputs, + SavedKernelCode code, + int deviceOrdinal) const override + { + auto restored = restoreIngestorLaunch( + inputs, + std::move(code), + kernelSignature(), + &readAttentionPagedUnifiedLaunchInputs, + deviceOrdinal); + return makePreparedAttentionPagedUnified(std::move(restored.code), restored.launch); + } + + std::optional + saveLaunchInputs(const PreparedDispatch& prepared) const override + { + const auto& p = dynamic_cast(prepared); + return SavedLaunchInputs{std::string(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1), + attentionPagedUnifiedLaunchValues(p.launchInputs())}; + } + + bool supportsSaving() const override + { + return true; } void launch(const Handle& handle, @@ -1095,11 +1120,13 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler(s.q.seqStride), - static_cast(s.q.tokenStride), - static_cast(s.q.headStride), - static_cast(s.o.seqStride), - static_cast(s.o.tokenStride), - static_cast(s.o.headStride), + s.q.seqStride, + s.q.tokenStride, + s.q.headStride, + s.o.seqStride, + s.o.tokenStride, + s.o.headStride, s.kvBlockStride, s.kvTokStride, s.kvHeadStride, @@ -1153,6 +1180,157 @@ compilation::KpackModuleCache& moduleCache() } // namespace +MetadataValues attentionPagedUnifiedLaunchValues(const AttentionPagedUnifiedLaunchInputs& launch) +{ + const auto& u = launch.uids; + const auto& s = launch.scalars; + const auto value = [](std::string_view name, int64_t number) { + return std::pair{std::string(name), number}; + }; + return {value(ATTENTION_PAGED_UNIFIED_Q_UID_VALUE, u.q), + value(ATTENTION_PAGED_UNIFIED_K_UID_VALUE, u.k), + value(ATTENTION_PAGED_UNIFIED_V_UID_VALUE, u.v), + value(ATTENTION_PAGED_UNIFIED_O_UID_VALUE, u.o), + value(ATTENTION_PAGED_UNIFIED_PAGE_TABLE_K_UID_VALUE, u.pageTableK), + value(ATTENTION_PAGED_UNIFIED_PAGE_TABLE_V_UID_VALUE, u.pageTableV), + value(ATTENTION_PAGED_UNIFIED_SEQ_LEN_KV_UID_VALUE, u.seqLenKv), + value(ATTENTION_PAGED_UNIFIED_SEQ_LEN_Q_UID_VALUE, u.seqLenQ), + value(ATTENTION_PAGED_UNIFIED_RAGGED_OFFSET_UID_VALUE, u.raggedOffset), + value(ATTENTION_PAGED_UNIFIED_SINK_UID_VALUE, u.sink), + {std::string(ATTENTION_PAGED_UNIFIED_SCALE_VALUE), static_cast(s.scale)}, + value(ATTENTION_PAGED_UNIFIED_NUM_SEQS_VALUE, s.numSeqs), + value(ATTENTION_PAGED_UNIFIED_BLOCK_TABLE_STRIDE_VALUE, s.blockTableStride), + value(ATTENTION_PAGED_UNIFIED_NUM_QUERY_HEADS_VALUE, s.numQueryHeads), + value(ATTENTION_PAGED_UNIFIED_NUM_KV_HEADS_VALUE, s.numKvHeads), + value(ATTENTION_PAGED_UNIFIED_SLIDING_WINDOW_VALUE, s.slidingWindow), + value(ATTENTION_PAGED_UNIFIED_Q_UNIFORM_LEN_VALUE, s.qUniformLen), + value(ATTENTION_PAGED_UNIFIED_Q_SEQ_STRIDE_VALUE, s.q.seqStride), + value(ATTENTION_PAGED_UNIFIED_Q_TOK_STRIDE_VALUE, s.q.tokenStride), + value(ATTENTION_PAGED_UNIFIED_Q_HEAD_STRIDE_VALUE, s.q.headStride), + value(ATTENTION_PAGED_UNIFIED_O_SEQ_STRIDE_VALUE, s.o.seqStride), + value(ATTENTION_PAGED_UNIFIED_O_TOK_STRIDE_VALUE, s.o.tokenStride), + value(ATTENTION_PAGED_UNIFIED_O_HEAD_STRIDE_VALUE, s.o.headStride), + value(ATTENTION_PAGED_UNIFIED_KV_BLOCK_STRIDE_VALUE, s.kvBlockStride), + value(ATTENTION_PAGED_UNIFIED_KV_TOK_STRIDE_VALUE, s.kvTokStride), + value(ATTENTION_PAGED_UNIFIED_KV_HEAD_STRIDE_VALUE, s.kvHeadStride), + value(ATTENTION_PAGED_UNIFIED_KV_BLOCK_SPAN_BYTES_VALUE, s.kvBlockSpanBytes), + value(ATTENTION_PAGED_UNIFIED_Q_BLOCK_GRID_VALUE, s.qBlockGrid), + value(ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE, launch.blockThreads)}; +} + +AttentionPagedUnifiedLaunchInputs + readAttentionPagedUnifiedLaunchInputs(const SavedLaunchInputs& inputs) +{ + requireLaunchContract(inputs, ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1); + requireOnlyLaunchValues(inputs, + {ATTENTION_PAGED_UNIFIED_Q_UID_VALUE, + ATTENTION_PAGED_UNIFIED_K_UID_VALUE, + ATTENTION_PAGED_UNIFIED_V_UID_VALUE, + ATTENTION_PAGED_UNIFIED_O_UID_VALUE, + ATTENTION_PAGED_UNIFIED_PAGE_TABLE_K_UID_VALUE, + ATTENTION_PAGED_UNIFIED_PAGE_TABLE_V_UID_VALUE, + ATTENTION_PAGED_UNIFIED_SEQ_LEN_KV_UID_VALUE, + ATTENTION_PAGED_UNIFIED_SEQ_LEN_Q_UID_VALUE, + ATTENTION_PAGED_UNIFIED_RAGGED_OFFSET_UID_VALUE, + ATTENTION_PAGED_UNIFIED_SINK_UID_VALUE, + ATTENTION_PAGED_UNIFIED_SCALE_VALUE, + ATTENTION_PAGED_UNIFIED_NUM_SEQS_VALUE, + ATTENTION_PAGED_UNIFIED_BLOCK_TABLE_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_NUM_QUERY_HEADS_VALUE, + ATTENTION_PAGED_UNIFIED_NUM_KV_HEADS_VALUE, + ATTENTION_PAGED_UNIFIED_SLIDING_WINDOW_VALUE, + ATTENTION_PAGED_UNIFIED_Q_UNIFORM_LEN_VALUE, + ATTENTION_PAGED_UNIFIED_Q_SEQ_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_Q_TOK_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_Q_HEAD_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_O_SEQ_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_O_TOK_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_O_HEAD_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_KV_BLOCK_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_KV_TOK_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_KV_HEAD_STRIDE_VALUE, + ATTENTION_PAGED_UNIFIED_KV_BLOCK_SPAN_BYTES_VALUE, + ATTENTION_PAGED_UNIFIED_Q_BLOCK_GRID_VALUE, + ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE}); + + const auto refuse = [&inputs](std::string_view name, const std::string& rule) { + serialization::refuseIngestorPlan(serialization::IngestorPlanRefusal::INCOMPATIBLE, + "launch value '" + std::string(name) + "' of dispatch '" + + inputs.dispatchSymbol + "' must be " + rule); + }; + // Every by-value argument is a kernel int32. + const auto int32 = [&inputs](std::string_view name, int64_t lowest, int64_t highest) { + return static_cast(requireLaunchInt(inputs, name, lowest, highest)); + }; + const auto stride = [&int32](std::string_view name) { return int32(name, 0, INT32_LIMIT); }; + + AttentionPagedUnifiedLaunchInputs launch; + auto& u = launch.uids; + u.q = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_Q_UID_VALUE); + u.k = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_K_UID_VALUE); + u.v = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_V_UID_VALUE); + u.o = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_O_UID_VALUE); + u.pageTableK = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_PAGE_TABLE_K_UID_VALUE); + u.pageTableV = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_PAGE_TABLE_V_UID_VALUE); + u.seqLenKv = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_SEQ_LEN_KV_UID_VALUE); + u.seqLenQ = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_SEQ_LEN_Q_UID_VALUE); + u.raggedOffset = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_RAGGED_OFFSET_UID_VALUE); + u.sink = requireLaunchInt(inputs, ATTENTION_PAGED_UNIFIED_SINK_UID_VALUE); + const bool ragged = u.raggedOffset != ATTENTION_PAGED_UNIFIED_NO_UID; + + auto& s = launch.scalars; + // A double that is not a float value was not written from the float the kernel takes. + const double scale = requireLaunchDouble(inputs, ATTENTION_PAGED_UNIFIED_SCALE_VALUE); + constexpr auto FLOAT_MAX = static_cast(std::numeric_limits::max()); + const bool isFloat = std::isfinite(scale) && std::abs(scale) <= FLOAT_MAX + && static_cast(static_cast(scale)) == scale; + if(!isFloat || !isServedAttentionScale(static_cast(scale))) + { + refuse(ATTENTION_PAGED_UNIFIED_SCALE_VALUE, + "a finite float value, and the plan holds " + std::to_string(scale)); + } + s.scale = static_cast(scale); + + // The ragged sequence search takes its trip count from num_seqs at run time. + s.numSeqs = int32(ATTENTION_PAGED_UNIFIED_NUM_SEQS_VALUE, 1, INT32_LIMIT); + s.blockTableStride = stride(ATTENTION_PAGED_UNIFIED_BLOCK_TABLE_STRIDE_VALUE); + s.numQueryHeads = int32(ATTENTION_PAGED_UNIFIED_NUM_QUERY_HEADS_VALUE, 1, INT32_LIMIT); + s.numKvHeads = int32(ATTENTION_PAGED_UNIFIED_NUM_KV_HEADS_VALUE, 1, INT32_LIMIT); + if(s.numQueryHeads % s.numKvHeads != 0) + { + refuse(ATTENTION_PAGED_UNIFIED_NUM_QUERY_HEADS_VALUE, + "a multiple of '" + std::string(ATTENTION_PAGED_UNIFIED_NUM_KV_HEADS_VALUE) + + "', and the plan holds " + std::to_string(s.numQueryHeads) + " and " + + std::to_string(s.numKvHeads)); + } + s.slidingWindow = int32(ATTENTION_PAGED_UNIFIED_SLIDING_WINDOW_VALUE, 1, NO_WINDOW); + // A dense Q has Sq rows per sequence; a ragged Q reads its rows from the offsets. + s.qUniformLen = ragged ? int32(ATTENTION_PAGED_UNIFIED_Q_UNIFORM_LEN_VALUE, 0, 0) + : int32(ATTENTION_PAGED_UNIFIED_Q_UNIFORM_LEN_VALUE, 1, INT32_LIMIT); + s.q = {stride(ATTENTION_PAGED_UNIFIED_Q_SEQ_STRIDE_VALUE), + stride(ATTENTION_PAGED_UNIFIED_Q_TOK_STRIDE_VALUE), + stride(ATTENTION_PAGED_UNIFIED_Q_HEAD_STRIDE_VALUE)}; + s.o = {stride(ATTENTION_PAGED_UNIFIED_O_SEQ_STRIDE_VALUE), + stride(ATTENTION_PAGED_UNIFIED_O_TOK_STRIDE_VALUE), + stride(ATTENTION_PAGED_UNIFIED_O_HEAD_STRIDE_VALUE)}; + s.kvBlockStride = stride(ATTENTION_PAGED_UNIFIED_KV_BLOCK_STRIDE_VALUE); + s.kvTokStride = stride(ATTENTION_PAGED_UNIFIED_KV_TOK_STRIDE_VALUE); + s.kvHeadStride = stride(ATTENTION_PAGED_UNIFIED_KV_HEAD_STRIDE_VALUE); + s.kvBlockSpanBytes + = int32(ATTENTION_PAGED_UNIFIED_KV_BLOCK_SPAN_BYTES_VALUE, 1, MAX_BLOCK_SPAN_BYTES); + s.qBlockGrid = int32(ATTENTION_PAGED_UNIFIED_Q_BLOCK_GRID_VALUE, 1, MAX_GRID_Y); + + // The CTA is whole waves, at most the 1024 threads a HIP block holds. + launch.blockThreads = int32(ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE, WAVE_LANES, 1024); + if(launch.blockThreads % WAVE_LANES != 0) + { + refuse(ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE, + "a multiple of " + std::to_string(WAVE_LANES) + ", and the plan holds " + + std::to_string(launch.blockThreads)); + } + return launch; +} + void resetAttentionPagedUnifiedModuleCache() { moduleCache().clear(); @@ -1166,7 +1344,10 @@ void registerAttentionPagedUnifiedSymbols(SymbolScope& scope) scope.add(std::string(GFX942_MATCHER_SYMBOL), &gfx942PackMatches); scope.add(std::string(GFX950_MATCHER_SYMBOL), &gfx950PackMatches); scope.add(std::string(KERNEL_MATCHER_SYMBOL), &kernelMatches); + // The UDD's unversioned name dispatches the catalog; saved plans carry the versioned + // name of their launch-value contract. One handler serves both. scope.add(std::string(DISPATCH_SYMBOL), &s_handler); + scope.add(std::string(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1), &s_handler); } } // namespace hip_kernel_provider::kernel_ingestor_engine diff --git a/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp b/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp index ba36bd8f7798..5c262530fa7a 100644 --- a/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp +++ b/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp @@ -14,11 +14,13 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -28,17 +30,21 @@ #include #include +#include "IngestorIntegrationSupport.hpp" + /** * @file IntegrationGpuAttentionPagedUnified.cpp * @brief End-to-end runs of hipkernel:AttentionPagedUnified through the hipDNN frontend: * paged uniform decode (dense Q), ragged Q over paged K/V (mixed decode and - * chunked prefill, a first origin past 0), sliding windows, separate K and V page - * tables, attention sinks, and HIP-graph capture/replay with changed sequence - * lengths, block ids and data. Every output is compared with a host gather-then-dense - * fp32 reference over the same page tables, which is itself checked against hipDNN's - * CPU SDPA reference. A dense Q's rows past seq_len_q, and rows with no visible key, - * must be zero (SdpaSemanticsRegister SEM-008, SEM-010); a ragged Q's rows past - * seq_len_q belong to no sequence (RFC 0014) and must keep their contents. + * chunked prefill, a first origin past 0), sliding windows, + * separate K and V page tables, attention sinks, + * HIP-graph capture/replay with changed sequence lengths, block ids and data, and + * saved plans restored into a fresh handle. Every output is compared with a host + * gather-then-dense fp32 reference over the same page tables, which is itself + * checked against hipDNN's CPU SDPA reference. A dense Q's rows past seq_len_q, + * and rows with no visible key, must be zero (SdpaSemanticsRegister SEM-008, + * SEM-010); a ragged Q's rows past seq_len_q belong to no sequence (RFC 0014) and + * must keep their contents. * * Set HIPDNN_TEST_EXPECTED_ARCH=gfx942 (or gfx950) on required runs so a missing or * different device fails instead of skipping. @@ -51,6 +57,9 @@ using namespace hipdnn_frontend::graph; constexpr const char* ENGINE = "hipkernel:AttentionPagedUnified"; +namespace ingestor_it = hip_kernel_provider::kernel_ingestor_engine::integration; +using ingestor_it::SaveForm; + uint16_t toBits(float x, DataType type) { if(type == DataType::BFLOAT16) @@ -1057,6 +1066,137 @@ TEST_F(IntegrationGpuAttentionPagedUnified, HipGraphCaptureReplaysWithChangedLen } } +/// Saved plans: the engine saves the kernel's code object and its launch values, and a +/// plan loaded into a fresh handle (a new provider container, no module cache) launches +/// the same kernel with the same arguments. +class IntegrationGpuAttentionPagedUnifiedSaveLoad : public IntegrationGpuAttentionPagedUnified +{ +protected: + std::vector readOutput(const Built& built) + { + std::vector out(built.oBytes / 2); + EXPECT_EQ( + hipMemcpyAsync( + out.data(), built.buffers.at(O), built.oBytes, hipMemcpyDeviceToHost, _stream), + hipSuccess); + EXPECT_EQ(hipStreamSynchronize(_stream), hipSuccess); + return out; + } + + /// Builds and runs @p p, saves the plan in @p form, destroys the graph and the handle, + /// loads the plan into a fresh handle and runs it on the same buffers and inputs. The + /// loaded plan's output must pass the same reference check and equal the original + /// plan's output bit for bit. + void roundTripInAFreshHandle(const Problem& p, SaveForm form) + { + Built built; + build(p, built); + if(::testing::Test::HasFatalFailure() || ::testing::Test::IsSkipped()) + { + return; + } + const int64_t engineId = hipdnn_data_sdk::utilities::engineNameToId(ENGINE); + std::vector notes; + ASSERT_TRUE(ok(built.graph->get_behavior_notes_for_engine(engineId, notes))); + ASSERT_NE(std::find(notes.begin(), + notes.end(), + BehaviorNote::SUPPORTS_EXECUTION_PLAN_SERIALIZATION), + notes.end()); + + const auto state = makeState(p, p.seed); + upload(p, state, built); + ASSERT_TRUE(ok(built.graph->execute(_handle, built.buffers, nullptr))); + ASSERT_NO_FATAL_FAILURE(check(p, state, built)); + const auto original = readOutput(built); + + std::vector saved; + { + auto save = ingestor_it::detail::saveInForm(*built.graph, form); + ASSERT_TRUE(ok(save.second)); + saved = std::move(save.first); + } + if(form == SaveForm::GRAPH_AND_PLAN) + { + int contents = 0; + ASSERT_EQ( + hipdnnBackendGetSerializedBinaryContents_ext(saved.data(), saved.size(), &contents), + HIPDNN_STATUS_SUCCESS); + ASSERT_NE(contents & HIPDNN_SERIALIZED_CONTENT_EXECUTION_PLAN, 0) + << "the saved graph holds no execution plan"; + } + + built.graph.reset(); + ASSERT_NO_FATAL_FAILURE(ingestor_it::detail::replaceHandleWithAFreshOne(_handle, _stream)); + + auto loaded = std::make_shared(); + ASSERT_TRUE(ok(ingestor_it::detail::loadInForm(*loaded, _handle, saved, form))); + int64_t loadedEngineId = 0; + ASSERT_TRUE(ok(loaded->get_execution_plan_engine_id(loadedEngineId))); + EXPECT_EQ(loadedEngineId, engineId); + int64_t workspace = -1; + ASSERT_TRUE(ok(loaded->get_workspace_size(workspace))); + EXPECT_EQ(workspace, 0); + + // upload() poisons O again, so the comparison sees only what the loaded plan wrote. + upload(p, state, built); + ASSERT_TRUE(ok(loaded->execute(_handle, built.buffers, nullptr))); + ASSERT_NO_FATAL_FAILURE(check(p, state, built)); + EXPECT_TRUE(readOutput(built) == original) + << "the loaded plan's output differs from the original plan's"; + } + + void roundTripInBothForms(const Problem& p) + { + for(const SaveForm form : {SaveForm::GRAPH_AND_PLAN, SaveForm::PLAN_ONLY}) + { + SCOPED_TRACE(form == SaveForm::GRAPH_AND_PLAN ? "graph and plan" : "plan only"); + roundTripInAFreshHandle(p, form); + if(::testing::Test::HasFatalFailure() || ::testing::Test::IsSkipped()) + { + return; + } + } + } +}; + +TEST_F(IntegrationGpuAttentionPagedUnifiedSaveLoad, RestoresPagedUniformDecode) +{ + roundTripInBothForms(decodeProblem(DataType::BFLOAT16)); +} + +TEST_F(IntegrationGpuAttentionPagedUnifiedSaveLoad, RestoresSpeculativeDecodeRowsHalf) +{ + Problem p = decodeProblem(DataType::HALF); + p.denseQueryLength = 3; + p.queryLengths = {3, 1, 3, 2, 0, 3}; + roundTripInBothForms(p); +} + +TEST_F(IntegrationGpuAttentionPagedUnifiedSaveLoad, RestoresRaggedQueryOverPagedKvWithWindow) +{ + Problem p = mixedProblem(DataType::BFLOAT16); + p.leftBound = 32; + roundTripInBothForms(p); +} + +TEST_F(IntegrationGpuAttentionPagedUnifiedSaveLoad, RestoresSeparateKAndVPageTables) +{ + Problem dense = decodeProblem(DataType::BFLOAT16); + dense.separateVTable = true; + roundTripInBothForms(dense); + + Problem ragged = mixedProblem(DataType::HALF); + ragged.separateVTable = true; + roundTripInBothForms(ragged); +} + +TEST_F(IntegrationGpuAttentionPagedUnifiedSaveLoad, RestoresAttentionSinks) +{ + Problem p = mixedProblem(DataType::BFLOAT16); + p.sinks = true; + roundTripInBothForms(p); +} + } // namespace #endif diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt index 956ceb44796d..5773e042458c 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/CMakeLists.txt @@ -40,6 +40,7 @@ target_sources(hip_kernel_provider_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950ConvDgradGeometry.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestGfx950ConvDgradMatchers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestAttentionPagedUnifiedMatchers.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestAttentionPagedUnifiedLaunchValues.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestIngestorDispatchAliases.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packs/TestPackLaunchValues.cpp ${CMAKE_CURRENT_SOURCE_DIR}/serialization/TestIngestorPlanHeader.cpp diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp new file mode 100644 index 000000000000..8284011e6290 --- /dev/null +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp @@ -0,0 +1,357 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#ifdef HIPDNN_ENABLE_KERNEL_INGESTOR + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp" +#include "engines/kernel_ingestor_engine/serialization/IngestorPlanTestUtilities.hpp" + +/** + * @file TestAttentionPagedUnifiedLaunchValues.cpp + * @brief The saved launch values of hipkernel:AttentionPagedUnified: every member of the + * launch state maps to the value of its own name and type, reads back unchanged + * for each binding the engine serves (dense, ragged, separate K and V page tables, + * sinks), and the reader refuses values outside the v1 contract. No device needed. + * + * Each member gets a distinct value, so a swapped or dropped mapping shows. The expected + * names are written out again here: they are the stored contract, and a test that shared + * the constants would not see a rename. + */ +namespace hip_kernel_provider::kernel_ingestor_engine +{ +namespace +{ + +using hipdnn_plugin_sdk::ingestor::MetadataType; +using hipdnn_plugin_sdk::ingestor::MetadataValues; +using hipdnn_plugin_sdk::ingestor::SavedLaunchInputs; +using hipdnn_plugin_sdk::ingestor::toString; +using serialization::expectCommonReadRefusals; + +constexpr int64_t NO_UID = ATTENTION_PAGED_UNIFIED_NO_UID; + +/// A dense (uniform decode) binding: one page table for K and V, no sink. +AttentionPagedUnifiedLaunchInputs denseInputs() +{ + AttentionPagedUnifiedLaunchInputs launch; + launch.uids.q = 101; + launch.uids.k = 102; + launch.uids.v = 103; + launch.uids.o = 104; + launch.uids.pageTableK = 105; + launch.uids.pageTableV = 105; + launch.uids.seqLenKv = 107; + launch.uids.seqLenQ = 108; + launch.uids.raggedOffset = NO_UID; + launch.uids.sink = NO_UID; + auto& s = launch.scalars; + s.scale = 1.0F / std::sqrt(128.0F); + s.numSeqs = 6; + s.blockTableStride = 24; + s.numQueryHeads = 32; + s.numKvHeads = 8; + s.slidingWindow = 0x3FFFFFFF; + s.qUniformLen = 3; + s.q = {12288, 4096, 128}; + s.o = {12416, 4224, 136}; + s.kvBlockStride = 65536; + s.kvTokStride = 256; + s.kvHeadStride = 8192; + s.kvBlockSpanBytes = 131072; + s.qBlockGrid = 18; + launch.blockThreads = 256; + return launch; +} + +/// A ragged Q over paged K/V with a sliding window. +AttentionPagedUnifiedLaunchInputs raggedInputs() +{ + auto launch = denseInputs(); + launch.uids.raggedOffset = 109; + launch.scalars.numSeqs = 5; + launch.scalars.qUniformLen = 0; + launch.scalars.slidingWindow = 33; + launch.scalars.q = {4096, 4096, 128}; + launch.scalars.o = {4224, 4224, 136}; + launch.scalars.qBlockGrid = 21; + return launch; +} + +/// Separate page_table_k and page_table_v tensors. +AttentionPagedUnifiedLaunchInputs separateTablesInputs() +{ + auto launch = denseInputs(); + launch.uids.pageTableV = 110; + return launch; +} + +/// An attention sink in the I/O dtype. +AttentionPagedUnifiedLaunchInputs sinkInputs() +{ + auto launch = raggedInputs(); + launch.uids.sink = 111; + launch.blockThreads = 128; + return launch; +} + +SavedLaunchInputs saved(const AttentionPagedUnifiedLaunchInputs& launch) +{ + return {std::string(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1), + attentionPagedUnifiedLaunchValues(launch)}; +} + +uint32_t bitsOf(float value) +{ + uint32_t bits = 0; + std::memcpy(&bits, &value, sizeof(bits)); + return bits; +} + +void expectSameLaunch(const AttentionPagedUnifiedLaunchInputs& read, + const AttentionPagedUnifiedLaunchInputs& expected) +{ + EXPECT_EQ(read.uids.q, expected.uids.q); + EXPECT_EQ(read.uids.k, expected.uids.k); + EXPECT_EQ(read.uids.v, expected.uids.v); + EXPECT_EQ(read.uids.o, expected.uids.o); + EXPECT_EQ(read.uids.pageTableK, expected.uids.pageTableK); + EXPECT_EQ(read.uids.pageTableV, expected.uids.pageTableV); + EXPECT_EQ(read.uids.seqLenKv, expected.uids.seqLenKv); + EXPECT_EQ(read.uids.seqLenQ, expected.uids.seqLenQ); + EXPECT_EQ(read.uids.raggedOffset, expected.uids.raggedOffset); + EXPECT_EQ(read.uids.sink, expected.uids.sink); + const auto& r = read.scalars; + const auto& e = expected.scalars; + EXPECT_EQ(bitsOf(r.scale), bitsOf(e.scale)); + EXPECT_EQ(r.numSeqs, e.numSeqs); + EXPECT_EQ(r.blockTableStride, e.blockTableStride); + EXPECT_EQ(r.numQueryHeads, e.numQueryHeads); + EXPECT_EQ(r.numKvHeads, e.numKvHeads); + EXPECT_EQ(r.slidingWindow, e.slidingWindow); + EXPECT_EQ(r.qUniformLen, e.qUniformLen); + EXPECT_EQ(r.q.seqStride, e.q.seqStride); + EXPECT_EQ(r.q.tokenStride, e.q.tokenStride); + EXPECT_EQ(r.q.headStride, e.q.headStride); + EXPECT_EQ(r.o.seqStride, e.o.seqStride); + EXPECT_EQ(r.o.tokenStride, e.o.tokenStride); + EXPECT_EQ(r.o.headStride, e.o.headStride); + EXPECT_EQ(r.kvBlockStride, e.kvBlockStride); + EXPECT_EQ(r.kvTokStride, e.kvTokStride); + EXPECT_EQ(r.kvHeadStride, e.kvHeadStride); + EXPECT_EQ(r.kvBlockSpanBytes, e.kvBlockSpanBytes); + EXPECT_EQ(r.qBlockGrid, e.qBlockGrid); + EXPECT_EQ(read.blockThreads, expected.blockThreads); +} + +// Expects the reader to refuse `inputs` as a valid plan that cannot be restored, with +// `phrase` in the message. +void expectRefusal(const SavedLaunchInputs& inputs, const std::string& phrase) +{ + serialization::expectReadRefusal(&readAttentionPagedUnifiedLaunchInputs, inputs, phrase); +} + +SavedLaunchInputs with(SavedLaunchInputs inputs, + const std::string& name, + hipdnn_plugin_sdk::ingestor::MetadataValue value) +{ + inputs.values[name] = std::move(value); + return inputs; +} + +TEST(TestAttentionPagedUnifiedLaunchValues, ValuesMatchTheV1Contract) +{ + const auto launch = denseInputs(); + + const MetadataValues values = attentionPagedUnifiedLaunchValues(launch); + + const MetadataValues expected{{"q.uid", int64_t{101}}, + {"k.uid", int64_t{102}}, + {"v.uid", int64_t{103}}, + {"o.uid", int64_t{104}}, + {"page_table_k.uid", int64_t{105}}, + {"page_table_v.uid", int64_t{105}}, + {"seq_len_kv.uid", int64_t{107}}, + {"seq_len_q.uid", int64_t{108}}, + {"ragged_offset.uid", int64_t{-1}}, + {"sink.uid", int64_t{-1}}, + {"scale", static_cast(launch.scalars.scale)}, + {"num_seqs", int64_t{6}}, + {"block_table_stride", int64_t{24}}, + {"num_query_heads", int64_t{32}}, + {"num_kv_heads", int64_t{8}}, + {"sliding_window", int64_t{0x3FFFFFFF}}, + {"q_uniform_len", int64_t{3}}, + {"q_seq_stride", int64_t{12288}}, + {"q_tok_stride", int64_t{4096}}, + {"q_head_stride", int64_t{128}}, + {"o_seq_stride", int64_t{12416}}, + {"o_tok_stride", int64_t{4224}}, + {"o_head_stride", int64_t{136}}, + {"kv_block_stride", int64_t{65536}}, + {"kv_tok_stride", int64_t{256}}, + {"kv_head_stride", int64_t{8192}}, + {"kv_block_span_bytes", int64_t{131072}}, + {"q_block_grid", int64_t{18}}, + {"block_threads", int64_t{256}}}; + EXPECT_EQ(values, expected); + EXPECT_EQ(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1, + "hipkernel.attention_paged_unified.dispatch.v1"); +} + +TEST(TestAttentionPagedUnifiedLaunchValues, DenseInputsRoundTripThroughTheirValues) +{ + expectSameLaunch(readAttentionPagedUnifiedLaunchInputs(saved(denseInputs())), denseInputs()); +} + +TEST(TestAttentionPagedUnifiedLaunchValues, RaggedInputsRoundTripThroughTheirValues) +{ + expectSameLaunch(readAttentionPagedUnifiedLaunchInputs(saved(raggedInputs())), raggedInputs()); +} + +TEST(TestAttentionPagedUnifiedLaunchValues, SeparateKAndVTablesRoundTripThroughTheirValues) +{ + const auto read = readAttentionPagedUnifiedLaunchInputs(saved(separateTablesInputs())); + expectSameLaunch(read, separateTablesInputs()); + EXPECT_NE(read.uids.pageTableK, read.uids.pageTableV); +} + +TEST(TestAttentionPagedUnifiedLaunchValues, SinkInputsRoundTripThroughTheirValues) +{ + expectSameLaunch(readAttentionPagedUnifiedLaunchInputs(saved(sinkInputs())), sinkInputs()); +} + +// graph_match serves every finite attn_scale, so a plan with a zero or negative scale +// saves and must load back. +TEST(TestAttentionPagedUnifiedLaunchValues, ZeroAndNegativeScalesRoundTripThroughTheirValues) +{ + for(const float scale : {0.0F, -0.0F, -0.125F, -std::numeric_limits::max()}) + { + SCOPED_TRACE(scale); + auto launch = denseInputs(); + launch.scalars.scale = scale; + expectSameLaunch(readAttentionPagedUnifiedLaunchInputs(saved(launch)), launch); + } +} + +TEST(TestAttentionPagedUnifiedLaunchValues, RefusesWhatEveryReaderRefuses) +{ + expectCommonReadRefusals(&readAttentionPagedUnifiedLaunchInputs, + saved(denseInputs()), + "hipkernel.attention_paged_unified.dispatch", + "num_seqs"); +} + +TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnotherContractName) +{ + for(const char* name : {"hipkernel.attention_paged_unified.dispatch.v2", + "hipkernel.gfx950_attention_dense.dispatch.v2"}) + { + SCOPED_TRACE(name); + auto inputs = saved(denseInputs()); + inputs.dispatchSymbol = name; + expectRefusal(inputs, "names no launch-value contract"); + } +} + +TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAMissingOptionalOrFloatValue) +{ + for(const char* name : {"sink.uid", "ragged_offset.uid", "scale"}) + { + SCOPED_TRACE(name); + auto missing = saved(denseInputs()); + missing.values.erase(name); + expectRefusal(missing, "needs launch value '" + std::string(name) + "'"); + } +} + +TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAValueOfAnotherType) +{ + const auto valid = saved(denseInputs()); + expectRefusal(with(valid, "k.uid", 102.0), "launch value 'k.uid'"); + + const std::string mustBeFloat + = "must be " + toString(MetadataType::FLOAT) + ", and the plan holds "; + expectRefusal(with(valid, "scale", int64_t{1}), mustBeFloat + toString(MetadataType::INT)); + expectRefusal(with(valid, "scale", std::string("0.088")), + mustBeFloat + toString(MetadataType::STRING)); +} + +TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnIntegerOutsideWhatTheKernelTakes) +{ + const auto dense = saved(denseInputs()); + const auto ragged = saved(raggedInputs()); + struct OutOfRange + { + const SavedLaunchInputs* base; + const char* name; + int64_t value; + }; + const std::vector cases = { + {&dense, "num_seqs", 0}, + {&dense, "num_seqs", int64_t{2147483648}}, + {&dense, "num_query_heads", 0}, + {&dense, "num_kv_heads", 0}, + {&dense, "sliding_window", 0}, + {&dense, "sliding_window", int64_t{0x40000000}}, + {&dense, "q_uniform_len", 0}, // a dense Q has at least one row per sequence + {&dense, "q_uniform_len", -3}, + {&ragged, "q_uniform_len", 1}, // a ragged Q reads its rows from the offsets + {&ragged, "q_uniform_len", -1}, + {&dense, "block_table_stride", -1}, + {&dense, "q_tok_stride", -1}, + {&dense, "o_head_stride", int64_t{2147483648}}, + {&dense, "kv_block_stride", -1}, + {&dense, "kv_block_span_bytes", 0}, + {&dense, "kv_block_span_bytes", int64_t{0x7FFF0001}}, + {&dense, "q_block_grid", 0}, + {&dense, "q_block_grid", 65536}, + {&dense, "block_threads", 32}, + {&dense, "block_threads", 2048}, + }; + for(const auto& c : cases) + { + SCOPED_TRACE(std::string(c.name) + " = " + std::to_string(c.value)); + expectRefusal(with(*c.base, c.name, c.value), "launch value '" + std::string(c.name) + "'"); + } + + // In range, but not a whole number of waves. + expectRefusal(with(dense, "block_threads", int64_t{96}), "a multiple of 64"); + // The query heads must share the KV heads evenly. + expectRefusal(with(dense, "num_query_heads", int64_t{12}), "a multiple of 'num_kv_heads'"); +} + +TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAScaleNoFiniteFloatWasSavedAs) +{ + const auto valid = saved(denseInputs()); + // 0.1 as a double is not a float value, so no float scale was saved as it. + for(const double scale : {0.1, + std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + std::numeric_limits::quiet_NaN(), + 1.0e39, + -1.0e39}) + { + SCOPED_TRACE(scale); + expectRefusal(with(valid, "scale", scale), "launch value 'scale'"); + } +} + +} // namespace +} // namespace hip_kernel_provider::kernel_ingestor_engine + +#endif // HIPDNN_ENABLE_KERNEL_INGESTOR diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp index ee795fd3e2ef..0df62a2b881a 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -487,6 +488,27 @@ TEST(TestAttentionPagedUnifiedMatchers, ServesAnAttentionSinkInTheIoDataType) }).has_value()); } +/// Every finite attn_scale is served, zero and negative ones included; the saved-plan +/// reader takes the same set (TestAttentionPagedUnifiedLaunchValues). +TEST(TestAttentionPagedUnifiedMatchers, ServesEveryFiniteScale) +{ + for(const float scale : {0.0F, -0.125F, 1.0e30F}) + { + SCOPED_TRACE(scale); + EXPECT_TRUE(match(decodeGraph(), [scale](d::GraphT& g) { + attrs(g).attn_scale_value = scale; + }).has_value()); + } + for(const float scale : + {std::numeric_limits::quiet_NaN(), std::numeric_limits::infinity()}) + { + SCOPED_TRACE(scale); + const auto decline = loggedDecline( + decodeGraph(), [scale](d::GraphT& g) { attrs(g).attn_scale_value = scale; }); + EXPECT_EQ(decline.cause, "scale") << decline.detail; + } +} + TEST(TestAttentionPagedUnifiedMatchers, SelectsTheSinkObjectExactlyWhenTheGraphHasASink) { EXPECT_TRUE(kernelMatches(sinkGraph(), sinkKernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4))); diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestIngestorDispatchAliases.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestIngestorDispatchAliases.cpp index 149e96d8bc1d..ee3cdd514bb2 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestIngestorDispatchAliases.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestIngestorDispatchAliases.cpp @@ -12,6 +12,7 @@ #include "core/Handle.hpp" #include "engines/kernel_ingestor_engine/KernelIngestorEngine.hpp" +#include "engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp" #include "engines/kernel_ingestor_engine/packs/ConvFwdLaunchValues.hpp" #include "engines/kernel_ingestor_engine/packs/Gfx942AttentionDenseLaunchValues.hpp" #include "engines/kernel_ingestor_engine/packs/Gfx950AttentionDenseLaunchValues.hpp" @@ -47,6 +48,8 @@ TEST(TestIngestorDispatchAliases, EachVersionedAliasResolvesToTheSameHandler) expectOneHandler("hipkernel.conv_fwd.dispatch", CONV_FWD_DISPATCH_SYMBOL_V1); expectOneHandler("hipkernel.gfx950_attention_dense.dispatch", GFX950_ATTENTION_DENSE_DISPATCH_SYMBOL_V2); + expectOneHandler("hipkernel.attention_paged_unified.dispatch", + ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1); } // A superseded contract keeps its own handler, so a plan saved under it still restores diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestPackLaunchValues.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestPackLaunchValues.cpp index 0c6962d29ae5..60ee042abf94 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestPackLaunchValues.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestPackLaunchValues.cpp @@ -46,6 +46,8 @@ using hipdnn_plugin_sdk::ingestor::MetadataValue; using hipdnn_plugin_sdk::ingestor::MetadataValues; using hipdnn_plugin_sdk::ingestor::SavedLaunchInputs; using hipdnn_plugin_sdk::ingestor::toString; +using serialization::expectCommonReadRefusals; +using serialization::expectReadRefusal; TEST(TestPackLaunchValues, PointwiseValuesMatchTheV1Contract) { @@ -201,47 +203,6 @@ SavedLaunchInputs savedGfx950AttentionDense() gfx950AttentionDenseLaunchValues(launch.binding, launch.problem, launch.blockM)}; } -// Expects `read` to refuse `inputs` as a valid plan that cannot be restored, with `phrase` -// in the message. -template -void expectReadRefusal(TReader read, const SavedLaunchInputs& inputs, const std::string& phrase) -{ - serialization::expectIngestorPlanRefusal( - [&]() { static_cast(read(inputs)); }, HIPDNN_PLUGIN_STATUS_NOT_APPLICABLE, phrase); -} - -// The refusals every reader shares: a missing value, an extra value, an integer stored as a -// string or as an integer list, and the unversioned dispatch name, which is registered but -// names no contract. -template -void expectCommonReadRefusals(TReader read, - const SavedLaunchInputs& valid, - const std::string& unversionedAlias, - const std::string& integerName) -{ - SavedLaunchInputs missing = valid; - missing.values.erase(integerName); - expectReadRefusal(read, missing, "needs launch value '" + integerName + "'"); - - SavedLaunchInputs extra = valid; - extra.values["unexpected"] = int64_t{1}; - expectReadRefusal(read, extra, "launch value 'unexpected' is not part of the contract"); - - SavedLaunchInputs wrongType = valid; - wrongType.values[integerName] = std::string("1"); - expectReadRefusal(read, wrongType, "launch value '" + integerName + "'"); - expectReadRefusal(read, wrongType, "must be int in ["); - expectReadRefusal(read, wrongType, "and the plan holds string"); - - SavedLaunchInputs wrongList = valid; - wrongList.values[integerName] = std::vector{1}; - expectReadRefusal(read, wrongList, "and the plan holds int_list"); - - SavedLaunchInputs unversioned = valid; - unversioned.dispatchSymbol = unversionedAlias; - expectReadRefusal(read, unversioned, "names no launch-value contract"); -} - // The scales a dense reader restores: the [2^-64, 2^4] its graph match serves, bounds // included, and nothing else. A float scale outside it is refused with the match's reason; // NaN and the infinities are refused before that, as no float launch argument holds them. diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/IngestorPlanTestUtilities.hpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/IngestorPlanTestUtilities.hpp index 850174d0ae82..8fc9e6466631 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/IngestorPlanTestUtilities.hpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/IngestorPlanTestUtilities.hpp @@ -5,15 +5,18 @@ #ifdef HIPDNN_ENABLE_KERNEL_INGESTOR +#include #include #include #include #include #include +#include #include #include +#include #include "engines/kernel_ingestor_engine/serialization/IngestorPlanRefusal.hpp" @@ -92,6 +95,51 @@ std::string expectPluginInternalError(Action&& action, const std::string& phrase std::forward(action), HIPDNN_PLUGIN_STATUS_INTERNAL_ERROR, "", phrase); } +// Expects `read` to refuse `inputs` as a valid plan that cannot be restored, with `phrase` +// in the message. +template +void expectReadRefusal(TReader read, + const hipdnn_plugin_sdk::ingestor::SavedLaunchInputs& inputs, + const std::string& phrase) +{ + expectIngestorPlanRefusal( + [&]() { static_cast(read(inputs)); }, HIPDNN_PLUGIN_STATUS_NOT_APPLICABLE, phrase); +} + +// The refusals every launch-value reader shares: a missing value, an extra value, an +// integer stored as a string or as an integer list, and the unversioned dispatch name, +// which is registered but names no contract. +template +void expectCommonReadRefusals(TReader read, + const hipdnn_plugin_sdk::ingestor::SavedLaunchInputs& valid, + const std::string& unversionedAlias, + const std::string& integerName) +{ + using hipdnn_plugin_sdk::ingestor::SavedLaunchInputs; + + SavedLaunchInputs missing = valid; + missing.values.erase(integerName); + expectReadRefusal(read, missing, "needs launch value '" + integerName + "'"); + + SavedLaunchInputs extra = valid; + extra.values["unexpected"] = int64_t{1}; + expectReadRefusal(read, extra, "launch value 'unexpected' is not part of the contract"); + + SavedLaunchInputs wrongType = valid; + wrongType.values[integerName] = std::string("1"); + expectReadRefusal(read, wrongType, "launch value '" + integerName + "'"); + expectReadRefusal(read, wrongType, "must be int in ["); + expectReadRefusal(read, wrongType, "and the plan holds string"); + + SavedLaunchInputs wrongList = valid; + wrongList.values[integerName] = std::vector{1}; + expectReadRefusal(read, wrongList, "and the plan holds int_list"); + + SavedLaunchInputs unversioned = valid; + unversioned.dispatchSymbol = unversionedAlias; + expectReadRefusal(read, unversioned, "names no launch-value contract"); +} + } // namespace hip_kernel_provider::kernel_ingestor_engine::serialization #endif // HIPDNN_ENABLE_KERNEL_INGESTOR diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp index 68626098cb7f..445ef9572a43 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp @@ -21,6 +21,7 @@ #include "engines/kernel_ingestor_engine/packs/AttentionDenseCommon.hpp" #include "engines/kernel_ingestor_engine/packs/AttentionDensePersistent.hpp" +#include "engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp" #include "engines/kernel_ingestor_engine/packs/ConvFwdGeometry.hpp" #include "engines/kernel_ingestor_engine/packs/ConvFwdLaunchValues.hpp" #include "engines/kernel_ingestor_engine/packs/Gfx942AttentionDenseGeometry.hpp" @@ -85,6 +86,8 @@ constexpr std::string_view GFX950_ATTENTION_DENSE_V2_SAMPLE_DISPATCH = "hipkernel.gfx950_attention_dense.dispatch.v2"; constexpr std::string_view GFX942_ATTENTION_DENSE_SAMPLE_DISPATCH = "hipkernel.gfx942_attention_dense.dispatch.v1"; +constexpr std::string_view ATTENTION_PAGED_UNIFIED_SAMPLE_DISPATCH + = "hipkernel.attention_paged_unified.dispatch.v1"; // The value names and types of each contract, also spelled out so a pack rename fails // this test. These are what the generator encodes into a new sample. @@ -243,6 +246,41 @@ MetadataValues gfx942AttentionDensePersistentThreePairSampleValues() {"num_persistent", int64_t{304}}}; } +// A ragged Q with a sink and separate K and V page tables, so every optional uid holds a +// value and every value differs from the others. +MetadataValues attentionPagedUnifiedSampleValues() +{ + return {{"q.uid", int64_t{51}}, + {"k.uid", int64_t{52}}, + {"v.uid", int64_t{53}}, + {"o.uid", int64_t{54}}, + {"page_table_k.uid", int64_t{55}}, + {"page_table_v.uid", int64_t{56}}, + {"seq_len_kv.uid", int64_t{57}}, + {"seq_len_q.uid", int64_t{58}}, + {"ragged_offset.uid", int64_t{59}}, + {"sink.uid", int64_t{60}}, + {"scale", 0.125}, + {"num_seqs", int64_t{5}}, + {"block_table_stride", int64_t{24}}, + {"num_query_heads", int64_t{32}}, + {"num_kv_heads", int64_t{8}}, + {"sliding_window", int64_t{33}}, + {"q_uniform_len", int64_t{0}}, + {"q_seq_stride", int64_t{4096}}, + {"q_tok_stride", int64_t{4097}}, + {"q_head_stride", int64_t{128}}, + {"o_seq_stride", int64_t{4224}}, + {"o_tok_stride", int64_t{4225}}, + {"o_head_stride", int64_t{136}}, + {"kv_block_stride", int64_t{65536}}, + {"kv_tok_stride", int64_t{256}}, + {"kv_head_stride", int64_t{8192}}, + {"kv_block_span_bytes", int64_t{131072}}, + {"q_block_grid", int64_t{21}}, + {"block_threads", int64_t{128}}}; +} + // The fields outside the dispatch contract. Fixed across the samples, so they differ only // in the contract under test. Each signature column holds different values, and one name // is empty, so a decoder that mixes up two columns fails the comparison. @@ -316,6 +354,12 @@ serialization::IngestorPlanPayload gfx942AttentionDensePersistentThreePairSample gfx942AttentionDensePersistentThreePairSampleValues()); } +serialization::IngestorPlanPayload attentionPagedUnifiedSamplePayload() +{ + return samplePayload(std::string(ATTENTION_PAGED_UNIFIED_SAMPLE_DISPATCH), + attentionPagedUnifiedSampleValues()); +} + // --------------------------------------------------------------------------- // The checked-in bytes // --------------------------------------------------------------------------- @@ -1022,6 +1066,139 @@ constexpr std::array GFX942_ATTENTION_DENSE_V1_PERSISTENT_THREE_P 0x05, 0x00, 0x00, 0x00, 0x61, 0x5F, 0x70, 0x74, 0x72, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x5F, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x00, 0x00}; +constexpr std::array ATTENTION_PAGED_UNIFIED_V1_GOLDEN = { + 0x48, 0x4B, 0x49, 0x50, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x63, 0x66, 0xC6, 0x87, 0xBC, 0x44, 0xA5, 0xF4, 0x58, 0x27, 0xE8, 0x6C, 0xED, 0xF5, 0xC7, + 0x6C, 0xD1, 0xC9, 0xA2, 0xD3, 0x65, 0x1E, 0x86, 0x5E, 0x73, 0x9A, 0x82, 0x81, 0x4D, 0x86, 0x11, + 0x1C, 0x00, 0x00, 0x00, 0x48, 0x4B, 0x53, 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2C, 0x00, + 0x1C, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0x94, 0x06, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x05, 0x00, 0x00, 0x00, 0x31, 0x2E, 0x30, 0x2E, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, + 0x68, 0x69, 0x70, 0x6B, 0x65, 0x72, 0x6E, 0x65, 0x6C, 0x2E, 0x61, 0x74, 0x74, 0x65, 0x6E, 0x74, + 0x69, 0x6F, 0x6E, 0x5F, 0x70, 0x61, 0x67, 0x65, 0x64, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x2E, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2E, 0x76, 0x31, 0x00, 0x00, 0x00, + 0x1D, 0x00, 0x00, 0x00, 0xC8, 0x05, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x50, 0x05, 0x00, 0x00, + 0x14, 0x05, 0x00, 0x00, 0xDC, 0x04, 0x00, 0x00, 0xA8, 0x04, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00, + 0x40, 0x04, 0x00, 0x00, 0x0C, 0x04, 0x00, 0x00, 0xDC, 0x03, 0x00, 0x00, 0xAC, 0x03, 0x00, 0x00, + 0x78, 0x03, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0xD8, 0x02, 0x00, 0x00, + 0x9C, 0x02, 0x00, 0x00, 0x6C, 0x02, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, + 0xD0, 0x01, 0x00, 0x00, 0x9C, 0x01, 0x00, 0x00, 0x6C, 0x01, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xB6, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x76, 0x2E, 0x75, 0x69, + 0x64, 0x00, 0x00, 0x00, 0x9E, 0xFA, 0xFF, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xDE, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x73, 0x6C, 0x69, 0x64, 0x69, 0x6E, 0x67, 0x5F, 0x77, 0x69, 0x6E, 0x64, + 0x6F, 0x77, 0x00, 0x00, 0x4E, 0xFB, 0xFF, 0xFF, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x12, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x73, 0x69, 0x6E, 0x6B, 0x2E, 0x75, 0x69, 0x64, + 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFA, 0xFF, 0xFF, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x5F, 0x6C, 0x65, 0x6E, 0x5F, 0x71, 0x2E, 0x75, 0x69, + 0x64, 0x00, 0x00, 0x00, 0x2E, 0xFB, 0xFF, 0xFF, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x5F, 0x6C, 0x65, 0x6E, 0x5F, 0x6B, 0x76, 0x2E, 0x75, + 0x69, 0x64, 0x00, 0x00, 0x5E, 0xFB, 0xFF, 0xFF, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x06, 0xFC, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xCA, 0xFB, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x72, 0x61, 0x67, 0x67, 0x65, 0x64, 0x5F, 0x6F, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2E, 0x75, 0x69, + 0x64, 0x00, 0x00, 0x00, 0x3E, 0xFC, 0xFF, 0xFF, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x6F, 0x72, + 0x6D, 0x5F, 0x6C, 0x65, 0x6E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x2E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x74, 0x6F, 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, + 0x00, 0x00, 0x00, 0x00, 0x1E, 0xFC, 0xFF, 0xFF, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x73, 0x65, 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, + 0x00, 0x00, 0x00, 0x00, 0x4E, 0xFC, 0xFF, 0xFF, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, + 0x65, 0x00, 0x00, 0x00, 0x7E, 0xFC, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xBE, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x67, 0x72, 0x69, 0x64, + 0x00, 0x00, 0x00, 0x00, 0xAE, 0xFC, 0xFF, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xEE, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x71, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x56, 0xFD, 0xFF, 0xFF, + 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0xFD, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x70, 0x61, 0x67, 0x65, 0x5F, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x5F, 0x76, 0x2E, 0x75, 0x69, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x8E, 0xFD, 0xFF, 0xFF, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x52, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x70, 0x61, 0x67, 0x65, 0x5F, 0x74, 0x61, 0x62, + 0x6C, 0x65, 0x5F, 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x46, 0xFD, 0xFF, 0xFF, + 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x74, 0x6F, + 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x76, 0xFD, 0xFF, 0xFF, + 0x81, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x73, 0x65, + 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0xA6, 0xFD, 0xFF, 0xFF, + 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x68, 0x65, + 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0xD6, 0xFD, 0xFF, 0xFF, + 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6F, 0x2E, 0x75, 0x69, + 0x64, 0x00, 0x00, 0x00, 0x7E, 0xFE, 0xFF, 0xFF, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x42, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x73, 0x65, 0x71, 0x73, + 0x00, 0x00, 0x00, 0x00, 0x2E, 0xFE, 0xFF, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5F, 0x68, 0x65, + 0x61, 0x64, 0x73, 0x00, 0x5E, 0xFE, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x6B, 0x76, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x73, + 0x00, 0x00, 0x00, 0x00, 0x8E, 0xFE, 0xFF, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xCE, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x74, 0x6F, 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, + 0x65, 0x00, 0x00, 0x00, 0xBE, 0xFE, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFE, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, + 0x64, 0x65, 0x00, 0x00, 0xEE, 0xFE, 0xFF, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2E, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x73, 0x74, 0x72, + 0x69, 0x64, 0x65, 0x00, 0x9E, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x62, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, + 0x5F, 0x73, 0x70, 0x61, 0x6E, 0x5F, 0x62, 0x79, 0x74, 0x65, 0x73, 0x00, 0xD6, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x06, 0x00, 0x10, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCA, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x00, 0x06, 0x00, + 0x0E, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x5F, 0x73, 0x74, 0x72, 0x69, + 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x1C, 0x00, 0x07, 0x00, 0x08, 0x00, + 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x68, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x6C, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x65, 0x66, 0x35, 0x31, 0x39, 0x39, 0x39, 0x39, + 0x39, 0x32, 0x38, 0x65, 0x37, 0x38, 0x37, 0x39, 0x62, 0x64, 0x64, 0x30, 0x36, 0x32, 0x33, 0x30, + 0x31, 0x39, 0x31, 0x36, 0x33, 0x35, 0x64, 0x35, 0x32, 0x65, 0x64, 0x34, 0x32, 0x37, 0x37, 0x37, + 0x64, 0x34, 0x62, 0x33, 0x36, 0x34, 0x66, 0x62, 0x63, 0x63, 0x38, 0x66, 0x36, 0x31, 0x66, 0x62, + 0x30, 0x62, 0x35, 0x34, 0x30, 0x61, 0x35, 0x38, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x67, 0x66, 0x78, 0x39, 0x34, 0x32, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x67, 0x6F, 0x6C, 0x64, + 0x65, 0x6E, 0x5F, 0x6B, 0x65, 0x72, 0x6E, 0x65, 0x6C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x7F, 0x45, 0x4C, 0x46, 0x02, 0x01, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, + 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x62, 0x79, 0x5F, 0x76, + 0x61, 0x6C, 0x75, 0x65, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x14, 0x00, 0x04, 0x00, 0x08, 0x00, + 0x0C, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x63, 0x6F, 0x75, 0x6E, + 0x74, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x62, 0x79, 0x5F, 0x76, 0x61, 0x6C, 0x75, 0x65, + 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0C, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x61, 0x5F, 0x70, 0x74, 0x72, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x5F, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x00, 0x00}; + // --------------------------------------------------------------------------- // Reading a sample // --------------------------------------------------------------------------- @@ -1374,6 +1551,45 @@ TEST(TestIngestorPlanLaunchContractGoldens, {613566757, 3}, {1431655766, 3}, {-1717986918, 3}})); } +TEST(TestIngestorPlanLaunchContractGoldens, AttentionPagedUnifiedV1SampleStillReadsAsItsContract) +{ + const SavedLaunchInputs inputs + = readSample(ATTENTION_PAGED_UNIFIED_V1_GOLDEN, attentionPagedUnifiedSamplePayload()); + ASSERT_EQ(inputs.dispatchSymbol, "hipkernel.attention_paged_unified.dispatch.v1"); + + const AttentionPagedUnifiedLaunchInputs launch = readAttentionPagedUnifiedLaunchInputs(inputs); + EXPECT_EQ(launch.uids.q, 51); + EXPECT_EQ(launch.uids.k, 52); + EXPECT_EQ(launch.uids.v, 53); + EXPECT_EQ(launch.uids.o, 54); + EXPECT_EQ(launch.uids.pageTableK, 55); + EXPECT_EQ(launch.uids.pageTableV, 56); + EXPECT_EQ(launch.uids.seqLenKv, 57); + EXPECT_EQ(launch.uids.seqLenQ, 58); + EXPECT_EQ(launch.uids.raggedOffset, 59); + EXPECT_EQ(launch.uids.sink, 60); + const AttentionPagedUnifiedScalars& s = launch.scalars; + EXPECT_EQ(s.scale, 0.125F); + EXPECT_EQ(s.numSeqs, 5); + EXPECT_EQ(s.blockTableStride, 24); + EXPECT_EQ(s.numQueryHeads, 32); + EXPECT_EQ(s.numKvHeads, 8); + EXPECT_EQ(s.slidingWindow, 33); + EXPECT_EQ(s.qUniformLen, 0); + EXPECT_EQ(s.q.seqStride, 4096); + EXPECT_EQ(s.q.tokenStride, 4097); + EXPECT_EQ(s.q.headStride, 128); + EXPECT_EQ(s.o.seqStride, 4224); + EXPECT_EQ(s.o.tokenStride, 4225); + EXPECT_EQ(s.o.headStride, 136); + EXPECT_EQ(s.kvBlockStride, 65536); + EXPECT_EQ(s.kvTokStride, 256); + EXPECT_EQ(s.kvHeadStride, 8192); + EXPECT_EQ(s.kvBlockSpanBytes, 131072); + EXPECT_EQ(s.qBlockGrid, 21); + EXPECT_EQ(launch.blockThreads, 128); +} + TEST(TestIngestorPlanLaunchContractGoldens, ConvFwdV1SampleGivesTheSameGeometry) { const ConvFwdLaunchInputs launch @@ -1444,6 +1660,8 @@ TEST(TestIngestorPlanLaunchContractGoldens, DISABLED_PrintLaunchContractSamples) printSample( "GFX942_ATTENTION_DENSE_V1_PERSISTENT_THREE_PAIR_GOLDEN", serialization::encodeIngestorPlan(gfx942AttentionDensePersistentThreePairSamplePayload())); + printSample("ATTENTION_PAGED_UNIFIED_V1_GOLDEN", + serialization::encodeIngestorPlan(attentionPagedUnifiedSamplePayload())); } } // namespace From 3bed02a4f10a3402458101c187319b6b2aee4961 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Fri, 6 Nov 2026 18:14:36 -0600 Subject: [PATCH 09/22] feat(hip-kernel-provider): serve FLOAT attention sinks in hipkernel:AttentionPagedUnified hipDNN's frontend admits only cuDNN's FLOAT sink_token, so the Q-dtype sinks the engine read could not reach it on develop. The rocKE tiled 2D runtime_layout kernels gain a sink_is_f32 launch argument (the 16th of the runtime_layout tail): nonzero means sink_ptr holds Hq fp32 logits, zero means Hq logits in the Q data type. Each head's sink is read with masked loads of both forms, so neither reads past the other's buffer, and the same use_sinks objects serve both; there are no new objects. Python and the C++ twin build the same IR. The engine accepts a FLOAT sink_token as well as one in the Q data type (sdpa_graph::sinkFor), binds sink_is_f32 from it, passes it at launch and saves it as the launch value sink_is_f32. The FLOAT integration cases run on develop's frontend; the Q-dtype ones still skip on its rejection. Two FLOAT-sink quick bundles of #14358 are now claimed. The representative-IR golden's runtime_layout entries are re-recorded for the new argument, and rocKE's SUPPORT_MATRIX.md and dsl_docs/instances/attention.md describe the runtime_layout mode. --- .../kernels/gfx942/attention_tiled_2d.py | 43 +- .../kernels/gfx950/attention_tiled_2d.py | 36 +- ...ttention_tiled_2d_runtime_layout_gfx950.py | 29 +- .../test_gfx942_attention_runtime_layout.py | 20 +- ...instance_attention_tiled_2d_rtl_internal.h | 46 ++- .../attention_tiled_2d_loop_scaffold.cpp | 18 +- .../attention_tiled_2d_q_load_gather.cpp | 19 +- .../platform/dsl_docs/instances/attention.md | 31 ++ .../python/rocke/instances/SUPPORT_MATRIX.md | 1 + .../attention.json | 96 ++--- .../differential/golden/llvm_gfx_all.json | 380 +++++++++--------- .../rocKE/attention_paged_unified/README.md | 26 +- .../AttentionPagedUnifiedLaunchValues.hpp | 4 +- .../packs/AttentionPagedUnifiedNative.cpp | 24 +- .../packs/SdpaGraphMatch.hpp | 22 +- .../IntegrationGpuAttentionPagedUnified.cpp | 88 +++- .../TestAttentionPagedUnifiedLaunchValues.cpp | 20 +- .../TestAttentionPagedUnifiedMatchers.cpp | 41 +- .../TestIngestorPlanLaunchContractGoldens.cpp | 58 +-- .../Decode/Decode.support.json | 11 +- .../Mixed/Mixed.support.json | 11 +- .../configs/attention_paged_unified.yaml | 5 +- 22 files changed, 664 insertions(+), 365 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py index c3ec34c215d9..cd792f59d47a 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py @@ -47,6 +47,7 @@ F16, F32, FP8E4M3, + I16, I32, I64, IRBuilder, @@ -506,11 +507,12 @@ class UnifiedAttention2DTiledSpec: # Runtime-layout mode (hipDNN paged/ragged SDPA engine, vLLM KV-cache view). # The head counts, the window and the batch's search trip count are already # kernargs (``RUNTIME_KERNARG_FIELDS``, ``RUNTIME_SEARCH_ITERS``). When True - # the kernel also takes 15 appended kernargs (block_tables_v_ptr, + # the kernel also takes 16 appended kernargs (block_tables_v_ptr, # seq_lens_q_ptr, has_seq_lens_q, q_uniform_len, the Q/O/KV element strides, - # kv_block_span_bytes, q_block_grid) and serves a dense-or-ragged Q and a - # real paged-KV layout from one compiled object: Q/O/KV strides are runtime, - # K pages through ``block_tables_ptr`` and V through ``block_tables_v_ptr`` + # kv_block_span_bytes, q_block_grid, sink_is_f32) and serves a + # dense-or-ragged Q and a real paged-KV layout from one compiled object: + # Q/O/KV strides are runtime, K pages through ``block_tables_ptr`` and V + # through ``block_tables_v_ptr`` # (the same pointer, or a second table with the same row stride), the # per-sequence Q/O base and the KV block term are 64-bit (one buffer # resource per page), block-table reads past ceil(seq_len/BS) and K/V reads @@ -1163,6 +1165,8 @@ def kernel_name(self) -> str: # the same pointer. ``q_uniform_len`` is L > 0 for a dense Q (L rows per # sequence) and 0 for a ragged one, whose offsets must be non-decreasing with # off[b+1] - off[b] >= seq_lens_q[b] and off[B] the end of the last block. +# ``sink_is_f32`` nonzero: ``sink_ptr`` holds Hq fp32 logits, else Hq logits in +# the Q dtype (ignored without sinks). RUNTIME_LAYOUT_EXTRA_ARGS = ( ("block_tables_v_ptr", "ptr"), ("seq_lens_q_ptr", "ptr"), @@ -1179,6 +1183,7 @@ def kernel_name(self) -> str: ("kv_head_stride", "i32"), ("kv_block_span_bytes", "i32"), ("q_block_grid", "i32"), + ("sink_is_f32", "i32"), ) @@ -2798,6 +2803,30 @@ def _pack_p_a32(p_regs0_f32: list[Value], p_regs1_f32: list[Value]) -> Value: hi.append(_select_lane_rg(v0_x16, v0_x32, v1_x48, v1)) return b.vec_pack([b.cast_f32_to(v, dtype) for v in (lo + hi)], dtype) + def _sink_logit(qh, qh_in): + # Query head ``qh``'s sink logit in f32. Runtime-layout kernels read + # ``sink_is_f32``: nonzero means ``sink_ptr`` holds Hq fp32 logits, + # else Hq logits in the Q dtype. The fp32 form is read as two 16-bit + # halves and both forms mask on their own flag, so neither reads past + # the other's buffer (2*Hq halves vs Hq). + if not RTL: + return b.cast_to_f32(b.global_load(sinks, qh, dtype, align=2)) + is_f32 = b.cmp_ne(rtl_p["sink_is_f32"], b.const_i32(0)) + is_q = b.cmp_eq(rtl_p["sink_is_f32"], b.const_i32(0)) + f32_in = b.land(qh_in, is_f32) + qh2 = b.mul(qh, b.const_i32(2)) + lo_idx = b.select(f32_in, qh2, b.const_i32(0)) + lo = b.global_load(sinks, lo_idx, I16, align=2) + hi_idx = b.select(f32_in, b.add(qh2, b.const_i32(1)), b.const_i32(0)) + hi = b.global_load(sinks, hi_idx, I16, align=2) + lo32 = b.zext(lo, I32) + hi32 = b.zext(hi, I32) + word = b.add(lo32, b.shl(hi32, b.const_i32(16))) + sink_w = b.bitcast(word, F32) + q_idx = b.select(b.land(qh_in, is_q), qh, b.const_i32(0)) + sink_h = b.global_load(sinks, q_idx, dtype, align=2) + return b.select(is_f32, sink_w, b.cast_to_f32(sink_h)) + if USE_SINKS: m_inits = [] if USE_MFMA_32X32 and TRANSPOSED_QK_32X32 and TRANSPOSED_SCALAR_STATE: @@ -2806,8 +2835,7 @@ def _pack_p_a32(p_regs0_f32: list[Value], p_regs1_f32: list[Value]) -> Value: b.mul(kv_head_idx, b.const_i32(NQK)), b.mod(row, b.const_i32(NQK)) ) qh_in = b.cmp_lt(qh, num_qh_p) - sink_h = b.global_load(sinks, qh, dtype, align=2) - sink_f = b.fmul(b.cast_to_f32(sink_h), rcp_ln2) + sink_f = b.fmul(_sink_logit(qh, qh_in), rcp_ln2) m_inits.append(b.select(qh_in, sink_f, neg_inf)) else: for r in range(REGS_PER_LANE): @@ -2816,8 +2844,7 @@ def _pack_p_a32(p_regs0_f32: list[Value], p_regs1_f32: list[Value]) -> Value: b.mul(kv_head_idx, b.const_i32(NQK)), b.mod(row, b.const_i32(NQK)) ) qh_in = b.cmp_lt(qh, num_qh_p) - sink_h = b.global_load(sinks, qh, dtype, align=2) - sink_f = b.fmul(b.cast_to_f32(sink_h), rcp_ln2) + sink_f = b.fmul(_sink_logit(qh, qh_in), rcp_ln2) m_inits.append(b.select(qh_in, sink_f, neg_inf)) else: m_inits = [neg_inf for _ in range(SOFTMAX_STATE_SLOTS)] diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index 4f361aac6515..82650ce78e56 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -56,6 +56,7 @@ F16, F32, FP8E4M3, + I16, I32, I64, IRBuilder, @@ -1041,7 +1042,9 @@ def kernel_name(self) -> str: # with ``block_tables_ptr`` (K's table) and may be the same pointer. # ``q_uniform_len`` is L > 0 for a dense Q (L rows per sequence) and 0 for a # ragged one, whose offsets must be non-decreasing with off[b+1] - off[b] >= -# seq_lens_q[b] and off[B] the end of the last block. +# seq_lens_q[b] and off[B] the end of the last block. ``sink_is_f32`` nonzero: +# ``sink_ptr`` holds Hq fp32 logits, else Hq logits in the Q dtype (ignored +# without sinks). _RTL_PARAMS = ( "block_tables_v_ptr", "seq_lens_q_ptr", @@ -1058,6 +1061,7 @@ def kernel_name(self) -> str: "kv_head_stride", "kv_block_span_bytes", "q_block_grid", + "sink_is_f32", ) @@ -2274,6 +2278,30 @@ def _pack_p_a32(p_regs0_f32: list[Value], p_regs1_f32: list[Value]) -> Value: hi.append(_select_lane_rg(v0_x16, v0_x32, v1_x48, v1)) return b.vec_pack([b.cast_f32_to(v, dtype) for v in (lo + hi)], dtype) + def _sink_logit(qh, qh_in): + # Query head ``qh``'s sink logit in f32. Runtime-layout kernels read + # ``sink_is_f32``: nonzero means ``sink_ptr`` holds Hq fp32 logits, + # else Hq logits in the Q dtype. The fp32 form is read as two 16-bit + # halves and both forms mask on their own flag, so neither reads past + # the other's buffer (2*Hq halves vs Hq). + if not RTL: + return b.cast_to_f32(b.global_load(sinks, qh, dtype, align=2)) + is_f32 = b.cmp_ne(rtl["sink_is_f32"], b.const_i32(0)) + is_q = b.cmp_eq(rtl["sink_is_f32"], b.const_i32(0)) + f32_in = b.land(qh_in, is_f32) + qh2 = b.mul(qh, b.const_i32(2)) + lo_idx = b.select(f32_in, qh2, b.const_i32(0)) + lo = b.global_load(sinks, lo_idx, I16, align=2) + hi_idx = b.select(f32_in, b.add(qh2, b.const_i32(1)), b.const_i32(0)) + hi = b.global_load(sinks, hi_idx, I16, align=2) + lo32 = b.zext(lo, I32) + hi32 = b.zext(hi, I32) + word = b.add(lo32, b.shl(hi32, b.const_i32(16))) + sink_w = b.bitcast(word, F32) + q_idx = b.select(b.land(qh_in, is_q), qh, b.const_i32(0)) + sink_h = b.global_load(sinks, q_idx, dtype, align=2) + return b.select(is_f32, sink_w, b.cast_to_f32(sink_h)) + if USE_SINKS: m_inits = [] if USE_MFMA_32X32 and TRANSPOSED_QK_32X32 and TRANSPOSED_SCALAR_STATE: @@ -2282,8 +2310,7 @@ def _pack_p_a32(p_regs0_f32: list[Value], p_regs1_f32: list[Value]) -> Value: b.mul(kv_head_idx, b.const_i32(NQK)), b.mod(row, b.const_i32(NQK)) ) qh_in = b.cmp_lt(qh, num_qh_p) - sink_h = b.global_load(sinks, qh, dtype, align=2) - sink_f = b.fmul(b.cast_to_f32(sink_h), rcp_ln2) + sink_f = b.fmul(_sink_logit(qh, qh_in), rcp_ln2) m_inits.append(b.select(qh_in, sink_f, neg_inf)) else: for r in range(REGS_PER_LANE): @@ -2292,8 +2319,7 @@ def _pack_p_a32(p_regs0_f32: list[Value], p_regs1_f32: list[Value]) -> Value: b.mul(kv_head_idx, b.const_i32(NQK)), b.mod(row, b.const_i32(NQK)) ) qh_in = b.cmp_lt(qh, num_qh_p) - sink_h = b.global_load(sinks, qh, dtype, align=2) - sink_f = b.fmul(b.cast_to_f32(sink_h), rcp_ln2) + sink_f = b.fmul(_sink_logit(qh, qh_in), rcp_ln2) m_inits.append(b.select(qh_in, sink_f, neg_inf)) else: m_inits = [neg_inf for _ in range(SOFTMAX_STATE_SLOTS)] diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py index 6209171829fc..76620f678060 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py @@ -23,7 +23,8 @@ Outputs must be finite and within tolerance; rows that see no key, and a dense Q's padded rows past seq_lens_q, must be exactly zero; every O element the kernel must not write (a ragged Q's gap rows past seq_lens_q, token-stride -padding, guard regions) must keep its sentinel. The device test is skipped +padding, guard regions) must keep its sentinel. Sinks come as fp32 logits +(``sink_is_f32``) or in the Q dtype. The device test is skipped unless the visible device is gfx950; the catalog check needs no device. """ @@ -245,6 +246,7 @@ def _launcher( "kv_head_stride", "kv_block_span_bytes", "q_block_grid", + "sink_is_f32", ): sb.scalar(name, "i32") launcher = KernelLauncher( @@ -321,6 +323,7 @@ def _run( qpk: int, sc: Scenario, use_sinks: bool = False, + sink_f32: bool = False, ): from rocke.runtime.hip_module import Runtime from rocke.runtime.host_buffers import as_u8_buffer @@ -451,14 +454,20 @@ def upload(a: np.ndarray) -> DeviceMem: k_ptr, v_ptr = cache_dev.ptr(), cache_dev.ptr() + D * 2 else: k_ptr, v_ptr = upload(k_cache).ptr(), upload(v_cache).ptr() - # Sinks in the I/O dtype, spread from negligible to row-dominating so a head - # that loses (or reads another head's) sink fails the comparison. + # Sinks spread from negligible to row-dominating so a head that loses (or + # reads another head's) sink fails the comparison. fp32 logits when + # ``sink_f32``, else in the I/O dtype. sinks_view = None sink_ptr = 0 if use_sinks: - sinks_host = _encode(rng.uniform(-4.0, 6.0, hq).astype(np.float32), dtype) - sinks_view = _decode(sinks_host, dtype) - sink_ptr = upload(sinks_host) + sinks_f = rng.uniform(-4.0, 6.0, hq).astype(np.float32) + if sink_f32: + sinks_view = sinks_f + sink_ptr = upload(sinks_f) + else: + sinks_host = _encode(sinks_f, dtype) + sinks_view = _decode(sinks_host, dtype) + sink_ptr = upload(sinks_host) values = { "output_ptr": o_dev.ptr() + GUARD * 2, "query_ptr": q_dev, @@ -496,6 +505,7 @@ def upload(a: np.ndarray) -> DeviceMem: "kv_head_stride": kv_head_stride, "kv_block_span_bytes": kv_span_bytes, "q_block_grid": grid_y, + "sink_is_f32": int(sink_f32), } launcher( values, @@ -587,12 +597,15 @@ def test_runtime_layout_matches_reference(dtype, head_size, block_size, qpk, sc) @pytest.mark.gpu @_NEEDS_GFX950 +@pytest.mark.parametrize("sink_f32", (False, True), ids=("sink_qdtype", "sink_f32")) @pytest.mark.parametrize("sc", SCENARIOS, ids=lambda s: s.name) @pytest.mark.parametrize( "dtype,head_size,block_size,qpk", _SINK_KERNEL_CASES, ids=lambda v: str(v) ) -def test_runtime_layout_sinks_match_reference(dtype, head_size, block_size, qpk, sc): - _run(dtype, head_size, block_size, qpk, sc, use_sinks=True) +def test_runtime_layout_sinks_match_reference( + dtype, head_size, block_size, qpk, sc, sink_f32 +): + _run(dtype, head_size, block_size, qpk, sc, use_sinks=True, sink_f32=sink_f32) def test_runtime_layout_sinks_accepted(): diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py index 09884a3ae745..68b389e287d0 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -467,7 +467,7 @@ def _decode(a, dtype): return a.view(np.float16).astype(np.float32) -def _run_case(spec, sc, rng): +def _run_case(spec, sc, rng, sink_f32=False): from rocke.runtime.hip_module import Runtime from rocke.runtime.host_buffers import as_u8_buffer from rocke.runtime.launcher import DeviceMem, LaunchConfig @@ -573,16 +573,20 @@ def upload(a): kv_block_stride, kv_tok_stride, kv_head_stride = strides span_bytes = ((_HKV - 1) * kv_head_stride + (bs - 1) * kv_tok_stride + hd) * 2 - # ---- sinks (I/O dtype, one per query head) ---- + # ---- sinks (one per query head; fp32 when sink_f32, else I/O dtype) ---- sinks_np = None sink_ptr = 0 if spec.use_sinks: # Spread from "negligible" to "dominates the row" so a head that loses # (or reads another head's) sink fails the comparison. sinks_host = rng.uniform(-4.0, 6.0, hq).astype(np.float32) - sinks_raw = _encode(sinks_host, dt) - sinks_np = _decode(sinks_raw, dt) - sink_ptr = upload(sinks_raw) + if sink_f32: + sinks_np = sinks_host + sink_ptr = upload(sinks_host) + else: + sinks_raw = _encode(sinks_host, dt) + sinks_np = _decode(sinks_raw, dt) + sink_ptr = upload(sinks_raw) # ---- output with sentinel guards ---- o_tok = hq * hd + sc["o_pad"] @@ -645,6 +649,7 @@ def upload(a): kv_head_stride=kv_head_stride, kv_block_span_bytes=span_bytes, q_block_grid=grid_y, + sink_is_f32=int(sink_f32), ) _launcher(spec)( values, @@ -737,8 +742,9 @@ def test_runtime_layout_numerics(dtype, head_size, block_size, qpk): @pytest.mark.gpu @requires_gfx942_gpu +@pytest.mark.parametrize("sink_f32", (False, True), ids=("sink_qdtype", "sink_f32")) @pytest.mark.parametrize("dtype,head_size,block_size,qpk", _GPU_SINK_KERNELS) -def test_runtime_layout_sinks_numerics(dtype, head_size, block_size, qpk): +def test_runtime_layout_sinks_numerics(dtype, head_size, block_size, qpk, sink_f32): spec = runtime_layout_catalog_spec( dtype=dtype, head_size=head_size, @@ -750,4 +756,4 @@ def test_runtime_layout_sinks_numerics(dtype, head_size, block_size, qpk): zlib.crc32(f"sinks:{dtype}:{head_size}:{block_size}:{qpk}".encode()) ) for sc in _scenarios(block_size): - _run_case(spec, sc, rng) + _run_case(spec, sc, rng, sink_f32=sink_f32) diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h index bfbcc335dc3f..72b51af1506a 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h @@ -3,7 +3,7 @@ /* runtime_layout kernel arguments of the gfx942 and gfx950 tiled 2D unified * attention twins. Mirrors RUNTIME_LAYOUT_EXTRA_ARGS * (kernels/gfx942/attention_tiled_2d.py) and _RTL_PARAMS - * (kernels/gfx950/attention_tiled_2d.py): the same 15 arguments, in the same + * (kernels/gfx950/attention_tiled_2d.py): the same 16 arguments, in the same * order, appended after the fixed ones and the runtime shape arguments * (num_query_heads, num_kv_heads, sliding_window). Not a public ABI. */ #ifndef ROCKE_INSTANCE_ATTENTION_TILED_2D_RTL_INTERNAL_H @@ -19,7 +19,8 @@ * block_table_stride with block_tables_ptr (K's) and may be the same pointer. * q_uniform_len is L > 0 for a dense Q and 0 for a ragged one (offsets * non-decreasing, off[b+1] - off[b] >= seq_lens_q[b], off[B] the end of the - * last block). */ + * last block). sink_is_f32 nonzero: sink_ptr holds Hq fp32 logits, else Hq + * logits in the Q dtype. */ typedef enum rocke_attn2d_rtl_param { ROCKE_ATTN2D_RTL_BLOCK_TABLES_V = 0, @@ -37,6 +38,7 @@ typedef enum rocke_attn2d_rtl_param ROCKE_ATTN2D_RTL_KV_HEAD_STRIDE, ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES, ROCKE_ATTN2D_RTL_Q_BLOCK_GRID, + ROCKE_ATTN2D_RTL_SINK_IS_F32, ROCKE_ATTN2D_RTL_NUM_PARAMS } rocke_attn2d_rtl_param_t; @@ -60,6 +62,7 @@ static inline void rocke_attn2d_rtl_declare_params(rocke_ir_builder_t* b, rocke_ "kv_head_stride", "kv_block_span_bytes", "q_block_grid", + "sink_is_f32", }; const rocke_type_t* ptr_i32 = rocke_ptr_type(b, rocke_i32(), "global"); for(int i = 0; i < ROCKE_ATTN2D_RTL_NUM_PARAMS; ++i) @@ -81,4 +84,43 @@ static inline void rocke_attn2d_rtl_declare_params(rocke_ir_builder_t* b, rocke_ } } +/* Query head qh's sink logit in f32 in a runtime_layout kernel (Python + * ``_sink_logit``). sink_is_f32 picks the fp32 form (read as two 16-bit + * halves) or the Q-dtype form; each load masks on its own flag, so neither + * reads past the other's buffer. One builder call per statement, in Python + * order. */ +static inline rocke_value_t* rocke_attn2d_rtl_sink_logit(rocke_ir_builder_t* b, + rocke_value_t* const* rtl_p, + rocke_value_t* sinks, + rocke_value_t* qh, + rocke_value_t* qh_in, + const rocke_type_t* dtype) +{ + rocke_value_t* flag = rtl_p[ROCKE_ATTN2D_RTL_SINK_IS_F32]; + rocke_value_t* c0 = rocke_b_const_i32(b, 0); + rocke_value_t* is_f32 = rocke_b_cmp_ne(b, flag, c0); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* is_q = rocke_b_cmp_eq(b, flag, c0); + rocke_value_t* f32_in = rocke_b_land(b, qh_in, is_f32); + rocke_value_t* qh2 = rocke_b_mul(b, qh, rocke_b_const_i32(b, 2)); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* lo_idx = rocke_b_select(b, f32_in, qh2, c0); + rocke_value_t* lo = rocke_b_global_load(b, sinks, lo_idx, rocke_i16(), 2); + rocke_value_t* qh2_p1 = rocke_b_add(b, qh2, rocke_b_const_i32(b, 1)); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* hi_idx = rocke_b_select(b, f32_in, qh2_p1, c0); + rocke_value_t* hi = rocke_b_global_load(b, sinks, hi_idx, rocke_i16(), 2); + rocke_value_t* lo32 = rocke_b_zext(b, lo, rocke_i32()); + rocke_value_t* hi32 = rocke_b_zext(b, hi, rocke_i32()); + rocke_value_t* hi_sh = rocke_b_shl(b, hi32, rocke_b_const_i32(b, 16)); + rocke_value_t* word = rocke_b_add(b, lo32, hi_sh); + rocke_value_t* sink_w = rocke_b_bitcast(b, word, rocke_f32()); + rocke_value_t* q_in = rocke_b_land(b, qh_in, is_q); + c0 = rocke_b_const_i32(b, 0); + rocke_value_t* q_idx = rocke_b_select(b, q_in, qh, c0); + rocke_value_t* sink_h = rocke_b_global_load(b, sinks, q_idx, dtype, 2); + rocke_value_t* sink_hf = rocke_b_cast_to_f32(b, sink_h); + return rocke_b_select(b, is_f32, sink_w, sink_hf); +} + #endif /* ROCKE_INSTANCE_ATTENTION_TILED_2D_RTL_INTERNAL_H */ diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp index a98d8431f911..098d3f186e82 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_loop_scaffold.cpp @@ -54,6 +54,16 @@ static rocke_value_t* sc_rcp_ln2(rocke_gfx942_attn2d_build_ctx_t* ctx) return rocke_b_const_f32(B, 1.4426950408889634); } +/* Python ``_sink_logit``: query head qh's sink logit in f32 (runtime-layout + * kernels pick the fp32 or Q-dtype sink form from sink_is_f32). */ +static rocke_value_t* + sc_sink_logit(rocke_gfx942_attn2d_build_ctx_t* ctx, rocke_value_t* qh, rocke_value_t* qh_in) +{ + if(!ctx->RTL) + return rocke_b_cast_to_f32(B, rocke_b_global_load(B, ctx->sinks, qh, ctx->dtype, 2)); + return rocke_attn2d_rtl_sink_logit(B, ctx->rtl_p, ctx->sinks, qh, qh_in, ctx->dtype); +} + /* _in_warp_row(r) (Python 2031-2037): the in-warp row for softmax state slot r * on the narrow (block_m_per_warp=16/32) layout. */ static rocke_value_t* @@ -191,8 +201,8 @@ void rocke_gfx942_attn2d_emit_loop_bounds_and_inits(rocke_gfx942_attn2d_build_ct rocke_value_t* qh_mod = rocke_b_mod(B, row, rocke_b_const_i32(B, NQK)); rocke_value_t* qh = rocke_b_add(B, qh_mul, qh_mod); rocke_value_t* qh_in = rocke_b_cmp_lt(B, qh, ctx->num_qh_p); - rocke_value_t* sink_h = rocke_b_global_load(B, ctx->sinks, qh, ctx->dtype, 2); - rocke_value_t* sink_f = rocke_b_fmul(B, rocke_b_cast_to_f32(B, sink_h), rcp_ln2); + rocke_value_t* sink_l = sc_sink_logit(ctx, qh, qh_in); + rocke_value_t* sink_f = rocke_b_fmul(B, sink_l, rcp_ln2); m_inits[0] = rocke_b_select(B, qh_in, sink_f, neg_inf); } else if(ctx->USE_SINKS) @@ -207,8 +217,8 @@ void rocke_gfx942_attn2d_emit_loop_bounds_and_inits(rocke_gfx942_attn2d_build_ct rocke_value_t* qh_mod = rocke_b_mod(B, row, rocke_b_const_i32(B, NQK)); rocke_value_t* qh = rocke_b_add(B, qh_mul, qh_mod); rocke_value_t* qh_in = rocke_b_cmp_lt(B, qh, ctx->num_qh_p); - rocke_value_t* sink_h = rocke_b_global_load(B, ctx->sinks, qh, ctx->dtype, 2); - rocke_value_t* sink_f = rocke_b_fmul(B, rocke_b_cast_to_f32(B, sink_h), rcp_ln2); + rocke_value_t* sink_l = sc_sink_logit(ctx, qh, qh_in); + rocke_value_t* sink_f = rocke_b_fmul(B, sink_l, rcp_ln2); m_inits[r] = rocke_b_select(B, qh_in, sink_f, neg_inf); } } diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp index 07f20d387c52..5c326c9e94f2 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_q_load_gather.cpp @@ -83,6 +83,17 @@ static rocke_value_t* sc_rcp_ln2(rocke_gfx950_attn2d_build_ctx_t* ctx) return rocke_b_const_f32(B, 1.4426950408889634); } +/* Python ``_sink_logit``: query head qh's sink logit in f32 (runtime-layout + * kernels pick the fp32 or Q-dtype sink form from sink_is_f32). */ +static rocke_value_t* rocke_g950_sink_logit(rocke_gfx950_attn2d_build_ctx_t* ctx, + rocke_value_t* qh, + rocke_value_t* qh_in) +{ + if(!ctx->RTL) + return rocke_b_cast_to_f32(B, rocke_b_global_load(B, ctx->sinks, qh, ctx->dtype, 2)); + return rocke_attn2d_rtl_sink_logit(B, ctx->rtl_p, ctx->sinks, qh, qh_in, ctx->dtype); +} + /* ============================================================ * * Q -> LDS cooperative stage (Python lines 1151-1215). * ============================================================ */ @@ -356,8 +367,8 @@ void rocke_gfx950_attn2d_emit_loop_bounds_and_inits(rocke_gfx950_attn2d_build_ct rocke_value_t* qh_mod = rocke_b_mod(B, row, rocke_b_const_i32(B, NQK)); rocke_value_t* qh = rocke_b_add(B, qh_mul, qh_mod); rocke_value_t* qh_in = rocke_b_cmp_lt(B, qh, ctx->num_qh_p); - rocke_value_t* sink_h = rocke_b_global_load(B, ctx->sinks, qh, ctx->dtype, 2); - rocke_value_t* sink_f = rocke_b_fmul(B, rocke_b_cast_to_f32(B, sink_h), rcp_ln2); + rocke_value_t* sink_l = rocke_g950_sink_logit(ctx, qh, qh_in); + rocke_value_t* sink_f = rocke_b_fmul(B, sink_l, rcp_ln2); m_inits[0] = rocke_b_select(B, qh_in, sink_f, neg_inf); } else @@ -371,8 +382,8 @@ void rocke_gfx950_attn2d_emit_loop_bounds_and_inits(rocke_gfx950_attn2d_build_ct rocke_value_t* qh_mod = rocke_b_mod(B, row, rocke_b_const_i32(B, NQK)); rocke_value_t* qh = rocke_b_add(B, qh_mul, qh_mod); rocke_value_t* qh_in = rocke_b_cmp_lt(B, qh, ctx->num_qh_p); - rocke_value_t* sink_h = rocke_b_global_load(B, ctx->sinks, qh, ctx->dtype, 2); - rocke_value_t* sink_f = rocke_b_fmul(B, rocke_b_cast_to_f32(B, sink_h), rcp_ln2); + rocke_value_t* sink_l = rocke_g950_sink_logit(ctx, qh, qh_in); + rocke_value_t* sink_f = rocke_b_fmul(B, sink_l, rcp_ln2); m_inits[r] = rocke_b_select(B, qh_in, sink_f, neg_inf); } } diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md b/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md index 6f3ce7545043..19fbb8955dd5 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md +++ b/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md @@ -421,6 +421,37 @@ Detailed flow: Tiled 2D is useful for chunked prefill, sliding-window rows, and moderate contexts. It can under-occupy for long single-token decode compared with split-KV 3D. +### Runtime layout (`runtime_layout=True`, gfx942 and gfx950) + +A tiled 2D spec with `runtime_layout=True` builds one object that serves any +dense or ragged Q over a paged K/V cache. The layout is read from kernargs +appended after the fixed ones (`RUNTIME_LAYOUT_EXTRA_ARGS` in each arch's +`attention_tiled_2d.py`): the Q/O/KV element strides, a separate V block table, +`seq_lens_q`, the dense row count `q_uniform_len` (0 for a ragged Q), the +q-block grid size, and `sink_is_f32`, which says whether `sink_ptr` holds fp32 or +Q-dtype sink logits. Head counts and the sliding window are runtime kernargs as +in the fixed-layout kernel. hip-kernel-provider's `hipkernel:AttentionPagedUnified` +engine is the consumer. + +- fp16/bf16, head size 64/128/256, paged block 16/32/64, 1-16 query heads per + KV head. +- Only the default 16x16 pipeline: softcap, ALiBi, QQ bias, fp8 KV, LSE output + and the 32x32/transposed/fast-KV variants are refused at spec construction + (`_runtime_layout_reject_reason`, mirrored in C++). +- gfx942 may split a block into 16-row multiples (`tile_size`); gfx950 uses one + block per KV tile. `runtime_layout_catalog_spec` picks the geometry. +- A ragged Q needs non-decreasing offsets with + `off[b+1] - off[b] >= seq_lens_q[b]`, and `off[B]` the end of the last block. +- On gfx942, `supports_tiled_2d_spec` and both builders charge + `runtime_layout_lds_bytes` against `ArchTarget.lds_capacity_bytes`; on gfx950 + the shared tiled 2D LDS gate applies. + +Byte identity is checked by the parity emitters +(`library/tests/parity/gfx94{2,50}_attention_tiled_2d_emit.*`), and +representative objects are pinned in +`platform/tests/golden/rocke_representative_ir_sha256/attention.json` +(`attention/gfx9{42,50}/2d_rtl_*`). + ## Tiled 3D Split-KV Kernel Files: diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/instances/SUPPORT_MATRIX.md b/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/instances/SUPPORT_MATRIX.md index b66e4e03baab..a0879bcffe4a 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/instances/SUPPORT_MATRIX.md +++ b/dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/instances/SUPPORT_MATRIX.md @@ -151,6 +151,7 @@ be smaller than 2 GiB. | `unified_attention_3d` | ✅ | ✅ | ✅ | scalar | | `unified_attention_reduce` | ✅ | ✅ | ✅ | scalar | | tiled 3D `kv_layout="strided"` | ✅ | ✅ | ❌ | non-paged Sq=1, fp16/bf16 D64/128/256, aligned unit-D KV views; existing tiled segment/reduce pipeline | +| tiled 2D `runtime_layout=True` | ✅ | ✅ | ❌ | fp16/bf16 D64/128/256, paged block 16/32/64, 1-16 query heads per KV head, default 16x16 pipeline only (no softcap, ALiBi, QQ bias, fp8 KV or LSE). One object serves a dense or ragged Q and paged K/V: strides, separate K/V block tables, `seq_len_q`, the window and Q-dtype or fp32 sinks are kernargs. Specs over the `ArchTarget` LDS budget are refused (on gfx942 by the support gate and both builders). GPU-numeric-verified on both arches (`test_gfx942_attention_runtime_layout.py`, `test_attention_tiled_2d_runtime_layout_gfx950.py`) | | `mla_prefill_fwd` | ✅ | ❌ | ❌ | bf16 only; paged compressed KV, `W_UK` absorbed into the query and `W_UV` applied in the epilogue (the latent KV is never expanded). Takes an already projected, RoPE-rotated query. Lives in `library/kernels/mla/`, dispatched by the separate `dispatch.mla` registry (not `dispatch.attention`). gfx950 is a later phase. | --- diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json index 9cb465ab75ed..177d49142dc6 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json @@ -53,26 +53,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 105940, + "bytes": 105958, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "8f42c5eb0bf9b30f7df0f860edcb2ee681676355c4e9f2ccc61df5e79e2f375a", + "sha256": "f3d4041dc9f4bcce9c7071e80b2b26d288f3a96e2d994fad12508016f7622c8c", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 202510, + "bytes": 206197, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "2a2807332de61d5bf596dc864fcfab6fbac8242c2848daf15cb02de837e1c043", + "sha256": "877fd82b5c17d8e1f991c45b9a4f7edfa4c883a61714c63afa813bc7667e01d9", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 105230, + "bytes": 108960, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "b69e9abd141e02319af2a51e645ce59260eaa11a2dcc293a6d38238ad2934608", + "sha256": "7b7c6b3a885371cb7aa6e64e0c4ab0868e58344ce869e220b38e0c51d22c384f", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -269,26 +269,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81439, + "bytes": 81457, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "54544b94041b9e2b3dba2408e88cc34e421b3d41ff81b9fca35dfa10d0a626b0", + "sha256": "3416f78366d7fa9c31aff46c844f95c4fa72309c52e5e4755a6d32d2c1c30782", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 236088, + "bytes": 239748, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "09dd73b05261cd4e526a5477f07b6bee9b1429fba92908626d7957346879215e", + "sha256": "bc427261c99784c0d9c45d72d8ac84bb55456d594fe5c8aaf1bf3b2c70165cdb", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 82278, + "bytes": 85972, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "9c7ca81cd3dfe6a32e65ff6f852f9501c8827689cd36a9cfd992fc76f9d93237", + "sha256": "4ff725a175ffd194bf2ebade5467817d9c155078b32f12760c2a6dc855d01605", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -482,26 +482,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106262, + "bytes": 106280, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "a89724e214221d6bd23c09b2a1aa51517bc8e8246b9e7ed7d6b25726453a915f", + "sha256": "49a637954eca28bcc8e3ff7f6cf792e4a60f9319b8bb4e0d66400cfa13647fcc", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 202821, + "bytes": 206508, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "0cd8e9464042eb8a77fc08ec46ef2bf3eb2d3a528e98df09e769897d80c8e004", + "sha256": "b2696c5aadbe5ecfc9b228d614cb22365a91ceab58be95ddaf9d176ec4f6261d", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 105541, + "bytes": 109302, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "65a395020a203de61cee6894dd6919206a59ddcedd361487cdf1c87088355f81", + "sha256": "8f5dba82f4eeaf94c353117caf3262b6406d1ee6e57b206ecc998c2e1a59bb5a", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -698,26 +698,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81664, + "bytes": 81682, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "69638ff6a45e11a355075f13ec4952cac7bb671412c96b168b62d8f23cad528e", + "sha256": "6196c922182e7788851e512a2f05383d6794271db07ed4cbc98c3c59d50c7a06", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 236313, + "bytes": 239973, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "c3a52861ef72092fd0f50416e83cfc1423a093e268e4468f546bc219ace6674e", + "sha256": "785aa70542db9b80302a4db5a6e991605c70b52d90236160b5d77e87709cfe8f", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 82503, + "bytes": 86197, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "5d6efc63b830cbd1f4ea9a164fa9a9c419f37d669d9920487971296e95018d3a", + "sha256": "0d8415f3fbefa6fc5cf5c25b07715344e54d7f421d1d506c30d355fb8df8397c", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -911,26 +911,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106326, + "bytes": 106344, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", + "sha256": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 202885, + "bytes": 206572, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "a774126e35f62ff4a39930a55f49dbc991ac7c958eb513ae154ecb63f5389ca6", + "sha256": "d34c37b8e0e5af7a3bc75417684bd1a95b31f69525a53a33d80e6ee258955882", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 105605, + "bytes": 109366, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "5063eaaf732ce50d3ed0705bc14785d4acb930e6985c9c881642ccc49edadf31", + "sha256": "6829ebdb9882aeb7fa41f4487eefe1c470ca79baea4c28ba72514c6a4baea1d4", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -1127,26 +1127,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81728, + "bytes": 81746, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", + "sha256": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 236377, + "bytes": 240037, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "5dfd50625325c524b73d9e04df1de934a528c3742648e71f2e988171e04528af", + "sha256": "7fa0e3fc9a51cfc3516ee9665e661c67fda0a4ad1b94788f1d4b9001db5d0605", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 82567, + "bytes": 86261, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "4b53df96d25d325a39dff797d287b9bbb1fe44bad1d4309f930fae70785e6198", + "sha256": "f75f2a279747be1f413eede7bc38f5ca86d837c3a72c8b8af5dc4e0af7de185f", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -1340,26 +1340,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106326, + "bytes": 106344, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", + "sha256": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 202885, + "bytes": 206572, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "a774126e35f62ff4a39930a55f49dbc991ac7c958eb513ae154ecb63f5389ca6", + "sha256": "d34c37b8e0e5af7a3bc75417684bd1a95b31f69525a53a33d80e6ee258955882", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 105605, + "bytes": 109366, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "5063eaaf732ce50d3ed0705bc14785d4acb930e6985c9c881642ccc49edadf31", + "sha256": "6829ebdb9882aeb7fa41f4487eefe1c470ca79baea4c28ba72514c6a4baea1d4", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -1556,26 +1556,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81728, + "bytes": 81746, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", + "sha256": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 236377, + "bytes": 240037, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "5dfd50625325c524b73d9e04df1de934a528c3742648e71f2e988171e04528af", + "sha256": "7fa0e3fc9a51cfc3516ee9665e661c67fda0a4ad1b94788f1d4b9001db5d0605", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 82567, + "bytes": 86261, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "4b53df96d25d325a39dff797d287b9bbb1fe44bad1d4309f930fae70785e6198", + "sha256": "f75f2a279747be1f413eede7bc38f5ca86d837c3a72c8b8af5dc4e0af7de185f", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json index 181f1e0dd7d1..8116b2c2c8f8 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/differential/golden/llvm_gfx_all.json @@ -1364,26 +1364,26 @@ "18": "bf7b02b7aa2d32470335fc8dbb966b40af321525e28b3f351bc7405a27265d69", "19": "d9b3c7bf671ce53b4eaed65a93a88fdc88eadc9a4013f22a4c654984440711e0", "2": "ee4683453afbbc49e5ae11714bccf200fada5e75884a59405cc6676af6e57b81", - "20": "666303a6b2e796bc57262ee0d602d0d5b7bfe1d072348b55cd531316602077e8", - "21": "454b75f8bc1ecdee95a2638e88fef0e8c884e1d8cba5c57c91f7d916c9915268", - "22": "73afa617beb3add79f4b3cec4b40552b9d27293b1f980dbe1147a64e2bf5f96f", - "23": "56ad09bbf240243bf55ab217031f75ae05c63247b097a8c7d15800fc7711ac31", - "24": "86ad26838baf83b893b43390ef75a38c6ac6d5fd7838e70a2ea171e7e7bd5f99", - "25": "25d3537319d899b4f2690823f20952cf78922532f4b9bf1f5a54d6be76bc2f1e", - "26": "91c6afd3ad49023f966b7b9265d05a1b8802121d61c92222d84cf1aac003e42d", - "27": "7206c529f514d7f6d3c62f44ae05143e783f41c7babffcc9132433e88d58f5a3", - "28": "70641ee085d38835020d7e8681ed04ae085e909ebb28210646d3fc6aff508f11", - "29": "6e4f5b4d2bfe3d7866077ae463a7eccc0b4066fd3160e75568eb45fe5fa27a3c", + "20": "2e363d8d921ff4dac7049040c305f826aae20cfacb62ec38201299277ef149fb", + "21": "9347a9d03cabedac2be9306289acb206a1c0731d52f114efe2527ea2dbc74798", + "22": "b6442395c9ff6650b406bb10722c0546c8181db620c525a09ab67a5fc5fc3817", + "23": "dee0200b60b0351ec8183c6de4ebdf9269cc4395271b2d07d3d97af3338cd027", + "24": "38a0921bb85ce12dbfb5395e4eb3c4614921fedc67e3071aff191bd1715fd39a", + "25": "f2c8a908d78512b19bbbf7e2e666248cf24089380d1617dfda1f2136c00fef2e", + "26": "059cd49d9c353c6ec175635613d4af58075135fe2815448986e1841e3ddd1a6b", + "27": "c19fc2279b66486ad98cec637bb4cfe69d5061563e1c1e4058eaf9244bc6fb62", + "28": "eb602e7059d2276478354744ec8a59bf1f0f48798195d1af114dbdf84bca5d6a", + "29": "05341eae7c9d281f6608591f66869e28f360ded0bca79e70fd8b77878895faa4", "3": "b364ec606939a153220377511d8bb21345bf28f998a41c1f8e3b0d96cac6c4a8", - "30": "866171f3d8994ab5e108a021802871a072d0fe23b2ad978e000fc1ae6f8fad88", - "31": "576b6aba324763dfb744f7bc4b2d25fcb93f8fbf585b5f8a76ef9ed98a8ef242", - "32": "af4031604abcf4ff6ccc1c0c5b20092e7be1b230112cc8599c9fad95be4ad81e", - "33": "db1e6218a2fbf0f336649852e3f1df2da7379ce8ea440cdb710f9ec8596d7bab", - "34": "633be65fd33fb20fbd454f6bae07a0958a9813ffbca836be0a9dcaa33656de4f", - "35": "511b5c0c74e9a8e7c142f3a67576729d72c45edce8c89273cfaa2c37873bb235", - "36": "ca120317512e687e21ea79df7b093ac15ac8ac14266ff77cc747f7b7f05e6546", - "37": "d0d24908b2657ee6f11c14b15e674f472b23f4bdd21b1989af948d16a55aca63", - "38": "d1989c8414580ae3259b908df889d5fd2c78a5f68362016217106552bbeee586", + "30": "ecefeda4d13a4e5126356dacbaefcfc2cc56d1bfe7a96e0d342ab8714980fd2c", + "31": "6815dfba91d35428a18dd62c6864862dc6c26ed08bed8b2facaef8c4b3ae58ea", + "32": "c616bbc0aa3cf62580737b3950121324af981b4eb9a9964c37fb26f63f730f06", + "33": "d646fe28e6ad877a51dd9cd24ef3ffca4e6d7f16a9b678c006929f3714878f78", + "34": "308a5afd581b6a84442c9dcf7fbbc84a3800840668b4b77b544a7e5ce5ecda1b", + "35": "04d41a0611d4cba06ae16b1d704c073666f5d3bd5e16bb476dde4d2a597ae355", + "36": "7cd2f4b54f608344c8e2ee1b25cef1dd64d38ec103f2fa89c307fea289534349", + "37": "c6199ad0383db9596ee0bfa74b7aec10e190b22b6a16cfcbe8fcf1f872ecd25c", + "38": "907fc4bb266715e7c461b7b7b091647fc3929a1fffa4657619652ba424879edc", "4": "66849d43bf1485879bcf1c5f173d72862cca98a1985d0d2d0ef824fba8c5cbe6", "5": "e9427bcb1fe7b9bfe568b7451b9f6ccd770c9399ff05deae35775479e13a407b", "6": "4337bae9b89e2794112a158ead6c4f06c3c86d992046ba3902496ddc4f940b07", @@ -1549,27 +1549,27 @@ "7": "1067ddfadbdb481e9623ec4389070eca0a385d2968de4d5218cdaf62f68481f0", "70": "6b98a1c3fe47f3794abb2eac2c2be60dddd0030b9247848df12867450260a76b", "71": "f072b9b61cc857838d5cddd76a6b9796a00c613392c172c6e837a20f76969019", - "72": "f9134ac77ebda713d0abd51835a0dae98bee946247bc9fe6a40e349c3140bfa5", - "73": "4234b32422c8ab20c15b720b38f661cb73a121aa69982c39b9c43f798b52da77", - "74": "4b867000de3d7981d3435abe475f7c517c59b8a9115f25a81967770a7ddec9ef", - "75": "4018c03a10ec9b450cd061cf8cb2a59db635527f4a9940f14d87967246174ce1", - "76": "81ec48f4a3bc5239c9a0de08962a16c3f7ff72a661dd9e8e15bbeb4c71046bb8", - "77": "a2338afd929c6a5e60c4fd6b6bc9f64283fa38dfcffc24eecb22ee357f888dee", - "78": "f26157886fbaf79ffb6ada88da0650701c3d41c48f0f843a650cf04b136751bf", - "79": "7d2ec86467e0760be88a4669eaea0d1f2f998a2c4469714ae8eeb2caa006f89a", + "72": "83de75d5bc2cdc480983d0b2c4cf4c2f4fb553daa4f68536b4207e23e60d59dd", + "73": "974b7059d2445402ca6b6689e8838eaf723fd4f2a7155e1df237085b22052683", + "74": "9b0252dbdb2b1e93aa1973f8c097bb54d22d68394869c04caaf9337d9e399237", + "75": "8b6e051abb7471e2c83db644d5d9fec40dd119f82eb4fa37b5d6423062fe82f1", + "76": "67398f6448c854e7c87e700a4e8724a4376b4fa797e0220f97d166c0976628ac", + "77": "056abed73fa4d1c8b1c2794141012755b53caa514592ea54bbbd5fd73034903d", + "78": "7f8e854e8349ee5040862d931698d63d0efda193235476509e1e06dcb17fffa4", + "79": "75f3fdf71b55cf0d5f77933851d85f0406f695f1bcd4049e9ee1e3b16c9ddadb", "8": "f4f0267af6f85a06591533f53a3cc74339723fa2e33c5f68e5fcd1b1ac4a6520", - "80": "5e0743eb0be9c60c86567fc1b1a12d24f63351282852ac6c0d67aa522728fb59", - "81": "a4ab530ee81f1480733c390b3e62add7ba94a40d58e32e65643b3cd7fee98d73", - "82": "46e0e63b208ca20392ad494a2637dd30aa95d08d3482ed8fd100b12be1e52b62", - "83": "2781af8e584afd78567a74bea9cc50827fed7ecb8442af323d469dfba6db7f2a", - "84": "d3e861d6ede760cb88ac006e557f70a0da2034625d0378224638f3dc9f5d336a", - "85": "e1711a898fc515fa3328cbe6357c4fa03261861c676636e4004942845562018e", - "86": "a059f21190198fc779b91c748cd37145ef35b6724fe0c1abb3dd7b655ca14f92", - "87": "6c0e71fe2691ce540ff756d13fcfaf458dfef6e0db6c33bad22290cb884dfc36", - "88": "5506596f31e8c1564799495c47b88e88f4b1ba4b111b1c37a4b97629b706cf0a", - "89": "91c7aeb7dd6a251458c9485559a8385cb03abbab1d19359b44ccb35746b371d0", + "80": "3a894620bd7a50a98dd7774239ac2164a680d1be983b8f8e44da680efcf4e478", + "81": "fc4e0c901ec55d5f9f609d5881e6686afbf62352dafc6d76c3be6132ddd85fc6", + "82": "a5e3c7c51c7eed9fa752244a8699b95e8ad0bfb2e0e7e0a99cdc372ead9a1a50", + "83": "b9a9e1be3901d1edd475a8c0e7f6528c80f42f649eab1942c93a9c9351074789", + "84": "1cf25dfbde8a5f5fc1bf07bb3549910be77e611efa70df1425fd2ecdf1a20b1a", + "85": "ae24d1bad69ed66502fe51b9025b5779cdd9526fdb65459b1d2ec940e4b8259d", + "86": "068f99e10ecc49047a777edb72762940dcece7faf83f77c1c13ce1a57a27e892", + "87": "fb8fa07a7d3a28e7012d21a97d71274b40238088ed123f12bf6788a1d562689e", + "88": "471c057c6b9b1ed6763fba2f6a05ca60e63afd4f75c777dd9f7d31fe3acec625", + "89": "0696ec81941ca9f864de7f64151d81c0099d0d55f4fdaecdd95c53001ae69a0e", "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25", - "90": "cb49636a4e30e6bddc791e02cc00c012028e7ef51684af0f4adf69334a22ff7f" + "90": "8d72374533bc3888f8d5bee6a0729e25cfc874f97a8fe40da05c07ee216cba15" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "d21a86dc7cd4b574b7c58faad7dff5e113e6ad5fd5739abed3d049e27de730fa", @@ -3247,26 +3247,26 @@ "18": "7d21d4ce1dd271b1dfe7f82d0c6c128c3e249b1f00833a090b74b3facb94f80e", "19": "d5b8888550a1db52d497b490f09cc169d739d054d269284ff7be8f5e3d3c2031", "2": "5841c730e964542b171c289e6075eaf6332b3cae253707da9fd74d8bb3c9ba9a", - "20": "bcb4a07d3fc11b9577b30479578b782bd621376369f2f46a3bc2592ebbed440b", - "21": "d292fe091fb4e072f208730de8763da9f440cc146ec8bba646d65ac406d8067c", - "22": "56af4240da55d6176a75b974ec502194259be7b8c4c4537236a990a05c269081", - "23": "8f42c5eb0bf9b30f7df0f860edcb2ee681676355c4e9f2ccc61df5e79e2f375a", - "24": "8b0996f3a7486152e495eeba150cac329438053a6a6d91e877e0ef83aaabd248", - "25": "9a1bb67798af4586458004200f2bddf05ccda51d3ae5590c908fae3bbca2b1bd", - "26": "8c01099cdc4e52852af594bc68742a28c91e03fa2e2ee5da7b2eab9783bbb679", - "27": "c35dcb6ae2ced1ee068fbb21d3a3b0570aed7335be8d68010a8d134643646cf2", - "28": "57481c929026e8b74c8eea29eb92223201498193b20a110acb6a0238a4c18645", - "29": "5dd25528c8f42ac34bf4e92d996df104de0ec6f648b135593288afe871031c0f", + "20": "ae4bfc435d6bfc26cdae392617a32baf19ebd62127c73292c96aafa8e5768424", + "21": "e802f72913d1236b8fdfeecf80b823335faed4d641ae589932085e871982b9a4", + "22": "ac7abdd460b05604ee33d06350507a9110a5bd5e02bd5af5dec0b9bf45f9f8f7", + "23": "f3d4041dc9f4bcce9c7071e80b2b26d288f3a96e2d994fad12508016f7622c8c", + "24": "324d2208eaf6721a20e11143faa6bc1950a7fbfca2e1af9840801f0346f32c04", + "25": "20981eb1c6d0a69dbafd4b0631562457926644349abec10cc55e3a9a92ed7d7a", + "26": "cc3aeaf82a7d8cb5e82181cccd27171944903824c203518ba042b6b3287f4442", + "27": "f0fcf18f8bb49e5cca633f319c68cedc126e0cc9870b1f5d255de2f1dc8da903", + "28": "acc53278b8c18a3f0b51143ad51291ef6fd4638f66436416151e387963f07e55", + "29": "b31c1cf5b697c718c3a62f0fca6119a4b282d557d2c175b6572ede42228752ea", "3": "bd9164bfbcff6da42e08428ca167eeb648967f4c40c019f79ef435be664b0d6a", - "30": "fc6c7e58cc1f5a6117069cd4ea7be75b9d07b1cdbbaeb55715cae7af7c4a0715", - "31": "2c93e74a2abbe2e2aca310941bfa3f41bd63ce7b4aba1ab4df463fe3877e9022", - "32": "0b465cb3154883a09e10326623f891be99297430ea7a9a24d24af436d2dc4ce5", - "33": "bec1760aff6e1e1d22904bfdb02038214b8d6e868506d16d1d912c65cab19eee", - "34": "f67725e8c3ff89eb603ff96fb792ddefddea8dc2cec4009cc5350f26280a7007", - "35": "524ae8f18c0c8885b4ed5756507b014d4fe09633498341af9c8d58b1ee61c421", - "36": "8e9f0c37cb7be107d5f87b0ada13f8e5830eee850ef43c3e02770fb68715e753", - "37": "0fbc6efbbc9f5ac2cbb615b83e23b3c782121b513b800602f12658765ae593f3", - "38": "df7b2882fb0933d2158fbe8badf373935d492a84ee21584b600b661b49a3bbf9", + "30": "7aae0b5921e852a45ef6bddf9432d8f3fc624619e78145a3215ba8b25630b101", + "31": "a8a6bb419eae0da707475d2922f1ff0315f6f79822b09906792aa16daed70a87", + "32": "e88ae905222185d38c92d391e98caa9bda5a3b8b02c4dcc935493fa43826c319", + "33": "3364b7ef1018ea80b034b24251b1cbb3e81f60af867ffc2b66d3345d418c20b3", + "34": "2e547b15c999b6d33c8e42612e0d0571f7c998cea54f4f2dd7703895a1d94a31", + "35": "242529c725b7bedf06f07ddd56c614b03d4b171bcf9d0e49ef680ee18ba8414d", + "36": "379f545580656dfc09144c50d6ff58f3e336a2e21235bcefb08677fcdb38e941", + "37": "35c3050a5ad5bc562d94abcf8c75952ff6d7905ae55fafa01ad85e60c8df0df5", + "38": "0a82318b9093265d784a0f1a05486880eddcebbe517bc9f0844527f6bf0488e3", "4": "1b04fa2470af0aa59452389cb41125418154ab3939758ed4a38789ce290b33ab", "5": "f6e5cf8a0392c1bce3fd7d9ce4d0eccf9d39fe29f02ab9bcf5c342152eba4ffb", "6": "c5ef7876d05cc7b9ea1fd4a8fe807c660bb1102a5f198790aecfff165b017c28", @@ -3432,27 +3432,27 @@ "7": "763832662414ae026dad9670f8f064ceea6145dd42ec2159941d37f3927ed2f7", "70": "2a3870347ab70cbcb276925da1726e5c51dcb737771d9d2af5e742a8c22680fe", "71": "2e6df5bd9a6d6430bdd7cec8fb061975b840cc885565eb058307102a26e52b8b", - "72": "0233372e8a00b9fca79590c1cf9828802b9e28c0b951af6504f921aac69eb3a2", - "73": "99696217544419c1745ffe87e0fc43c094db13871f32b903ae083043e1eeae19", - "74": "ab47555355973e27326bc4ff5c9137409a42730c247c6f6575f99146e95062e1", - "75": "54544b94041b9e2b3dba2408e88cc34e421b3d41ff81b9fca35dfa10d0a626b0", - "76": "e4c3d292055d5e3a73bc0ac6c27c2ca022213fae0a436a2f6add4703fd52fb92", - "77": "c36631ec3a1353c919476ff4ae3254185566485ef7e68c150fdc8eae90e025d5", - "78": "c7aa33fdaaa57de209d1fb115d77d106b35a8ad8a418052fd751bfdaccd2a6f3", - "79": "1d4bdea08c34fb3776b779f5b56ad989fc7baab3ce26d7d8ea02b65ef095f5f0", + "72": "79a7dceef35235bbb253af5a093f25b630dbf44ee8fbac855b6c75dd4e08b99d", + "73": "c5ed02b00da5b262fc22fe25f9e598035ea0dc822abc52194b9bc35678954927", + "74": "5099ce92542815ba59346c78fac0156a75e4c9174b2a8ec34bf244aee7f9752f", + "75": "3416f78366d7fa9c31aff46c844f95c4fa72309c52e5e4755a6d32d2c1c30782", + "76": "aa7466461b935632290a6f8a6d3d27451cd3b2f02838c4305d5b3abd2d999e05", + "77": "3be96f3488605b1e2ccabe098e6a628a9dcf03bd0f1dc117ca6b8a0e43b25695", + "78": "08c099e740bd8af7a9e4c72da12ebdef8ac0a869414b657abca94ef79244adbf", + "79": "bc03ce48f54caac13e347e2c4e6f2c0186b5641c5f3e729583461e0be7c2f587", "8": "436a62f0670b97e464439f466724c5d911a96b10e4bb035429b37d5be8d85243", - "80": "6fdaac51b884fbbdbdd1e01ee5afce4c334fc1c203836842c6f91ae4196086a5", - "81": "7be0d9f0c4e9b40c65b962ee1e0e7611517f838d1b6b7d08f4a77694c1b70c76", - "82": "7e7c405e62a024d1704e21a371be6ea45c8ea187150d0bd2af73bb4484f4c7d7", - "83": "02669a17688d7203b3ac0322868d11a8836d694860e8e8246005c1ec5c94202a", - "84": "0e3e23d752dae8ebd6384661e7df5aec1b7246001114e04183a53c391bf78be0", - "85": "22c29d1bc0470751d76e96c07aeddd8e9cf4e7d28a9b617344cad8884b3a1a93", - "86": "b365c033a778d95309bfd13977bf10739ec6d29f3b10a880cbc1bbd90948a61b", - "87": "3830ed3ec13f6311ebde80539b568de035cc4ad83caa8576808fbc0e40dcad99", - "88": "cc8b31817e81c453c87898973559820297ca8a3478195c904e2178b5ab8aa3f7", - "89": "1935d741923dd4a591778c366724a945a6dd367ea43448400d6eb7d08218d883", + "80": "5fd1f51d2c59b87fde595b8cf690cc8735ce07f0e76444d86a0174ebe6b7ec4d", + "81": "93aa1b95e90868df7f5f3c808cc56eb9647f7c90259426017f7e4ed88f2a73b0", + "82": "5b4b9dec111e06c46cf2c9a6813d6405f79776726cc856b67cd408498c55234c", + "83": "bcf413b507d98252eca114e436367b37d7063a080d3d82ab6b9ef568dd24dca4", + "84": "a4baa945d1e24489e0bebbca05004486a0f41516308d95bc36ade6011568a6c4", + "85": "bc5c763745bf62f39d97f33409fd3de3504155eeebbb1f98ec7351fb3029baee", + "86": "cd63c4a08e6282d15538db79508a38cef846f726cbb0dc24c27d5fe11981804a", + "87": "6a234ac79b5f0ab44db42b26013db6e76ca8235f093e293a32c569bb53d7e627", + "88": "4ca9d6464a6c71ea850b365e2942b6007baf7863cf18b85a1d2bbf4e188df706", + "89": "b7afc2dc8cc7189521acd66d0e98ff4a185206f301539804ba8097c7f7afb789", "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9", - "90": "3498134cf5b592c98e08b3a22095f1b079eaa913bb6ac04cef235c323b9d0b60" + "90": "47b7a54388559ba28464f93aac43eca4f80f22c16c55b904d215734b60721587" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "52fef7be3f5b5752f4d62e09b0c9296df1abdaba39cc1d360d05e41e0b70edb3", @@ -5129,26 +5129,26 @@ "18": "eb020317c6d6bab712c0379731bdb9eab253ad67be3b1937c759c4ead5743c78", "19": "a8cc1af85ca357f2e5b109402706d4be4e6f9235839c3016290441ed7cdd6799", "2": "9b7b8d4ad0d7c67143c5887f561e08182cf9a095bed1a76ed53b406cbd45f768", - "20": "f6bd8ea4eb1b37d26ea34d20bbf07decdb6a4023db827b685c6b1016744f5ea0", - "21": "3f2dc386df2b174af12fd7ca2e7b6c93ff2748c3c192214bbf780a8663696006", - "22": "061b9089542c4fc2a5549af05166b92a547c1519330d28339228a8afb9e4a6c3", - "23": "a89724e214221d6bd23c09b2a1aa51517bc8e8246b9e7ed7d6b25726453a915f", - "24": "9270bdf1d5a416515efed92e90efb653162b46ebe87ca709c0640834315649f2", - "25": "30837d1a4206cd52910371072feff61e44e5ceacb7994b643815aae8e0b4d687", - "26": "61f5b9508ba3bf6c455e4ca12b0ab20cbf63fd945d96dd628b5a12ae582b9f7a", - "27": "6b2b72fd5802b0897d9a177602c7887c6726bc6b6bc55ab427b84ab47457ae2a", - "28": "1a15806eeb788f57adc4b2f71223f50f15b3d632d3d17fd8140c26fe15110d07", - "29": "940d064ac0ec9ba66eac1bb0b1fe71cb27d13325d4843f1654a86bc52785455c", + "20": "6a2d81a621a2ce026b3372719b170661ce3cff70d9aa8e6ee32be333898e8217", + "21": "b542158d8217e5de3264d44ad6bea2aa2bc1e3318bdebf59c946b12fb96b345f", + "22": "89a6cbb0c61afd04aae4f6ba5d3bab8c25bbb30b8770ef33a464a7e466b79969", + "23": "49a637954eca28bcc8e3ff7f6cf792e4a60f9319b8bb4e0d66400cfa13647fcc", + "24": "1a1acc25bd94e9eba76215ebe9d5f776953e2bcefb7f2b9b9e01366b8a11a4cb", + "25": "b1bb950a28a202cbf10e48d2bb36272c928b127baf1e5a96c491a0aef1f8ee28", + "26": "22b01dd891424c57b67ebaae5b4662a1c83925e685067ff91fb3d494498a0899", + "27": "394a6a7e99ebeb39163c937337c1886669c4c66d7affdd2c0d6183446b584e54", + "28": "a4869834955c92ca4c5d62b1328e2aded516b679dfc648281712e571c1351baf", + "29": "8f9c3f14e3552218b1981994433f9d5ebf8f43441c240133b74d270a14c4728e", "3": "04366ee133dbfc67fba244a8d80ef386386c288436c373fd2ba3fb34581287e7", - "30": "57ee817fa673ca055216d3fda7891ef5738b0d73c53ac26b7cbab6ebfa63ab23", - "31": "980fbdc1b97b5456850d6cc94c703bef9856c9e29e2bb55c3a5423817fdcdc09", - "32": "12e212bfd76862b05de34f55527246f9a4d1555e0934971003dcbd4f9d533c40", - "33": "494181a2a483168df1810295064ed62c5ad9af4f8fadc912b6c02717f5d74356", - "34": "4ead2bb421eaf455e56533f8274e7beaa5606c99ae6b7c8fe1f43bf94d103b2c", - "35": "3bdf72527ca314e2e753990025d6bfb7a9567d47271f04f92f7d3736db3b41ff", - "36": "e9b7879e54f0a493405adb3edbed29fc84a5241eb3ba0d027089224b3cecc13b", - "37": "e105747a45e35637abaa7df6f8e210903a4a6c5a4ef8f665226d90203558ce95", - "38": "5a915c91641043c6284b1a6c544ecfc2ea61020cf2c53831fd0073c31deaf34b", + "30": "82fff84cf5598a56813d3781d690dac63bf94a462368cd15700210930e3b48ed", + "31": "580f41ba37032b73b666bb8f168d48221fb14273cf02ed1175bce2c6ba2618a1", + "32": "5b873d4500327c2cac53982b01fda48103de00363fae05fa1a96e64abdf1d0b1", + "33": "9b21645e61ac0cc20af3f0448cd204815001e6083856481b8d78062f6a82297b", + "34": "72630d99102d2e13700c7930cef382770839d2bd2781792fb2b597a78a41ef7f", + "35": "5dc635d586cb3e2bd50b12e42cd93727cbd326b8f1fdc6f8631ba40a2cd3a2e3", + "36": "aa94b55e5450341682324309c79f4ad95ec59f36522b442c460d4d55756107a1", + "37": "1b6649c7a47bebc56d60fb2c743ecac6a409eedb0f7785debaeef285850a163f", + "38": "31a5721a1446f3ac288de1b3950508cb684036d4fefc00149b367ede5cc0d12e", "4": "f7627f88969eff7df1add5b6a54937fff1c2eb1f869cf4db71f51ab1657c72f8", "5": "3b8b9c52b4b74d31c9be73c6d0ba0c5e7549a0015ff4e3fffb86fa16968912e4", "6": "a42abe98ff959a8fec3fa4e6d733b7a7382fb99212f6c25846d80aa3fd6e734f", @@ -5314,27 +5314,27 @@ "7": "8212f1103d5177844f6a8f6ae2e4beb73c28486bb07d975da6aa94cbac407c41", "70": "6a08f23a301f5f3025c4f0aa673f1848a6a91af57b81f853f3150e347b6fd164", "71": "b8eff71e24ee9632e4c37ab8c589975411b851bc1abaaf0e47e4a2dada05ce10", - "72": "007d93ce03076713cf93ad873a579f17917d9709ad90c591bb9075094ad4802e", - "73": "eae27df1173f23b64cb3ddda39d9420015b916d63e06de219524add66556cfe5", - "74": "6dc84613c57a816aedbb938541768c4b39f579e35c6816b883ef8dc8c810909d", - "75": "69638ff6a45e11a355075f13ec4952cac7bb671412c96b168b62d8f23cad528e", - "76": "4597a2588631eda6b60b2d07bd84322f3d24628b0d62f2ec718e1d0a003dade1", - "77": "ac0c2ab073e44542d88d124530f446eeb4d7f6d81a8ff1646568714b8a1b73b6", - "78": "0cc4ae127fa9c5bac58a717f13a55bad2ff989b07160bd740997be6d5893d502", - "79": "8b01743f559c178bb3b5e01473f7f5d085fe40782d9b3b29984efd1c1690ce44", + "72": "de14403ba59c882784bb47433b1a8e1d8d280a9b0b767365105fa7acd6cc1f23", + "73": "17fc9442bc9bf3ae027ca9ad796028f2b203bf536f1cd23693db39801fd4d17e", + "74": "3626923f169016aca80b3e1942b0265ccb44611a5225fb0637aeebf1ce7b18a5", + "75": "6196c922182e7788851e512a2f05383d6794271db07ed4cbc98c3c59d50c7a06", + "76": "7344f201ef3e30dcd5fc83bb1be8546757706b4c2266e83614183b4b07428bbd", + "77": "a52409d57d6f6689613830d1e284a039bf2551340513a08e376be5036cda7ac2", + "78": "23955e43f93a2fb67587ceb1d82679a05ac2aa785c9062d24c8ac2514acddcc1", + "79": "10e2cb7544e6369ed3aceceb0b11a6c97a02e9a3ab64f4f6ad1efc2a973fe16f", "8": "7d827babcb8192445726b06e4250deb674158b5a77d87ecdd9e873118dc0ec93", - "80": "67dbe9c3dc6e3d01481ef6916ec6133cf0af5337a5463c3ac49c6975e09a2129", - "81": "a21cc72c28178f143ca1fdd2c3d81e5cebe4b18e5c5004af5553a4c9da5591a3", - "82": "85bbf23e240650688c03029d4c624c6929e31980797c809a9dd923c4b205c9a0", - "83": "a201c530909742c2a7034ee3b48a812bc4b9657c5f6b8cab80d24b0aa8dfb705", - "84": "d3c73804384e2d530f137d3e6f8469d1bcef46edbcf960611ccf7dd966515748", - "85": "bf950f025325be33161c13a8ce6382d017ae6b42ff7f57610aa62d1418f581f4", - "86": "f32161f66ba28212d0b599336cabd2c62127957a5b5de4fdb554b5d5c8a13c50", - "87": "a810cb1a1d64ee12853965833059ab5af8e24681b4caa9f275759aaf12458e58", - "88": "cbea7bbc58914d0dfcf53f3aec3349f754c63b1f094db98c6ae25bcafb2b49ed", - "89": "9350c73c9af128189caabd0fa5ded414e8f9b1994e24d2edaaed32022c83cd8f", + "80": "64fdd288503473d76e67a3417f4d2f4c44a8b7a2f56a6b76acbae3f8751b8f18", + "81": "6e35845ee53355d3a8632e22a54ebfa20ea721bb5df11871e45928b023cd6a11", + "82": "ed00b359330de953fe79257d72e86c77fdff6118fd04a2f7ea76d7ecb4c0f9ff", + "83": "a6d662afe23d3f4d29eecfe5dafc84432018133f45d0004dc25f4380c24f38e8", + "84": "2f0db0a60e370a4daeb73dab2f1bb4314ed25badbf6003fe9ee57916b9e4b6c8", + "85": "4f23fc449dca4cc0eb610ac8d1b884b97425448eee8b55dad8071a90e8354a83", + "86": "594c76b960c1c231640f33d780839b3bcbaf67c07b52e8b6c5683ea1bdc48dbb", + "87": "070e307bd89a43674c6f9f64e9445f9ae2fbb5b698edee2aff25ac4aa5b86140", + "88": "b70f01882ba0d81a9d2b1423c443341e416f28a987f609aa48a76e7bba18d826", + "89": "69a6c3ad66d6f1759e0eab717f2b0fbe74f955f2a40963a2ecafcc2501f9525c", "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0", - "90": "4e6ef62cc0b8c6086fd5ce70e716fcacb7bd3b4b82e9025abc4d441269b1efa5" + "90": "1767f385843d786be064c62f75efa6f692526188a0c1de293c93a058c56eee30" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "6f9c1088480f429bc5f275eac443b8bdeeb1bedc8113b3984c4abc00054969a1", @@ -7165,26 +7165,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", - "20": "ded0e8367c888ce468cb360995bdc16a3cf4a19b5871623918a44d27fad1b608", - "21": "3340e3adbf99fab5dfb75636bc3b6e52e3d645bdb3c1c56369d2d36ce1162635", - "22": "2fc147e6e38c77ab35278a458b3111e9cf6a809b8ff66df0dfeb0d4fcd75384a", - "23": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", - "24": "880d76bde4f69ddc629b36c5b9bdcb6c7daafbf43dad70e9e543366fef0619ee", - "25": "78aa461277b5b14266c99b87f6ba4f807d81c3c66d58d0007ef13429cd73c1f1", - "26": "ec7c5ae8d471cf87beca8d8dc66da692dbaea6f062f2a8bab130424e0fdb0b62", - "27": "f1bc3ee0b93035b537cc675c5b20a479ac63c72bbdff1a0df0151822226a0bf3", - "28": "0f86e62577b31c17dd6541a1481587dd76a7c96d5ded6d3d1844621e04d1cd50", - "29": "8f9a60a9d1695a7b971b5ccdc559cae67c20ba8e33db7817171c9329024f4996", + "20": "7b5c964d1ebd857f7ae48adb96a83315d638bf69d69270901f19509ed6c76ae3", + "21": "dee40ea04635e5c91883b8c4ec1498c5968bc973d6e504568c2bfe71324ce116", + "22": "eb6fb095a6e9de775ad4196c96d10d0beca7a8ccf6e5232849cf5efcd81b43ed", + "23": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", + "24": "8083585503b7b785968966b63ce1b546dc5c68576684b602e7ffadd5a2fcaf5c", + "25": "6accc0de09a10b6e3a0bf815c993b3109665ede51249544852359cf26e47eff0", + "26": "fc3e5cd90dbc98ba97bda0cf53d606ff3e7c64a5c8ec012eb9297cee31091afa", + "27": "9a869ca559a1e93cc5a04193124ba8fafa8a3c5438d6da77bd1e7ba9846f99e6", + "28": "7438df7db7c512f30ec542af1fc15e6df9d6b85953291d0c3aa6de7da4eb7f07", + "29": "480d3c86e6d694117e6cfc212de4b8e37ec00ed1ab65e33f33358f599b860e40", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", - "30": "f3aee49ba3ded3161a25a1a17683b344532aeeb6af5906e4ab64850067831d6a", - "31": "9970054b580619fd6316bbc34b6e377cad793703dc8ef17ebec3729830339321", - "32": "85504ed1d9cd7af35cecddbfe7205d82f32cc23516cb656f7449e02f23054238", - "33": "4dd9b75561ae9f6914387c875c18e9fb5dd1c2328d7f241774d6c13f1d5f54d7", - "34": "8530f615d6d5cd0365460a7bf93681f658725128963437a8b2e5a6f13a88620f", - "35": "1f7a0a2091f8c84959f25697daa2b79d6cf25b0d4d9d2b91ab5f04cddffccbd4", - "36": "fe0f4e2722b539734cffac16f786b56fad7d1855bb017828c08fbaafc1732ccb", - "37": "a81931ee9941f9fcebe923057133ebff55fc01e3b46636df9c33a88109fb824f", - "38": "4bfc89e833c54655f339616126dc026c8bbe85793a04674efb64ee25d9c4e659", + "30": "d1435a45dd2842a928d1094c8a5b1221c23eb93b5f1b74e0eb13de4cd6c1997f", + "31": "a877696df7b79711b91dd4c82af81d9332980af29c61921ad544c0f4fe3c0aa8", + "32": "6d8036d83a52d4aee1c0c07daf4711788bcbafa9288b013c68feda2e17717a1a", + "33": "80c0918a2675f42d8b40e7bcf61af227030ff3405805ab0948675460ddc0196f", + "34": "b7672e34e74add594abb9434080e422aad54fe31c6e3831d3e2b36aeadfe3767", + "35": "3c2b1492f0b222b5c03edde583748502c4c179988a7155f58716935bd5995e29", + "36": "f868a90e343310d9006e56138a15b67c7e674014f1f4e3b36679725d1fdad5b8", + "37": "c950dd9c531b03c33184c31c00f4158664244f1e5a69bb34defe8b821ce6389e", + "38": "d845086183c35c7ea62a02a4968ea6ec043077f01416dad41d908a64f03835f6", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -7350,27 +7350,27 @@ "7": "9f8857f7a94b9b8524bd631b0b1fcd3c89d8733d317d2ccfd9e26af3ff72e3ea", "70": "2d702df8314f65d553d8f0e1d72d0d202625361d26ec2a361f7ff3dd012ea947", "71": "a1e8c2259d9baa180cd31a07c3974ff01d000af87bc24a21a7e4b3a157e939ab", - "72": "55449a83cb5e965a2ab3051685e107aa4c3c1d592ebf815aeba153039434d888", - "73": "3c0fe43e46ba8a16c43283bd3034ec9402f1c346f5837c66262ad5ae6c1cb871", - "74": "8cb971881d8c1c5fd87a064d9e7151cfa2701d7e7ee400f43fb072a781522439", - "75": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", - "76": "f9ada83d0ffb7a07153d9364a661f8d9cafec0e9b3c8c3ed36ff655dab3924e9", - "77": "92cf4de7f3fe53a82389564a5ffe50b8af9b40663cd52c7b24f15ee926e596af", - "78": "087cbf264ef35b42a190255b5353b32993a83b6c65965754a4d9017e54f6c8ed", - "79": "b990325eb902c8682c90abbb3056fecb8013ded88fec6dc0fc21b43cd4f7dbd8", + "72": "3ca0c8ac9a950729db5893aa5acb212e2e93e6ec542877221b9e8acb51a25deb", + "73": "46d4d5ee0a69741c1c1be542a82654141ae2a3e55ffa99f309639fc7726df2a5", + "74": "b0ddb35ac351950e1d49953747b1479b3854f9cae5d1e66a18ccf6d57d6c4672", + "75": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", + "76": "fc2caff9d49f063e21990874352d07143908924e814430d3bf3c4ae43a296347", + "77": "d965e49ae59d3bb4948468bfd6ac66aa68e1f2ce2698b89d554e96f0f8aee054", + "78": "0c2a74039c4b7cf5eb7bf33773c4b8c6a9946e9460ebc258b7ef0ad0bce91dec", + "79": "da0cceeff692bb9894d4cc4804d3312a74e7660e7fc25411a4eb004805e60af5", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "80": "67aee1395648bf72d013d292201b336b6607d73b5974c2e82848c36b210e92b5", - "81": "2dcfe01e3dd46e0569097c2f72b071691fffa702195e42dced454017aaa1ea99", - "82": "214592b414935eba99ce00dd524ee74a99c0052f76ccd0b4fec463128bb8f26a", - "83": "bcbe8b80f4146053cf0985f842df04914244dcf05aaac8a21aef735eaa8fe453", - "84": "d28a01c3e5eff2323aa21d52e748c1a7ac38e44b9b8f454c3763c60e34f0bee4", - "85": "26a25170e935e15012639a90284c8f0c4e1844dc6c8744285208b3a408187f06", - "86": "67bf5a562ed09fdf64310cfa10cecaf390b0bcedb4a18ef1360ffcf7ef398d5e", - "87": "c08176a0ef6ca39ecb30ad2bfda80d8642c54ad7264b08b052d2a7c9ac74ab73", - "88": "ce427f1304101e31eabf170c8dcba33c5bc249fe49a13aec8806ca075eb3fa3f", - "89": "0031410567582d31be1b28312607003a5c4e3be63270970766c993dc2129c3aa", + "80": "63648b1d2f4af50f15ae3da7b2d4717caf7d4f71275cdd085a0bd20ffdebbff4", + "81": "cfda0212ef4f69b684d2552914302cfc7c7d682ef62924ab48fd4ffa56dcf35d", + "82": "1b09b4d3293815ca75d98b1d7b77afc6987928d14499e71e7bd324f01ce3d270", + "83": "56acba34ef2ad6e79c7d8ab165ab13f198619588b55bb55be677f64380dccfb8", + "84": "ab5f7bdaba3bc6daf84134b41d2d0673f9e9ce70325929034ebf5eca372f51c5", + "85": "7e7401e8a54cd787732ce17321895860eca9c1b07a4b79d5281e96ebb492eb79", + "86": "2ea74fa8c1c31373f8546ca88249449e1a398271437bce4d81b362318c41a500", + "87": "058e9037f665a5b662b8d479aecc1ee72655dd00821e6d96a1e63f8123b57568", + "88": "ca99208b56497388d6475b4eb16e12d0e58e8433e6a0edffc32036260f0adb26", + "89": "969868a055d91142f2e55c4a2834bb0135daa91f34ef36960e9f37aef7d22823", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", - "90": "d1b3c31e36ae7a62a45fed9c1fd45ce6ab832c082777ab2e30296eeda53e5b3d" + "90": "c8a9718858a6bb16f11824d9600a46e9fd0b668830fbcbdc53046e0c6e588938" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", @@ -9508,26 +9508,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", - "20": "ded0e8367c888ce468cb360995bdc16a3cf4a19b5871623918a44d27fad1b608", - "21": "3340e3adbf99fab5dfb75636bc3b6e52e3d645bdb3c1c56369d2d36ce1162635", - "22": "2fc147e6e38c77ab35278a458b3111e9cf6a809b8ff66df0dfeb0d4fcd75384a", - "23": "d6e5df98712400946930bd3ce2710bf70b919759a95e735fcc58ea4114587bb4", - "24": "880d76bde4f69ddc629b36c5b9bdcb6c7daafbf43dad70e9e543366fef0619ee", - "25": "78aa461277b5b14266c99b87f6ba4f807d81c3c66d58d0007ef13429cd73c1f1", - "26": "ec7c5ae8d471cf87beca8d8dc66da692dbaea6f062f2a8bab130424e0fdb0b62", - "27": "f1bc3ee0b93035b537cc675c5b20a479ac63c72bbdff1a0df0151822226a0bf3", - "28": "0f86e62577b31c17dd6541a1481587dd76a7c96d5ded6d3d1844621e04d1cd50", - "29": "8f9a60a9d1695a7b971b5ccdc559cae67c20ba8e33db7817171c9329024f4996", + "20": "7b5c964d1ebd857f7ae48adb96a83315d638bf69d69270901f19509ed6c76ae3", + "21": "dee40ea04635e5c91883b8c4ec1498c5968bc973d6e504568c2bfe71324ce116", + "22": "eb6fb095a6e9de775ad4196c96d10d0beca7a8ccf6e5232849cf5efcd81b43ed", + "23": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", + "24": "8083585503b7b785968966b63ce1b546dc5c68576684b602e7ffadd5a2fcaf5c", + "25": "6accc0de09a10b6e3a0bf815c993b3109665ede51249544852359cf26e47eff0", + "26": "fc3e5cd90dbc98ba97bda0cf53d606ff3e7c64a5c8ec012eb9297cee31091afa", + "27": "9a869ca559a1e93cc5a04193124ba8fafa8a3c5438d6da77bd1e7ba9846f99e6", + "28": "7438df7db7c512f30ec542af1fc15e6df9d6b85953291d0c3aa6de7da4eb7f07", + "29": "480d3c86e6d694117e6cfc212de4b8e37ec00ed1ab65e33f33358f599b860e40", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", - "30": "f3aee49ba3ded3161a25a1a17683b344532aeeb6af5906e4ab64850067831d6a", - "31": "9970054b580619fd6316bbc34b6e377cad793703dc8ef17ebec3729830339321", - "32": "85504ed1d9cd7af35cecddbfe7205d82f32cc23516cb656f7449e02f23054238", - "33": "4dd9b75561ae9f6914387c875c18e9fb5dd1c2328d7f241774d6c13f1d5f54d7", - "34": "8530f615d6d5cd0365460a7bf93681f658725128963437a8b2e5a6f13a88620f", - "35": "1f7a0a2091f8c84959f25697daa2b79d6cf25b0d4d9d2b91ab5f04cddffccbd4", - "36": "fe0f4e2722b539734cffac16f786b56fad7d1855bb017828c08fbaafc1732ccb", - "37": "a81931ee9941f9fcebe923057133ebff55fc01e3b46636df9c33a88109fb824f", - "38": "4bfc89e833c54655f339616126dc026c8bbe85793a04674efb64ee25d9c4e659", + "30": "d1435a45dd2842a928d1094c8a5b1221c23eb93b5f1b74e0eb13de4cd6c1997f", + "31": "a877696df7b79711b91dd4c82af81d9332980af29c61921ad544c0f4fe3c0aa8", + "32": "6d8036d83a52d4aee1c0c07daf4711788bcbafa9288b013c68feda2e17717a1a", + "33": "80c0918a2675f42d8b40e7bcf61af227030ff3405805ab0948675460ddc0196f", + "34": "b7672e34e74add594abb9434080e422aad54fe31c6e3831d3e2b36aeadfe3767", + "35": "3c2b1492f0b222b5c03edde583748502c4c179988a7155f58716935bd5995e29", + "36": "f868a90e343310d9006e56138a15b67c7e674014f1f4e3b36679725d1fdad5b8", + "37": "c950dd9c531b03c33184c31c00f4158664244f1e5a69bb34defe8b821ce6389e", + "38": "d845086183c35c7ea62a02a4968ea6ec043077f01416dad41d908a64f03835f6", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -9693,27 +9693,27 @@ "7": "9f8857f7a94b9b8524bd631b0b1fcd3c89d8733d317d2ccfd9e26af3ff72e3ea", "70": "2d702df8314f65d553d8f0e1d72d0d202625361d26ec2a361f7ff3dd012ea947", "71": "a1e8c2259d9baa180cd31a07c3974ff01d000af87bc24a21a7e4b3a157e939ab", - "72": "55449a83cb5e965a2ab3051685e107aa4c3c1d592ebf815aeba153039434d888", - "73": "3c0fe43e46ba8a16c43283bd3034ec9402f1c346f5837c66262ad5ae6c1cb871", - "74": "8cb971881d8c1c5fd87a064d9e7151cfa2701d7e7ee400f43fb072a781522439", - "75": "6ee9236d07c4dd45404d7f2cdfe9aa71d8ab9e9fde888e0cfa9a450f31bcba50", - "76": "f9ada83d0ffb7a07153d9364a661f8d9cafec0e9b3c8c3ed36ff655dab3924e9", - "77": "92cf4de7f3fe53a82389564a5ffe50b8af9b40663cd52c7b24f15ee926e596af", - "78": "087cbf264ef35b42a190255b5353b32993a83b6c65965754a4d9017e54f6c8ed", - "79": "b990325eb902c8682c90abbb3056fecb8013ded88fec6dc0fc21b43cd4f7dbd8", + "72": "3ca0c8ac9a950729db5893aa5acb212e2e93e6ec542877221b9e8acb51a25deb", + "73": "46d4d5ee0a69741c1c1be542a82654141ae2a3e55ffa99f309639fc7726df2a5", + "74": "b0ddb35ac351950e1d49953747b1479b3854f9cae5d1e66a18ccf6d57d6c4672", + "75": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", + "76": "fc2caff9d49f063e21990874352d07143908924e814430d3bf3c4ae43a296347", + "77": "d965e49ae59d3bb4948468bfd6ac66aa68e1f2ce2698b89d554e96f0f8aee054", + "78": "0c2a74039c4b7cf5eb7bf33773c4b8c6a9946e9460ebc258b7ef0ad0bce91dec", + "79": "da0cceeff692bb9894d4cc4804d3312a74e7660e7fc25411a4eb004805e60af5", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "80": "67aee1395648bf72d013d292201b336b6607d73b5974c2e82848c36b210e92b5", - "81": "2dcfe01e3dd46e0569097c2f72b071691fffa702195e42dced454017aaa1ea99", - "82": "214592b414935eba99ce00dd524ee74a99c0052f76ccd0b4fec463128bb8f26a", - "83": "bcbe8b80f4146053cf0985f842df04914244dcf05aaac8a21aef735eaa8fe453", - "84": "d28a01c3e5eff2323aa21d52e748c1a7ac38e44b9b8f454c3763c60e34f0bee4", - "85": "26a25170e935e15012639a90284c8f0c4e1844dc6c8744285208b3a408187f06", - "86": "67bf5a562ed09fdf64310cfa10cecaf390b0bcedb4a18ef1360ffcf7ef398d5e", - "87": "c08176a0ef6ca39ecb30ad2bfda80d8642c54ad7264b08b052d2a7c9ac74ab73", - "88": "ce427f1304101e31eabf170c8dcba33c5bc249fe49a13aec8806ca075eb3fa3f", - "89": "0031410567582d31be1b28312607003a5c4e3be63270970766c993dc2129c3aa", + "80": "63648b1d2f4af50f15ae3da7b2d4717caf7d4f71275cdd085a0bd20ffdebbff4", + "81": "cfda0212ef4f69b684d2552914302cfc7c7d682ef62924ab48fd4ffa56dcf35d", + "82": "1b09b4d3293815ca75d98b1d7b77afc6987928d14499e71e7bd324f01ce3d270", + "83": "56acba34ef2ad6e79c7d8ab165ab13f198619588b55bb55be677f64380dccfb8", + "84": "ab5f7bdaba3bc6daf84134b41d2d0673f9e9ce70325929034ebf5eca372f51c5", + "85": "7e7401e8a54cd787732ce17321895860eca9c1b07a4b79d5281e96ebb492eb79", + "86": "2ea74fa8c1c31373f8546ca88249449e1a398271437bce4d81b362318c41a500", + "87": "058e9037f665a5b662b8d479aecc1ee72655dd00821e6d96a1e63f8123b57568", + "88": "ca99208b56497388d6475b4eb16e12d0e58e8433e6a0edffc32036260f0adb26", + "89": "969868a055d91142f2e55c4a2834bb0135daa91f34ef36960e9f37aef7d22823", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", - "90": "d1b3c31e36ae7a62a45fed9c1fd45ce6ab832c082777ab2e30296eeda53e5b3d" + "90": "c8a9718858a6bb16f11824d9600a46e9fd0b668830fbcbdc53046e0c6e588938" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md index 8c1ed4a4aa12..abd273b13ebb 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md @@ -18,7 +18,7 @@ padding, SEM-009 paged K/V, SEM-010 empty rows), one SDPA-forward node, compute | page tables | `[B, 1, M, 1]` INT32 | `page_table_k` and `page_table_v`: one tensor for both, or two tensors with the same `M` and batch stride; unit stride along M; not packed | | `seq_len_q`, `seq_len_kv` | `[B,1,1,1]` INT32 | both required, as for every paged graph | | `max_seq_len_kv` | | set or unset; unset is inferred as `M * block_size` | -| `sink_token` | `[1, Hq, 1, 1]` | optional; the Q/K/V/O data type (FP16 or BF16, not FLOAT) and a unit head stride (see [Attention sinks](#attention-sinks)) | +| `sink_token` | `[1, Hq, 1, 1]` | optional; FLOAT (cuDNN's form) or the Q/K/V/O data type, with a unit head stride (see [Attention sinks](#attention-sinks)) | - Head size 64, 128 or 256; block size 16, 32 or 64; `Hq / Hkv` in {1, 2, 4, 5, 6, 7, 8, 16}. - Masking: bottom-right causal (`right_bound` 0), optionally with a `left_bound` L, which @@ -65,7 +65,7 @@ hipDNN graphs this kernel cannot read: | `seq_len_q`, `seq_len_kv` | a missing or malformed length tensor | | `ragged` | a ragged Q/O whose `ragged_offset_multiplier` is not its token (sequence-axis) stride, i.e. offsets stored in other units than tokens (RFC 0014 allows them; the kernel reads offsets as token counts); a ragged K or V; Q and O not ragged through one offset tensor; an offset tensor that is not INT32 `[B+1, 1, 1, 1]` | | `mask` | no causal mask, top-left alignment, a right bound other than 0, `left_bound = 0` | -| `sinks` | a `sink_token` that is not `[1, Hq, 1, 1]`, a FLOAT sink (cuDNN's form; the kernels load the sink in the I/O dtype), or a sink without a unit head stride | +| `sinks` | a `sink_token` that is not `[1, Hq, 1, 1]`, one in a data type other than FLOAT or the Q data type, or a sink without a unit head stride | Other causes: `alibi_mask`, `fp8`, `stats`, `dropout`, `attn_mask`, `scale_tensor`, `block_mask`, `implementation`, `gqa`, `head_size`, `kv_layout`, `layout`, @@ -137,7 +137,7 @@ both page tables, `seq_len_kv`, `seq_len_q`, the ragged offset and the sink (`-1 absent), the scale (any finite float, stored exactly as a double), every by-value kernel argument (`num_seqs`, `block_table_stride`, the head counts, `sliding_window`, `q_uniform_len` (`Sq` for a dense Q, 0 for a ragged one), the Q/O/KV strides, -`kv_block_span_bytes`, `q_block_grid`) and +`kv_block_span_bytes`, `q_block_grid`, `sink_is_f32` (1 for a FLOAT sink, else 0)) and `block_threads`. The loaded plan launches the same grid, `(num_kv_heads, q_block_grid)`, with `block_threads` threads. A load refuses a value of another type, an extra or missing value, or one outside what the kernel @@ -149,11 +149,15 @@ loaded plan serves every step just as the original does `sink_token` adds one logit per query head to the softmax max and denominator, with no value row and no `attn_scale` (SdpaSemanticsRegister SEM-022); a row with no visible key still gets -O = 0. cuDNN and the hipDNN frontend take it as FLOAT `[1, Hq, 1, 1]`. This engine reads it in -the Q data type instead (FP16 or BF16), because vLLM keeps sinks in the model dtype -(`layer.sinks`, a `[Hq]` tensor of raw logits): bind it without a copy as the view -`[1, Hq, 1, 1]` with strides `[Hq, 1, 1, 1]`. The buffer must be 16-byte aligned; a graph -declaring a smaller `alignment` for it is declined with cause `alignment`. FLOAT sinks -are declined with cause `sinks`. Graphs with a Q-dtype sink need a frontend that accepts that -data type, which is still to be agreed with the hipDNN team; until then the sink integration -tests skip with that reason. +O = 0. Both forms are served by the same `use_sinks` objects, and the launch argument +`sink_is_f32` tells the kernel which one `sink_ptr` holds: + +- FLOAT `[1, Hq, 1, 1]`, cuDNN's form and the one the hipDNN frontend admits. +- The Q data type (FP16 or BF16), because vLLM keeps sinks in the model dtype + (`layer.sinks`, a `[Hq]` tensor of raw logits): bind it without a copy as the view + `[1, Hq, 1, 1]` with strides `[Hq, 1, 1, 1]`. A frontend that accepts only FLOAT sinks + rejects such a graph before any engine sees it; the Q-dtype sink integration tests skip + with that reason there. + +The kernel reads exactly `Hq` logits of the declared type. The buffer must be 16-byte +aligned; a graph declaring a smaller `alignment` for it is declined with cause `alignment`. diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp index 44b966c82970..b7302dc56e35 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp @@ -71,6 +71,7 @@ inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_HEAD_STRIDE_VALUE = inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_BLOCK_SPAN_BYTES_VALUE = "kv_block_span_bytes"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_BLOCK_GRID_VALUE = "q_block_grid"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SINK_IS_F32_VALUE = "sink_is_f32"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE = "block_threads"; /// The tensor uids a launch binds to device buffers. raggedOffset is NO_UID for a dense Q; @@ -116,6 +117,7 @@ struct AttentionPagedUnifiedScalars int32_t kvHeadStride = 0; int32_t kvBlockSpanBytes = 0; int32_t qBlockGrid = 0; + int32_t sinkIsF32 = 0; ///< 1: the sink is FLOAT; 0: in the Q data type, or no sink }; /// Everything a launch is computed from: block = (blockThreads, 1, 1) and @@ -136,7 +138,7 @@ hipdnn_plugin_sdk::ingestor::MetadataValues /// value must be in the range the kernel takes (int32, positive where the kernel divides /// by it or indexes with it), `scale` must be a finite float stored exactly, the head /// counts must divide, a dense Q needs `q_uniform_len` >= 1 and a ragged one 0, -/// and `block_threads` must be a whole number of waves. +/// `sink_is_f32` must be 0 or 1, and `block_threads` must be a whole number of waves. /// /// @throws HipdnnPluginException with a load refusal when the dispatch name is not the /// contract, or when a value is missing, extra, of another type or out of range. diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index 124d3cdcd109..92045e549958 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -82,9 +82,9 @@ * - `max_seq_len_kv` set or unset: the kernel reads only seq_len_kv, and the extent cuDNN * infers for an unset one (M * block_size) bounds it the same way; * - bottom-right causal masking with an optional left bound (sliding window); - * - an optional attention sink `sink_token` `[1, Hq, 1, 1]` in the Q/K/V/O data type - * with a unit head stride, served by the use_sinks objects. This is a hipDNN extension - * of cuDNN's FLOAT sink (vLLM keeps sinks in the model dtype); FLOAT sinks are declined. + * - an optional attention sink `sink_token` `[1, Hq, 1, 1]` with a unit head stride, + * served by the use_sinks objects: FLOAT (cuDNN's form) or in the Q/K/V/O data type + * (vLLM keeps sinks in the model dtype). The launch tells the kernel which. * * One-sided paging, K and V page tables of different widths or batch strides, differing * K and V block sizes, packed page tables and a declared alignment below what the kernels @@ -135,6 +135,8 @@ constexpr std::string_view SEQ_LEN_Q_TOKEN = "attention_paged_unified.seq_len_q. constexpr std::string_view RAGGED_OFFSET_TOKEN = "attention_paged_unified.ragged_offset.uid"; /// UID of the sink_token tensor, or ATTENTION_PAGED_UNIFIED_NO_UID. constexpr std::string_view SINK_TOKEN = "attention_paged_unified.sink.uid"; +/// 1 for a FLOAT sink_token, 0 for one in the Q data type (or no sink). +constexpr std::string_view SINK_IS_F32_TOKEN = "attention_paged_unified.sink_is_f32"; constexpr std::string_view SCALE_BITS_TOKEN = "attention_paged_unified.scale_bits"; /// The kernel's sliding_window argument: `d - k < window` keeps key k for diagonal d. constexpr std::string_view WINDOW_TOKEN = "attention_paged_unified.window"; @@ -655,8 +657,9 @@ std::optional graphMatches(const MatchContext& context) return decline("block_mask", reason("a block mask is not supported")); } // A sink is one logit per query head, which the use_sinks kernels load from sink_ptr - // at index `query head` in the I/O dtype. They declare sink_ptr 16-byte aligned, as - // they do Q/K/V/O, and launch() checks it the same way. + // at index `query head`, as FLOAT or in the I/O dtype (sink_is_f32 says which). They + // declare sink_ptr 16-byte aligned, as they do Q/K/V/O, and launch() checks it the + // same way. const auto sink = sdpa_graph::sinkFor(ATTENTION_PAGED_UNIFIED_ENGINE_NAME, context, attributes, @@ -725,6 +728,7 @@ std::optional graphMatches(const MatchContext& context) bound[std::string(SEQ_LEN_Q_TOKEN)] = lengths->qUid; bound[std::string(RAGGED_OFFSET_TOKEN)] = raggedOffsetUid; bound[std::string(SINK_TOKEN)] = sinkUid; + bound[std::string(SINK_IS_F32_TOKEN)] = int64_t{sink->f32 ? 1 : 0}; int32_t scaleBits = 0; static_assert(sizeof(scaleBits) == sizeof(scale), "float must be 32-bit to round-trip"); std::memcpy(&scaleBits, &scale, sizeof(scale)); @@ -882,6 +886,8 @@ std::vector kernelSignature() "kv_tok_stride", "kv_head_stride", "kv_block_span_bytes", + "q_block_grid", + "sink_is_f32"}) { appendKernelArgument(signature, "by_value", I32, name); } @@ -1032,6 +1038,7 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler(readBound(bound, SINK_IS_F32_TOKEN)); const auto narrowStrides = [](const QueryLayout& layout) { return AttentionPagedUnifiedQueryStrides{narrow(layout.seqStride, "Q/O stride"), narrow(layout.tokenStride, "Q/O stride"), @@ -1165,7 +1172,8 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler sinkFor(std::string_view engine, const MatchContext& context, @@ -634,20 +637,13 @@ inline std::optional sinkFor(std::string_view engine, << numQueryHeads << ", one logit per query head)"); return std::nullopt; } - if(tensor->data_type() == data_objects::DataType::FLOAT - && queryType != data_objects::DataType::FLOAT) + if(tensor->data_type() != data_objects::DataType::FLOAT && tensor->data_type() != queryType) { HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "sinks"}) - << "a FLOAT sink_token: the kernels load the sink in the Q data " - "type"); - return std::nullopt; - } - if(tensor->data_type() != queryType) - { - HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "sinks"}) - << "sink_token's data type is not the Q data type"); + << "sink_token's data type is neither FLOAT nor the Q data type"); return std::nullopt; } + sink.f32 = tensor->data_type() == data_objects::DataType::FLOAT; if(numQueryHeads > 1 && tensor->strides()->Get(HEAD_AXIS) != 1) { HIPDNN_PLUGIN_LOG_INFO((DeclinedBy{engine, "sinks"}) diff --git a/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp b/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp index 5c262530fa7a..bd1ceb347204 100644 --- a/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp +++ b/dnn-providers/hip-kernel-provider/src/integration_tests/kernel_ingestor_engine/IntegrationGpuAttentionPagedUnified.cpp @@ -37,7 +37,7 @@ * @brief End-to-end runs of hipkernel:AttentionPagedUnified through the hipDNN frontend: * paged uniform decode (dense Q), ragged Q over paged K/V (mixed decode and * chunked prefill, a first origin past 0), sliding windows, - * separate K and V page tables, attention sinks, + * separate K and V page tables, attention sinks (FLOAT and in the I/O dtype), * HIP-graph capture/replay with changed sequence lengths, block ids and data, and * saved plans restored into a fresh handle. Every output is compared with a host * gather-then-dense fp32 reference over the same page tables, which is itself @@ -114,7 +114,8 @@ struct Problem bool setMaxSeqLenKv = true; ///< false leaves max_seq_len_kv for the engine to infer int64_t leftBound = -1; ///< the graph's (cuDNN) left_bound; -1 = none int64_t qTokenHeads = 0; ///< Q token stride in heads; 0 = queryHeads - bool sinks = false; ///< a sink_token `[1, Hq, 1, 1]` in the I/O dtype + bool sinks = false; ///< a sink_token `[1, Hq, 1, 1]` + bool floatSinks = false; ///< the sink is FLOAT (cuDNN's form), not in the I/O dtype /// V pages through its own page_table_v, which places V in other blocks than K; /// otherwise one tensor is both page_table_k and page_table_v. bool separateVTable = false; @@ -167,7 +168,7 @@ struct HostState std::vector queryLengths; std::vector offsets; ///< ragged token offsets [B+1] int64_t qTokens = 0; ///< tokens of the Q/O storage - std::vector sinks; ///< [Hq] sink logits (p.sinks only) + std::vector sinks; ///< [Hq] sink logits as the engine reads them (p.sinks only) }; /// seq_len_q[b]: the live query rows of sequence b. @@ -293,12 +294,17 @@ HostState makeState(const Problem& p, uint32_t seed) if(p.sinks) { // From negligible to row-dominating, so a head that loses its sink, or reads - // another head's, fails the comparison. + // another head's, fails the comparison. A FLOAT sink keeps every mantissa bit, so + // a kernel that read it in the I/O dtype would fail too. std::uniform_real_distribution logit(-4.0F, 6.0F); s.sinks.resize(static_cast(p.queryHeads)); for(auto& x : s.sinks) { - x = toBits(logit(rng), p.type); + x = logit(rng); + if(!p.floatSinks) + { + x = fromBits(toBits(x, p.type), p.type); + } } } return s; @@ -359,8 +365,7 @@ std::vector reference(const Problem& p, const HostState& s, float scale) continue; // no visible key: zeros } float maximum = *std::max_element(scores.begin(), scores.end()); - const float sink - = p.sinks ? fromBits(s.sinks[static_cast(h)], p.type) : 0.0F; + const float sink = p.sinks ? s.sinks[static_cast(h)] : 0.0F; if(p.sinks) { maximum = std::max(maximum, sink); @@ -453,14 +458,13 @@ std::vector hipdnnReferenceAs(const Problem& p, HostState s, float scale) .setScale(scale) .setBand(p.leftBound, 0, false) .setSeqLens(&qLengths, &kvLengths); - // The reference takes cuDNN's FLOAT sink; the Q-dtype values upcast exactly. + // The reference takes cuDNN's FLOAT sink; Q-dtype sink values upcast exactly. Tensor sink({1, p.queryHeads, 1, 1}); if(p.sinks) { for(int64_t h = 0; h < p.queryHeads; ++h) { - sink.setHostValue(fromBits(s.sinks[static_cast(h)], p.type), - std::vector{0, h, 0, 0}); + sink.setHostValue(s.sinks[static_cast(h)], std::vector{0, h, 0, 0}); } options.setSink(&sink); } @@ -646,8 +650,10 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test } if(p.sinks) { - attributes.set_sink_token( - make(SINK, p.type, {1, p.queryHeads, 1, 1}, {p.queryHeads, 1, 1, 1})); + attributes.set_sink_token(make(SINK, + p.floatSinks ? DataType::FLOAT : p.type, + {1, p.queryHeads, 1, 1}, + {p.queryHeads, 1, 1, 1})); } auto o = graph.sdpa(q, k, v, attributes)[0]; o->set_uid(O) @@ -659,18 +665,17 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test { o->set_ragged_offset(offsets).set_ragged_offset_multiplier(p.queryHeads * d); } - // The engine reads sinks in the I/O dtype (vLLM keeps them in the model dtype). A - // frontend that accepts only cuDNN's FLOAT sink_token rejects that graph before any - // engine sees it, so the sink cases skip there instead of failing. Only that data - // type rejection skips; any other validate() error fails. + // The engine also reads sinks in the I/O dtype (vLLM keeps them in the model + // dtype). A frontend that accepts only cuDNN's FLOAT sink_token rejects that graph + // before any engine sees it, so those cases skip there instead of failing. Only + // that data type rejection of a Q-dtype sink skips; any other validate() error, + // and any error for a FLOAT sink, fails. const auto validated = graph.validate(); - if(p.sinks && validated.code != ErrorCode::OK + if(p.sinks && !p.floatSinks && validated.code != ErrorCode::OK && validated.err_msg.find("sink_token must have FLOAT data type") != std::string::npos) { GTEST_SKIP() << "the hipDNN frontend rejects a sink_token in the Q data type (" - << validated.err_msg << "); " << ENGINE - << " serves only Q-dtype sinks, so this case needs a frontend that " - "accepts them"; + << validated.err_msg << "); this case needs a frontend that accepts it"; } ASSERT_TRUE(ok(validated)); ASSERT_TRUE(ok(graph.build_operation_graph(_handle))); @@ -706,7 +711,8 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test } if(p.sinks) { - built.buffers[SINK] = built.memory.allocate(static_cast(p.queryHeads * 2)); + built.buffers[SINK] + = built.memory.allocate(static_cast(p.queryHeads * (p.floatSinks ? 4 : 2))); } } @@ -731,7 +737,18 @@ class IntegrationGpuAttentionPagedUnified : public ::testing::Test } if(p.sinks) { - copy(built.buffers[SINK], s.sinks.data(), s.sinks.size() * 2); + if(p.floatSinks) + { + copy(built.buffers[SINK], s.sinks.data(), s.sinks.size() * 4); + } + else + { + std::vector bits(s.sinks.size()); + std::transform(s.sinks.begin(), s.sinks.end(), bits.begin(), [&](float x) { + return toBits(x, p.type); + }); + copy(built.buffers[SINK], bits.data(), bits.size() * 2); + } } std::vector poison(built.oBytes / 2, SENTINEL); copy(built.buffers[O], poison.data(), built.oBytes); @@ -1005,6 +1022,25 @@ TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryWithAttentionSinksAndWind run(p); } +/// cuDNN's FLOAT sink_token, which hipDNN's frontend admits: the kernel reads full fp32 +/// logits. +TEST_F(IntegrationGpuAttentionPagedUnified, DecodeWithFloatAttentionSinksBf16) +{ + Problem p = decodeProblem(DataType::BFLOAT16); + p.sinks = true; + p.floatSinks = true; + run(p); +} + +TEST_F(IntegrationGpuAttentionPagedUnified, RaggedQueryWithFloatAttentionSinksAndWindowHalf) +{ + Problem p = mixedProblem(DataType::HALF); + p.sinks = true; + p.floatSinks = true; + p.leftBound = 32; + run(p); +} + /// One plan, captured once into a HIP graph and replayed with new lengths, new block ids /// and new data: the engine reads all of them from device memory, so the replay must /// match a fresh reference every time. @@ -1197,6 +1233,14 @@ TEST_F(IntegrationGpuAttentionPagedUnifiedSaveLoad, RestoresAttentionSinks) roundTripInBothForms(p); } +TEST_F(IntegrationGpuAttentionPagedUnifiedSaveLoad, RestoresFloatAttentionSinks) +{ + Problem p = mixedProblem(DataType::HALF); + p.sinks = true; + p.floatSinks = true; + roundTripInBothForms(p); +} + } // namespace #endif diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp index 8284011e6290..f5b324587022 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp @@ -26,7 +26,8 @@ * @brief The saved launch values of hipkernel:AttentionPagedUnified: every member of the * launch state maps to the value of its own name and type, reads back unchanged * for each binding the engine serves (dense, ragged, separate K and V page tables, - * sinks), and the reader refuses values outside the v1 contract. No device needed. + * sinks in the Q data type and FLOAT, every finite scale), and the reader refuses + * values outside the v1 contract. No device needed. * * Each member gets a distinct value, so a swapped or dropped mapping shows. The expected * names are written out again here: they are the stored contract, and a test that shared @@ -109,6 +110,14 @@ AttentionPagedUnifiedLaunchInputs sinkInputs() return launch; } +/// A FLOAT attention sink (cuDNN's form). +AttentionPagedUnifiedLaunchInputs floatSinkInputs() +{ + auto launch = sinkInputs(); + launch.scalars.sinkIsF32 = 1; + return launch; +} + SavedLaunchInputs saved(const AttentionPagedUnifiedLaunchInputs& launch) { return {std::string(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1), @@ -155,6 +164,7 @@ void expectSameLaunch(const AttentionPagedUnifiedLaunchInputs& read, EXPECT_EQ(r.kvHeadStride, e.kvHeadStride); EXPECT_EQ(r.kvBlockSpanBytes, e.kvBlockSpanBytes); EXPECT_EQ(r.qBlockGrid, e.qBlockGrid); + EXPECT_EQ(r.sinkIsF32, e.sinkIsF32); EXPECT_EQ(read.blockThreads, expected.blockThreads); } @@ -207,6 +217,7 @@ TEST(TestAttentionPagedUnifiedLaunchValues, ValuesMatchTheV1Contract) {"kv_head_stride", int64_t{8192}}, {"kv_block_span_bytes", int64_t{131072}}, {"q_block_grid", int64_t{18}}, + {"sink_is_f32", int64_t{0}}, {"block_threads", int64_t{256}}}; EXPECT_EQ(values, expected); EXPECT_EQ(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1, @@ -233,6 +244,9 @@ TEST(TestAttentionPagedUnifiedLaunchValues, SeparateKAndVTablesRoundTripThroughT TEST(TestAttentionPagedUnifiedLaunchValues, SinkInputsRoundTripThroughTheirValues) { expectSameLaunch(readAttentionPagedUnifiedLaunchInputs(saved(sinkInputs())), sinkInputs()); + const auto read = readAttentionPagedUnifiedLaunchInputs(saved(floatSinkInputs())); + expectSameLaunch(read, floatSinkInputs()); + EXPECT_EQ(read.scalars.sinkIsF32, 1); } // graph_match serves every finite attn_scale, so a plan with a zero or negative scale @@ -270,7 +284,7 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnotherContractName) TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAMissingOptionalOrFloatValue) { - for(const char* name : {"sink.uid", "ragged_offset.uid", "scale"}) + for(const char* name : {"sink.uid", "ragged_offset.uid", "scale", "sink_is_f32"}) { SCOPED_TRACE(name); auto missing = saved(denseInputs()); @@ -312,6 +326,8 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnIntegerOutsideWhatTheKernel {&dense, "q_uniform_len", -3}, {&ragged, "q_uniform_len", 1}, // a ragged Q reads its rows from the offsets {&ragged, "q_uniform_len", -1}, + {&dense, "sink_is_f32", -1}, + {&dense, "sink_is_f32", 2}, {&dense, "block_table_stride", -1}, {&dense, "q_tok_stride", -1}, {&dense, "o_head_stride", int64_t{2147483648}}, diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp index 0df62a2b881a..1047b5fe52a5 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp @@ -466,7 +466,9 @@ TEST(TestAttentionPagedUnifiedMatchers, ServesAnAttentionSinkInTheIoDataType) const auto bound = match(sinkGraph()); ASSERT_TRUE(bound.has_value()); EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.sink.uid"), SINK_UID); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.sink_is_f32"), 0); EXPECT_EQ(tryGetBoundInt(*match(decodeGraph()), "attention_paged_unified.sink.uid"), -1); + EXPECT_EQ(tryGetBoundInt(*match(decodeGraph()), "attention_paged_unified.sink_is_f32"), 0); // FP16 graph with an FP16 sink; a ragged Q with a sink. EXPECT_TRUE(match(decodeGraph(d::DataType::HALF), [](d::GraphT& g) { g.tensors.push_back(tensor(SINK_UID, @@ -488,6 +490,33 @@ TEST(TestAttentionPagedUnifiedMatchers, ServesAnAttentionSinkInTheIoDataType) }).has_value()); } +/// cuDNN's FLOAT sink_token, the form hipDNN's frontend admits, on a BF16 and an FP16 +/// graph, dense and ragged: the launch passes sink_is_f32 = 1 and the same sink objects +/// serve it. +TEST(TestAttentionPagedUnifiedMatchers, ServesAFloatAttentionSink) +{ + const auto floatSink = [](d::GraphT& g) { + g.tensors.push_back(tensor( + SINK_UID, d::DataType::FLOAT, {1, QUERY_HEADS, 1, 1}, packed({1, QUERY_HEADS, 1, 1}))); + attrs(g).sink_token_tensor_uid = SINK_UID; + }; + const std::vector> graphs + = {[] { return decodeGraph(); }, + [] { return decodeGraph(d::DataType::HALF); }, + [] { return raggedGraph(); }}; + for(const auto& graph : graphs) + { + const auto bound = match(graph(), floatSink); + ASSERT_TRUE(bound.has_value()); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.sink.uid"), SINK_UID); + EXPECT_EQ(tryGetBoundInt(*bound, "attention_paged_unified.sink_is_f32"), 1); + } + auto graph = decodeGraph(); + floatSink(graph); + EXPECT_TRUE(kernelMatches(graph, sinkKernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4))); + EXPECT_FALSE(kernelMatches(graph, kernel("BF16", HEAD_SIZE, BLOCK_SIZE, 4))); +} + /// Every finite attn_scale is served, zero and negative ones included; the saved-plan /// reader takes the same set (TestAttentionPagedUnifiedLaunchValues). TEST(TestAttentionPagedUnifiedMatchers, ServesEveryFiniteScale) @@ -768,14 +797,18 @@ TEST(TestAttentionPagedUnifiedMatchers, DeclinesWithALoggedCause) [](d::GraphT& g) { attrs(g).left_bound = 0; }, "mask"}, {"right bound 2", decode, [](d::GraphT& g) { attrs(g).right_bound = 2; }, "mask"}, - {"float sink", - [] { return sinkGraph(); }, - [](d::GraphT& g) { find(g, SINK_UID).data_type = d::DataType::FLOAT; }, - "sinks"}, {"fp16 sink on a bf16 graph", [] { return sinkGraph(); }, [](d::GraphT& g) { find(g, SINK_UID).data_type = d::DataType::HALF; }, "sinks"}, + {"int32 sink", + [] { return sinkGraph(); }, + [](d::GraphT& g) { find(g, SINK_UID).data_type = d::DataType::INT32; }, + "sinks"}, + {"double sink", + [] { return sinkGraph(); }, + [](d::GraphT& g) { find(g, SINK_UID).data_type = d::DataType::DOUBLE; }, + "sinks"}, {"sink per key-value head", [] { return sinkGraph(); }, [](d::GraphT& g) { diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp index 445ef9572a43..626aeb345cab 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp @@ -246,8 +246,8 @@ MetadataValues gfx942AttentionDensePersistentThreePairSampleValues() {"num_persistent", int64_t{304}}}; } -// A ragged Q with a sink and separate K and V page tables, so every optional uid holds a -// value and every value differs from the others. +// A ragged Q with a FLOAT sink and separate K and V page tables, so every optional uid +// holds a value and every value differs from the others. MetadataValues attentionPagedUnifiedSampleValues() { return {{"q.uid", int64_t{51}}, @@ -278,6 +278,7 @@ MetadataValues attentionPagedUnifiedSampleValues() {"kv_head_stride", int64_t{8192}}, {"kv_block_span_bytes", int64_t{131072}}, {"q_block_grid", int64_t{21}}, + {"sink_is_f32", int64_t{1}}, {"block_threads", int64_t{128}}}; } @@ -1066,33 +1067,37 @@ constexpr std::array GFX942_ATTENTION_DENSE_V1_PERSISTENT_THREE_P 0x05, 0x00, 0x00, 0x00, 0x61, 0x5F, 0x70, 0x74, 0x72, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x5F, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x00, 0x00}; -constexpr std::array ATTENTION_PAGED_UNIFIED_V1_GOLDEN = { +constexpr std::array ATTENTION_PAGED_UNIFIED_V1_GOLDEN = { 0x48, 0x4B, 0x49, 0x50, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x63, 0x66, 0xC6, 0x87, 0xBC, 0x44, 0xA5, 0xF4, 0x58, 0x27, 0xE8, 0x6C, 0xED, 0xF5, 0xC7, - 0x6C, 0xD1, 0xC9, 0xA2, 0xD3, 0x65, 0x1E, 0x86, 0x5E, 0x73, 0x9A, 0x82, 0x81, 0x4D, 0x86, 0x11, - 0x1C, 0x00, 0x00, 0x00, 0x48, 0x4B, 0x53, 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2C, 0x00, - 0x1C, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x28, 0x00, 0x00, 0x00, 0x94, 0x06, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x05, 0x00, 0x00, 0x00, 0x31, 0x2E, 0x30, 0x2E, - 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, - 0x68, 0x69, 0x70, 0x6B, 0x65, 0x72, 0x6E, 0x65, 0x6C, 0x2E, 0x61, 0x74, 0x74, 0x65, 0x6E, 0x74, - 0x69, 0x6F, 0x6E, 0x5F, 0x70, 0x61, 0x67, 0x65, 0x64, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x2E, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2E, 0x76, 0x31, 0x00, 0x00, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0xC8, 0x05, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x50, 0x05, 0x00, 0x00, - 0x14, 0x05, 0x00, 0x00, 0xDC, 0x04, 0x00, 0x00, 0xA8, 0x04, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00, - 0x40, 0x04, 0x00, 0x00, 0x0C, 0x04, 0x00, 0x00, 0xDC, 0x03, 0x00, 0x00, 0xAC, 0x03, 0x00, 0x00, - 0x78, 0x03, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0xD8, 0x02, 0x00, 0x00, - 0x9C, 0x02, 0x00, 0x00, 0x6C, 0x02, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, - 0xD0, 0x01, 0x00, 0x00, 0x9C, 0x01, 0x00, 0x00, 0x6C, 0x01, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xB6, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x24, 0x42, 0x29, 0xC8, 0x99, 0x41, 0xAC, 0xCC, 0xA9, 0x0D, 0x35, 0x67, 0x49, 0x31, 0x4E, 0x1D, + 0x53, 0x87, 0x89, 0x72, 0x50, 0x1C, 0x79, 0x54, 0x75, 0xAC, 0x0C, 0x85, 0x25, 0xFE, 0xD5, 0x88, + 0x24, 0x00, 0x00, 0x00, 0x48, 0x4B, 0x53, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x20, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0C, 0x00, + 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0xCC, 0x06, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, + 0x2C, 0x2D, 0x2E, 0x2F, 0x05, 0x00, 0x00, 0x00, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x68, 0x69, 0x70, 0x6B, + 0x65, 0x72, 0x6E, 0x65, 0x6C, 0x2E, 0x61, 0x74, 0x74, 0x65, 0x6E, 0x74, 0x69, 0x6F, 0x6E, 0x5F, + 0x70, 0x61, 0x67, 0x65, 0x64, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2E, 0x64, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2E, 0x76, 0x31, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0xFC, 0x05, 0x00, 0x00, 0xB8, 0x05, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x48, 0x05, 0x00, 0x00, + 0x10, 0x05, 0x00, 0x00, 0xDC, 0x04, 0x00, 0x00, 0xA8, 0x04, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00, + 0x40, 0x04, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xAC, 0x03, 0x00, 0x00, + 0x78, 0x03, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x0C, 0x03, 0x00, 0x00, 0xD0, 0x02, 0x00, 0x00, + 0xA0, 0x02, 0x00, 0x00, 0x6C, 0x02, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, + 0xD0, 0x01, 0x00, 0x00, 0xA0, 0x01, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x9C, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x86, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x76, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x9E, 0xFA, 0xFF, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xDE, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x6E, 0xFA, 0xFF, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xAE, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x73, 0x6C, 0x69, 0x64, 0x69, 0x6E, 0x67, 0x5F, 0x77, 0x69, 0x6E, 0x64, - 0x6F, 0x77, 0x00, 0x00, 0x4E, 0xFB, 0xFF, 0xFF, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6F, 0x77, 0x00, 0x00, 0x1E, 0xFB, 0xFF, 0xFF, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xE2, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x73, 0x69, 0x6E, 0x6B, 0x5F, 0x69, 0x73, 0x5F, + 0x66, 0x33, 0x32, 0x00, 0x4E, 0xFB, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x73, 0x69, 0x6E, 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFA, 0xFF, 0xFF, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1587,6 +1592,7 @@ TEST(TestIngestorPlanLaunchContractGoldens, AttentionPagedUnifiedV1SampleStillRe EXPECT_EQ(s.kvHeadStride, 8192); EXPECT_EQ(s.kvBlockSpanBytes, 131072); EXPECT_EQ(s.qBlockGrid, 21); + EXPECT_EQ(s.sinkIsF32, 1); EXPECT_EQ(launch.blockThreads, 128); } diff --git a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_causal_paged_sinks/Decode/Decode.support.json b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_causal_paged_sinks/Decode/Decode.support.json index 42566e269577..9cb9ed1e55c0 100644 --- a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_causal_paged_sinks/Decode/Decode.support.json +++ b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_causal_paged_sinks/Decode/Decode.support.json @@ -1,4 +1,13 @@ { - "claims": {}, + "claims": { + "hipkernel:AttentionPagedUnified": { + "gfx942": [ + "linux" + ], + "gfx950": [ + "linux" + ] + } + }, "version": 1 } diff --git a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_window_ragged_paged_sinks/Mixed/Mixed.support.json b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_window_ragged_paged_sinks/Mixed/Mixed.support.json index 42566e269577..9cb9ed1e55c0 100644 --- a/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_window_ragged_paged_sinks/Mixed/Mixed.support.json +++ b/dnn-providers/integration-tests/integration-test-bundles/quick/SdpaFwd/bshd/bf16/hd64_window_ragged_paged_sinks/Mixed/Mixed.support.json @@ -1,4 +1,13 @@ { - "claims": {}, + "claims": { + "hipkernel:AttentionPagedUnified": { + "gfx942": [ + "linux" + ], + "gfx950": [ + "linux" + ] + } + }, "version": 1 } diff --git a/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml b/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml index f4c0a65a49eb..197b37904051 100644 --- a/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml +++ b/projects/hipdnn/tools/IngestorGenerator/configs/attention_paged_unified.yaml @@ -16,8 +16,9 @@ # left bound, optionally with a per-query-head attention sink (sink_token). # # Every object ships twice: without sinks, and with use_sinks (name suffix _sinks, -# KMD use_sinks = 1), which loads one sink logit per query head from sink_ptr in the -# I/O dtype and joins it to the softmax max and denominator. +# KMD use_sinks = 1), which loads one sink logit per query head from sink_ptr, FLOAT or +# in the I/O dtype as the sink_is_f32 launch argument says, and joins it to the softmax +# max and denominator. # # sdk_version 1.4.0: ragged Q/O (1.3.0) with a token-unit ragged_offset_multiplier # (1.4.0). The matcher declines override-shape graphs (1.1.0). From cdfa58d0f5971ab003f736cd506f5a0b424107fe Mon Sep 17 00:00:00 2001 From: David Peabody Date: Tue, 10 Nov 2026 14:46:18 -0600 Subject: [PATCH 10/22] fix(hip-kernel-provider): review round 4 on the runtime-layout attention kernels - Correct the appended runtime-layout kernel argument count to 16 in the five C++ comments and one test docstring that said 15 or 17. - Name the gfx942 window predicate (SW_ACTIVE), as gfx950 does. - Derive the wave size from the exact arch in the runtime-layout geometry (Python and C++) instead of hard-coding 64. - Document that page ids and lengths are device-read inputs the caller keeps in range. --- .../library/kernels/gfx942/attention_tiled_2d.py | 12 +++++++++--- .../library/kernels/gfx950/attention_tiled_2d.py | 11 +++++++++-- .../test_gfx942_attention_runtime_layout.py | 2 +- ...r_rocke.instances.gfx942.attention_tiled_2d.h | 2 +- ...instance_gfx942_attention_tiled_2d_internal.h | 2 +- ...instance_gfx950_attention_tiled_2d_internal.h | 2 +- .../cpp/instances/gfx942/attention_tiled_2d.cpp | 10 +++++++++- .../gfx942/attention_tiled_2d_ctx_prologue.cpp | 2 +- .../attention_tiled_2d_public_entry_glue.cpp | 2 +- .../rocKE/attention_paged_unified/README.md | 16 ++++++++++++++++ .../packs/AttentionPagedUnifiedNative.cpp | 5 +++++ 11 files changed, 54 insertions(+), 12 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py index cd792f59d47a..2a5e0949b476 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py @@ -1239,13 +1239,16 @@ def runtime_layout_geometry( divides ``block_size`` and fits the arch LDS budget. ``tile_size`` is None when the tile is one whole cache block. None when nothing fits. """ + from rocke.core.arch import ArchTarget + from ..common.attention_arch import attention_lds_capacity_bytes cap = attention_lds_capacity_bytes(arch) + wave_size = ArchTarget.from_gfx(arch).wave_size for nw in (4, 2, 1): t = block_size while t >= 16: - if (t * head_size) % (nw * 64 * 2) == 0 and runtime_layout_lds_bytes( + if (t * head_size) % (nw * wave_size * 2) == 0 and runtime_layout_lds_bytes( head_size=head_size, tile_size=t, num_warps=nw ) <= cap: return nw, (None if t == block_size else t) @@ -1883,6 +1886,9 @@ def build_unified_attention_2d_tiled( else None ) RTL = spec.runtime_layout + # The window code paths are compiled whenever a window may be active: a + # compile-time window, or always in runtime-layout mode (window kernarg). + SW_ACTIVE = SLIDING_WINDOW > 0 or RTL if RTL: # Appended runtime-layout kernargs (ABI order: RUNTIME_LAYOUT_EXTRA_ARGS). rtl_p = {} @@ -2677,7 +2683,7 @@ def _v_load1(v_buf: Value, v_row: Value, v_n_col: Value) -> Value: b.cmp_lt(qb_start_pos, cur_batch_q_len), num_tiles, b.const_i32(0) ) - if SLIDING_WINDOW > 0 or RTL: + if SW_ACTIVE: qpos_hi_raw = b.add(qb_start_pos, b.const_i32(bm1_div_nqk)) cur_q_minus1 = b.sub(cur_batch_q_len, b.const_i32(1)) qpos_hi = b.select( @@ -5373,7 +5379,7 @@ def _kslot(group_idx: int) -> int: causal_ok = b.cmp_le(col_abs, causal_lim) in_prefix = b.cmp_lt(col_abs, max_seq_prefix_len) m_ok = b.land(b.land(row_ok, causal_ok), in_prefix) - if SLIDING_WINDOW > 0 or RTL: + if SW_ACTIVE: dist = b.sub(causal_lim, col_abs) m_ok = b.land(m_ok, b.cmp_lt(dist, sw_const)) s_raw = b.vec_extract(S_n[atom][n], in_atom) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index 82650ce78e56..36e2237692c6 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -1065,6 +1065,13 @@ def kernel_name(self) -> str: ) +def _runtime_layout_wave_size() -> int: + """Lanes per wave of the runtime-layout target, from the exact arch.""" + from rocke.core.arch import ArchTarget + + return ArchTarget.from_gfx("gfx950").wave_size + + def _runtime_layout_reject_reason(spec: "UnifiedAttention2DTiledSpec") -> Optional[str]: """Why ``spec`` cannot use ``runtime_layout`` (``None`` when it can). @@ -1138,7 +1145,7 @@ def _runtime_layout_reject_reason(spec: "UnifiedAttention2DTiledSpec") -> Option "runtime_layout requires num_warps in {1, 2, 4, 8} " f"(got {spec.num_warps})" ) - threads = spec.num_warps * 64 + threads = spec.num_warps * _runtime_layout_wave_size() if (spec.block_size * spec.head_size) % (threads * 8) != 0: return ( f"runtime_layout: block_size*head_size={spec.block_size * spec.head_size} " @@ -1155,7 +1162,7 @@ def runtime_layout_num_warps(head_size: int, block_size: int) -> int: calls; the single smaller tile (head_size=64, block_size=16) uses two. """ for nw in (4, 2, 1): - if (head_size * block_size) % (nw * 64 * 8) == 0: + if (head_size * block_size) % (nw * _runtime_layout_wave_size() * 8) == 0: return nw raise ValueError( f"no runtime_layout geometry for head_size={head_size}, block_size={block_size}" diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py index 68b389e287d0..7b00a5f09401 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -5,7 +5,7 @@ ``runtime_layout=True`` makes one compiled object serve any head count, sliding window, DENSE or RAGGED query layout, Q/O strides and paged-KV layout (vLLM's interleaved ``[nb, Hkv, bs, 2D]`` view, NHD, HND): the head counts and window -are the body's runtime shape kernargs, the rest 15 appended kernargs. +are the body's runtime shape kernargs, the rest 16 appended kernargs. The CPU tests check that every catalog spec passes ``supports_tiled_2d_spec`` and emits, and that the Python and native (C) checks reject incompatible specs. diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h index 000a9c4b4924..00313946e7d1 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h @@ -184,7 +184,7 @@ typedef struct rocke_attention_tiled_2d_spec * no new IR; on appends the "lse" kernel-name token. */ bool emit_lse; /* False (Python kw_only) */ /* Runtime-layout mode (hipDNN paged/ragged SDPA): the Q/O/KV strides and a - * dense-or-ragged Q become 15 appended kernel arguments (after the runtime + * dense-or-ragged Q become 16 appended kernel arguments (after the runtime * head counts and window), * the page tables and lengths are read on the device and the q-block grid * is walked with a grid-stride loop. Off emits no new IR; on appends the diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h index 43e691d4313e..4906f94b560b 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h @@ -185,7 +185,7 @@ typedef struct rocke_gfx942_attn2d_build_ctx rocke_value_t* sliding_window_p; /* Trailing lse_ptr (F32*), declared only when spec->emit_lse; else NULL. */ rocke_value_t* lse; - /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, + /* runtime_layout (spec->runtime_layout): the 16 appended kernel arguments, * indexed by ROCKE_ATTN2D_RTL_*; all NULL when off. */ bool RTL; rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h index 1de5bbcf7f9c..3e46ca73a4b4 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h @@ -184,7 +184,7 @@ typedef struct rocke_gfx950_attn2d_build_ctx rocke_value_t* num_kv_p; rocke_value_t* sliding_window_p; rocke_value_t* lse; /* lse_ptr (spec->emit_lse only, else NULL) */ - /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, + /* runtime_layout (spec->runtime_layout): the 16 appended kernel arguments, * indexed by ROCKE_ATTN2D_RTL_* (Python _RTL_PARAMS); all NULL when off. */ bool RTL; rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp index d5edc8fbbf8f..9ceb0b5bc93f 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d.cpp @@ -33,6 +33,7 @@ #include #include +#include "rocke/arch_target.h" #include "rocke/error.hpp" #include "rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h" #include "rocke/helper_rocke.instances.common._fmha_common.h" /* rocke_attention_check_head_counts */ @@ -325,7 +326,14 @@ bool rocke_gfx950_attention_tiled_2d_runtime_layout_reject_reason( s->num_warps); return true; } - const int threads = s->num_warps * 64; + /* Python: ArchTarget.from_gfx("gfx950").wave_size. */ + const rocke_arch_target_t* gfx950 = rocke_arch_target_from_gfx("gfx950"); + if(gfx950 == NULL) + { + rocke_attn2d_reason(reason, reason_cap, "runtime_layout: no gfx950 arch target"); + return true; + } + const int threads = s->num_warps * gfx950->wave_size; if((s->block_size * s->head_size) % (threads * 8) != 0) { rocke_attn2d_reason(reason, diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp index 5b3fe6f6259f..fec1c7bddbf5 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp @@ -567,7 +567,7 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } - /* runtime_layout: the 17 appended arguments (RUNTIME_LAYOUT_EXTRA_ARGS). */ + /* runtime_layout: the 16 appended arguments (RUNTIME_LAYOUT_EXTRA_ARGS). */ if(spec->runtime_layout) { ctx->RTL = true; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp index 73d000f0ef05..5396a024ead5 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp @@ -852,7 +852,7 @@ static bool rocke_gfx950_attn2d_build_ctx_init(rocke_gfx950_attn2d_build_ctx_t* o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } - /* runtime_layout: the 17 appended arguments (_RTL_PARAMS). */ + /* runtime_layout: the 16 appended arguments (_RTL_PARAMS). */ if(spec->runtime_layout) { ctx->RTL = true; diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md index abd273b13ebb..2d26f8c0ab2c 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md @@ -126,6 +126,22 @@ the cache's K and V halves as two containers over one allocation, its `block_tab page tables (one tensor, `[B, 1, max_blocks, 1]`), `seq_lens` as `seq_len_kv`, the query lengths as `seq_len_q`, and `query_start_loc` as the ragged offset of Q and O. +### Device-read inputs are trusted + +Because these values are read only on the device, the engine cannot validate them at +execute without a device-to-host copy, which would break HIP graph capture. The caller +guarantees, as with cuDNN and vLLM's own kernels: + +- every K and V page id the lengths reach is in `[0, num_blocks)` of the K/V containers (a + page id outside that range addresses memory outside the cache: the kernel bounds reads + within a page, not the page); +- `seq_len_kv[b] <= max_blocks * block_size`, `seq_len_q[b] >= 0`, and ragged offsets as + described in the Graphs served list of `AttentionPagedUnifiedNative.cpp`. + +What a graph's descriptors fix (ranks, dtypes, strides, extents, alignment, table widths) is +checked when the engine matches. A serving stack that cannot vouch for its page tables +checks them on the host before launch. + ## Saved plans The engine reports `SUPPORTS_EXECUTION_PLAN_SERIALIZATION`: a built plan saves with diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index 92045e549958..511d869bef45 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -90,6 +90,11 @@ * K and V block sizes, packed page tables and a declared alignment below what the kernels * load (16 bytes for Q/K/V/O and the sink, 4 for the INT32 operands) are valid graphs that * this engine declines with a logged cause. + * + * The device-read inputs (page ids, lengths, ragged offsets) are the caller's to keep in + * range: page ids in `[0, num_blocks)`, `seq_len_kv[b] <= M * block_size`. The kernels + * bound reads within a page, not the page, and execute cannot check them without a + * device-to-host copy (README, "Device-read inputs are trusted"). */ namespace hip_kernel_provider::kernel_ingestor_engine { From 1afd2136261194e4f40f129387bf0afea9748493 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Fri, 13 Nov 2026 09:01:28 -0600 Subject: [PATCH 11/22] fix(hip-kernel-provider): refuse a K without a block extent in AttentionPagedUnified prepare --- .../packs/AttentionPagedUnifiedNative.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index 511d869bef45..908111d68470 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -1056,7 +1056,16 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler Date: Sat, 14 Nov 2026 13:19:11 -0600 Subject: [PATCH 12/22] feat(hip-kernel-provider): contain out-of-range page ids and lengths in the runtime_layout kernels A K or V page id outside [0, num_kv_blocks) (negative included) now reads as a masked page: block 0 with a zero-size buffer resource, so it touches no memory. seq_len_kv is bounded by the page-table row's extent, block_table_stride * block_size, so the page-table read stays inside its row. num_kv_blocks is a new appended kernel argument (17 in all), passed by the AttentionPagedUnified engine from the K container's block count and saved in the dispatch launch values. A page-table row of more than int32 tokens declines at match time. --- .../common/_attention_runtime_layout.py | 5 ++- .../kernels/gfx942/attention_tiled_2d.py | 16 +++++-- .../kernels/gfx950/attention_tiled_2d.py | 13 +++++- ...ttention_tiled_2d_runtime_layout_gfx950.py | 31 +++++++++++++ .../test_gfx942_attention_runtime_layout.py | 45 +++++++++++++++++-- ...ocke.instances.gfx942.attention_tiled_2d.h | 2 +- ...instance_attention_tiled_2d_rtl_internal.h | 2 + ...tance_gfx942_attention_tiled_2d_internal.h | 2 +- ...tance_gfx950_attention_tiled_2d_internal.h | 2 +- .../attention_tiled_2d_ctx_prologue.cpp | 10 ++++- ...ttention_tiled_2d_kv_descriptors_loads.cpp | 9 +++- ...ttention_tiled_2d_kv_descriptors_loads.cpp | 9 +++- .../attention_tiled_2d_public_entry_glue.cpp | 10 ++++- .../rocKE/attention_paged_unified/README.md | 38 +++++++++------- .../AttentionPagedUnifiedLaunchValues.hpp | 4 +- .../packs/AttentionPagedUnifiedNative.cpp | 36 ++++++++++----- 16 files changed, 189 insertions(+), 45 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py index 4ce221500c6d..31fa2920e73e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py @@ -23,7 +23,9 @@ # off[b+1] - off[b] >= seq_lens_q[b] and off[B] the end of the last block. # Strides are in elements; ``kv_block_span_bytes`` is the per-block # buffer-resource size. ``sink_is_f32`` nonzero: ``sink_ptr`` holds Hq fp32 -# logits, else Hq logits in the Q dtype (ignored without sinks). +# logits, else Hq logits in the Q dtype (ignored without sinks). ``num_kv_blocks`` is +# the K/V container's block count: a page id at or past it (or negative) reads as a +# masked page instead of addressing memory outside the cache. RUNTIME_LAYOUT_EXTRA_ARGS = ( ("block_tables_v_ptr", "ptr"), ("seq_lens_q_ptr", "ptr"), @@ -41,6 +43,7 @@ ("kv_block_span_bytes", "i32"), ("q_block_grid", "i32"), ("sink_is_f32", "i32"), + ("num_kv_blocks", "i32"), ) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py index 5eab44d235b2..8d36caa949b5 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py @@ -512,9 +512,9 @@ class UnifiedAttention2DTiledSpec: # Runtime-layout mode (hipDNN paged/ragged SDPA engine, vLLM KV-cache view). # The head counts, the window and the batch's search trip count are already # kernargs (``RUNTIME_KERNARG_FIELDS``, ``RUNTIME_SEARCH_ITERS``). When True - # the kernel also takes 16 appended kernargs (block_tables_v_ptr, + # the kernel also takes 17 appended kernargs (block_tables_v_ptr, # seq_lens_q_ptr, has_seq_lens_q, q_uniform_len, the Q/O/KV element strides, - # kv_block_span_bytes, q_block_grid, sink_is_f32) and serves a + # kv_block_span_bytes, q_block_grid, sink_is_f32, num_kv_blocks) and serves a # dense-or-ragged Q and a real paged-KV layout from one compiled object: # Q/O/KV strides are runtime, K pages through ``block_tables_ptr`` and V # through ``block_tables_v_ptr`` @@ -1986,6 +1986,10 @@ def build_unified_attention_2d_tiled( ) q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) seq_len = b.global_load_i32(seq_lens, seq_idx) + # A length past the table row would walk the page-table read off its end: + # bound it by the row's extent (block_table_stride * block_size). + rtl_bt_cap = b.mul(bt_stride_p, b.const_i32(BS)) + seq_len = b.select(b.cmp_ult(seq_len, rtl_bt_cap), seq_len, rtl_bt_cap) context_len = b.sub(seq_len, cur_batch_q_len) qb_start_pos = b.mul(q_block_local_idx, b.const_i32(BLOCK_Q)) rtl_rows_if = b.scf_if(b.cmp_lt(qb_start_pos, rtl_q_rows)) @@ -3216,8 +3220,14 @@ def _rtl_kv_block( ) phys = b.buffer_load_vN(bt_rsrc, bt_voff, zero_soff, I32, 1) phys = b.to_sgpr_u32(b.vec_extract(phys, 0)) + # A page id outside [0, num_kv_blocks) would address memory outside the + # cache: it reads as a masked page (block 0, zero-size resource). + phys_ok = b.cmp_ult(phys, rtl_p["num_kv_blocks"]) + phys = b.select(phys_ok, phys, b.const_i32(0)) page = b.global_ptr_add(cache, b.mul(b.zext(phys, I64), rtl_kv_page_stride_b)) - rsrc = b.buffer_rsrc(page, rtl_p["kv_block_span_bytes"]) + rsrc = b.buffer_rsrc( + page, b.select(phys_ok, rtl_p["kv_block_span_bytes"], b.const_i32(0)) + ) return tok0, b.sub(tok0, lblk_tok), rsrc def _rtl_kv_call(call: int, blk: Tuple[Value, Value, Value]) -> Tuple[Value, Value]: diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index 9ec29cac11cb..e1f53586af2c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -1668,6 +1668,10 @@ def build_unified_attention_2d_tiled( ) q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) seq_len = b.global_load_i32(seq_lens, seq_idx) + # A length past the table row would walk the page-table read off its end: + # bound it by the row's extent (block_table_stride * block_size). + rtl_bt_cap = b.mul(bt_stride_p, b.const_i32(BS)) + seq_len = b.select(b.cmp_ult(seq_len, rtl_bt_cap), seq_len, rtl_bt_cap) context_len = b.sub(seq_len, cur_batch_q_len) # Per-sequence Q/O base terms in i64 (ragged offsets times the # multiplier can pass 2^31 elements); within-sequence terms stay i32. @@ -2560,10 +2564,15 @@ def _rtl_kv_page(src: Value, table: Value, kv_tile_idx: Value) -> Value: dtype=I32, align=4, ) + phys = b.to_sgpr_u32(phys) + # A page id outside [0, num_kv_blocks) would address memory outside + # the cache: it reads as a masked page (block 0, zero-size resource). + phys_ok = b.cmp_ult(phys, rtl["num_kv_blocks"]) + phys = b.select(phys_ok, phys, b.const_i32(0)) page = b.global_ptr_add( - src, b.mul(b.zext(b.to_sgpr_u32(phys), I64), rtl_kv_page_stride_b) + src, b.mul(b.zext(phys, I64), rtl_kv_page_stride_b) ) - return b.buffer_rsrc(page, rtl_kv_span) + return b.buffer_rsrc(page, b.select(phys_ok, rtl_kv_span, b.const_i32(0))) def _rtl_kv_voff(kv_tile_idx: Value, linear_half: Value) -> Value: """This lane's voffset within the page for one async-DMA call. diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py index 76620f678060..25f24979d218 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py @@ -247,6 +247,7 @@ def _launcher( "kv_block_span_bytes", "q_block_grid", "sink_is_f32", + "num_kv_blocks", ): sb.scalar(name, "i32") launcher = KernelLauncher( @@ -324,6 +325,7 @@ def _run( sc: Scenario, use_sinks: bool = False, sink_f32: bool = False, + bad_page: Optional[str] = None, ): from rocke.runtime.hip_module import Runtime from rocke.runtime.host_buffers import as_u8_buffer @@ -418,6 +420,17 @@ def _run( k_cache[blk, tt] = kf[t] v_cache[vblk, tt] = vf[t] gathered.append((_decode(kf, dtype), _decode(vf, dtype))) + if bad_page is not None: + # The last sequence's page ids (K and V) all lie outside [0, num_blocks): + # they read as masked pages, so its K and V are zeros and its output is + # zero, whatever the cache holds there (NaN in the unowned blocks). + bad = {"past_end": num_blocks, "int_max": 0x7FFFFFFF, "negative": -1}[bad_page] + last = B - 1 + assert nblk[last] > 0, "the corrupted sequence must own blocks" + block_tables[last, : nblk[last]] = bad + v_block_tables[last, : nblk[last]] = bad + kf0, vf0 = gathered[last] + gathered[last] = (np.zeros_like(kf0), np.zeros_like(vf0)) # ---- launch ---- bq = spec.block_q @@ -506,6 +519,7 @@ def upload(a: np.ndarray) -> DeviceMem: "kv_block_span_bytes": kv_span_bytes, "q_block_grid": grid_y, "sink_is_f32": int(sink_f32), + "num_kv_blocks": num_blocks, } launcher( values, @@ -608,6 +622,23 @@ def test_runtime_layout_sinks_match_reference( _run(dtype, head_size, block_size, qpk, sc, use_sinks=True, sink_f32=sink_f32) +@pytest.mark.gpu +@_NEEDS_GFX950 +@pytest.mark.parametrize("bad_page", ("past_end", "int_max", "negative")) +@pytest.mark.parametrize("use_sinks", (False, True), ids=("nosink", "sinks")) +@pytest.mark.parametrize( + "dtype,head_size,block_size,qpk", _SINK_KERNEL_CASES[:3], ids=lambda v: str(v) +) +def test_runtime_layout_contains_out_of_range_page_ids( + dtype, head_size, block_size, qpk, use_sinks, bad_page +): + """A page id outside the cache reads as masked: no memory outside the cache is read + (the other sequences are exact), and the corrupted sequence's output is zero.""" + sc = next(s for s in SCENARIOS if s.name == "dense_l1") + assert sc.seq_lens[-1] > 0 + _run(dtype, head_size, block_size, qpk, sc, use_sinks=use_sinks, bad_page=bad_page) + + def test_runtime_layout_sinks_accepted(): """runtime_layout composes with use_sinks; the object keeps ``sink_ptr``.""" from kernels.gfx950.attention_tiled_2d import ( diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py index 7b00a5f09401..03893fe3e1d3 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -5,7 +5,7 @@ ``runtime_layout=True`` makes one compiled object serve any head count, sliding window, DENSE or RAGGED query layout, Q/O strides and paged-KV layout (vLLM's interleaved ``[nb, Hkv, bs, 2D]`` view, NHD, HND): the head counts and window -are the body's runtime shape kernargs, the rest 16 appended kernargs. +are the body's runtime shape kernargs, the rest 17 appended kernargs. The CPU tests check that every catalog spec passes ``supports_tiled_2d_spec`` and emits, and that the Python and native (C) checks reject incompatible specs. @@ -467,7 +467,7 @@ def _decode(a, dtype): return a.view(np.float16).astype(np.float32) -def _run_case(spec, sc, rng, sink_f32=False): +def _run_case(spec, sc, rng, sink_f32=False, bad_page=None): from rocke.runtime.hip_module import Runtime from rocke.runtime.host_buffers import as_u8_buffer from rocke.runtime.launcher import DeviceMem, LaunchConfig @@ -597,8 +597,19 @@ def upload(a): o_ptr = o_base + _GUARD * 2 seq_lens_dev = upload(np.array(seq_lens, np.int32)) - table_dev = upload(table) - v_table_dev = upload(v_table) if v_table is not table else table_dev + dev_table, dev_v_table = table, v_table + bad_seq = nseq - 1 + if bad_page is not None: + # The last sequence's page ids (K and V) all lie outside [0, nb): they read + # as masked pages, so its K and V are zeros and its output is zero. + assert used[bad_seq] > 0, "the corrupted sequence must own blocks" + bad = {"past_end": nb, "int_max": 0x7FFFFFFF, "negative": -1}[bad_page] + dev_table = table.copy() + dev_table[bad_seq, : used[bad_seq]] = bad + dev_v_table = dev_table if v_table is table else v_table.copy() + dev_v_table[bad_seq, : used[bad_seq]] = bad + table_dev = upload(dev_table) + v_table_dev = upload(dev_v_table) if dev_v_table is not dev_table else table_dev lq_dev = upload(np.array(q_lens_kernel if not dense else q_lens, np.int32)) off_dev = upload(np.array(off, np.int32)) if not dense else seq_lens_dev @@ -650,6 +661,7 @@ def upload(a): kv_block_span_bytes=span_bytes, q_block_grid=grid_y, sink_is_f32=int(sink_f32), + num_kv_blocks=nb, ) _launcher(spec)( values, @@ -673,6 +685,10 @@ def upload(a): sinks_np, v_table, ) + if bad_page is not None: + for (b, s), res in ref.items(): + if b == bad_seq: + res[:] = 0.0 written = np.zeros(got.shape, bool) for (b, s), res in ref.items(): base = _GUARD + (tok_base[b] + s) * o_tok @@ -729,6 +745,27 @@ def test_runtime_layout_numerics(dtype, head_size, block_size, qpk): _run_case(spec, sc, rng) +@pytest.mark.gpu +@requires_gfx942_gpu +@pytest.mark.parametrize("bad_page", ("past_end", "int_max", "negative")) +@pytest.mark.parametrize("dtype,head_size,block_size,qpk", _GPU_KERNELS[:3]) +def test_runtime_layout_contains_out_of_range_page_ids( + dtype, head_size, block_size, qpk, bad_page +): + """A page id outside the cache reads as masked: no memory outside the cache is read + (the other sequences are exact), and the corrupted sequence's output is zero.""" + spec = runtime_layout_catalog_spec( + dtype=dtype, head_size=head_size, block_size=block_size, num_queries_per_kv=qpk + ) + rng = np.random.default_rng( + zlib.crc32(f"bad:{dtype}:{head_size}:{block_size}:{qpk}".encode()) + ) + sc = next( + s for s in _scenarios(block_size) if s["seq_lens"][-1] > 0 and s["mode"] == "dense" + ) + _run_case(spec, sc, rng, bad_page=bad_page) + + # Sink objects: _HKV=2 KV heads, so query heads of KV head 1 (h >= qpk) need # the runtime query-head bound and mapping to find their sink. _GPU_SINK_KERNELS = [ diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h index 267f3381f938..e1bcfdef7139 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h @@ -188,7 +188,7 @@ typedef struct rocke_attention_tiled_2d_spec * "lse" token becomes "lsehm". Needs emit_lse. */ bool lse_head_major; /* False */ /* Runtime-layout mode (hipDNN paged/ragged SDPA): the Q/O/KV strides and a - * dense-or-ragged Q become 16 appended kernel arguments (after the runtime + * dense-or-ragged Q become 17 appended kernel arguments (after the runtime * head counts and window), * the page tables and lengths are read on the device and the q-block grid * is walked with a grid-stride loop. Off emits no new IR; on appends the diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h index 72b51af1506a..eb041d2fc65e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h @@ -39,6 +39,7 @@ typedef enum rocke_attn2d_rtl_param ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES, ROCKE_ATTN2D_RTL_Q_BLOCK_GRID, ROCKE_ATTN2D_RTL_SINK_IS_F32, + ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS, ROCKE_ATTN2D_RTL_NUM_PARAMS } rocke_attn2d_rtl_param_t; @@ -63,6 +64,7 @@ static inline void rocke_attn2d_rtl_declare_params(rocke_ir_builder_t* b, rocke_ "kv_block_span_bytes", "q_block_grid", "sink_is_f32", + "num_kv_blocks", }; const rocke_type_t* ptr_i32 = rocke_ptr_type(b, rocke_i32(), "global"); for(int i = 0; i < ROCKE_ATTN2D_RTL_NUM_PARAMS; ++i) diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h index 4906f94b560b..43e691d4313e 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h @@ -185,7 +185,7 @@ typedef struct rocke_gfx942_attn2d_build_ctx rocke_value_t* sliding_window_p; /* Trailing lse_ptr (F32*), declared only when spec->emit_lse; else NULL. */ rocke_value_t* lse; - /* runtime_layout (spec->runtime_layout): the 16 appended kernel arguments, + /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, * indexed by ROCKE_ATTN2D_RTL_*; all NULL when off. */ bool RTL; rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h index 3e46ca73a4b4..1de5bbcf7f9c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h @@ -184,7 +184,7 @@ typedef struct rocke_gfx950_attn2d_build_ctx rocke_value_t* num_kv_p; rocke_value_t* sliding_window_p; rocke_value_t* lse; /* lse_ptr (spec->emit_lse only, else NULL) */ - /* runtime_layout (spec->runtime_layout): the 16 appended kernel arguments, + /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, * indexed by ROCKE_ATTN2D_RTL_* (Python _RTL_PARAMS); all NULL when off. */ bool RTL; rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp index da58cb0ab4a2..6ae58773e34f 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp @@ -184,6 +184,14 @@ static void rocke_a2d_rtl_seq_lookup(rocke_gfx942_attn2d_build_ctx_t* ctx, int B ctx->q_block_start_idx = rocke_b_select(b, dense, qbs_dense, qbs_ragged); ctx->q_block_local_idx = rocke_b_sub(b, qb, ctx->q_block_start_idx); ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, seq_idx, 0); + /* A length past the table row would walk the page-table read off its end: + * bound it by the row's extent (block_table_stride * block_size). */ + { + rocke_value_t* c_bs_cap = rocke_b_const_i32(b, ctx->BS); + rocke_value_t* bt_cap = rocke_b_mul(b, ctx->bt_stride_p, c_bs_cap); + rocke_value_t* in_cap = rocke_b_cmp_ult(b, ctx->seq_len, bt_cap); + ctx->seq_len = rocke_b_select(b, in_cap, ctx->seq_len, bt_cap); + } ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); bq = rocke_b_const_i32(b, BLOCK_Q); ctx->qb_start_pos = rocke_b_mul(b, ctx->q_block_local_idx, bq); @@ -575,7 +583,7 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } - /* runtime_layout: the 16 appended arguments (RUNTIME_LAYOUT_EXTRA_ARGS). */ + /* runtime_layout: the 17 appended arguments (RUNTIME_LAYOUT_EXTRA_ARGS). */ if(spec->runtime_layout) { ctx->RTL = true; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp index cfef57a41b16..0d9ecf43ab03 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp @@ -751,10 +751,17 @@ static rocke__rtl_kv_block_t rocke__rtl_kv_block(rocke_gfx942_attn2d_build_ctx_t = rocke_b_buffer_load_vN(b, bt_rsrc, bt_voff, rocke__zero_soff(ctx), rocke_i32(), 1); rocke_value_t* phys_e = rocke_b_vec_extract(b, phys_v, 0); rocke_value_t* phys = rocke_b_to_sgpr_u32(b, phys_e); + /* A page id outside [0, num_kv_blocks) would address memory outside the + * cache: it reads as a masked page (block 0, zero-size resource). */ + rocke_value_t* phys_ok + = rocke_b_cmp_ult(b, phys, ctx->rtl_p[ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS]); + phys = rocke_b_select(b, phys_ok, phys, rocke_b_const_i32(b, 0)); rocke_value_t* phys64 = rocke_b_zext(b, phys, rocke_i64()); rocke_value_t* page_off = rocke_b_mul(b, phys64, ctx->rtl_kv_page_stride_b); rocke_value_t* page = rocke_b_global_ptr_add(b, cache, page_off); - blk.rsrc = rocke_b_buffer_rsrc(b, page, ctx->rtl_p[ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES]); + rocke_value_t* span = rocke_b_select( + b, phys_ok, ctx->rtl_p[ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES], rocke_b_const_i32(b, 0)); + blk.rsrc = rocke_b_buffer_rsrc(b, page, span); blk.tok_in_blk0 = rocke_b_sub(b, blk.tok0, lblk_tok); return blk; } diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp index 2062eb5f9f5e..3dc63e0576e8 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp @@ -604,10 +604,17 @@ static rocke_value_t* rocke__rtl_kv_page(rocke_gfx950_attn2d_build_ctx_t* ctx, rocke_value_t* c0 = rocke_b_const_i32(b, 0); rocke_value_t* phys = rocke_b_masked_global_load(b, table, idx, in_table, c0, rocke_i32(), 4); rocke_value_t* phys_s = rocke_b_to_sgpr_u32(b, phys); + /* A page id outside [0, num_kv_blocks) would address memory outside the + * cache: it reads as a masked page (block 0, zero-size resource). */ + rocke_value_t* phys_ok + = rocke_b_cmp_ult(b, phys_s, ctx->rtl_p[ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS]); + phys_s = rocke_b_select(b, phys_ok, phys_s, rocke_b_const_i32(b, 0)); rocke_value_t* phys64 = rocke_b_zext(b, phys_s, rocke_i64()); rocke_value_t* page_off = rocke_b_mul(b, phys64, ctx->rtl_kv_page_stride_b); rocke_value_t* page = rocke_b_global_ptr_add(b, src, page_off); - return rocke_b_buffer_rsrc(b, page, ctx->rtl_p[ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES]); + rocke_value_t* span = rocke_b_select( + b, phys_ok, ctx->rtl_p[ROCKE_ATTN2D_RTL_KV_BLOCK_SPAN_BYTES], rocke_b_const_i32(b, 0)); + return rocke_b_buffer_rsrc(b, page, span); } /* _rtl_kv_voff(kv_tile_idx, linear_half): this lane's voffset within the page diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp index 37b1c1e1c256..31ac590cf723 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp @@ -440,6 +440,14 @@ static void rocke_g950_rtl_seq_lookup(rocke_gfx950_attn2d_build_ctx_t* ctx, int ctx->q_block_start_idx = rocke_b_select(b, dense, qbs_dense, qbs_ragged); ctx->q_block_local_idx = rocke_b_sub(b, qb, ctx->q_block_start_idx); ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, seq_idx, 0); + /* A length past the table row would walk the page-table read off its end: + * bound it by the row's extent (block_table_stride * block_size). */ + { + rocke_value_t* c_bs_cap = rocke_b_const_i32(b, ctx->BS); + rocke_value_t* bt_cap = rocke_b_mul(b, ctx->bt_stride_p, c_bs_cap); + rocke_value_t* in_cap = rocke_b_cmp_ult(b, ctx->seq_len, bt_cap); + ctx->seq_len = rocke_b_select(b, in_cap, ctx->seq_len, bt_cap); + } ctx->context_len = rocke_b_sub(b, ctx->seq_len, ctx->cur_batch_q_len); /* Per-sequence Q/O base terms in i64 (ragged offsets times the multiplier @@ -858,7 +866,7 @@ static bool rocke_gfx950_attn2d_build_ctx_init(rocke_gfx950_attn2d_build_ctx_t* o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } - /* runtime_layout: the 16 appended arguments (_RTL_PARAMS). */ + /* runtime_layout: the 17 appended arguments (_RTL_PARAMS). */ if(spec->runtime_layout) { ctx->RTL = true; diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md index 2d26f8c0ab2c..1d65434e3b03 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md @@ -126,21 +126,26 @@ the cache's K and V halves as two containers over one allocation, its `block_tab page tables (one tensor, `[B, 1, max_blocks, 1]`), `seq_lens` as `seq_len_kv`, the query lengths as `seq_len_q`, and `query_start_loc` as the ragged offset of Q and O. -### Device-read inputs are trusted - -Because these values are read only on the device, the engine cannot validate them at -execute without a device-to-host copy, which would break HIP graph capture. The caller -guarantees, as with cuDNN and vLLM's own kernels: - -- every K and V page id the lengths reach is in `[0, num_blocks)` of the K/V containers (a - page id outside that range addresses memory outside the cache: the kernel bounds reads - within a page, not the page); -- `seq_len_kv[b] <= max_blocks * block_size`, `seq_len_q[b] >= 0`, and ragged offsets as - described in the Graphs served list of `AttentionPagedUnifiedNative.cpp`. - -What a graph's descriptors fix (ranks, dtypes, strides, extents, alignment, table widths) is -checked when the engine matches. A serving stack that cannot vouch for its page tables -checks them on the host before launch. +### Device-read inputs are contained + +The page tables and lengths are read only on the device, so the engine cannot check their +contents at execute without a device-to-host copy, which would break HIP graph capture. +The kernels contain them instead, with the container's block count passed as the +`num_kv_blocks` argument: + +- a K or V page id outside `[0, num_kv_blocks)` (negative included) reads as a masked page: + block 0 with a zero-size buffer resource, so it touches no memory and the tile contributes + zeros; +- `seq_len_kv[b]` is bounded by the table row's extent, `block_table_stride * block_size`, + so the page-table read stays inside its row. A longer length is a caller bug and attends + to masked pages past the table. + +An invalid page id or length makes that sequence's output wrong (no error is reported); it +cannot read or write outside the cache, the table or the output. Other device-read values +(`seq_len_q`, ragged offsets) keep their documented preconditions: the kernel writes only +rows the offsets and `seq_len_q` own. What the graph's descriptors fix (ranks, dtypes, +strides, extents, alignment, table widths, `M * block_size` within int32) is checked when +the engine matches. ## Saved plans @@ -153,7 +158,8 @@ both page tables, `seq_len_kv`, `seq_len_q`, the ragged offset and the sink (`-1 absent), the scale (any finite float, stored exactly as a double), every by-value kernel argument (`num_seqs`, `block_table_stride`, the head counts, `sliding_window`, `q_uniform_len` (`Sq` for a dense Q, 0 for a ragged one), the Q/O/KV strides, -`kv_block_span_bytes`, `q_block_grid`, `sink_is_f32` (1 for a FLOAT sink, else 0)) and +`kv_block_span_bytes`, `q_block_grid`, `sink_is_f32` (1 for a FLOAT sink, else 0), +`num_kv_blocks`) and `block_threads`. The loaded plan launches the same grid, `(num_kv_heads, q_block_grid)`, with `block_threads` threads. A load refuses a value of another type, an extra or missing value, or one outside what the kernel diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp index b7302dc56e35..9ff07a58a763 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp @@ -72,6 +72,7 @@ inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_BLOCK_SPAN_BYTES_VA = "kv_block_span_bytes"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_BLOCK_GRID_VALUE = "q_block_grid"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SINK_IS_F32_VALUE = "sink_is_f32"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_NUM_KV_BLOCKS_VALUE = "num_kv_blocks"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE = "block_threads"; /// The tensor uids a launch binds to device buffers. raggedOffset is NO_UID for a dense Q; @@ -118,6 +119,7 @@ struct AttentionPagedUnifiedScalars int32_t kvBlockSpanBytes = 0; int32_t qBlockGrid = 0; int32_t sinkIsF32 = 0; ///< 1: the sink is FLOAT; 0: in the Q data type, or no sink + int32_t numKvBlocks = 0; ///< the K/V container's block count; a page id at or past it reads as masked }; /// Everything a launch is computed from: block = (blockThreads, 1, 1) and @@ -138,7 +140,7 @@ hipdnn_plugin_sdk::ingestor::MetadataValues /// value must be in the range the kernel takes (int32, positive where the kernel divides /// by it or indexes with it), `scale` must be a finite float stored exactly, the head /// counts must divide, a dense Q needs `q_uniform_len` >= 1 and a ragged one 0, -/// `sink_is_f32` must be 0 or 1, and `block_threads` must be a whole number of waves. +/// `sink_is_f32` must be 0 or 1, `num_kv_blocks` must be positive, and `block_threads` must be a whole number of waves. /// /// @throws HipdnnPluginException with a load refusal when the dispatch name is not the /// contract, or when a value is missing, extra, of another type or out of range. diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index 908111d68470..a0e56cd2af09 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -91,10 +91,12 @@ * load (16 bytes for Q/K/V/O and the sink, 4 for the INT32 operands) are valid graphs that * this engine declines with a logged cause. * - * The device-read inputs (page ids, lengths, ragged offsets) are the caller's to keep in - * range: page ids in `[0, num_blocks)`, `seq_len_kv[b] <= M * block_size`. The kernels - * bound reads within a page, not the page, and execute cannot check them without a - * device-to-host copy (README, "Device-read inputs are trusted"). + * The device-read inputs (page ids, lengths, ragged offsets) cannot be checked on the host + * at execute without a device-to-host copy, which would break HIP graph capture, so the + * kernels contain them: a page id outside `[0, num_kv_blocks)` reads as a masked page (a + * zero-size buffer resource at block 0), and `seq_len_kv[b]` is bounded by the page-table + * row's extent `M * block_size`. Such a graph computes a wrong answer for that sequence; + * it never reads or writes outside the cache or the table (README, "Device-read inputs"). */ namespace hip_kernel_provider::kernel_ingestor_engine { @@ -573,12 +575,18 @@ std::optional graphMatches(const MatchContext& context) " entries (0x7FFF0000 bytes)")); } + const auto rowTokens = checkedProduct({dim(*pageTables->k, SEQ_AXIS), dim(*k, SEQ_AXIS)}); + if(!rowTokens.has_value() || *rowTokens > INT32_LIMIT) + { + return decline("size_limit", reason("a page-table row covers more than int32 tokens")); + } + // --- 9. Sequence lengths, both required for a paged graph (SEM-009). The kernels read - // the first ceil(seq_len_kv[b] / block_size) entries of row b of each table and do not - // clamp seq_len_kv: 0 <= seq_len_kv[b] <= max_seq_len_kv <= M * block_size is a - // precondition of the launch. An unset max_seq_len_kv is inferred as M * block_size - // (both tables have the same M), which bounds seq_len_kv the same way, so it is served - // either way. A dense Q's rows past seq_len_q[b] (padding) are written as zeros; a + // the first ceil(seq_len_kv[b] / block_size) entries of row b of each table and bound + // seq_len_kv[b] by M * block_size (a longer length is a caller bug, and reads as masked + // rather than walking off the table row); that bound is an int32, so a row of more + // tokens declines. An unset max_seq_len_kv is inferred as M * block_size (both tables + // have the same M), which bounds seq_len_kv the same way, so it is served either way. A dense Q's rows past seq_len_q[b] (padding) are written as zeros; a // ragged Q writes only its first seq_len_q[b] rows. const auto lengths = sdpa_graph::sequenceLengthsFor( ATTENTION_PAGED_UNIFIED_ENGINE_NAME, context, attributes, batch); @@ -892,7 +900,8 @@ std::vector kernelSignature() "kv_head_stride", "kv_block_span_bytes", "q_block_grid", - "sink_is_f32"}) + "sink_is_f32", + "num_kv_blocks"}) { appendKernelArgument(signature, "by_value", I32, name); } @@ -1066,6 +1075,7 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler Date: Sat, 14 Nov 2026 13:22:10 -0600 Subject: [PATCH 13/22] test(hip-kernel-provider): re-bless the runtime_layout IR goldens for num_kv_blocks and update the launch-value tests --- .../tests/parity/golden/llvm_gfx_all.json | 380 +++++++++--------- .../attention.json | 96 ++--- .../TestAttentionPagedUnifiedLaunchValues.cpp | 8 +- .../TestIngestorPlanLaunchContractGoldens.cpp | 2 + 4 files changed, 247 insertions(+), 239 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json index b5d48e97ba71..db0420395034 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json @@ -1033,26 +1033,26 @@ "18": "bf7b02b7aa2d32470335fc8dbb966b40af321525e28b3f351bc7405a27265d69", "19": "d9b3c7bf671ce53b4eaed65a93a88fdc88eadc9a4013f22a4c654984440711e0", "2": "ee4683453afbbc49e5ae11714bccf200fada5e75884a59405cc6676af6e57b81", - "20": "2e363d8d921ff4dac7049040c305f826aae20cfacb62ec38201299277ef149fb", - "21": "9347a9d03cabedac2be9306289acb206a1c0731d52f114efe2527ea2dbc74798", - "22": "b6442395c9ff6650b406bb10722c0546c8181db620c525a09ab67a5fc5fc3817", - "23": "dee0200b60b0351ec8183c6de4ebdf9269cc4395271b2d07d3d97af3338cd027", - "24": "38a0921bb85ce12dbfb5395e4eb3c4614921fedc67e3071aff191bd1715fd39a", - "25": "f2c8a908d78512b19bbbf7e2e666248cf24089380d1617dfda1f2136c00fef2e", - "26": "059cd49d9c353c6ec175635613d4af58075135fe2815448986e1841e3ddd1a6b", - "27": "c19fc2279b66486ad98cec637bb4cfe69d5061563e1c1e4058eaf9244bc6fb62", - "28": "eb602e7059d2276478354744ec8a59bf1f0f48798195d1af114dbdf84bca5d6a", - "29": "05341eae7c9d281f6608591f66869e28f360ded0bca79e70fd8b77878895faa4", + "20": "41e3e964ea9b2970f6702de3cfa034e6eba9c089ffe2ef3eb4df4e072923d0e7", + "21": "e435a1206cdf6441e2619dd153a0b7e552231d6110f4ac25d1b102c057134ecd", + "22": "df09ec99c4d8ef4407ec0c9af50902f0fdccaaef048d953f1573680d3722deac", + "23": "43359e9f442d38eb8483fcc8988101f65cf51fb88e8f04e8e61f11dea7bc3b1b", + "24": "e65c2528efd8b868b3fbc1e471214e43d4ca9b00c74751cfecdef10c47dfb010", + "25": "59ecd964a20dde0a021b6fb3f3c9b9ebd9187c45d00e1d5c21caa27dfadbf2ab", + "26": "7d16d8ff27ccce2c3001c0f45d3aa2280692359a1346817e15ff08dc5d07dd0e", + "27": "f97789b6ed4e8333ebe1f767c3493a2ab7a56b45e2ab0038b88eb54d58b19e5a", + "28": "d1f5458ba71517f712812acde4f810212f946aa5ed067f19599d9351e53e3830", + "29": "c61ab4483455777eb0204ff535124df4fbf48148905952ea06b5d2e758bfab53", "3": "b364ec606939a153220377511d8bb21345bf28f998a41c1f8e3b0d96cac6c4a8", - "30": "ecefeda4d13a4e5126356dacbaefcfc2cc56d1bfe7a96e0d342ab8714980fd2c", - "31": "6815dfba91d35428a18dd62c6864862dc6c26ed08bed8b2facaef8c4b3ae58ea", - "32": "c616bbc0aa3cf62580737b3950121324af981b4eb9a9964c37fb26f63f730f06", - "33": "d646fe28e6ad877a51dd9cd24ef3ffca4e6d7f16a9b678c006929f3714878f78", - "34": "308a5afd581b6a84442c9dcf7fbbc84a3800840668b4b77b544a7e5ce5ecda1b", - "35": "04d41a0611d4cba06ae16b1d704c073666f5d3bd5e16bb476dde4d2a597ae355", - "36": "7cd2f4b54f608344c8e2ee1b25cef1dd64d38ec103f2fa89c307fea289534349", - "37": "c6199ad0383db9596ee0bfa74b7aec10e190b22b6a16cfcbe8fcf1f872ecd25c", - "38": "907fc4bb266715e7c461b7b7b091647fc3929a1fffa4657619652ba424879edc", + "30": "4b77087f3d75fd7c20ad6df0693d11ebd57dd86cc1f175b7f1651efa25eec2c3", + "31": "b22ac84b6729b83a2c734862cbe07f5c307be2ddf162cdf868b5b2d29252ea0f", + "32": "fc7441ab0575a64ab79a2c93030013b14f78fc60c4011f421b8fb67feda2ffa3", + "33": "109e0df160064306e7dcb201e29f739e8818aeeb330a58c2b8305a6eb50663e4", + "34": "dc12682a6c2ae7b39da6a0fc75fd8f8ee294be8a6254d172155d50bf6b3aee9e", + "35": "157325e4da1c11c9b920da1f41d875439f1f722332dafae03bed81da2f5c2782", + "36": "3db9e3374d4e94467b43e1cb8dc7b15fb9d887c3fb9b5d294e4f9e4bacfe24d2", + "37": "447b68344ce4c4cf1c962161a8433f59105c59d8ee930b633ecd0ac586f6a7d1", + "38": "80a798aa2228ffad6da7c4d24a7783111a8f1ac5c73314a18b6889536594445a", "4": "66849d43bf1485879bcf1c5f173d72862cca98a1985d0d2d0ef824fba8c5cbe6", "5": "e9427bcb1fe7b9bfe568b7451b9f6ccd770c9399ff05deae35775479e13a407b", "6": "4337bae9b89e2794112a158ead6c4f06c3c86d992046ba3902496ddc4f940b07", @@ -1221,27 +1221,27 @@ "72": "e3601c74d24fbcdbcd326867ce993bd2d6aa38c6f914bd635424c2ff161cead3", "73": "c5523cb2aacd611fd6d5ee919b5f85c22d6f25d6dac10c31893ad42fdc0cc246", "74": "4ed2861ee15646599091a13275f1a61728089a306f294cf7d13930eb5830fd3f", - "75": "83de75d5bc2cdc480983d0b2c4cf4c2f4fb553daa4f68536b4207e23e60d59dd", - "76": "974b7059d2445402ca6b6689e8838eaf723fd4f2a7155e1df237085b22052683", - "77": "9b0252dbdb2b1e93aa1973f8c097bb54d22d68394869c04caaf9337d9e399237", - "78": "8b6e051abb7471e2c83db644d5d9fec40dd119f82eb4fa37b5d6423062fe82f1", - "79": "67398f6448c854e7c87e700a4e8724a4376b4fa797e0220f97d166c0976628ac", + "75": "195d5101f22484fe02d8f4016815fb9f25081a059e3fb835fc45c74846cce717", + "76": "f29dac8b54bb382430fea477266647d283d6f1399b2bc8c5d0b31ca129d56336", + "77": "cf6186e95321b8d81dbb06ca49e9f75066ec2a79ee39349d1ae4ebb334ec872d", + "78": "57186281131becdb166275a0bd7a89f4f01043009d34acdd29dcfcc2b489dc0d", + "79": "ec5fe76761283c2f8d5e302e873c67d1e9e19ce69f7b0bf222de590bd4fd57b1", "8": "f4f0267af6f85a06591533f53a3cc74339723fa2e33c5f68e5fcd1b1ac4a6520", - "80": "056abed73fa4d1c8b1c2794141012755b53caa514592ea54bbbd5fd73034903d", - "81": "7f8e854e8349ee5040862d931698d63d0efda193235476509e1e06dcb17fffa4", - "82": "75f3fdf71b55cf0d5f77933851d85f0406f695f1bcd4049e9ee1e3b16c9ddadb", - "83": "3a894620bd7a50a98dd7774239ac2164a680d1be983b8f8e44da680efcf4e478", - "84": "fc4e0c901ec55d5f9f609d5881e6686afbf62352dafc6d76c3be6132ddd85fc6", - "85": "a5e3c7c51c7eed9fa752244a8699b95e8ad0bfb2e0e7e0a99cdc372ead9a1a50", - "86": "b9a9e1be3901d1edd475a8c0e7f6528c80f42f649eab1942c93a9c9351074789", - "87": "1cf25dfbde8a5f5fc1bf07bb3549910be77e611efa70df1425fd2ecdf1a20b1a", - "88": "ae24d1bad69ed66502fe51b9025b5779cdd9526fdb65459b1d2ec940e4b8259d", - "89": "068f99e10ecc49047a777edb72762940dcece7faf83f77c1c13ce1a57a27e892", + "80": "7ee2bbb5a2096bb7ba7ea48f628a9abc959d1d97643f1c7a728478bf58506b46", + "81": "3ce3d5643ae9211bdffa86db7e4df334ff3d98e755c70b0ae5fda31bf2540832", + "82": "3f8f6813d25c6ef0cb87e61d59344b882fcddd1827d5b26d54251a9c618132d2", + "83": "4e29c76c7aef6794f395d4ec78494401a411ebdf1213bef7347152c839e66f49", + "84": "4aae377220026669bd1f4cb6974b2aa6c9b0666b85da4e1b04019c4a398ec28d", + "85": "812f2f4152a2a33b3a06b5878cca018c2e3a7ab299c302ff675ef2b38fd40017", + "86": "5c04a09600b09e2a18206cf9b8fc1617c8a830989db1f73d0f77743bc86827e3", + "87": "1936eab85c1c6826dc3c49f06ea70ac63bc28ebfedb557f0da15a1babaa0f30b", + "88": "9a65aba2c30f555baf0af2bf5888ef15f7b625937b8b474fc028a84175dee3eb", + "89": "7a8b2d7dee078f5b8663cc56f6656e5a9bd86c591e53472dc42be03520c84c4e", "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25", - "90": "fb8fa07a7d3a28e7012d21a97d71274b40238088ed123f12bf6788a1d562689e", - "91": "471c057c6b9b1ed6763fba2f6a05ca60e63afd4f75c777dd9f7d31fe3acec625", - "92": "0696ec81941ca9f864de7f64151d81c0099d0d55f4fdaecdd95c53001ae69a0e", - "93": "8d72374533bc3888f8d5bee6a0729e25cfc874f97a8fe40da05c07ee216cba15" + "90": "087d5df71d22a057b0c5985faeb564f1a2f293bd08cdf7df1941161d670903d3", + "91": "3dcbc7d1ae267db020ad9894c59cbba897cc4f03828e2bcdb214220f55948c67", + "92": "e2556c52d863abbc9452eb9d1cd865a6f5cb1431ad584effafbe4b196f94e7ee", + "93": "10cb9f9103d28893c665134c0d371c9a5fc9e98961193ce4e0b3c3949dbe9854" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "d21a86dc7cd4b574b7c58faad7dff5e113e6ad5fd5739abed3d049e27de730fa", @@ -2303,26 +2303,26 @@ "18": "7d21d4ce1dd271b1dfe7f82d0c6c128c3e249b1f00833a090b74b3facb94f80e", "19": "d5b8888550a1db52d497b490f09cc169d739d054d269284ff7be8f5e3d3c2031", "2": "5841c730e964542b171c289e6075eaf6332b3cae253707da9fd74d8bb3c9ba9a", - "20": "ae4bfc435d6bfc26cdae392617a32baf19ebd62127c73292c96aafa8e5768424", - "21": "e802f72913d1236b8fdfeecf80b823335faed4d641ae589932085e871982b9a4", - "22": "ac7abdd460b05604ee33d06350507a9110a5bd5e02bd5af5dec0b9bf45f9f8f7", - "23": "f3d4041dc9f4bcce9c7071e80b2b26d288f3a96e2d994fad12508016f7622c8c", - "24": "324d2208eaf6721a20e11143faa6bc1950a7fbfca2e1af9840801f0346f32c04", - "25": "20981eb1c6d0a69dbafd4b0631562457926644349abec10cc55e3a9a92ed7d7a", - "26": "cc3aeaf82a7d8cb5e82181cccd27171944903824c203518ba042b6b3287f4442", - "27": "f0fcf18f8bb49e5cca633f319c68cedc126e0cc9870b1f5d255de2f1dc8da903", - "28": "acc53278b8c18a3f0b51143ad51291ef6fd4638f66436416151e387963f07e55", - "29": "b31c1cf5b697c718c3a62f0fca6119a4b282d557d2c175b6572ede42228752ea", + "20": "704db10788f73b91df421e3d1e1fc10ac697c8f65eaf6343e69dba26965d36c3", + "21": "c6bc168e74f363f8f2c23a6bbb713bfd25a8fcd78514a2032ed15c43b38bedcc", + "22": "cb7965d16473597103ebd129594bf2b2e3f429faced6ecd1b5e15be46956e220", + "23": "ffd330e03c0bf9154bb9902062cf5b568901a7ef9d0c179b73b4fc154546169d", + "24": "a6f58a251d3283a6e6509753f04878b79521e2b9d89028aa0507485ebd0c049f", + "25": "b24e0b666134deb2ae92856f13a13b34b2be86f72147b41ce67e9ddf1d031eb8", + "26": "147f3464c0329e91b9097709b60b311c4218d23cefe39baf4bf410b3c1a3ef3b", + "27": "989d1afcec385c55b40060bb661066f87aa0dbdd107bcef5c08794b200b1dd8b", + "28": "d630beb57b53eb158c7f9f5353088ee7c411b94f9424c882ee7a656e3dc6e8d5", + "29": "61f0ff5f964907d13efe94a8b8ca5451e9d3efec66bd66903ecf34cab1d66939", "3": "bd9164bfbcff6da42e08428ca167eeb648967f4c40c019f79ef435be664b0d6a", - "30": "7aae0b5921e852a45ef6bddf9432d8f3fc624619e78145a3215ba8b25630b101", - "31": "a8a6bb419eae0da707475d2922f1ff0315f6f79822b09906792aa16daed70a87", - "32": "e88ae905222185d38c92d391e98caa9bda5a3b8b02c4dcc935493fa43826c319", - "33": "3364b7ef1018ea80b034b24251b1cbb3e81f60af867ffc2b66d3345d418c20b3", - "34": "2e547b15c999b6d33c8e42612e0d0571f7c998cea54f4f2dd7703895a1d94a31", - "35": "242529c725b7bedf06f07ddd56c614b03d4b171bcf9d0e49ef680ee18ba8414d", - "36": "379f545580656dfc09144c50d6ff58f3e336a2e21235bcefb08677fcdb38e941", - "37": "35c3050a5ad5bc562d94abcf8c75952ff6d7905ae55fafa01ad85e60c8df0df5", - "38": "0a82318b9093265d784a0f1a05486880eddcebbe517bc9f0844527f6bf0488e3", + "30": "4cd7be6b98b0f5747d027785911b73215c1bddef985181479a12e18ada569569", + "31": "44b28380ffeb028a7f4a015cbb5d47fdd2dcfcf5587251224023d423ac68e182", + "32": "50da765925cf795cb660b1be5b9aac9b055a85238391059edf74ba8918da25ab", + "33": "031c4c29136a8098a7ceee16b23bee621055967e39dc0124e248a0c2d997dfbd", + "34": "46c42b31b70243156035efbb2b86d75be9c241158b7a25ec5233914b88e2d369", + "35": "dc5571167f0128ab98dd886a4e4d911b665990f0e6ec39859263c6ca9faf92e2", + "36": "0ebcde1b3cfa1f58d9ceda9ad1853a16a330af4f01a552e800d4dd2d2787b935", + "37": "84ab1d9930c114cb3c02f99939b521fbbd9b0da88497c8cc2cfd0d0481944b8f", + "38": "2e81ee4047e18140f4bb25c243c88c5cf8faf749c672f03903539458c4881c81", "4": "1b04fa2470af0aa59452389cb41125418154ab3939758ed4a38789ce290b33ab", "5": "f6e5cf8a0392c1bce3fd7d9ce4d0eccf9d39fe29f02ab9bcf5c342152eba4ffb", "6": "c5ef7876d05cc7b9ea1fd4a8fe807c660bb1102a5f198790aecfff165b017c28", @@ -2491,27 +2491,27 @@ "72": "1bd13e6794ae78170a11b1f04269fdd32379b62c2ade487d89cfb8b51529d365", "73": "b43bd80a85d2482d4a02060ca09f9d1163f03c6a7a11e8435dd4ef8b619b1bb4", "74": "d833ca18333f361c1c677dd9d1e59b506cfd1733a90a56c5c782a80a224867a5", - "75": "79a7dceef35235bbb253af5a093f25b630dbf44ee8fbac855b6c75dd4e08b99d", - "76": "c5ed02b00da5b262fc22fe25f9e598035ea0dc822abc52194b9bc35678954927", - "77": "5099ce92542815ba59346c78fac0156a75e4c9174b2a8ec34bf244aee7f9752f", - "78": "3416f78366d7fa9c31aff46c844f95c4fa72309c52e5e4755a6d32d2c1c30782", - "79": "aa7466461b935632290a6f8a6d3d27451cd3b2f02838c4305d5b3abd2d999e05", + "75": "1a3b620d9a2bb5840afb59faac1b7dd7fc821a4d7c5aa5ff282a1cb560e1566b", + "76": "1f9a80e8681cd0a6f5cc37f23a067f038840136071ba0b71de5e0c80ab9569e8", + "77": "23ad78200e2b3aaf53c26ad5046b9f2b3cccc574763c27392ff7f9db2c2fd251", + "78": "6057d6bca37698f8c7395de1fdc2045236aa54a1f82d0d3a893a1b64b5ff85bb", + "79": "643b97a0d37d7e8d9a5d38d877203c1c1ab0375d5e1506647f50f939770a738d", "8": "436a62f0670b97e464439f466724c5d911a96b10e4bb035429b37d5be8d85243", - "80": "3be96f3488605b1e2ccabe098e6a628a9dcf03bd0f1dc117ca6b8a0e43b25695", - "81": "08c099e740bd8af7a9e4c72da12ebdef8ac0a869414b657abca94ef79244adbf", - "82": "bc03ce48f54caac13e347e2c4e6f2c0186b5641c5f3e729583461e0be7c2f587", - "83": "5fd1f51d2c59b87fde595b8cf690cc8735ce07f0e76444d86a0174ebe6b7ec4d", - "84": "93aa1b95e90868df7f5f3c808cc56eb9647f7c90259426017f7e4ed88f2a73b0", - "85": "5b4b9dec111e06c46cf2c9a6813d6405f79776726cc856b67cd408498c55234c", - "86": "bcf413b507d98252eca114e436367b37d7063a080d3d82ab6b9ef568dd24dca4", - "87": "a4baa945d1e24489e0bebbca05004486a0f41516308d95bc36ade6011568a6c4", - "88": "bc5c763745bf62f39d97f33409fd3de3504155eeebbb1f98ec7351fb3029baee", - "89": "cd63c4a08e6282d15538db79508a38cef846f726cbb0dc24c27d5fe11981804a", + "80": "fea66f219ae9cc6c41a4a33e5ca1f503a7abee1385d8b41912484b02995345e4", + "81": "84de246ec691cf0b6e5f3e4554234d5b5b903f0e76707ed6c0225ed7d52c8b40", + "82": "ef4890338c25debe61a74a6d89bbef48f6ed1429bd411e34e880213c23fd78b4", + "83": "b4f184a5900954bd550deae2cb4b60d1e86b0288a20efbf4c00b6fb516402916", + "84": "04254bedc0589d70a64362fae0d36f294f57165f0606c464c81c6ba20ddce4c1", + "85": "e39e55a921db171cff4c174df58266e17a99a8d34f2988e36ef4502b555d5d48", + "86": "5721bd9a1d6c51e700c08a0b285690234cbb7864273a13716cb0cbef60fa19b6", + "87": "0d930412b81ad081beb7cbb38ff7e4ca008e70467e256ed73ed61d028eb5b38d", + "88": "cd0705db3b7c69cf39dd5707b73482217e334ea704217040896b0564cf738b77", + "89": "0db1524200c5ef11d2aaa095895bc8caa9965dbdfb8be6f6a11885ffd970bc9f", "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9", - "90": "6a234ac79b5f0ab44db42b26013db6e76ca8235f093e293a32c569bb53d7e627", - "91": "4ca9d6464a6c71ea850b365e2942b6007baf7863cf18b85a1d2bbf4e188df706", - "92": "b7afc2dc8cc7189521acd66d0e98ff4a185206f301539804ba8097c7f7afb789", - "93": "47b7a54388559ba28464f93aac43eca4f80f22c16c55b904d215734b60721587" + "90": "73ccde85f7d9b34e3979ffdba2fe04a88ce031a6b8443181c276e61df32e3f8b", + "91": "414fca3660471da8085502e8ce1ea61b9b3410233333031a26bc578ac2512689", + "92": "dc50b5df4a208071ad93b00a35dfb52947ab0d8bbbb748d49f09c8e8293b8386", + "93": "ba1b692f83d89f8522af1edb641a137360f7c1c4fafcc747f7e0a3fc952c6843" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "52fef7be3f5b5752f4d62e09b0c9296df1abdaba39cc1d360d05e41e0b70edb3", @@ -3572,26 +3572,26 @@ "18": "eb020317c6d6bab712c0379731bdb9eab253ad67be3b1937c759c4ead5743c78", "19": "a8cc1af85ca357f2e5b109402706d4be4e6f9235839c3016290441ed7cdd6799", "2": "9b7b8d4ad0d7c67143c5887f561e08182cf9a095bed1a76ed53b406cbd45f768", - "20": "6a2d81a621a2ce026b3372719b170661ce3cff70d9aa8e6ee32be333898e8217", - "21": "b542158d8217e5de3264d44ad6bea2aa2bc1e3318bdebf59c946b12fb96b345f", - "22": "89a6cbb0c61afd04aae4f6ba5d3bab8c25bbb30b8770ef33a464a7e466b79969", - "23": "49a637954eca28bcc8e3ff7f6cf792e4a60f9319b8bb4e0d66400cfa13647fcc", - "24": "1a1acc25bd94e9eba76215ebe9d5f776953e2bcefb7f2b9b9e01366b8a11a4cb", - "25": "b1bb950a28a202cbf10e48d2bb36272c928b127baf1e5a96c491a0aef1f8ee28", - "26": "22b01dd891424c57b67ebaae5b4662a1c83925e685067ff91fb3d494498a0899", - "27": "394a6a7e99ebeb39163c937337c1886669c4c66d7affdd2c0d6183446b584e54", - "28": "a4869834955c92ca4c5d62b1328e2aded516b679dfc648281712e571c1351baf", - "29": "8f9c3f14e3552218b1981994433f9d5ebf8f43441c240133b74d270a14c4728e", + "20": "4ad5416d52c24c5e6380c83fc7d533c1ef797e6535d04aa30624c81a51b8603b", + "21": "245700c76983095caa20b852abc7bea7b2c79663e97caa399dfb71b1c18b9469", + "22": "a3713e079f5ea4593db05f0911e29258ce288e41e88c278506d321f5d2ddd85c", + "23": "cf47f97757c2bc6cf003c52d539b0d910de18d3e8fe62abe820056736c745c00", + "24": "fed016a7654a49fbf994e1f4a0ccec49e6c2bb1d3b15c2dcbd415ac5945aac05", + "25": "8e7aa4b626d01738738f7c7b51d3abb90c1011260d4f9ace8d4ab46a720097ef", + "26": "545be80aaf693682ddce9304a97d8536f6743eb9c88ebd7e2090485aa69cfa68", + "27": "4001210004065ff38eba9353ebd40d9c2dcb1bb89dcc86489a97b547d051d3d0", + "28": "612dc0e4b94794d14f15d01e960c8c5175032d858ddb2c365d7ede225614b623", + "29": "883dfade0ae93f6dea6c053bd63ce1c7df7b6c95bb408342ffe14bd4b70460cb", "3": "04366ee133dbfc67fba244a8d80ef386386c288436c373fd2ba3fb34581287e7", - "30": "82fff84cf5598a56813d3781d690dac63bf94a462368cd15700210930e3b48ed", - "31": "580f41ba37032b73b666bb8f168d48221fb14273cf02ed1175bce2c6ba2618a1", - "32": "5b873d4500327c2cac53982b01fda48103de00363fae05fa1a96e64abdf1d0b1", - "33": "9b21645e61ac0cc20af3f0448cd204815001e6083856481b8d78062f6a82297b", - "34": "72630d99102d2e13700c7930cef382770839d2bd2781792fb2b597a78a41ef7f", - "35": "5dc635d586cb3e2bd50b12e42cd93727cbd326b8f1fdc6f8631ba40a2cd3a2e3", - "36": "aa94b55e5450341682324309c79f4ad95ec59f36522b442c460d4d55756107a1", - "37": "1b6649c7a47bebc56d60fb2c743ecac6a409eedb0f7785debaeef285850a163f", - "38": "31a5721a1446f3ac288de1b3950508cb684036d4fefc00149b367ede5cc0d12e", + "30": "a11545b7cbed6875dcdd9eda6a7a5e286b24cdb77788e5dc2ec46189bb2f2a56", + "31": "848dce2fc8f727d37a262484fd31cf831eded44c2d1fe51f6acd11e454eb0146", + "32": "1d5524960dd53fc3c85b6589b19fdd4f365ba2da42563a4276629fd295a79db7", + "33": "be4dc1ddd5199c6b3c2fcadf309b0766f98471217658ef198a10a55ce31d3b6a", + "34": "380245de14920be23117b5dceaf1dba7f488946f9b04b09e12247f00e89f8bcf", + "35": "c7b64d3b4996d11219ba3a387ca110122694fb6ad6323d9a17351fbf81d5ebe4", + "36": "4db9c23a0e3b61b585a16a3a7a91a057ec8d6ef24bdc59c030062e5d80d60763", + "37": "e9f35a2a4a76dc34e5d1155681b4ce962b860a68617293177f26bce94b9b6993", + "38": "a4346f7e004e2e9f15039d6b2ceeb0cb57b0912c21a8debb7f4ffa1b959aed7c", "4": "f7627f88969eff7df1add5b6a54937fff1c2eb1f869cf4db71f51ab1657c72f8", "5": "3b8b9c52b4b74d31c9be73c6d0ba0c5e7549a0015ff4e3fffb86fa16968912e4", "6": "a42abe98ff959a8fec3fa4e6d733b7a7382fb99212f6c25846d80aa3fd6e734f", @@ -3760,27 +3760,27 @@ "72": "53ea7f0f2ee7cb77321b1efda5311034f5d19b5e42f63f83df496e96e2c15b3f", "73": "eec1ddecbcb6c99f680e745a1c2a7a3d7d9e2371999b0078501edf025e813c64", "74": "70a3199bf1a975e725d3fad3d15cb5e8845ac78d7d100894fe89876ea4efbad8", - "75": "de14403ba59c882784bb47433b1a8e1d8d280a9b0b767365105fa7acd6cc1f23", - "76": "17fc9442bc9bf3ae027ca9ad796028f2b203bf536f1cd23693db39801fd4d17e", - "77": "3626923f169016aca80b3e1942b0265ccb44611a5225fb0637aeebf1ce7b18a5", - "78": "6196c922182e7788851e512a2f05383d6794271db07ed4cbc98c3c59d50c7a06", - "79": "7344f201ef3e30dcd5fc83bb1be8546757706b4c2266e83614183b4b07428bbd", + "75": "7b7a2af4d2914022770c8df97aec2d310e20a98f29299d0206fed5c7e093ce8e", + "76": "62e6674038b54d602a7e1e05e2fc00de67ffa2da4d89ccfc06e80b1fc3fc7a80", + "77": "b1826c1a6055d4f9c051ab76599701051cfb38b5f053e5c5837e0776deaa347a", + "78": "633691a6f9697dcbb8bf3f791f5e35d0ce4dcfa2f820c5efc0a0911d22e9b685", + "79": "a4b1d8ffdf4a45e9df679b63cbf958eaa93d554eee8392c2d3fb9330a4cbb127", "8": "7d827babcb8192445726b06e4250deb674158b5a77d87ecdd9e873118dc0ec93", - "80": "a52409d57d6f6689613830d1e284a039bf2551340513a08e376be5036cda7ac2", - "81": "23955e43f93a2fb67587ceb1d82679a05ac2aa785c9062d24c8ac2514acddcc1", - "82": "10e2cb7544e6369ed3aceceb0b11a6c97a02e9a3ab64f4f6ad1efc2a973fe16f", - "83": "64fdd288503473d76e67a3417f4d2f4c44a8b7a2f56a6b76acbae3f8751b8f18", - "84": "6e35845ee53355d3a8632e22a54ebfa20ea721bb5df11871e45928b023cd6a11", - "85": "ed00b359330de953fe79257d72e86c77fdff6118fd04a2f7ea76d7ecb4c0f9ff", - "86": "a6d662afe23d3f4d29eecfe5dafc84432018133f45d0004dc25f4380c24f38e8", - "87": "2f0db0a60e370a4daeb73dab2f1bb4314ed25badbf6003fe9ee57916b9e4b6c8", - "88": "4f23fc449dca4cc0eb610ac8d1b884b97425448eee8b55dad8071a90e8354a83", - "89": "594c76b960c1c231640f33d780839b3bcbaf67c07b52e8b6c5683ea1bdc48dbb", + "80": "5f3c94bc57302913b9969ce9ae9aea5a6b78ad79e45bf99826d5ef6d842d1395", + "81": "2f8a952fcf2bba0daecddd5361017ab54c92ee9ece942cec4b5dc80100611027", + "82": "7fa2df25a8460695da922fff0dddab1d817b15e13a35912ed83aa867da128425", + "83": "43594f76265e1e89ae18e198e92eb0d11afb1fb9422ebc1dd6892fbced25809e", + "84": "e88b68294463070b84a4930c6de5d2c20bb1227f2201600e10afca3bd5248169", + "85": "0078cec6682ba64bc1105f8b6c5250f7fca5540580437c32677b7a49085d7143", + "86": "76c827c667b52235b3967ff119c873ca547ac355d67e1385812e96147bed1ec5", + "87": "ca169efaefc94eca8c36eec18f79124785f908226c7b0a7a8f8ba0334d10ebb7", + "88": "c215c852adab863ddd17d3f9a78d02e825688848c04614e1ef34e66407668d13", + "89": "bacda89a3aeae9be962e924c12fbb5d300c9aa85f2b3e3edf600e743da86cf36", "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0", - "90": "070e307bd89a43674c6f9f64e9445f9ae2fbb5b698edee2aff25ac4aa5b86140", - "91": "b70f01882ba0d81a9d2b1423c443341e416f28a987f609aa48a76e7bba18d826", - "92": "69a6c3ad66d6f1759e0eab717f2b0fbe74f955f2a40963a2ecafcc2501f9525c", - "93": "1767f385843d786be064c62f75efa6f692526188a0c1de293c93a058c56eee30" + "90": "239460448be6f16c5cc0303c089e281e7b9a521ea1fe0f50074521423ed8fe8c", + "91": "d098676fa7c8fc55d276e1b826d2ed567bdf8a66508c2c11bac048e19ec61db2", + "92": "1316c4a698a7a5746c2768bb3a84bcbacf1669185d71f06f76d1c78ffeaf4989", + "93": "b358b885e2719c21b1d1d42f2ccacf55132c101ae664d6508ee2de00f30832b6" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "6f9c1088480f429bc5f275eac443b8bdeeb1bedc8113b3984c4abc00054969a1", @@ -4904,26 +4904,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", - "20": "7b5c964d1ebd857f7ae48adb96a83315d638bf69d69270901f19509ed6c76ae3", - "21": "dee40ea04635e5c91883b8c4ec1498c5968bc973d6e504568c2bfe71324ce116", - "22": "eb6fb095a6e9de775ad4196c96d10d0beca7a8ccf6e5232849cf5efcd81b43ed", - "23": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", - "24": "8083585503b7b785968966b63ce1b546dc5c68576684b602e7ffadd5a2fcaf5c", - "25": "6accc0de09a10b6e3a0bf815c993b3109665ede51249544852359cf26e47eff0", - "26": "fc3e5cd90dbc98ba97bda0cf53d606ff3e7c64a5c8ec012eb9297cee31091afa", - "27": "9a869ca559a1e93cc5a04193124ba8fafa8a3c5438d6da77bd1e7ba9846f99e6", - "28": "7438df7db7c512f30ec542af1fc15e6df9d6b85953291d0c3aa6de7da4eb7f07", - "29": "480d3c86e6d694117e6cfc212de4b8e37ec00ed1ab65e33f33358f599b860e40", + "20": "738b857fa5b55cbfa82e6676b98c84260f3949540200cbd14c3ad07054019ac9", + "21": "a8d9e178af69d4075646d3d266ffbc0e19b9842c9e747c22d7a75fcaa0b063cf", + "22": "f13766b1e9ded060dab40e8bc089b8c41a8c0e246f94bff4c7f2f1497e80c511", + "23": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", + "24": "4c6955dcef8f7873a78c971e10f626ccdee092dd6276694978498f19cf6cfd01", + "25": "29ba1f0df5f4df07ecb72ce3a6a2955d03a0a26b06e315594dcfc6cf8b5955a2", + "26": "e7c074393fbefcf708245a82379bf05f653438799b219f72bb460f81b5bdb632", + "27": "70feee573cb4660824da23579ca445cde04accf9222ff29bae59e650b32665e9", + "28": "7f19d6830182ecd395c4b8fc480fbec61139b568f2e97202f4a513f3d81c3203", + "29": "efa7cb3c33b74eb9c2f34a3d7a070129e33ffd9d2bb0213d0cc661772c22934a", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", - "30": "d1435a45dd2842a928d1094c8a5b1221c23eb93b5f1b74e0eb13de4cd6c1997f", - "31": "a877696df7b79711b91dd4c82af81d9332980af29c61921ad544c0f4fe3c0aa8", - "32": "6d8036d83a52d4aee1c0c07daf4711788bcbafa9288b013c68feda2e17717a1a", - "33": "80c0918a2675f42d8b40e7bcf61af227030ff3405805ab0948675460ddc0196f", - "34": "b7672e34e74add594abb9434080e422aad54fe31c6e3831d3e2b36aeadfe3767", - "35": "3c2b1492f0b222b5c03edde583748502c4c179988a7155f58716935bd5995e29", - "36": "f868a90e343310d9006e56138a15b67c7e674014f1f4e3b36679725d1fdad5b8", - "37": "c950dd9c531b03c33184c31c00f4158664244f1e5a69bb34defe8b821ce6389e", - "38": "d845086183c35c7ea62a02a4968ea6ec043077f01416dad41d908a64f03835f6", + "30": "6a0b393ed1cd99e78944054162878218a1ac30f70e8705a59ad07c9a53d80c85", + "31": "3c6ab43322d6bfa68400e8d7afa6bdc08303b5db491b50e5486043f69b1dd93d", + "32": "2f76aa086ece94e6c011aab498730b503188f90b2c64162b1d66d6f0dc584615", + "33": "78c45eb6a8213eaf395bf4557112fbe59a4cf6849364ef629f43769a03da16f6", + "34": "17b54f397c8a189e0bc8b9a3fdf37a41adab6f2cbeb29d6c01a017a96e24dab5", + "35": "18bebfa6c18ce2a1a42f9cbad07341351b54611c970cf7f1d571776797005fa4", + "36": "9af605d56bea5ba2efc585da99474b1062634cda64ca9d3b636a456092c8e93f", + "37": "f8d3f46d7e8774c699d6941d338158320c1df84e1ed0dcbf274576b31b19ec74", + "38": "7fbfbef2c94aad31a4d8d153975589d9e4e8fae05cefa52b2a9d6f29d568a17f", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -5092,27 +5092,27 @@ "72": "0bbbdb89d50da2b066832374b659157935afd3ddf897bfc2b670b5fe2cf87e51", "73": "c1eb94f10ea0fd98f045b280812a8affea33519fb332bea910bdcf8b85f3e9d0", "74": "bb8b0a1e8e06e91044209b4407f8ddfc8dcb3c51d91d28f7673fc209c8d84bb0", - "75": "3ca0c8ac9a950729db5893aa5acb212e2e93e6ec542877221b9e8acb51a25deb", - "76": "46d4d5ee0a69741c1c1be542a82654141ae2a3e55ffa99f309639fc7726df2a5", - "77": "b0ddb35ac351950e1d49953747b1479b3854f9cae5d1e66a18ccf6d57d6c4672", - "78": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", - "79": "fc2caff9d49f063e21990874352d07143908924e814430d3bf3c4ae43a296347", + "75": "d4f1697482e1491e731851689d6f31d92b2f5aed90b36e15e3eb6bc52d638134", + "76": "eb70ba4c300d33d544ba5986444a34030fbe7eb5c632da768b6dfa2b8db54d9e", + "77": "586a0d1ca0744c4e35ca05d8b28e9ed7b519389227085240a1332b1bc265e560", + "78": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", + "79": "59f02cf30bd80cc88a7ddd45044bf322fd87f591a9fa559fc0b50e955de94f70", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "80": "d965e49ae59d3bb4948468bfd6ac66aa68e1f2ce2698b89d554e96f0f8aee054", - "81": "0c2a74039c4b7cf5eb7bf33773c4b8c6a9946e9460ebc258b7ef0ad0bce91dec", - "82": "da0cceeff692bb9894d4cc4804d3312a74e7660e7fc25411a4eb004805e60af5", - "83": "63648b1d2f4af50f15ae3da7b2d4717caf7d4f71275cdd085a0bd20ffdebbff4", - "84": "cfda0212ef4f69b684d2552914302cfc7c7d682ef62924ab48fd4ffa56dcf35d", - "85": "1b09b4d3293815ca75d98b1d7b77afc6987928d14499e71e7bd324f01ce3d270", - "86": "56acba34ef2ad6e79c7d8ab165ab13f198619588b55bb55be677f64380dccfb8", - "87": "ab5f7bdaba3bc6daf84134b41d2d0673f9e9ce70325929034ebf5eca372f51c5", - "88": "7e7401e8a54cd787732ce17321895860eca9c1b07a4b79d5281e96ebb492eb79", - "89": "2ea74fa8c1c31373f8546ca88249449e1a398271437bce4d81b362318c41a500", + "80": "6b1a31bb5875e1769bf088c5eca7ae099901653fdb09d3f1397095290cba2997", + "81": "c85b788d82efcb0cc90fb5dd0951577f07509d4f8576897ea09648f774f2d66d", + "82": "d4801212922fdbc3f92901f29896f5bdcea6a7019deffef0ea74f47727450b84", + "83": "6750f5d231aa29a824e1e4b63936c21eb45fd6e9595b3afc2114aaa02da039ea", + "84": "3cd48b8828e716b83be8edd0854bda3a9399ff6a60d33eafbdd59caef28de0c4", + "85": "bf6050f6fb92813daf9f519f02e0db67adac7fc5962837af322097c9621c8e8b", + "86": "01544ebdc62e031b9d2ed51caf0da5edbb3b1c93db7868bcbecee6acc4735fae", + "87": "30d64ab338efc3192c5f6b5a5dcc62c79d479bb295c467a7100eec70207d6895", + "88": "f17fb589a0523cf1fd000d9b5d9a77156c5217d0bf680a267f23f0007eff083b", + "89": "4e752e8b595690bdd29d8ce8f74dc2fe7df97f3f2a024520824947cb6cc05af6", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", - "90": "058e9037f665a5b662b8d479aecc1ee72655dd00821e6d96a1e63f8123b57568", - "91": "ca99208b56497388d6475b4eb16e12d0e58e8433e6a0edffc32036260f0adb26", - "92": "969868a055d91142f2e55c4a2834bb0135daa91f34ef36960e9f37aef7d22823", - "93": "c8a9718858a6bb16f11824d9600a46e9fd0b668830fbcbdc53046e0c6e588938" + "90": "5697e781e6846b657b3f238ab08edde9312359897c62a164c674be436cc4a673", + "91": "d7f054eaac8fae438a3288e5dee683df62f1ab42a452ad3a11b7c69677783c30", + "92": "8293a32874210d967d598bda66401472d57bcb8187dd1b61bda301fb3dbbd991", + "93": "1996579136d6ec9668e45df3519c4ce567841e1f929402552c3d2cb5ada43b7f" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", @@ -6440,26 +6440,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", - "20": "7b5c964d1ebd857f7ae48adb96a83315d638bf69d69270901f19509ed6c76ae3", - "21": "dee40ea04635e5c91883b8c4ec1498c5968bc973d6e504568c2bfe71324ce116", - "22": "eb6fb095a6e9de775ad4196c96d10d0beca7a8ccf6e5232849cf5efcd81b43ed", - "23": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", - "24": "8083585503b7b785968966b63ce1b546dc5c68576684b602e7ffadd5a2fcaf5c", - "25": "6accc0de09a10b6e3a0bf815c993b3109665ede51249544852359cf26e47eff0", - "26": "fc3e5cd90dbc98ba97bda0cf53d606ff3e7c64a5c8ec012eb9297cee31091afa", - "27": "9a869ca559a1e93cc5a04193124ba8fafa8a3c5438d6da77bd1e7ba9846f99e6", - "28": "7438df7db7c512f30ec542af1fc15e6df9d6b85953291d0c3aa6de7da4eb7f07", - "29": "480d3c86e6d694117e6cfc212de4b8e37ec00ed1ab65e33f33358f599b860e40", + "20": "738b857fa5b55cbfa82e6676b98c84260f3949540200cbd14c3ad07054019ac9", + "21": "a8d9e178af69d4075646d3d266ffbc0e19b9842c9e747c22d7a75fcaa0b063cf", + "22": "f13766b1e9ded060dab40e8bc089b8c41a8c0e246f94bff4c7f2f1497e80c511", + "23": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", + "24": "4c6955dcef8f7873a78c971e10f626ccdee092dd6276694978498f19cf6cfd01", + "25": "29ba1f0df5f4df07ecb72ce3a6a2955d03a0a26b06e315594dcfc6cf8b5955a2", + "26": "e7c074393fbefcf708245a82379bf05f653438799b219f72bb460f81b5bdb632", + "27": "70feee573cb4660824da23579ca445cde04accf9222ff29bae59e650b32665e9", + "28": "7f19d6830182ecd395c4b8fc480fbec61139b568f2e97202f4a513f3d81c3203", + "29": "efa7cb3c33b74eb9c2f34a3d7a070129e33ffd9d2bb0213d0cc661772c22934a", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", - "30": "d1435a45dd2842a928d1094c8a5b1221c23eb93b5f1b74e0eb13de4cd6c1997f", - "31": "a877696df7b79711b91dd4c82af81d9332980af29c61921ad544c0f4fe3c0aa8", - "32": "6d8036d83a52d4aee1c0c07daf4711788bcbafa9288b013c68feda2e17717a1a", - "33": "80c0918a2675f42d8b40e7bcf61af227030ff3405805ab0948675460ddc0196f", - "34": "b7672e34e74add594abb9434080e422aad54fe31c6e3831d3e2b36aeadfe3767", - "35": "3c2b1492f0b222b5c03edde583748502c4c179988a7155f58716935bd5995e29", - "36": "f868a90e343310d9006e56138a15b67c7e674014f1f4e3b36679725d1fdad5b8", - "37": "c950dd9c531b03c33184c31c00f4158664244f1e5a69bb34defe8b821ce6389e", - "38": "d845086183c35c7ea62a02a4968ea6ec043077f01416dad41d908a64f03835f6", + "30": "6a0b393ed1cd99e78944054162878218a1ac30f70e8705a59ad07c9a53d80c85", + "31": "3c6ab43322d6bfa68400e8d7afa6bdc08303b5db491b50e5486043f69b1dd93d", + "32": "2f76aa086ece94e6c011aab498730b503188f90b2c64162b1d66d6f0dc584615", + "33": "78c45eb6a8213eaf395bf4557112fbe59a4cf6849364ef629f43769a03da16f6", + "34": "17b54f397c8a189e0bc8b9a3fdf37a41adab6f2cbeb29d6c01a017a96e24dab5", + "35": "18bebfa6c18ce2a1a42f9cbad07341351b54611c970cf7f1d571776797005fa4", + "36": "9af605d56bea5ba2efc585da99474b1062634cda64ca9d3b636a456092c8e93f", + "37": "f8d3f46d7e8774c699d6941d338158320c1df84e1ed0dcbf274576b31b19ec74", + "38": "7fbfbef2c94aad31a4d8d153975589d9e4e8fae05cefa52b2a9d6f29d568a17f", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -6628,27 +6628,27 @@ "72": "0bbbdb89d50da2b066832374b659157935afd3ddf897bfc2b670b5fe2cf87e51", "73": "c1eb94f10ea0fd98f045b280812a8affea33519fb332bea910bdcf8b85f3e9d0", "74": "bb8b0a1e8e06e91044209b4407f8ddfc8dcb3c51d91d28f7673fc209c8d84bb0", - "75": "3ca0c8ac9a950729db5893aa5acb212e2e93e6ec542877221b9e8acb51a25deb", - "76": "46d4d5ee0a69741c1c1be542a82654141ae2a3e55ffa99f309639fc7726df2a5", - "77": "b0ddb35ac351950e1d49953747b1479b3854f9cae5d1e66a18ccf6d57d6c4672", - "78": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", - "79": "fc2caff9d49f063e21990874352d07143908924e814430d3bf3c4ae43a296347", + "75": "d4f1697482e1491e731851689d6f31d92b2f5aed90b36e15e3eb6bc52d638134", + "76": "eb70ba4c300d33d544ba5986444a34030fbe7eb5c632da768b6dfa2b8db54d9e", + "77": "586a0d1ca0744c4e35ca05d8b28e9ed7b519389227085240a1332b1bc265e560", + "78": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", + "79": "59f02cf30bd80cc88a7ddd45044bf322fd87f591a9fa559fc0b50e955de94f70", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "80": "d965e49ae59d3bb4948468bfd6ac66aa68e1f2ce2698b89d554e96f0f8aee054", - "81": "0c2a74039c4b7cf5eb7bf33773c4b8c6a9946e9460ebc258b7ef0ad0bce91dec", - "82": "da0cceeff692bb9894d4cc4804d3312a74e7660e7fc25411a4eb004805e60af5", - "83": "63648b1d2f4af50f15ae3da7b2d4717caf7d4f71275cdd085a0bd20ffdebbff4", - "84": "cfda0212ef4f69b684d2552914302cfc7c7d682ef62924ab48fd4ffa56dcf35d", - "85": "1b09b4d3293815ca75d98b1d7b77afc6987928d14499e71e7bd324f01ce3d270", - "86": "56acba34ef2ad6e79c7d8ab165ab13f198619588b55bb55be677f64380dccfb8", - "87": "ab5f7bdaba3bc6daf84134b41d2d0673f9e9ce70325929034ebf5eca372f51c5", - "88": "7e7401e8a54cd787732ce17321895860eca9c1b07a4b79d5281e96ebb492eb79", - "89": "2ea74fa8c1c31373f8546ca88249449e1a398271437bce4d81b362318c41a500", + "80": "6b1a31bb5875e1769bf088c5eca7ae099901653fdb09d3f1397095290cba2997", + "81": "c85b788d82efcb0cc90fb5dd0951577f07509d4f8576897ea09648f774f2d66d", + "82": "d4801212922fdbc3f92901f29896f5bdcea6a7019deffef0ea74f47727450b84", + "83": "6750f5d231aa29a824e1e4b63936c21eb45fd6e9595b3afc2114aaa02da039ea", + "84": "3cd48b8828e716b83be8edd0854bda3a9399ff6a60d33eafbdd59caef28de0c4", + "85": "bf6050f6fb92813daf9f519f02e0db67adac7fc5962837af322097c9621c8e8b", + "86": "01544ebdc62e031b9d2ed51caf0da5edbb3b1c93db7868bcbecee6acc4735fae", + "87": "30d64ab338efc3192c5f6b5a5dcc62c79d479bb295c467a7100eec70207d6895", + "88": "f17fb589a0523cf1fd000d9b5d9a77156c5217d0bf680a267f23f0007eff083b", + "89": "4e752e8b595690bdd29d8ce8f74dc2fe7df97f3f2a024520824947cb6cc05af6", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", - "90": "058e9037f665a5b662b8d479aecc1ee72655dd00821e6d96a1e63f8123b57568", - "91": "ca99208b56497388d6475b4eb16e12d0e58e8433e6a0edffc32036260f0adb26", - "92": "969868a055d91142f2e55c4a2834bb0135daa91f34ef36960e9f37aef7d22823", - "93": "c8a9718858a6bb16f11824d9600a46e9fd0b668830fbcbdc53046e0c6e588938" + "90": "5697e781e6846b657b3f238ab08edde9312359897c62a164c674be436cc4a673", + "91": "d7f054eaac8fae438a3288e5dee683df62f1ab42a452ad3a11b7c69677783c30", + "92": "8293a32874210d967d598bda66401472d57bcb8187dd1b61bda301fb3dbbd991", + "93": "1996579136d6ec9668e45df3519c4ce567841e1f929402552c3d2cb5ada43b7f" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json index 177d49142dc6..088f156f49a0 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json @@ -53,26 +53,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 105958, + "bytes": 106631, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "f3d4041dc9f4bcce9c7071e80b2b26d288f3a96e2d994fad12508016f7622c8c", + "sha256": "ffd330e03c0bf9154bb9902062cf5b568901a7ef9d0c179b73b4fc154546169d", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 206197, + "bytes": 206897, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "877fd82b5c17d8e1f991c45b9a4f7edfa4c883a61714c63afa813bc7667e01d9", + "sha256": "3e1e805a6ef63a6ee5a7c0161a8b746193a41f0abbbe8dacfebb296d062764cc", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 108960, + "bytes": 109624, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "7b7c6b3a885371cb7aa6e64e0c4ab0868e58344ce869e220b38e0c51d22c384f", + "sha256": "1ce436e0725ae702c0fda74e06ce6e9e22f5a77e160021d50adad8f517ea5c48", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -269,26 +269,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81457, + "bytes": 82107, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "3416f78366d7fa9c31aff46c844f95c4fa72309c52e5e4755a6d32d2c1c30782", + "sha256": "6057d6bca37698f8c7395de1fdc2045236aa54a1f82d0d3a893a1b64b5ff85bb", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 239748, + "bytes": 240423, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "bc427261c99784c0d9c45d72d8ac84bb55456d594fe5c8aaf1bf3b2c70165cdb", + "sha256": "28808c37f703e2abe1781b35fddc3351b2f3a34737300037e7b679b518352368", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 85972, + "bytes": 86656, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "4ff725a175ffd194bf2ebade5467817d9c155078b32f12760c2a6dc855d01605", + "sha256": "9c46f1995c989128f0f96345d2fec7e3bee0f6985aa326f2379922e0b814039f", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -482,26 +482,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106280, + "bytes": 106953, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "49a637954eca28bcc8e3ff7f6cf792e4a60f9319b8bb4e0d66400cfa13647fcc", + "sha256": "cf47f97757c2bc6cf003c52d539b0d910de18d3e8fe62abe820056736c745c00", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 206508, + "bytes": 207208, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "b2696c5aadbe5ecfc9b228d614cb22365a91ceab58be95ddaf9d176ec4f6261d", + "sha256": "a6538f57c98ccedff5f68b37377b0fd058834f64ebe4688fb012953b5bf54998", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 109302, + "bytes": 109966, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "8f5dba82f4eeaf94c353117caf3262b6406d1ee6e57b206ecc998c2e1a59bb5a", + "sha256": "639249f03fccd43b250acf62c57ad7981014f8eb9dcf214228c177793fb56506", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -698,26 +698,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81682, + "bytes": 82332, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "6196c922182e7788851e512a2f05383d6794271db07ed4cbc98c3c59d50c7a06", + "sha256": "633691a6f9697dcbb8bf3f791f5e35d0ce4dcfa2f820c5efc0a0911d22e9b685", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 239973, + "bytes": 240648, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "785aa70542db9b80302a4db5a6e991605c70b52d90236160b5d77e87709cfe8f", + "sha256": "3fc99b456a61a3b2a35411252cbf1335386f4241897a2736ec698ad3ef1c3cc9", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 86197, + "bytes": 86881, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "0d8415f3fbefa6fc5cf5c25b07715344e54d7f421d1d506c30d355fb8df8397c", + "sha256": "8bdc5e9c69455e75723552bc68c577354d3ac6674553e27f594469ad55e82837", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -911,26 +911,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106344, + "bytes": 107017, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", + "sha256": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 206572, + "bytes": 207272, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "d34c37b8e0e5af7a3bc75417684bd1a95b31f69525a53a33d80e6ee258955882", + "sha256": "66e2005b1c4d833f81448ef9dcceb0737fe11e668b303864a830576b6a7549b7", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 109366, + "bytes": 110030, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "6829ebdb9882aeb7fa41f4487eefe1c470ca79baea4c28ba72514c6a4baea1d4", + "sha256": "0a5b3e9bcfe64b2bf1963176a7c3f5b8cd503688e5b8764ff615468382b818d6", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -1127,26 +1127,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81746, + "bytes": 82396, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", + "sha256": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 240037, + "bytes": 240712, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "7fa0e3fc9a51cfc3516ee9665e661c67fda0a4ad1b94788f1d4b9001db5d0605", + "sha256": "d8bc0a23d4c7eca82400141d8244f268ea773d96efc2e16c5d932a54c0059fd1", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 86261, + "bytes": 86945, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "f75f2a279747be1f413eede7bc38f5ca86d837c3a72c8b8af5dc4e0af7de185f", + "sha256": "7214385e9aab885e7644a9bc65919f5da74ae5f447f6e2135cbc047a9dad8dff", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -1340,26 +1340,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106344, + "bytes": 107017, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "b3e251c5195b69d59f51377e26c5c4ae1c9e4c5a0263ed8e7845f2ba235ab5e4", + "sha256": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 206572, + "bytes": 207272, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "d34c37b8e0e5af7a3bc75417684bd1a95b31f69525a53a33d80e6ee258955882", + "sha256": "66e2005b1c4d833f81448ef9dcceb0737fe11e668b303864a830576b6a7549b7", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 109366, + "bytes": 110030, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "6829ebdb9882aeb7fa41f4487eefe1c470ca79baea4c28ba72514c6a4baea1d4", + "sha256": "0a5b3e9bcfe64b2bf1963176a7c3f5b8cd503688e5b8764ff615468382b818d6", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -1556,26 +1556,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 81746, + "bytes": 82396, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "c552ffaf5b0658e508f7a3cf3f60b329ca40eb144aaac214d501eb8ac971fe83", + "sha256": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 240037, + "bytes": 240712, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "7fa0e3fc9a51cfc3516ee9665e661c67fda0a4ad1b94788f1d4b9001db5d0605", + "sha256": "d8bc0a23d4c7eca82400141d8244f268ea773d96efc2e16c5d932a54c0059fd1", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 86261, + "bytes": 86945, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "f75f2a279747be1f413eede7bc38f5ca86d837c3a72c8b8af5dc4e0af7de185f", + "sha256": "7214385e9aab885e7644a9bc65919f5da74ae5f447f6e2135cbc047a9dad8dff", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp index f5b324587022..af2fe69f5c87 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp @@ -75,6 +75,7 @@ AttentionPagedUnifiedLaunchInputs denseInputs() s.kvHeadStride = 8192; s.kvBlockSpanBytes = 131072; s.qBlockGrid = 18; + s.numKvBlocks = 4096; launch.blockThreads = 256; return launch; } @@ -165,6 +166,7 @@ void expectSameLaunch(const AttentionPagedUnifiedLaunchInputs& read, EXPECT_EQ(r.kvBlockSpanBytes, e.kvBlockSpanBytes); EXPECT_EQ(r.qBlockGrid, e.qBlockGrid); EXPECT_EQ(r.sinkIsF32, e.sinkIsF32); + EXPECT_EQ(r.numKvBlocks, e.numKvBlocks); EXPECT_EQ(read.blockThreads, expected.blockThreads); } @@ -218,6 +220,7 @@ TEST(TestAttentionPagedUnifiedLaunchValues, ValuesMatchTheV1Contract) {"kv_block_span_bytes", int64_t{131072}}, {"q_block_grid", int64_t{18}}, {"sink_is_f32", int64_t{0}}, + {"num_kv_blocks", int64_t{4096}}, {"block_threads", int64_t{256}}}; EXPECT_EQ(values, expected); EXPECT_EQ(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1, @@ -284,7 +287,7 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnotherContractName) TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAMissingOptionalOrFloatValue) { - for(const char* name : {"sink.uid", "ragged_offset.uid", "scale", "sink_is_f32"}) + for(const char* name : {"sink.uid", "ragged_offset.uid", "scale", "sink_is_f32", "num_kv_blocks"}) { SCOPED_TRACE(name); auto missing = saved(denseInputs()); @@ -328,6 +331,9 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnIntegerOutsideWhatTheKernel {&ragged, "q_uniform_len", -1}, {&dense, "sink_is_f32", -1}, {&dense, "sink_is_f32", 2}, + {&dense, "num_kv_blocks", 0}, // a K/V container holds at least one block + {&dense, "num_kv_blocks", -1}, + {&dense, "num_kv_blocks", int64_t{2147483648}}, {&dense, "block_table_stride", -1}, {&dense, "q_tok_stride", -1}, {&dense, "o_head_stride", int64_t{2147483648}}, diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp index 626aeb345cab..bf9ee6b88b4e 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp @@ -279,6 +279,7 @@ MetadataValues attentionPagedUnifiedSampleValues() {"kv_block_span_bytes", int64_t{131072}}, {"q_block_grid", int64_t{21}}, {"sink_is_f32", int64_t{1}}, + {"num_kv_blocks", int64_t{8192}}, {"block_threads", int64_t{128}}}; } @@ -1593,6 +1594,7 @@ TEST(TestIngestorPlanLaunchContractGoldens, AttentionPagedUnifiedV1SampleStillRe EXPECT_EQ(s.kvBlockSpanBytes, 131072); EXPECT_EQ(s.qBlockGrid, 21); EXPECT_EQ(s.sinkIsF32, 1); + EXPECT_EQ(s.numKvBlocks, 8192); EXPECT_EQ(launch.blockThreads, 128); } From bf3edcfc18b871be38f6ba42bb97ee300193d8c9 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Sat, 14 Nov 2026 16:01:28 -0600 Subject: [PATCH 14/22] test(hip-kernel-provider): regenerate the AttentionPagedUnified v1 launch-contract golden for num_kv_blocks --- .../TestIngestorPlanLaunchContractGoldens.cpp | 121 +++++++++--------- 1 file changed, 62 insertions(+), 59 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp index bf9ee6b88b4e..b4e165ceaac6 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp @@ -1068,97 +1068,100 @@ constexpr std::array GFX942_ATTENTION_DENSE_V1_PERSISTENT_THREE_P 0x05, 0x00, 0x00, 0x00, 0x61, 0x5F, 0x70, 0x74, 0x72, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x5F, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x00, 0x00}; -constexpr std::array ATTENTION_PAGED_UNIFIED_V1_GOLDEN = { +constexpr std::array ATTENTION_PAGED_UNIFIED_V1_GOLDEN = { 0x48, 0x4B, 0x49, 0x50, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x24, 0x42, 0x29, 0xC8, 0x99, 0x41, 0xAC, 0xCC, 0xA9, 0x0D, 0x35, 0x67, 0x49, 0x31, 0x4E, 0x1D, - 0x53, 0x87, 0x89, 0x72, 0x50, 0x1C, 0x79, 0x54, 0x75, 0xAC, 0x0C, 0x85, 0x25, 0xFE, 0xD5, 0x88, + 0x50, 0x3C, 0x95, 0x32, 0xB8, 0x77, 0x9B, 0x75, 0x07, 0xA6, 0x2D, 0x90, 0xA1, 0x93, 0xE7, 0xD6, + 0x0F, 0x4B, 0x81, 0x58, 0xA7, 0x40, 0x06, 0x49, 0x69, 0x3F, 0xAB, 0x8E, 0xAE, 0x21, 0xAD, 0x1E, 0x24, 0x00, 0x00, 0x00, 0x48, 0x4B, 0x53, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x20, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0C, 0x00, - 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0xCC, 0x06, 0x00, 0x00, - 0x3C, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, - 0x2C, 0x2D, 0x2E, 0x2F, 0x05, 0x00, 0x00, 0x00, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x68, 0x69, 0x70, 0x6B, - 0x65, 0x72, 0x6E, 0x65, 0x6C, 0x2E, 0x61, 0x74, 0x74, 0x65, 0x6E, 0x74, 0x69, 0x6F, 0x6E, 0x5F, - 0x70, 0x61, 0x67, 0x65, 0x64, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2E, 0x64, 0x69, - 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2E, 0x76, 0x31, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0xFC, 0x05, 0x00, 0x00, 0xB8, 0x05, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x48, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2C, 0x00, 0x1C, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0C, 0x00, + 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xFC, 0x06, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x05, 0x00, 0x00, 0x00, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x68, 0x69, 0x70, 0x6B, 0x65, 0x72, 0x6E, 0x65, + 0x6C, 0x2E, 0x61, 0x74, 0x74, 0x65, 0x6E, 0x74, 0x69, 0x6F, 0x6E, 0x5F, 0x70, 0x61, 0x67, 0x65, + 0x64, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2E, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, + 0x63, 0x68, 0x2E, 0x76, 0x31, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, + 0xEC, 0x05, 0x00, 0x00, 0xB8, 0x05, 0x00, 0x00, 0x7C, 0x05, 0x00, 0x00, 0x44, 0x05, 0x00, 0x00, 0x10, 0x05, 0x00, 0x00, 0xDC, 0x04, 0x00, 0x00, 0xA8, 0x04, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xAC, 0x03, 0x00, 0x00, 0x78, 0x03, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x0C, 0x03, 0x00, 0x00, 0xD0, 0x02, 0x00, 0x00, 0xA0, 0x02, 0x00, 0x00, 0x6C, 0x02, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0xD0, 0x01, 0x00, 0x00, 0xA0, 0x01, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x9C, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x86, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x56, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x76, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x6E, 0xFA, 0xFF, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xAE, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x3E, 0xFA, 0xFF, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7E, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x73, 0x6C, 0x69, 0x64, 0x69, 0x6E, 0x67, 0x5F, 0x77, 0x69, 0x6E, 0x64, - 0x6F, 0x77, 0x00, 0x00, 0x1E, 0xFB, 0xFF, 0xFF, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xE2, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x6F, 0x77, 0x00, 0x00, 0xEE, 0xFA, 0xFF, 0xFF, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xB2, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x73, 0x69, 0x6E, 0x6B, 0x5F, 0x69, 0x73, 0x5F, - 0x66, 0x33, 0x32, 0x00, 0x4E, 0xFB, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x12, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x66, 0x33, 0x32, 0x00, 0x1E, 0xFB, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xE2, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x73, 0x69, 0x6E, 0x6B, 0x2E, 0x75, 0x69, 0x64, - 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFA, 0xFF, 0xFF, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xCE, 0xFA, 0xFF, 0xFF, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x5F, 0x6C, 0x65, 0x6E, 0x5F, 0x71, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x2E, 0xFB, 0xFF, 0xFF, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0xFE, 0xFA, 0xFF, 0xFF, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x5F, 0x6C, 0x65, 0x6E, 0x5F, 0x6B, 0x76, 0x2E, 0x75, - 0x69, 0x64, 0x00, 0x00, 0x5E, 0xFB, 0xFF, 0xFF, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x06, 0xFC, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xCA, 0xFB, 0xFF, 0xFF, + 0x69, 0x64, 0x00, 0x00, 0x2E, 0xFB, 0xFF, 0xFF, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x00, 0x00, 0x00, 0xD6, 0xFB, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x72, 0x61, 0x67, 0x67, 0x65, 0x64, 0x5F, 0x6F, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x3E, 0xFC, 0xFF, 0xFF, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x0E, 0xFC, 0xFF, 0xFF, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xD2, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x6F, 0x72, 0x6D, 0x5F, 0x6C, 0x65, 0x6E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x2E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0xFE, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x74, 0x6F, 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, - 0x00, 0x00, 0x00, 0x00, 0x1E, 0xFC, 0xFF, 0xFF, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xEE, 0xFB, 0xFF, 0xFF, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x73, 0x65, 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, - 0x00, 0x00, 0x00, 0x00, 0x4E, 0xFC, 0xFF, 0xFF, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x8E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1E, 0xFC, 0xFF, 0xFF, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, - 0x65, 0x00, 0x00, 0x00, 0x7E, 0xFC, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBE, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x65, 0x00, 0x00, 0x00, 0x4E, 0xFC, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x67, 0x72, 0x69, 0x64, - 0x00, 0x00, 0x00, 0x00, 0xAE, 0xFC, 0xFF, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xEE, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x71, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x56, 0xFD, 0xFF, 0xFF, - 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0xFD, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x7E, 0xFC, 0xFF, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xBE, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x71, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x26, 0xFD, 0xFF, 0xFF, + 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x70, 0x61, 0x67, 0x65, 0x5F, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x5F, 0x76, 0x2E, 0x75, 0x69, 0x64, - 0x00, 0x00, 0x00, 0x00, 0x8E, 0xFD, 0xFF, 0xFF, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5E, 0xFD, 0xFF, 0xFF, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x22, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x70, 0x61, 0x67, 0x65, 0x5F, 0x74, 0x61, 0x62, - 0x6C, 0x65, 0x5F, 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x46, 0xFD, 0xFF, 0xFF, - 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x6C, 0x65, 0x5F, 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x16, 0xFD, 0xFF, 0xFF, + 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x74, 0x6F, - 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x76, 0xFD, 0xFF, 0xFF, - 0x81, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x46, 0xFD, 0xFF, 0xFF, + 0x81, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x73, 0x65, - 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0xA6, 0xFD, 0xFF, 0xFF, - 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x76, 0xFD, 0xFF, 0xFF, + 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x68, 0x65, - 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0xD6, 0xFD, 0xFF, 0xFF, - 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0xA6, 0xFD, 0xFF, 0xFF, + 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6F, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x7E, 0xFE, 0xFF, 0xFF, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x42, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x4E, 0xFE, 0xFF, 0xFF, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x12, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x73, 0x65, 0x71, 0x73, - 0x00, 0x00, 0x00, 0x00, 0x2E, 0xFE, 0xFF, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFD, 0xFF, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5F, 0x68, 0x65, - 0x61, 0x64, 0x73, 0x00, 0x5E, 0xFE, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x61, 0x64, 0x73, 0x00, 0x2E, 0xFE, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x6B, 0x76, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x73, - 0x00, 0x00, 0x00, 0x00, 0x8E, 0xFE, 0xFF, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5E, 0xFE, 0xFF, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x6B, 0x76, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, + 0x73, 0x00, 0x00, 0x00, 0x8E, 0xFE, 0xFF, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x74, 0x6F, 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0xBE, 0xFE, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, From 6641b61c409c4df23ec7ccae67ea709f03255006 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Sat, 14 Nov 2026 16:46:02 -0600 Subject: [PATCH 15/22] style(hip-kernel-provider): apply clang-format and black to the page-id containment change --- .../rocke/library/kernels/gfx950/attention_tiled_2d.py | 8 ++++---- .../library/tests/test_gfx942_attention_runtime_layout.py | 4 +++- .../gfx942/attention_tiled_2d_kv_descriptors_loads.cpp | 3 +-- .../gfx950/attention_tiled_2d_kv_descriptors_loads.cpp | 3 +-- .../packs/AttentionPagedUnifiedLaunchValues.hpp | 3 ++- .../packs/AttentionTiled2DSignature.hpp | 4 ++-- .../packs/TestAttentionPagedUnifiedLaunchValues.cpp | 3 ++- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index e1f53586af2c..638376ab0545 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -2286,7 +2286,9 @@ def _pack_p_a32(p_regs0_f32: list[Value], p_regs1_f32: list[Value]) -> Value: def _sink_logit(qh, qh_in): # Query head ``qh``'s sink logit in f32 (see ``sink_logit``). - return sink_logit(b, sinks, dtype, qh, qh_in, rtl["sink_is_f32"] if RTL else None) + return sink_logit( + b, sinks, dtype, qh, qh_in, rtl["sink_is_f32"] if RTL else None + ) if USE_SINKS: m_inits = [] @@ -2569,9 +2571,7 @@ def _rtl_kv_page(src: Value, table: Value, kv_tile_idx: Value) -> Value: # the cache: it reads as a masked page (block 0, zero-size resource). phys_ok = b.cmp_ult(phys, rtl["num_kv_blocks"]) phys = b.select(phys_ok, phys, b.const_i32(0)) - page = b.global_ptr_add( - src, b.mul(b.zext(phys, I64), rtl_kv_page_stride_b) - ) + page = b.global_ptr_add(src, b.mul(b.zext(phys, I64), rtl_kv_page_stride_b)) return b.buffer_rsrc(page, b.select(phys_ok, rtl_kv_span, b.const_i32(0))) def _rtl_kv_voff(kv_tile_idx: Value, linear_half: Value) -> Value: diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py index 03893fe3e1d3..68eae4b90599 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -761,7 +761,9 @@ def test_runtime_layout_contains_out_of_range_page_ids( zlib.crc32(f"bad:{dtype}:{head_size}:{block_size}:{qpk}".encode()) ) sc = next( - s for s in _scenarios(block_size) if s["seq_lens"][-1] > 0 and s["mode"] == "dense" + s + for s in _scenarios(block_size) + if s["seq_lens"][-1] > 0 and s["mode"] == "dense" ) _run_case(spec, sc, rng, bad_page=bad_page) diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp index 0d9ecf43ab03..a465b3ea6437 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_kv_descriptors_loads.cpp @@ -753,8 +753,7 @@ static rocke__rtl_kv_block_t rocke__rtl_kv_block(rocke_gfx942_attn2d_build_ctx_t rocke_value_t* phys = rocke_b_to_sgpr_u32(b, phys_e); /* A page id outside [0, num_kv_blocks) would address memory outside the * cache: it reads as a masked page (block 0, zero-size resource). */ - rocke_value_t* phys_ok - = rocke_b_cmp_ult(b, phys, ctx->rtl_p[ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS]); + rocke_value_t* phys_ok = rocke_b_cmp_ult(b, phys, ctx->rtl_p[ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS]); phys = rocke_b_select(b, phys_ok, phys, rocke_b_const_i32(b, 0)); rocke_value_t* phys64 = rocke_b_zext(b, phys, rocke_i64()); rocke_value_t* page_off = rocke_b_mul(b, phys64, ctx->rtl_kv_page_stride_b); diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp index 3dc63e0576e8..1e9f5911243c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_kv_descriptors_loads.cpp @@ -606,8 +606,7 @@ static rocke_value_t* rocke__rtl_kv_page(rocke_gfx950_attn2d_build_ctx_t* ctx, rocke_value_t* phys_s = rocke_b_to_sgpr_u32(b, phys); /* A page id outside [0, num_kv_blocks) would address memory outside the * cache: it reads as a masked page (block 0, zero-size resource). */ - rocke_value_t* phys_ok - = rocke_b_cmp_ult(b, phys_s, ctx->rtl_p[ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS]); + rocke_value_t* phys_ok = rocke_b_cmp_ult(b, phys_s, ctx->rtl_p[ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS]); phys_s = rocke_b_select(b, phys_ok, phys_s, rocke_b_const_i32(b, 0)); rocke_value_t* phys64 = rocke_b_zext(b, phys_s, rocke_i64()); rocke_value_t* page_off = rocke_b_mul(b, phys64, ctx->rtl_kv_page_stride_b); diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp index 9ff07a58a763..145680e8f780 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp @@ -119,7 +119,8 @@ struct AttentionPagedUnifiedScalars int32_t kvBlockSpanBytes = 0; int32_t qBlockGrid = 0; int32_t sinkIsF32 = 0; ///< 1: the sink is FLOAT; 0: in the Q data type, or no sink - int32_t numKvBlocks = 0; ///< the K/V container's block count; a page id at or past it reads as masked + int32_t numKvBlocks + = 0; ///< the K/V container's block count; a page id at or past it reads as masked }; /// Everything a launch is computed from: block = (blockThreads, 1, 1) and diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp index bab38537c192..8cb96a6489f6 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionTiled2DSignature.hpp @@ -52,8 +52,8 @@ inline void /// shape kernargs (`RUNTIME_KERNARG_FIELDS`: head counts and window). An LSE-on kernel /// (@p emitLse) appends lse_ptr, 8-byte aligned after the runtime kernargs (read off the /// compiled LSE kernel). A runtime_layout kernel appends its own arguments after these. -inline std::vector - tiled2DKernelSignature(bool emitLse = false) +inline std::vector tiled2DKernelSignature(bool emitLse + = false) { constexpr auto PTR = static_cast(sizeof(void*)); constexpr auto I32 = static_cast(sizeof(int32_t)); diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp index af2fe69f5c87..4a288cd30593 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp @@ -287,7 +287,8 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnotherContractName) TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAMissingOptionalOrFloatValue) { - for(const char* name : {"sink.uid", "ragged_offset.uid", "scale", "sink_is_f32", "num_kv_blocks"}) + for(const char* name : + {"sink.uid", "ragged_offset.uid", "scale", "sink_is_f32", "num_kv_blocks"}) { SCOPED_TRACE(name); auto missing = saved(denseInputs()); From 00e3b57b452c168f6cfecbfb21f27b51de7c334e Mon Sep 17 00:00:00 2001 From: David Peabody Date: Sat, 14 Nov 2026 17:22:33 -0600 Subject: [PATCH 16/22] refactor(hip-kernel-provider): use the shared cuDNN paged-graph checks in Gfx1151WmmaAttention #14254 is merged, so the switch it was waiting on lands here. The engine keeps its cause keys, reasons, sink alignment rules and gfx1151 kernel limits. --- .../packs/Gfx1151WmmaAttentionNative.cpp | 238 ++++-------------- 1 file changed, 47 insertions(+), 191 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx1151WmmaAttentionNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx1151WmmaAttentionNative.cpp index a2f507b5451e..6876cb147728 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx1151WmmaAttentionNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/Gfx1151WmmaAttentionNative.cpp @@ -492,31 +492,6 @@ bool isWellFormedRaggedOperand(const data_objects::TensorAttributes& tensor) && !__builtin_mul_overflow(sliceEnd, int64_t{2}, &bytes) && fitsI32(bytes); } -/// A non-virtual device INT32 tensor read by the kernel at element `index * stride`, so -/// with no ragged offsets, pass-by-value storage or I32-overflowing addresses. -bool isDeviceI32Tensor(const data_objects::TensorAttributes* tensor) -{ - return tensor != nullptr && !tensor->virtual_() - && !tensor->ragged_offset_tensor_uid().has_value() - && !hipdnn_flatbuffers_sdk::utilities::isPassByValueTensor(tensor) - && tensor->data_type() == data_objects::DataType::INT32 && tensor->dims() != nullptr - && tensor->strides() != nullptr && tensor->dims()->size() == SDPA_RANK - && tensor->strides()->size() == SDPA_RANK; -} - -/// seq_len_q / seq_len_kv [B,1,1,1] or ragged offsets [B+1,1,1,1]: @p length INT32 -/// values the kernel reads as v[b], so the batch axis has unit stride. -bool isDeviceI32Vector(const data_objects::TensorAttributes* tensor, int64_t length) -{ - if(!isDeviceI32Tensor(tensor)) - { - return false; - } - const auto* dims = tensor->dims(); - return dims->Get(0) == length && dims->Get(1) == 1 && dims->Get(2) == 1 && dims->Get(3) == 1 - && (length == 1 || tensor->strides()->Get(0) == 1); -} - std::optional supportedDataTypeName(data_objects::DataType dataType) { if(dataType == data_objects::DataType::BFLOAT16) @@ -890,49 +865,6 @@ std::optional> return std::nullopt; } -/// Whether @p tensor declares a device-pointer alignment that is a multiple of @p bytes. -bool declaresAlignment(const data_objects::TensorAttributes& tensor, int64_t bytes) -{ - return tensor.alignment() >= bytes && tensor.alignment() % bytes == 0; -} - -/// A graph declares each operand's device-pointer alignment (16 bytes unless set; a graph -/// that sets it needs engine API 1.3.0, which this engine's 1.4.0 admits). The kernels -/// load Q / K / V / O rows as 16-byte vectors and INT32 operands as 4-byte words, so a -/// graph declaring less for any of them is declined here, with its cause logged, where -/// hipDNN can still pick another engine, rather than failing at execute. Each operand is -/// named by its role; null entries (absent operands) are skipped. -using NamedOperand = std::pair; -bool hasServedAlignment(std::string_view engine, - std::initializer_list rows, - std::initializer_list words) -{ - for(const auto& [role, tensor] : rows) - { - if(tensor != nullptr && !declaresAlignment(*tensor, static_cast(ROW_ALIGN_BYTES))) - { - HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "alignment"}) - << role << " declares a " << tensor->alignment() - << "-byte alignment; the kernels load Q, K, V and O rows as " - "16-byte vectors, so each must declare a multiple of 16 " - "bytes"); - return false; - } - } - for(const auto& [role, tensor] : words) - { - if(tensor != nullptr && !declaresAlignment(*tensor, int64_t{alignof(int32_t)})) - { - HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "alignment"}) - << role << " declares a " << tensor->alignment() - << "-byte alignment; the kernels read the INT32 page tables, " - "sequence lengths and ragged offsets as 4-byte words"); - return false; - } - } - return true; -} - /// Whether @p tensor (null when absent) declares at least the @p bytes its element loads /// and stores need; a graph declaring less is declined with the cause logged. bool hasElementAlignment(std::string_view engine, @@ -940,7 +872,7 @@ bool hasElementAlignment(std::string_view engine, const data_objects::TensorAttributes* tensor, int64_t bytes) { - if(tensor == nullptr || declaresAlignment(*tensor, bytes)) + if(tensor == nullptr || sdpa_graph::declaresAlignment(*tensor, bytes)) { return true; } @@ -1085,7 +1017,7 @@ std::optional sinkFor(std::string_view engine, return std::nullopt; } const int64_t bytes = isF32 ? int64_t{sizeof(float)} : int64_t{sizeof(uint16_t)}; - if(!declaresAlignment(*sink, bytes)) + if(!sdpa_graph::declaresAlignment(*sink, bytes)) { HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "alignment"}) << "sink_token declares a " << sink->alignment() @@ -1097,42 +1029,24 @@ std::optional sinkFor(std::string_view engine, return SinkOperand{true, *uid, isF32}; } -/// The cuDNN paged-K/V graph. K / V are page containers [num_blocks, H, page, D] of any -/// (row-aligned) strides and any size (one page of one head must be I32-addressable), -/// including both halves of one interleaved cache, with one block size and one -/// num_blocks (the kernel bounds K and V page ids by one page count); unpacked INT32 -/// page tables [B,1,M,1] (unit entry stride), one for K and one for V (they may be one -/// tensor) of one width M and one row stride; seq_len_q and seq_len_kv [B,1,1,1] bound -/// the rows and keys, max_seq_len_kv (M * page when unset) bounds the keys at build -/// time. Q is dense [B, Hq, Sq, D] or ragged through offsets O shares. Additive bias -/// and stats with a ragged Q are declined; attention sinks select the sinks objects -/// (sinkFor). Declines log under @p engine's name. +/// The cuDNN paged-K/V graph, checked through the paged-graph contract checks every +/// paged pack shares (sdpa_graph::, SEM-009) plus this engine's kernel limits. K / V are +/// page containers [num_blocks, H, page, D] of any (row-aligned) strides and any size (one +/// page of one head must be I32-addressable), including both halves of one interleaved +/// cache, with one block size and one num_blocks; the page sizes are the shipped powers of +/// two; the page tables' entries are I32-addressable; max_seq_len_kv (M * page when unset) +/// bounds the keys at build time. Q is dense [B, Hq, Sq, D] or ragged through offsets O +/// shares, in tokens. Stats with a ragged Q are declined; attention sinks select the sinks +/// objects (sinkFor). Declines log under @p engine's name. std::optional gfx1151WmmaAttentionPagedGraphMatches(std::string_view engine, const MatchContext& context, const data_objects::SdpaAttributes& attributes) { - const auto tableUid = attributes.page_table_k_tensor_uid(); - const auto tableVUid = attributes.page_table_v_tensor_uid(); - if(!tableUid.has_value() || !tableVUid.has_value()) + if(!sdpa_graph::pagesKAndV(engine, attributes)) { - HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "one_sided_paging"}) - << "only " << (tableUid.has_value() ? "K" : "V") - << " is paged; the kernels page both K and V or neither"); return std::nullopt; } - const auto* table = findTensor(context, *tableUid); - const auto* tableV = findTensor(context, *tableVUid); - for(const auto* pageTable : {table, tableV}) - { - if(pageTable != nullptr && pageTable->ragged_offset_tensor_uid().has_value()) - { - logDecline(engine, - "page_table", - "a packed (ragged) page table; the kernels read [B, 1, M, 1]"); - return std::nullopt; - } - } const auto* q = findTensor(context, attributes.q_tensor_uid()); const auto* k = findTensor(context, attributes.k_tensor_uid()); @@ -1143,21 +1057,8 @@ std::optional { return std::nullopt; } - if(v->dims()->Get(SEQ_AXIS) != k->dims()->Get(SEQ_AXIS)) - { - HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "block_size"}) - << "the K and V containers differ in block size (" - << k->dims()->Get(SEQ_AXIS) << " and " << v->dims()->Get(SEQ_AXIS) - << "); the kernels address both with one"); - return std::nullopt; - } - if(v->dims()->Get(BATCH_AXIS) != k->dims()->Get(BATCH_AXIS)) + if(!sdpa_graph::pagedContainersAgree(engine, *k, *v)) { - HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "shape"}) - << "the K and V containers differ in page count (" - << k->dims()->Get(BATCH_AXIS) << " and " - << v->dims()->Get(BATCH_AXIS) - << "); the kernels bound both page ids by one"); return std::nullopt; } const bool raggedQ = q->ragged_offset_tensor_uid().has_value(); @@ -1240,47 +1141,26 @@ std::optional } } - const auto isPageTable = [&](const data_objects::TensorAttributes* pageTable) { - return isDeviceI32Tensor(pageTable) && pageTable->dims()->Get(0) == p.batch - && pageTable->dims()->Get(1) == 1 && pageTable->dims()->Get(2) > 0 - && pageTable->dims()->Get(3) == 1 - && (pageTable->dims()->Get(2) == 1 || pageTable->strides()->Get(2) == 1) - && pageTable->strides()->Get(0) >= 0 && fitsI32(pageTable->strides()->Get(0)) - && addressFitsI32(*pageTable, 4); - }; - for(const auto& [role, pageTable] : - {NamedOperand{"page_table_k", table}, NamedOperand{"page_table_v", tableV}}) + const auto tables = sdpa_graph::pageTablesFor(engine, context, attributes, p.batch); + if(!tables.has_value()) { - if(!isPageTable(pageTable)) + return std::nullopt; + } + for(const auto& [role, table] : {sdpa_graph::NamedOperand{"page_table_k", tables->k}, + sdpa_graph::NamedOperand{"page_table_v", tables->v}}) + { + if(!fitsI32(table->strides()->Get(BATCH_AXIS)) || !addressFitsI32(*table, 4)) { HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "page_table"}) << role - << " must be a device INT32 [B, 1, M, 1] tensor with a unit " - "entry stride whose entries are I32-addressable"); + << "'s entries must be I32-addressable: the kernels index " + "the page tables in 32 bits"); return std::nullopt; } } - // The kernel reads both tables at one row offset. With one sequence the row stride is - // never used. - if(tableV->dims()->Get(2) != table->dims()->Get(2)) - { - HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "page_table"}) - << "the K and V page tables differ in width (" - << table->dims()->Get(2) << " and " << tableV->dims()->Get(2) - << "); the kernels read both at one row offset"); - return std::nullopt; - } - if(p.batch > 1 && tableV->strides()->Get(0) != table->strides()->Get(0)) - { - HIPDNN_PLUGIN_LOG_INFO((sdpa_graph::DeclinedBy{engine, "page_table"}) - << "the K and V page tables differ in row stride (" - << table->strides()->Get(0) << " and " << tableV->strides()->Get(0) - << "); the kernels read both at one row offset"); - return std::nullopt; - } // The keys one table row maps. An unset max_seq_len_kv is inferred from it as cuDNN does // (SEM-009); the kernels use it only as the bound on seq_len_kv. - const int64_t tableKeys = table->dims()->Get(2) * page; + const int64_t tableKeys = tables->k->dims()->Get(SEQ_AXIS) * page; const int64_t maxSeqLenKv = attributes.max_seq_len_kv().has_value() ? int64_t{attributes.max_seq_len_kv().value()} : tableKeys; @@ -1288,50 +1168,24 @@ std::optional { return std::nullopt; } - const auto seqLenKv = attributes.seq_len_kv_tensor_uid(); - const auto seqLenQ = attributes.seq_len_q_tensor_uid(); - if(!seqLenKv.has_value()) - { - logDecline(engine, "seq_len_kv", "a paged graph needs seq_len_kv"); - return std::nullopt; - } - if(!seqLenQ.has_value()) - { - logDecline(engine, "seq_len_q", "a paged graph needs seq_len_q"); - return std::nullopt; - } - const auto* seqLenKvTensor = findTensor(context, *seqLenKv); - const auto* seqLenQTensor = findTensor(context, *seqLenQ); - const auto* qOffsets = raggedQ ? findTensor(context, *q->ragged_offset_tensor_uid()) : nullptr; - if(!isDeviceI32Vector(seqLenKvTensor, p.batch)) + const auto lengths = sdpa_graph::sequenceLengthsFor(engine, context, attributes, p.batch); + if(!lengths.has_value()) { - logDecline(engine, - "seq_len_kv", - "seq_len_kv must be a device INT32 [B, 1, 1, 1] vector with a unit stride"); return std::nullopt; } - if(!isDeviceI32Vector(seqLenQTensor, p.batch)) + const auto query = sdpa_graph::raggedQueryFor(engine, context, *q, *o, *k, *v, p.batch); + if(!query.has_value()) { - logDecline(engine, - "seq_len_q", - "seq_len_q must be a device INT32 [B, 1, 1, 1] vector with a unit stride"); - return std::nullopt; - } - if(raggedQ && !isDeviceI32Vector(qOffsets, p.batch + 1)) - { - logDecline(engine, - "ragged", - "the ragged offsets must be a device INT32 [B+1, 1, 1, 1] vector with a unit " - "stride"); return std::nullopt; } - if(!hasServedAlignment(engine, - {{"Q", q}, {"K", k}, {"V", v}, {"O", o}}, - {{"page_table_k", table}, - {"page_table_v", tableV}, - {"seq_len_kv", seqLenKvTensor}, - {"seq_len_q", seqLenQTensor}, - {"ragged_offset", qOffsets}})) + if(!sdpa_graph::declaresServedAlignment(engine, + {{"Q", q}, {"K", k}, {"V", v}, {"O", o}}, + static_cast(ROW_ALIGN_BYTES), + {{"page_table_k", tables->k}, + {"page_table_v", tables->v}, + {"seq_len_kv", lengths->kv}, + {"seq_len_q", lengths->q}, + {"ragged_offset", query->offsets}})) { return std::nullopt; } @@ -1352,9 +1206,8 @@ std::optional { return std::nullopt; } - if(attributes.attn_mask_tensor_uid().has_value()) + if(!sdpa_graph::takesNoAttentionMask(engine, attributes)) { - logDecline(engine, "attn_mask", "the paged kernels take no additive attention mask"); return std::nullopt; } if(!bindCommon(engine, context, attributes, *lse, bound)) @@ -1365,15 +1218,15 @@ std::optional bound[std::string(BIAS_TOKEN)] = static_cast(BiasKind::NONE); bound[std::string(LAYOUT_TOKEN)] = static_cast(layout); bound[std::string(PAGE_SIZE_TOKEN)] = page; - bound[std::string(PAGE_TABLE_UID_TOKEN)] = *tableUid; - bound[std::string(PAGE_TABLE_V_UID_TOKEN)] = *tableVUid; - bound[std::string(PAGE_TABLE_STRIDE_TOKEN)] = table->strides()->Get(0); - bound[std::string(SEQ_LEN_KV_UID_TOKEN)] = *seqLenKv; + bound[std::string(PAGE_TABLE_UID_TOKEN)] = tables->kUid; + bound[std::string(PAGE_TABLE_V_UID_TOKEN)] = tables->vUid; + bound[std::string(PAGE_TABLE_STRIDE_TOKEN)] = tables->k->strides()->Get(BATCH_AXIS); + bound[std::string(SEQ_LEN_KV_UID_TOKEN)] = lengths->kvUid; bound[std::string(MAX_SEQ_LEN_KV_TOKEN)] = maxSeqLenKv; - bound[std::string(SEQ_LEN_Q_UID_TOKEN)] = *seqLenQ; + bound[std::string(SEQ_LEN_Q_UID_TOKEN)] = lengths->qUid; if(raggedQ) { - bound[std::string(Q_OFFSET_UID_TOKEN)] = *q->ragged_offset_tensor_uid(); + bound[std::string(Q_OFFSET_UID_TOKEN)] = query->offsetsUid; } if(sink->present) { @@ -1449,7 +1302,10 @@ std::optional graphMatchesFor(std::string_view engine, const MatchC "the dense layout has no padded-batch form"); return std::nullopt; } - if(!hasServedAlignment(engine, {{"Q", q}, {"K", k}, {"V", v}, {"O", o}}, {})) + if(!sdpa_graph::declaresServedAlignment(engine, + {{"Q", q}, {"K", k}, {"V", v}, {"O", o}}, + static_cast(ROW_ALIGN_BYTES), + {})) { return std::nullopt; } From 3e0fa550f42f876b27b82c874a9bb45813d211a1 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 18 Nov 2026 08:59:23 -0600 Subject: [PATCH 17/22] test(hip-kernel-provider): re-record the runtime_layout goldens after the develop merge gfx950 runtime_layout parity rows move to 77-95 (develop took 75-76 for the fp8 K-in-LDS rows); gfx942 rows stay 20-38. --- .../tests/parity/golden/llvm_gfx_all.json | 200 +++++++++++++++++- 1 file changed, 195 insertions(+), 5 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json index 4e5a2fd4f9df..3f8bebe0f789 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json @@ -1071,7 +1071,26 @@ "18": "bf7b02b7aa2d32470335fc8dbb966b40af321525e28b3f351bc7405a27265d69", "19": "d9b3c7bf671ce53b4eaed65a93a88fdc88eadc9a4013f22a4c654984440711e0", "2": "ee4683453afbbc49e5ae11714bccf200fada5e75884a59405cc6676af6e57b81", + "20": "41e3e964ea9b2970f6702de3cfa034e6eba9c089ffe2ef3eb4df4e072923d0e7", + "21": "e435a1206cdf6441e2619dd153a0b7e552231d6110f4ac25d1b102c057134ecd", + "22": "df09ec99c4d8ef4407ec0c9af50902f0fdccaaef048d953f1573680d3722deac", + "23": "43359e9f442d38eb8483fcc8988101f65cf51fb88e8f04e8e61f11dea7bc3b1b", + "24": "e65c2528efd8b868b3fbc1e471214e43d4ca9b00c74751cfecdef10c47dfb010", + "25": "59ecd964a20dde0a021b6fb3f3c9b9ebd9187c45d00e1d5c21caa27dfadbf2ab", + "26": "7d16d8ff27ccce2c3001c0f45d3aa2280692359a1346817e15ff08dc5d07dd0e", + "27": "f97789b6ed4e8333ebe1f767c3493a2ab7a56b45e2ab0038b88eb54d58b19e5a", + "28": "d1f5458ba71517f712812acde4f810212f946aa5ed067f19599d9351e53e3830", + "29": "c61ab4483455777eb0204ff535124df4fbf48148905952ea06b5d2e758bfab53", "3": "b364ec606939a153220377511d8bb21345bf28f998a41c1f8e3b0d96cac6c4a8", + "30": "4b77087f3d75fd7c20ad6df0693d11ebd57dd86cc1f175b7f1651efa25eec2c3", + "31": "b22ac84b6729b83a2c734862cbe07f5c307be2ddf162cdf868b5b2d29252ea0f", + "32": "fc7441ab0575a64ab79a2c93030013b14f78fc60c4011f421b8fb67feda2ffa3", + "33": "109e0df160064306e7dcb201e29f739e8818aeeb330a58c2b8305a6eb50663e4", + "34": "dc12682a6c2ae7b39da6a0fc75fd8f8ee294be8a6254d172155d50bf6b3aee9e", + "35": "157325e4da1c11c9b920da1f41d875439f1f722332dafae03bed81da2f5c2782", + "36": "3db9e3374d4e94467b43e1cb8dc7b15fb9d887c3fb9b5d294e4f9e4bacfe24d2", + "37": "447b68344ce4c4cf1c962161a8433f59105c59d8ee930b633ecd0ac586f6a7d1", + "38": "80a798aa2228ffad6da7c4d24a7783111a8f1ac5c73314a18b6889536594445a", "4": "66849d43bf1485879bcf1c5f173d72862cca98a1985d0d2d0ef824fba8c5cbe6", "5": "e9427bcb1fe7b9bfe568b7451b9f6ccd770c9399ff05deae35775479e13a407b", "6": "4337bae9b89e2794112a158ead6c4f06c3c86d992046ba3902496ddc4f940b07", @@ -1242,8 +1261,27 @@ "74": "4ed2861ee15646599091a13275f1a61728089a306f294cf7d13930eb5830fd3f", "75": "bed5bf3bdd0114db986f138893800f5dc59f5ac92ee24e07c6bd98320c750da1", "76": "e083d4f587b86585d0e42f29046dc9262a85ce1fd6182d543f171636e55407d1", + "77": "195d5101f22484fe02d8f4016815fb9f25081a059e3fb835fc45c74846cce717", + "78": "f29dac8b54bb382430fea477266647d283d6f1399b2bc8c5d0b31ca129d56336", + "79": "cf6186e95321b8d81dbb06ca49e9f75066ec2a79ee39349d1ae4ebb334ec872d", "8": "f4f0267af6f85a06591533f53a3cc74339723fa2e33c5f68e5fcd1b1ac4a6520", - "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25" + "80": "57186281131becdb166275a0bd7a89f4f01043009d34acdd29dcfcc2b489dc0d", + "81": "ec5fe76761283c2f8d5e302e873c67d1e9e19ce69f7b0bf222de590bd4fd57b1", + "82": "7ee2bbb5a2096bb7ba7ea48f628a9abc959d1d97643f1c7a728478bf58506b46", + "83": "3ce3d5643ae9211bdffa86db7e4df334ff3d98e755c70b0ae5fda31bf2540832", + "84": "3f8f6813d25c6ef0cb87e61d59344b882fcddd1827d5b26d54251a9c618132d2", + "85": "4e29c76c7aef6794f395d4ec78494401a411ebdf1213bef7347152c839e66f49", + "86": "4aae377220026669bd1f4cb6974b2aa6c9b0666b85da4e1b04019c4a398ec28d", + "87": "812f2f4152a2a33b3a06b5878cca018c2e3a7ab299c302ff675ef2b38fd40017", + "88": "5c04a09600b09e2a18206cf9b8fc1617c8a830989db1f73d0f77743bc86827e3", + "89": "1936eab85c1c6826dc3c49f06ea70ac63bc28ebfedb557f0da15a1babaa0f30b", + "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25", + "90": "9a65aba2c30f555baf0af2bf5888ef15f7b625937b8b474fc028a84175dee3eb", + "91": "7a8b2d7dee078f5b8663cc56f6656e5a9bd86c591e53472dc42be03520c84c4e", + "92": "087d5df71d22a057b0c5985faeb564f1a2f293bd08cdf7df1941161d670903d3", + "93": "3dcbc7d1ae267db020ad9894c59cbba897cc4f03828e2bcdb214220f55948c67", + "94": "e2556c52d863abbc9452eb9d1cd865a6f5cb1431ad584effafbe4b196f94e7ee", + "95": "10cb9f9103d28893c665134c0d371c9a5fc9e98961193ce4e0b3c3949dbe9854" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "d21a86dc7cd4b574b7c58faad7dff5e113e6ad5fd5739abed3d049e27de730fa", @@ -2343,7 +2381,26 @@ "18": "7d21d4ce1dd271b1dfe7f82d0c6c128c3e249b1f00833a090b74b3facb94f80e", "19": "d5b8888550a1db52d497b490f09cc169d739d054d269284ff7be8f5e3d3c2031", "2": "5841c730e964542b171c289e6075eaf6332b3cae253707da9fd74d8bb3c9ba9a", + "20": "704db10788f73b91df421e3d1e1fc10ac697c8f65eaf6343e69dba26965d36c3", + "21": "c6bc168e74f363f8f2c23a6bbb713bfd25a8fcd78514a2032ed15c43b38bedcc", + "22": "cb7965d16473597103ebd129594bf2b2e3f429faced6ecd1b5e15be46956e220", + "23": "ffd330e03c0bf9154bb9902062cf5b568901a7ef9d0c179b73b4fc154546169d", + "24": "a6f58a251d3283a6e6509753f04878b79521e2b9d89028aa0507485ebd0c049f", + "25": "b24e0b666134deb2ae92856f13a13b34b2be86f72147b41ce67e9ddf1d031eb8", + "26": "147f3464c0329e91b9097709b60b311c4218d23cefe39baf4bf410b3c1a3ef3b", + "27": "989d1afcec385c55b40060bb661066f87aa0dbdd107bcef5c08794b200b1dd8b", + "28": "d630beb57b53eb158c7f9f5353088ee7c411b94f9424c882ee7a656e3dc6e8d5", + "29": "61f0ff5f964907d13efe94a8b8ca5451e9d3efec66bd66903ecf34cab1d66939", "3": "bd9164bfbcff6da42e08428ca167eeb648967f4c40c019f79ef435be664b0d6a", + "30": "4cd7be6b98b0f5747d027785911b73215c1bddef985181479a12e18ada569569", + "31": "44b28380ffeb028a7f4a015cbb5d47fdd2dcfcf5587251224023d423ac68e182", + "32": "50da765925cf795cb660b1be5b9aac9b055a85238391059edf74ba8918da25ab", + "33": "031c4c29136a8098a7ceee16b23bee621055967e39dc0124e248a0c2d997dfbd", + "34": "46c42b31b70243156035efbb2b86d75be9c241158b7a25ec5233914b88e2d369", + "35": "dc5571167f0128ab98dd886a4e4d911b665990f0e6ec39859263c6ca9faf92e2", + "36": "0ebcde1b3cfa1f58d9ceda9ad1853a16a330af4f01a552e800d4dd2d2787b935", + "37": "84ab1d9930c114cb3c02f99939b521fbbd9b0da88497c8cc2cfd0d0481944b8f", + "38": "2e81ee4047e18140f4bb25c243c88c5cf8faf749c672f03903539458c4881c81", "4": "1b04fa2470af0aa59452389cb41125418154ab3939758ed4a38789ce290b33ab", "5": "f6e5cf8a0392c1bce3fd7d9ce4d0eccf9d39fe29f02ab9bcf5c342152eba4ffb", "6": "c5ef7876d05cc7b9ea1fd4a8fe807c660bb1102a5f198790aecfff165b017c28", @@ -2514,8 +2571,27 @@ "74": "d833ca18333f361c1c677dd9d1e59b506cfd1733a90a56c5c782a80a224867a5", "75": "c91136c4b793fba4b88cb3ce5ba0f88314ae0ab899493a6fae0460373d57b712", "76": "b6e22bf0098737c4fd607da275cec72c11266f82c9573d8d2d89bd446c32fdd8", + "77": "1a3b620d9a2bb5840afb59faac1b7dd7fc821a4d7c5aa5ff282a1cb560e1566b", + "78": "1f9a80e8681cd0a6f5cc37f23a067f038840136071ba0b71de5e0c80ab9569e8", + "79": "23ad78200e2b3aaf53c26ad5046b9f2b3cccc574763c27392ff7f9db2c2fd251", "8": "436a62f0670b97e464439f466724c5d911a96b10e4bb035429b37d5be8d85243", - "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9" + "80": "6057d6bca37698f8c7395de1fdc2045236aa54a1f82d0d3a893a1b64b5ff85bb", + "81": "643b97a0d37d7e8d9a5d38d877203c1c1ab0375d5e1506647f50f939770a738d", + "82": "fea66f219ae9cc6c41a4a33e5ca1f503a7abee1385d8b41912484b02995345e4", + "83": "84de246ec691cf0b6e5f3e4554234d5b5b903f0e76707ed6c0225ed7d52c8b40", + "84": "ef4890338c25debe61a74a6d89bbef48f6ed1429bd411e34e880213c23fd78b4", + "85": "b4f184a5900954bd550deae2cb4b60d1e86b0288a20efbf4c00b6fb516402916", + "86": "04254bedc0589d70a64362fae0d36f294f57165f0606c464c81c6ba20ddce4c1", + "87": "e39e55a921db171cff4c174df58266e17a99a8d34f2988e36ef4502b555d5d48", + "88": "5721bd9a1d6c51e700c08a0b285690234cbb7864273a13716cb0cbef60fa19b6", + "89": "0d930412b81ad081beb7cbb38ff7e4ca008e70467e256ed73ed61d028eb5b38d", + "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9", + "90": "cd0705db3b7c69cf39dd5707b73482217e334ea704217040896b0564cf738b77", + "91": "0db1524200c5ef11d2aaa095895bc8caa9965dbdfb8be6f6a11885ffd970bc9f", + "92": "73ccde85f7d9b34e3979ffdba2fe04a88ce031a6b8443181c276e61df32e3f8b", + "93": "414fca3660471da8085502e8ce1ea61b9b3410233333031a26bc578ac2512689", + "94": "dc50b5df4a208071ad93b00a35dfb52947ab0d8bbbb748d49f09c8e8293b8386", + "95": "ba1b692f83d89f8522af1edb641a137360f7c1c4fafcc747f7e0a3fc952c6843" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "52fef7be3f5b5752f4d62e09b0c9296df1abdaba39cc1d360d05e41e0b70edb3", @@ -3614,7 +3690,26 @@ "18": "eb020317c6d6bab712c0379731bdb9eab253ad67be3b1937c759c4ead5743c78", "19": "a8cc1af85ca357f2e5b109402706d4be4e6f9235839c3016290441ed7cdd6799", "2": "9b7b8d4ad0d7c67143c5887f561e08182cf9a095bed1a76ed53b406cbd45f768", + "20": "4ad5416d52c24c5e6380c83fc7d533c1ef797e6535d04aa30624c81a51b8603b", + "21": "245700c76983095caa20b852abc7bea7b2c79663e97caa399dfb71b1c18b9469", + "22": "a3713e079f5ea4593db05f0911e29258ce288e41e88c278506d321f5d2ddd85c", + "23": "cf47f97757c2bc6cf003c52d539b0d910de18d3e8fe62abe820056736c745c00", + "24": "fed016a7654a49fbf994e1f4a0ccec49e6c2bb1d3b15c2dcbd415ac5945aac05", + "25": "8e7aa4b626d01738738f7c7b51d3abb90c1011260d4f9ace8d4ab46a720097ef", + "26": "545be80aaf693682ddce9304a97d8536f6743eb9c88ebd7e2090485aa69cfa68", + "27": "4001210004065ff38eba9353ebd40d9c2dcb1bb89dcc86489a97b547d051d3d0", + "28": "612dc0e4b94794d14f15d01e960c8c5175032d858ddb2c365d7ede225614b623", + "29": "883dfade0ae93f6dea6c053bd63ce1c7df7b6c95bb408342ffe14bd4b70460cb", "3": "04366ee133dbfc67fba244a8d80ef386386c288436c373fd2ba3fb34581287e7", + "30": "a11545b7cbed6875dcdd9eda6a7a5e286b24cdb77788e5dc2ec46189bb2f2a56", + "31": "848dce2fc8f727d37a262484fd31cf831eded44c2d1fe51f6acd11e454eb0146", + "32": "1d5524960dd53fc3c85b6589b19fdd4f365ba2da42563a4276629fd295a79db7", + "33": "be4dc1ddd5199c6b3c2fcadf309b0766f98471217658ef198a10a55ce31d3b6a", + "34": "380245de14920be23117b5dceaf1dba7f488946f9b04b09e12247f00e89f8bcf", + "35": "c7b64d3b4996d11219ba3a387ca110122694fb6ad6323d9a17351fbf81d5ebe4", + "36": "4db9c23a0e3b61b585a16a3a7a91a057ec8d6ef24bdc59c030062e5d80d60763", + "37": "e9f35a2a4a76dc34e5d1155681b4ce962b860a68617293177f26bce94b9b6993", + "38": "a4346f7e004e2e9f15039d6b2ceeb0cb57b0912c21a8debb7f4ffa1b959aed7c", "4": "f7627f88969eff7df1add5b6a54937fff1c2eb1f869cf4db71f51ab1657c72f8", "5": "3b8b9c52b4b74d31c9be73c6d0ba0c5e7549a0015ff4e3fffb86fa16968912e4", "6": "a42abe98ff959a8fec3fa4e6d733b7a7382fb99212f6c25846d80aa3fd6e734f", @@ -3785,8 +3880,27 @@ "74": "70a3199bf1a975e725d3fad3d15cb5e8845ac78d7d100894fe89876ea4efbad8", "75": "3c712353d43586a58692f93c9e78c052a39649d37cf2ba5112381ce2e5b87aea", "76": "3182e2624ad47469c4b206a6e66648217cdba883df598df700ccc194b236c2d3", + "77": "7b7a2af4d2914022770c8df97aec2d310e20a98f29299d0206fed5c7e093ce8e", + "78": "62e6674038b54d602a7e1e05e2fc00de67ffa2da4d89ccfc06e80b1fc3fc7a80", + "79": "b1826c1a6055d4f9c051ab76599701051cfb38b5f053e5c5837e0776deaa347a", "8": "7d827babcb8192445726b06e4250deb674158b5a77d87ecdd9e873118dc0ec93", - "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0" + "80": "633691a6f9697dcbb8bf3f791f5e35d0ce4dcfa2f820c5efc0a0911d22e9b685", + "81": "a4b1d8ffdf4a45e9df679b63cbf958eaa93d554eee8392c2d3fb9330a4cbb127", + "82": "5f3c94bc57302913b9969ce9ae9aea5a6b78ad79e45bf99826d5ef6d842d1395", + "83": "2f8a952fcf2bba0daecddd5361017ab54c92ee9ece942cec4b5dc80100611027", + "84": "7fa2df25a8460695da922fff0dddab1d817b15e13a35912ed83aa867da128425", + "85": "43594f76265e1e89ae18e198e92eb0d11afb1fb9422ebc1dd6892fbced25809e", + "86": "e88b68294463070b84a4930c6de5d2c20bb1227f2201600e10afca3bd5248169", + "87": "0078cec6682ba64bc1105f8b6c5250f7fca5540580437c32677b7a49085d7143", + "88": "76c827c667b52235b3967ff119c873ca547ac355d67e1385812e96147bed1ec5", + "89": "ca169efaefc94eca8c36eec18f79124785f908226c7b0a7a8f8ba0334d10ebb7", + "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0", + "90": "c215c852adab863ddd17d3f9a78d02e825688848c04614e1ef34e66407668d13", + "91": "bacda89a3aeae9be962e924c12fbb5d300c9aa85f2b3e3edf600e743da86cf36", + "92": "239460448be6f16c5cc0303c089e281e7b9a521ea1fe0f50074521423ed8fe8c", + "93": "d098676fa7c8fc55d276e1b826d2ed567bdf8a66508c2c11bac048e19ec61db2", + "94": "1316c4a698a7a5746c2768bb3a84bcbacf1669185d71f06f76d1c78ffeaf4989", + "95": "b358b885e2719c21b1d1d42f2ccacf55132c101ae664d6508ee2de00f30832b6" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "6f9c1088480f429bc5f275eac443b8bdeeb1bedc8113b3984c4abc00054969a1", @@ -4948,7 +5062,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", + "20": "738b857fa5b55cbfa82e6676b98c84260f3949540200cbd14c3ad07054019ac9", + "21": "a8d9e178af69d4075646d3d266ffbc0e19b9842c9e747c22d7a75fcaa0b063cf", + "22": "f13766b1e9ded060dab40e8bc089b8c41a8c0e246f94bff4c7f2f1497e80c511", + "23": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", + "24": "4c6955dcef8f7873a78c971e10f626ccdee092dd6276694978498f19cf6cfd01", + "25": "29ba1f0df5f4df07ecb72ce3a6a2955d03a0a26b06e315594dcfc6cf8b5955a2", + "26": "e7c074393fbefcf708245a82379bf05f653438799b219f72bb460f81b5bdb632", + "27": "70feee573cb4660824da23579ca445cde04accf9222ff29bae59e650b32665e9", + "28": "7f19d6830182ecd395c4b8fc480fbec61139b568f2e97202f4a513f3d81c3203", + "29": "efa7cb3c33b74eb9c2f34a3d7a070129e33ffd9d2bb0213d0cc661772c22934a", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", + "30": "6a0b393ed1cd99e78944054162878218a1ac30f70e8705a59ad07c9a53d80c85", + "31": "3c6ab43322d6bfa68400e8d7afa6bdc08303b5db491b50e5486043f69b1dd93d", + "32": "2f76aa086ece94e6c011aab498730b503188f90b2c64162b1d66d6f0dc584615", + "33": "78c45eb6a8213eaf395bf4557112fbe59a4cf6849364ef629f43769a03da16f6", + "34": "17b54f397c8a189e0bc8b9a3fdf37a41adab6f2cbeb29d6c01a017a96e24dab5", + "35": "18bebfa6c18ce2a1a42f9cbad07341351b54611c970cf7f1d571776797005fa4", + "36": "9af605d56bea5ba2efc585da99474b1062634cda64ca9d3b636a456092c8e93f", + "37": "f8d3f46d7e8774c699d6941d338158320c1df84e1ed0dcbf274576b31b19ec74", + "38": "7fbfbef2c94aad31a4d8d153975589d9e4e8fae05cefa52b2a9d6f29d568a17f", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -5119,8 +5252,27 @@ "74": "bb8b0a1e8e06e91044209b4407f8ddfc8dcb3c51d91d28f7673fc209c8d84bb0", "75": "95c373866387c3529e8d60536d70d0d6372d782f1c1e64b067fa86daf3ca0fdd", "76": "fd54658289a24225c4a5b7a7ea339f4337b9b297f599b482da8ce45367c466be", + "77": "d4f1697482e1491e731851689d6f31d92b2f5aed90b36e15e3eb6bc52d638134", + "78": "eb70ba4c300d33d544ba5986444a34030fbe7eb5c632da768b6dfa2b8db54d9e", + "79": "586a0d1ca0744c4e35ca05d8b28e9ed7b519389227085240a1332b1bc265e560", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07" + "80": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", + "81": "59f02cf30bd80cc88a7ddd45044bf322fd87f591a9fa559fc0b50e955de94f70", + "82": "6b1a31bb5875e1769bf088c5eca7ae099901653fdb09d3f1397095290cba2997", + "83": "c85b788d82efcb0cc90fb5dd0951577f07509d4f8576897ea09648f774f2d66d", + "84": "d4801212922fdbc3f92901f29896f5bdcea6a7019deffef0ea74f47727450b84", + "85": "6750f5d231aa29a824e1e4b63936c21eb45fd6e9595b3afc2114aaa02da039ea", + "86": "3cd48b8828e716b83be8edd0854bda3a9399ff6a60d33eafbdd59caef28de0c4", + "87": "bf6050f6fb92813daf9f519f02e0db67adac7fc5962837af322097c9621c8e8b", + "88": "01544ebdc62e031b9d2ed51caf0da5edbb3b1c93db7868bcbecee6acc4735fae", + "89": "30d64ab338efc3192c5f6b5a5dcc62c79d479bb295c467a7100eec70207d6895", + "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", + "90": "f17fb589a0523cf1fd000d9b5d9a77156c5217d0bf680a267f23f0007eff083b", + "91": "4e752e8b595690bdd29d8ce8f74dc2fe7df97f3f2a024520824947cb6cc05af6", + "92": "5697e781e6846b657b3f238ab08edde9312359897c62a164c674be436cc4a673", + "93": "d7f054eaac8fae438a3288e5dee683df62f1ab42a452ad3a11b7c69677783c30", + "94": "8293a32874210d967d598bda66401472d57bcb8187dd1b61bda301fb3dbbd991", + "95": "1996579136d6ec9668e45df3519c4ce567841e1f929402552c3d2cb5ada43b7f" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", @@ -6486,7 +6638,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", + "20": "738b857fa5b55cbfa82e6676b98c84260f3949540200cbd14c3ad07054019ac9", + "21": "a8d9e178af69d4075646d3d266ffbc0e19b9842c9e747c22d7a75fcaa0b063cf", + "22": "f13766b1e9ded060dab40e8bc089b8c41a8c0e246f94bff4c7f2f1497e80c511", + "23": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", + "24": "4c6955dcef8f7873a78c971e10f626ccdee092dd6276694978498f19cf6cfd01", + "25": "29ba1f0df5f4df07ecb72ce3a6a2955d03a0a26b06e315594dcfc6cf8b5955a2", + "26": "e7c074393fbefcf708245a82379bf05f653438799b219f72bb460f81b5bdb632", + "27": "70feee573cb4660824da23579ca445cde04accf9222ff29bae59e650b32665e9", + "28": "7f19d6830182ecd395c4b8fc480fbec61139b568f2e97202f4a513f3d81c3203", + "29": "efa7cb3c33b74eb9c2f34a3d7a070129e33ffd9d2bb0213d0cc661772c22934a", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", + "30": "6a0b393ed1cd99e78944054162878218a1ac30f70e8705a59ad07c9a53d80c85", + "31": "3c6ab43322d6bfa68400e8d7afa6bdc08303b5db491b50e5486043f69b1dd93d", + "32": "2f76aa086ece94e6c011aab498730b503188f90b2c64162b1d66d6f0dc584615", + "33": "78c45eb6a8213eaf395bf4557112fbe59a4cf6849364ef629f43769a03da16f6", + "34": "17b54f397c8a189e0bc8b9a3fdf37a41adab6f2cbeb29d6c01a017a96e24dab5", + "35": "18bebfa6c18ce2a1a42f9cbad07341351b54611c970cf7f1d571776797005fa4", + "36": "9af605d56bea5ba2efc585da99474b1062634cda64ca9d3b636a456092c8e93f", + "37": "f8d3f46d7e8774c699d6941d338158320c1df84e1ed0dcbf274576b31b19ec74", + "38": "7fbfbef2c94aad31a4d8d153975589d9e4e8fae05cefa52b2a9d6f29d568a17f", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -6657,8 +6828,27 @@ "74": "bb8b0a1e8e06e91044209b4407f8ddfc8dcb3c51d91d28f7673fc209c8d84bb0", "75": "95c373866387c3529e8d60536d70d0d6372d782f1c1e64b067fa86daf3ca0fdd", "76": "fd54658289a24225c4a5b7a7ea339f4337b9b297f599b482da8ce45367c466be", + "77": "d4f1697482e1491e731851689d6f31d92b2f5aed90b36e15e3eb6bc52d638134", + "78": "eb70ba4c300d33d544ba5986444a34030fbe7eb5c632da768b6dfa2b8db54d9e", + "79": "586a0d1ca0744c4e35ca05d8b28e9ed7b519389227085240a1332b1bc265e560", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07" + "80": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", + "81": "59f02cf30bd80cc88a7ddd45044bf322fd87f591a9fa559fc0b50e955de94f70", + "82": "6b1a31bb5875e1769bf088c5eca7ae099901653fdb09d3f1397095290cba2997", + "83": "c85b788d82efcb0cc90fb5dd0951577f07509d4f8576897ea09648f774f2d66d", + "84": "d4801212922fdbc3f92901f29896f5bdcea6a7019deffef0ea74f47727450b84", + "85": "6750f5d231aa29a824e1e4b63936c21eb45fd6e9595b3afc2114aaa02da039ea", + "86": "3cd48b8828e716b83be8edd0854bda3a9399ff6a60d33eafbdd59caef28de0c4", + "87": "bf6050f6fb92813daf9f519f02e0db67adac7fc5962837af322097c9621c8e8b", + "88": "01544ebdc62e031b9d2ed51caf0da5edbb3b1c93db7868bcbecee6acc4735fae", + "89": "30d64ab338efc3192c5f6b5a5dcc62c79d479bb295c467a7100eec70207d6895", + "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", + "90": "f17fb589a0523cf1fd000d9b5d9a77156c5217d0bf680a267f23f0007eff083b", + "91": "4e752e8b595690bdd29d8ce8f74dc2fe7df97f3f2a024520824947cb6cc05af6", + "92": "5697e781e6846b657b3f238ab08edde9312359897c62a164c674be436cc4a673", + "93": "d7f054eaac8fae438a3288e5dee683df62f1ab42a452ad3a11b7c69677783c30", + "94": "8293a32874210d967d598bda66401472d57bcb8187dd1b61bda301fb3dbbd991", + "95": "1996579136d6ec9668e45df3519c4ce567841e1f929402552c3d2cb5ada43b7f" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", From 7a034b705fd99c5718360d05cba7db0d3d4fae38 Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 18 Nov 2026 08:59:31 -0600 Subject: [PATCH 18/22] fix(hip-kernel-provider): type-check runtime_layout, pin the tile and window contracts - Both attention_tiled_2d specs refuse a runtime_layout that is not a bool. - tile_size 0 and -16 join the runtime_layout reject tests on both architectures. - The window kernarg contract (0 or below keeps no key; the caller passes a wide window for none) and the masked-lane voffset bound are documented in the specs; the saved-plan reader refuses a negative window. - The gfx942 reject check notes that the spec has no additive-bias, top-left or right-bound field. --- .../kernels/gfx942/attention_tiled_2d.py | 22 +++++++++++++++---- .../kernels/gfx950/attention_tiled_2d.py | 4 +++- ...ttention_tiled_2d_runtime_layout_gfx950.py | 19 ++++++++++++++++ .../test_gfx942_attention_runtime_layout.py | 11 ++++++++++ .../TestAttentionPagedUnifiedLaunchValues.cpp | 2 ++ 5 files changed, 53 insertions(+), 5 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py index 3a52a20b88d3..816c60f9b363 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py @@ -528,7 +528,12 @@ class UnifiedAttention2DTiledSpec: # rows (the first seq_lens_q rows of its block), and the q-block grid # is walked with a grid-stride loop. The window mask is always on, with the # ``sliding_window`` kernarg as its size, so the spec's ``sliding_window`` - # must be 0. Only the default narrow 16x16x16 path is supported; see + # must be 0. The kernarg is a plain size: ``d - k < window`` keeps key k, so + # a window of 0 or below keeps none and every row stores zeros. "No window" + # is a window wider than any sequence (the engine passes 0x3FFFFFFF), never 0 + # or -1; the caller owns that (AttentionPagedUnifiedNative.cpp builds it, and + # a saved plan holding 0 or a negative window is refused at load). Only the + # default narrow 16x16x16 path is supported; see # ``_runtime_layout_reject_reason``. ``tile_size`` may divide ``block_size`` # here (sub-block tiles), which the fixed-layout path does not allow. # Default False -> every existing kernel is byte-identical. @@ -1177,8 +1182,12 @@ def kernel_name(self) -> str: "emit_lse", ) -# Buffer voffset used for masked K/V lanes: beyond any ``kv_block_span_bytes`` -# (an i32 kernarg), so the buffer range check returns 0 without a memory access. +# Buffer voffset used for masked K/V lanes. A page's buffer resource holds +# ``kv_block_span_bytes`` bytes, so a voffset at or past that returns 0 without a +# memory access. The caller keeps ``kv_block_span_bytes`` below +# ``0x7FFF0000`` (MAX_BLOCK_SPAN_BYTES in AttentionPagedUnifiedNative.cpp, which +# declines a graph with a larger block and refuses a saved plan holding one), so +# this voffset is always past the span, with the widest (16-byte) load to spare. _RTL_KV_OOB_VOFF = 0x7FFFFFF0 # The kernargs appended in runtime_layout mode are RUNTIME_LAYOUT_EXTRA_ARGS @@ -1186,7 +1195,12 @@ def kernel_name(self) -> str: def _runtime_layout_reject_reason(spec: "UnifiedAttention2DTiledSpec") -> Optional[str]: - """Why ``spec`` is not a valid runtime_layout spec (None when valid/unused).""" + """Why ``spec`` is not a valid runtime_layout spec (None when valid/unused). + + This spec has no ``use_additive_bias``, ``causal_top_left`` or ``right_bound`` + field (the gfx942 kernel is always bottom-right causal with no right bound), + so, unlike the gfx950 spec, there is nothing of those to refuse. + """ if not spec.runtime_layout: return None bad = [name for name in _RTL_INCOMPATIBLE_FLAGS if getattr(spec, name)] diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index bff71bfea91f..66e88359959f 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -549,7 +549,9 @@ class UnifiedAttention2DTiledSpec: # layout adds the Q/O/KV strides, a dense or ragged Q and a real paged KV # cache as appended kernel arguments (see ``_RTL_PARAMS``), so one compiled # object serves them all. ``sliding_window`` must be 0 (the window mask is - # always compiled, with the kernarg as its size) and every CTA walks the + # always compiled, with the kernarg as its size: ``d - k < window`` keeps key + # k, so a kernarg of 0 or below keeps none, and "no window" is a window wider + # than any sequence, which the caller passes) and every CTA walks the # q-block grid with a grid-stride loop. K pages through # ``block_tables_ptr`` and V through ``block_tables_v_ptr`` (the same # pointer, or a second table with the same row stride). The KV block term is diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py index 25f24979d218..cc0edb2b71e7 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py @@ -705,6 +705,8 @@ def test_runtime_layout_catalog_supported_and_named(): (dict(use_v_double_buffer=True), "use_v_double_buffer"), (dict(use_qblock_reverse=True), "use_qblock_reverse"), (dict(tile_size=64), "tile_size"), + (dict(tile_size=0), "tile_size"), + (dict(tile_size=-16), "tile_size"), # Refused before the async-DMA divisibility check divides by it. (dict(num_warps=0), r"runtime_layout requires num_warps in \{1, 2, 4, 8\}"), ], @@ -722,6 +724,21 @@ def test_runtime_layout_incompatible_spec_rejected(overrides, needle): dataclasses.replace(spec, **overrides) +@pytest.mark.parametrize("value", ["false", "", 1, 0, None]) +def test_runtime_layout_must_be_a_bool(value): + """A truthy non-bool would build the runtime_layout ABI for a caller that thinks it + asked for the fixed layout, so the flag is checked, never coerced.""" + import dataclasses + + from kernels.gfx950.attention_tiled_2d import runtime_layout_catalog_spec + + spec = runtime_layout_catalog_spec( + dtype="bf16", head_size=128, block_size=32, num_queries_per_kv=4 + ) + with pytest.raises(ValueError, match="runtime_layout must be a bool"): + dataclasses.replace(spec, runtime_layout=value) + + @pytest.mark.parametrize( "overrides,needle", [ @@ -731,6 +748,8 @@ def test_runtime_layout_incompatible_spec_rejected(overrides, needle): (dict(use_v_double_buffer=True), "use_v_double_buffer"), (dict(use_qblock_reverse=True), "use_qblock_reverse"), (dict(tile_size=64), "tile_size"), + (dict(tile_size=0), "tile_size"), + (dict(tile_size=-16), "tile_size"), (dict(num_warps=0), r"runtime_layout requires num_warps in \{1, 2, 4, 8\}"), ], ) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py index 68eae4b90599..c0b4ae058bb3 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -92,6 +92,9 @@ def _rtl_spec(**overrides): (dict(block_m_per_warp=32), "block_m_per_warp"), (dict(tile_size=24), "tile_size"), (dict(tile_size=64), "tile_size"), + # Zero and negative tiles never reach the divisibility arithmetic. + (dict(tile_size=0), "tile_size"), + (dict(tile_size=-16), "tile_size"), (dict(num_query_heads=5, num_kv_heads=2), "divisible"), (dict(emit_lse=True), "emit_lse"), ] @@ -103,6 +106,14 @@ def test_incompatible_spec_rejected(overrides, needle): UnifiedAttention2DTiledSpec(**_rtl_spec(**overrides)) +@pytest.mark.parametrize("value", ["false", "", 1, 0, None]) +def test_runtime_layout_must_be_a_bool(value): + """A truthy non-bool would build the runtime_layout ABI for a caller that thinks it + asked for the fixed layout, so the flag is checked, never coerced.""" + with pytest.raises(ValueError, match="runtime_layout must be a bool"): + UnifiedAttention2DTiledSpec(**_rtl_spec(runtime_layout=value)) + + @pytest.mark.parametrize("overrides,needle", _REJECTED) def test_native_builder_rejects_incompatible_spec(overrides, needle): """The C twin of the reject check refuses the same specs, with the same cause.""" diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp index 4a288cd30593..7cc6c3c76e45 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp @@ -324,7 +324,9 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnIntegerOutsideWhatTheKernel {&dense, "num_seqs", int64_t{2147483648}}, {&dense, "num_query_heads", 0}, {&dense, "num_kv_heads", 0}, + // The kernel keeps key k iff d - k < window, so 0 or below keeps none. {&dense, "sliding_window", 0}, + {&dense, "sliding_window", -1}, {&dense, "sliding_window", int64_t{0x40000000}}, {&dense, "q_uniform_len", 0}, // a dense Q has at least one row per sequence {&dense, "q_uniform_len", -3}, From 9eb151588c3a170bfd9513b53fe8bd1e7cb54d7a Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 18 Nov 2026 09:05:44 -0600 Subject: [PATCH 19/22] ci(hip-kernel-provider): shard the runtime_layout host pytest entry develop (#15539, #16009) refuses a rocKE pytest entry that does not start with _ROCKE_INSTALLED_PYTEST. --- .../hip-kernel-provider/rocke/library/tests/ctest_lists.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/ctest_lists.cmake b/dnn-providers/hip-kernel-provider/rocke/library/tests/ctest_lists.cmake index 9e96c1a1851c..88a3ff0cd2f9 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/ctest_lists.cmake +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/ctest_lists.cmake @@ -339,7 +339,7 @@ foreach(_t ${_ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TEST_RELPATHS}) " \"${ROCKE_TEST_CTEST_REL}${_t}\"") endforeach() string(APPEND _ROCKE_INSTALLED_CTEST_ENTRIES - "add_test(rocke_library_attention_runtime_layout_pytest python -m pytest${_ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TESTS} -m \"not gpu\" -v -rs --timeout=60)\n") + "add_test(rocke_library_attention_runtime_layout_pytest ${_ROCKE_INSTALLED_PYTEST}${_ROCKE_LIBRARY_ATTENTION_RUNTIME_LAYOUT_TESTS} -m \"not gpu\" -v -rs --timeout=60)\n") string(APPEND _ROCKE_INSTALLED_CTEST_ENTRIES "set_tests_properties(rocke_library_attention_runtime_layout_pytest PROPERTIES\n" " LABELS \"ckc\\;python\\;attention\\;host\\;quick\"\n" From 9bff129495fa3cd35798fbf7761e13c80775875b Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 18 Nov 2026 11:22:20 -0600 Subject: [PATCH 20/22] test(hip-kernel-provider): pin AttentionPagedUnified's graph schema 1.4.0 The provider's schema pin (PinsEveryEnginesDeclaredGraphSchema) fails an engine that claims a schema above the provider baseline without being on its opt-in list. The engine's graph matcher serves ragged Q / O with their offset multipliers and gates every declared alignment, which is what 1.4.0 admits. --- .../hip-kernel-provider/src/tests/core/TestContainer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dnn-providers/hip-kernel-provider/src/tests/core/TestContainer.cpp b/dnn-providers/hip-kernel-provider/src/tests/core/TestContainer.cpp index 81b6352c228d..a0a883497ecd 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/core/TestContainer.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/core/TestContainer.cpp @@ -444,7 +444,9 @@ TEST(TestContainer, GetEngineNameRejectsANullNameArgument) // backward engines claim 1.4.0 (their UEDs' sdk_version; their matchers reviewed against every field // up to it, and a backward graph never carries cu_seq_len). So does the RDNA WMMA prefill engine, // whose matcher gates paged K/V, ragged Q / O and their offset multipliers, and every declared -// alignment. The gfx950 rocKE conv dgrad engine +// alignment. The rocKE paged/ragged attention engine (AttentionPagedUnified) claims 1.4.0 +// as well: its graph matcher serves ragged Q / O with their offset multipliers and gates +// every declared alignment against what its kernels load. The gfx950 rocKE conv dgrad engine // claims 1.3.0: its graph matcher gates alignment (multiples of 16 bytes) and declines ragged // tensors. Every other engine stays at or below the 1.2.0 baseline, so ragged, aligned and // multiplier graphs never reach it. Opting an engine in is an edit here, reviewed with that @@ -454,6 +456,7 @@ TEST(TestContainer, PinsEveryEnginesDeclaredGraphSchema) const std::map optedIn{ {"hipkernel:Gfx950ConvDgradAot", "1.3.0"}, {"hipkernel:Gfx1151WmmaAttention", "1.4.0"}, + {"hipkernel:AttentionPagedUnified", "1.4.0"}, {std::string(hipdnn_data_sdk::utilities::ASM_SDPA_ENGINE_NAME), "1.4.0"}, {std::string(hipdnn_data_sdk::utilities::HIP_MLOPS_ENGINE_NAME), "1.4.0"}, {std::string(hipdnn_data_sdk::utilities::HIP_FLASH2_ENGINE_NAME), "1.4.0"}, From e0da3b15d0c33f9df2a856b71687f2c7e1849f4e Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 18 Nov 2026 11:22:27 -0600 Subject: [PATCH 21/22] test(hip-kernel-provider): pass cuSeqLen to the schema gate's version floor computeMinimumEnginePluginApiVersion gained a sixth argument on develop. --- .../packs/TestGfx950AttentionDenseSchemaGate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp index 5d4a1da3d62e..c623f79b7cb4 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestGfx950AttentionDenseSchemaGate.cpp @@ -160,7 +160,7 @@ d::GraphT eightByteAlignedGraph() Version stamp(d::GraphT& g, bool ragged, bool nonDefaultAlignment) { const auto& floor = hipdnn_plugin_sdk::computeMinimumEnginePluginApiVersion( - false, false, ragged, nonDefaultAlignment, false); + false, false, ragged, nonDefaultAlignment, false, false); g.min_required_engine_api_version = std::make_unique(hipdnn_plugin_sdk::toEngineApiVersion(floor)); return floor; From a33a472fe66e5ef8a0447bb889707308399ad9bc Mon Sep 17 00:00:00 2001 From: David Peabody Date: Wed, 18 Nov 2026 11:22:36 -0600 Subject: [PATCH 22/22] fix(hip-kernel-provider): cap a page-table length by the table's width, not its row stride The runtime_layout kernels capped seq_len_kv at block_table_stride * block_size. A batch of one has a unit batch extent, so the engine passes stride 0 (effectiveStrides) and the cap zeroed every single-sequence graph: RaggedQueryWithAShiftedFirstOrigin failed on gfx942 and gfx950. The tables' row width M is now its own appended kernel argument, block_table_width (18 in all), passed by the engine from the page table's width and saved in the dispatch launch values; the cap is block_table_width * block_size, in all four builders. Tests: a single-sequence case in both rocKE device suites (the runner passes stride 0 for a batch of one, as the engine does) and in the integration suite; launch-value refusals for a zero, negative and oversized width. The IR goldens and the v1 launch golden are regenerated. The README and the rocKE docs no longer cite PR numbers, and the rocKE instance doc says what the gfx950 LDS gate does not cover. --- .../common/_attention_runtime_layout.py | 7 +- .../kernels/gfx942/attention_tiled_2d.py | 11 +- .../kernels/gfx950/attention_tiled_2d.py | 6 +- .../tests/parity/golden/llvm_gfx_all.json | 380 +++++++++--------- ...ttention_tiled_2d_runtime_layout_gfx950.py | 10 +- .../test_gfx942_attention_runtime_layout.py | 20 +- ...ocke.instances.gfx942.attention_tiled_2d.h | 2 +- ...instance_attention_tiled_2d_rtl_internal.h | 2 + ...tance_gfx942_attention_tiled_2d_internal.h | 2 +- ...tance_gfx950_attention_tiled_2d_internal.h | 2 +- .../attention_tiled_2d_ctx_prologue.cpp | 9 +- .../attention_tiled_2d_public_entry_glue.cpp | 9 +- .../platform/dsl_docs/instances/attention.md | 13 +- .../attention.json | 96 ++--- .../rocKE/attention_paged_unified/README.md | 17 +- .../AttentionPagedUnifiedLaunchValues.hpp | 6 +- .../packs/AttentionPagedUnifiedNative.cpp | 12 +- .../IntegrationGpuAttentionPagedUnified.cpp | 20 +- .../TestAttentionPagedUnifiedLaunchValues.cpp | 14 +- .../TestAttentionPagedUnifiedMatchers.cpp | 2 +- .../TestIngestorPlanLaunchContractGoldens.cpp | 161 ++++---- 21 files changed, 449 insertions(+), 352 deletions(-) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py index 31fa2920e73e..7a4c92ad1bee 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/common/_attention_runtime_layout.py @@ -25,7 +25,11 @@ # buffer-resource size. ``sink_is_f32`` nonzero: ``sink_ptr`` holds Hq fp32 # logits, else Hq logits in the Q dtype (ignored without sinks). ``num_kv_blocks`` is # the K/V container's block count: a page id at or past it (or negative) reads as a -# masked page instead of addressing memory outside the cache. +# masked page instead of addressing memory outside the cache. ``block_table_width`` is +# the page tables' row width M in entries: a sequence length past ``M * block_size`` +# would walk the table read off its row, so it is capped there. It is not +# ``block_table_stride`` (the step between rows), which is 0 or arbitrary for a batch +# of one and may exceed the width. RUNTIME_LAYOUT_EXTRA_ARGS = ( ("block_tables_v_ptr", "ptr"), ("seq_lens_q_ptr", "ptr"), @@ -44,6 +48,7 @@ ("q_block_grid", "i32"), ("sink_is_f32", "i32"), ("num_kv_blocks", "i32"), + ("block_table_width", "i32"), ) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py index 816c60f9b363..d7d1047a8f92 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx942/attention_tiled_2d.py @@ -514,9 +514,10 @@ class UnifiedAttention2DTiledSpec: # Runtime-layout mode (hipDNN paged/ragged SDPA engine, vLLM KV-cache view). # The head counts, the window and the batch's search trip count are already # kernargs (``RUNTIME_KERNARG_FIELDS``, ``RUNTIME_SEARCH_ITERS``). When True - # the kernel also takes 17 appended kernargs (block_tables_v_ptr, + # the kernel also takes 18 appended kernargs (block_tables_v_ptr, # seq_lens_q_ptr, has_seq_lens_q, q_uniform_len, the Q/O/KV element strides, - # kv_block_span_bytes, q_block_grid, sink_is_f32, num_kv_blocks) and serves a + # kv_block_span_bytes, q_block_grid, sink_is_f32, num_kv_blocks, + # block_table_width) and serves a # dense-or-ragged Q and a real paged-KV layout from one compiled object: # Q/O/KV strides are runtime, K pages through ``block_tables_ptr`` and V # through ``block_tables_v_ptr`` @@ -2019,8 +2020,10 @@ def build_unified_attention_2d_tiled( q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) seq_len = b.global_load_i32(seq_lens, seq_idx) # A length past the table row would walk the page-table read off its end: - # bound it by the row's extent (block_table_stride * block_size). - rtl_bt_cap = b.mul(bt_stride_p, b.const_i32(BS)) + # bound it by the row's width (block_table_width * block_size). The width + # is its own argument: block_table_stride is the row-to-row step, which a + # batch of one has no use for. + rtl_bt_cap = b.mul(rtl_p["block_table_width"], b.const_i32(BS)) seq_len = b.select(b.cmp_ult(seq_len, rtl_bt_cap), seq_len, rtl_bt_cap) context_len = b.sub(seq_len, cur_batch_q_len) qb_start_pos = b.mul(q_block_local_idx, b.const_i32(BLOCK_Q)) diff --git a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py index 66e88359959f..9990e9aff4e9 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/kernels/gfx950/attention_tiled_2d.py @@ -1744,8 +1744,10 @@ def build_unified_attention_2d_tiled( q_block_local_idx = b.sub(q_block_global_idx, q_block_start_idx) seq_len = b.global_load_i32(seq_lens, seq_idx) # A length past the table row would walk the page-table read off its end: - # bound it by the row's extent (block_table_stride * block_size). - rtl_bt_cap = b.mul(bt_stride_p, b.const_i32(BS)) + # bound it by the row's width (block_table_width * block_size). The width + # is its own argument: block_table_stride is the row-to-row step, which a + # batch of one has no use for. + rtl_bt_cap = b.mul(rtl["block_table_width"], b.const_i32(BS)) seq_len = b.select(b.cmp_ult(seq_len, rtl_bt_cap), seq_len, rtl_bt_cap) context_len = b.sub(seq_len, cur_batch_q_len) # Per-sequence Q/O base terms in i64 (ragged offsets times the diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json index 3f8bebe0f789..e7065fb283c3 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/parity/golden/llvm_gfx_all.json @@ -1071,26 +1071,26 @@ "18": "bf7b02b7aa2d32470335fc8dbb966b40af321525e28b3f351bc7405a27265d69", "19": "d9b3c7bf671ce53b4eaed65a93a88fdc88eadc9a4013f22a4c654984440711e0", "2": "ee4683453afbbc49e5ae11714bccf200fada5e75884a59405cc6676af6e57b81", - "20": "41e3e964ea9b2970f6702de3cfa034e6eba9c089ffe2ef3eb4df4e072923d0e7", - "21": "e435a1206cdf6441e2619dd153a0b7e552231d6110f4ac25d1b102c057134ecd", - "22": "df09ec99c4d8ef4407ec0c9af50902f0fdccaaef048d953f1573680d3722deac", - "23": "43359e9f442d38eb8483fcc8988101f65cf51fb88e8f04e8e61f11dea7bc3b1b", - "24": "e65c2528efd8b868b3fbc1e471214e43d4ca9b00c74751cfecdef10c47dfb010", - "25": "59ecd964a20dde0a021b6fb3f3c9b9ebd9187c45d00e1d5c21caa27dfadbf2ab", - "26": "7d16d8ff27ccce2c3001c0f45d3aa2280692359a1346817e15ff08dc5d07dd0e", - "27": "f97789b6ed4e8333ebe1f767c3493a2ab7a56b45e2ab0038b88eb54d58b19e5a", - "28": "d1f5458ba71517f712812acde4f810212f946aa5ed067f19599d9351e53e3830", - "29": "c61ab4483455777eb0204ff535124df4fbf48148905952ea06b5d2e758bfab53", + "20": "d4b1497fd89d64769dd134adbf400c93b2abed67cc8a587974fc8b23f4f20096", + "21": "1609bbfbbcb7e20859c75bac8be5dd9a1c643c01e5d89f4b1d22a4985e1b466b", + "22": "af0770506442bc7d78c8f005d5482403bb3bdfdde2fb83f12923b9c2351d2e7e", + "23": "4f086eebccbe81e3f3375188bc09947b7a764a95570b4467a92b0a8e7e42f3a9", + "24": "553c5a2de77284b13a7d3b4319e57a97bb7062c9bc774ef46f32374606167fc8", + "25": "7897d5160a2910fe8412beec66fa668c53ec560e8155482ef19d1cec9c7981ba", + "26": "c12eaa755b4b5eafc5ef603c21069392dfabf34839ddc0acaeb27ebde3bed6e3", + "27": "5933a682d283412fd584efc17799738f50e35a345a22539fc834100970140296", + "28": "431dd33b1a3bd1a87c10f655b5b7bddd5c55d3454028624cc9b802ffa3f2347d", + "29": "6bc42b9083e241d4405c1810ee108bc173fff818e5bb8c28aa9ff2d04ced53e2", "3": "b364ec606939a153220377511d8bb21345bf28f998a41c1f8e3b0d96cac6c4a8", - "30": "4b77087f3d75fd7c20ad6df0693d11ebd57dd86cc1f175b7f1651efa25eec2c3", - "31": "b22ac84b6729b83a2c734862cbe07f5c307be2ddf162cdf868b5b2d29252ea0f", - "32": "fc7441ab0575a64ab79a2c93030013b14f78fc60c4011f421b8fb67feda2ffa3", - "33": "109e0df160064306e7dcb201e29f739e8818aeeb330a58c2b8305a6eb50663e4", - "34": "dc12682a6c2ae7b39da6a0fc75fd8f8ee294be8a6254d172155d50bf6b3aee9e", - "35": "157325e4da1c11c9b920da1f41d875439f1f722332dafae03bed81da2f5c2782", - "36": "3db9e3374d4e94467b43e1cb8dc7b15fb9d887c3fb9b5d294e4f9e4bacfe24d2", - "37": "447b68344ce4c4cf1c962161a8433f59105c59d8ee930b633ecd0ac586f6a7d1", - "38": "80a798aa2228ffad6da7c4d24a7783111a8f1ac5c73314a18b6889536594445a", + "30": "0e15d515a3e5835d0158cf948e6410cd79951b81ab02a33dd0824a1b52b69af4", + "31": "540d874ac13d7733f4af1b127868cbe8bc43fe6cfd134fd8ecbffb616f5d75cc", + "32": "220c7ac26c1c0c8a8b70382c51319d0588685a33d33996509d05d4bbdc5e5e02", + "33": "b652fa1440a923b73bd8fd8fc57b5752b1ef1bf17445a966f30312865120138e", + "34": "48a21a4a8d0026ffa58fd0764cddf8b4ee052a1913e4b79e4160266bffbf2871", + "35": "80cb9c3877aa7ef89c05ffe57267efafe112c6a2748794a9831be27337ede4cb", + "36": "dc24cc12cf63dc688e943cd047adbff4375cc85eeed2e08fe7b6d1ebf46c5d04", + "37": "bc8509a917703fa9a2bdcf30503bba871c14b45e8b90bc45428eff3715491524", + "38": "171908db8974fad6378eb3c88a83db33b56fd40106528b50473dc6b14ba54dd6", "4": "66849d43bf1485879bcf1c5f173d72862cca98a1985d0d2d0ef824fba8c5cbe6", "5": "e9427bcb1fe7b9bfe568b7451b9f6ccd770c9399ff05deae35775479e13a407b", "6": "4337bae9b89e2794112a158ead6c4f06c3c86d992046ba3902496ddc4f940b07", @@ -1261,27 +1261,27 @@ "74": "4ed2861ee15646599091a13275f1a61728089a306f294cf7d13930eb5830fd3f", "75": "bed5bf3bdd0114db986f138893800f5dc59f5ac92ee24e07c6bd98320c750da1", "76": "e083d4f587b86585d0e42f29046dc9262a85ce1fd6182d543f171636e55407d1", - "77": "195d5101f22484fe02d8f4016815fb9f25081a059e3fb835fc45c74846cce717", - "78": "f29dac8b54bb382430fea477266647d283d6f1399b2bc8c5d0b31ca129d56336", - "79": "cf6186e95321b8d81dbb06ca49e9f75066ec2a79ee39349d1ae4ebb334ec872d", + "77": "3d0bd8b87f3294e3a75539b975fa4b7679124e8b74a8b547e8dce984273c6019", + "78": "1821840057ad53e8a0dea176d99da6d0ccaceada36d34744f316f0a45154f368", + "79": "439cbefe8ec0ce49151c1412a53d0fdf2991a4bf7e23116941a12832d12c5c8d", "8": "f4f0267af6f85a06591533f53a3cc74339723fa2e33c5f68e5fcd1b1ac4a6520", - "80": "57186281131becdb166275a0bd7a89f4f01043009d34acdd29dcfcc2b489dc0d", - "81": "ec5fe76761283c2f8d5e302e873c67d1e9e19ce69f7b0bf222de590bd4fd57b1", - "82": "7ee2bbb5a2096bb7ba7ea48f628a9abc959d1d97643f1c7a728478bf58506b46", - "83": "3ce3d5643ae9211bdffa86db7e4df334ff3d98e755c70b0ae5fda31bf2540832", - "84": "3f8f6813d25c6ef0cb87e61d59344b882fcddd1827d5b26d54251a9c618132d2", - "85": "4e29c76c7aef6794f395d4ec78494401a411ebdf1213bef7347152c839e66f49", - "86": "4aae377220026669bd1f4cb6974b2aa6c9b0666b85da4e1b04019c4a398ec28d", - "87": "812f2f4152a2a33b3a06b5878cca018c2e3a7ab299c302ff675ef2b38fd40017", - "88": "5c04a09600b09e2a18206cf9b8fc1617c8a830989db1f73d0f77743bc86827e3", - "89": "1936eab85c1c6826dc3c49f06ea70ac63bc28ebfedb557f0da15a1babaa0f30b", + "80": "69ce31dc933740c24a6bbecec34079dc81c2f3070db58a3e9914a91ab93922ab", + "81": "20b02877f280ddd832039cdb424982816c0f3d655db4ebf79588afde1ec99cdf", + "82": "4c77a1519b39675ac3db218a0b50e08b9047cd11c9d62eebb532b9d2b927b12e", + "83": "6eac83af8d2bfbce49e22bfd7262420cb60554d1c7ad43c05121a1f0a2223b37", + "84": "682a3d422fd9f20b5960342ef334ec3e8018308382254c0aaa54d976524dae7a", + "85": "62085c2736e94165d4733f2371fa8261e5416c987197e102c6455e0b562d66d2", + "86": "c7b9c2e465957e4b787b11c4a37fb56c3bb293c5ada344f25a273fca0551de07", + "87": "8e142a89830409acc01a77dbd489b42e0e904a7703bda4fc9f7f27eea0e16da0", + "88": "4c0f095adb9e1c1fc8b38987e0c4168ca264fd08f628fdc713c244de0eb46b94", + "89": "a7412e4498c2d1c47cec0c70a2bb98528dcaed4d9b945ed7296c03794ff202c6", "9": "3c0bbb4435538d794f348fb385377e07b8274d96162257c6117e15e995afdf25", - "90": "9a65aba2c30f555baf0af2bf5888ef15f7b625937b8b474fc028a84175dee3eb", - "91": "7a8b2d7dee078f5b8663cc56f6656e5a9bd86c591e53472dc42be03520c84c4e", - "92": "087d5df71d22a057b0c5985faeb564f1a2f293bd08cdf7df1941161d670903d3", - "93": "3dcbc7d1ae267db020ad9894c59cbba897cc4f03828e2bcdb214220f55948c67", - "94": "e2556c52d863abbc9452eb9d1cd865a6f5cb1431ad584effafbe4b196f94e7ee", - "95": "10cb9f9103d28893c665134c0d371c9a5fc9e98961193ce4e0b3c3949dbe9854" + "90": "a342b3af825f8026c29383f7ac92b2b4fa9bfd5c4e57fe73025d3782826b413a", + "91": "68a32ce23aef680e46a08f6907f9cb78431d69ddfe317674bba2db7435ae9b3f", + "92": "ca959a0c4adc29985a421c6967b14ea44a1ee9085ff2d0a63aec9656264212a3", + "93": "7416f65411c2b11e875d85d0b3422138301a7c50568b4c16285be0ec0c57b9ee", + "94": "24ed900308dc939aead8cc084e7f05f5f1784a6dc34943533e14385da7642308", + "95": "9395eab4cd47c069bec4fc00f070b5d9f81b99c275dfd1e52da75f50dff4a41d" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "d21a86dc7cd4b574b7c58faad7dff5e113e6ad5fd5739abed3d049e27de730fa", @@ -2381,26 +2381,26 @@ "18": "7d21d4ce1dd271b1dfe7f82d0c6c128c3e249b1f00833a090b74b3facb94f80e", "19": "d5b8888550a1db52d497b490f09cc169d739d054d269284ff7be8f5e3d3c2031", "2": "5841c730e964542b171c289e6075eaf6332b3cae253707da9fd74d8bb3c9ba9a", - "20": "704db10788f73b91df421e3d1e1fc10ac697c8f65eaf6343e69dba26965d36c3", - "21": "c6bc168e74f363f8f2c23a6bbb713bfd25a8fcd78514a2032ed15c43b38bedcc", - "22": "cb7965d16473597103ebd129594bf2b2e3f429faced6ecd1b5e15be46956e220", - "23": "ffd330e03c0bf9154bb9902062cf5b568901a7ef9d0c179b73b4fc154546169d", - "24": "a6f58a251d3283a6e6509753f04878b79521e2b9d89028aa0507485ebd0c049f", - "25": "b24e0b666134deb2ae92856f13a13b34b2be86f72147b41ce67e9ddf1d031eb8", - "26": "147f3464c0329e91b9097709b60b311c4218d23cefe39baf4bf410b3c1a3ef3b", - "27": "989d1afcec385c55b40060bb661066f87aa0dbdd107bcef5c08794b200b1dd8b", - "28": "d630beb57b53eb158c7f9f5353088ee7c411b94f9424c882ee7a656e3dc6e8d5", - "29": "61f0ff5f964907d13efe94a8b8ca5451e9d3efec66bd66903ecf34cab1d66939", + "20": "7ecea7f1743994ce3e9245f22615974f89f28d010e7aa44bf34c0622ace8b1bb", + "21": "e9cd008e7be4d014c63ab3be6902cac8fb85feab131f0d0ae704b9baa6e3dfe3", + "22": "625b1e29624f55d85059eeea53d3f1b628aaf9847648dc20cc9b17a7332e7445", + "23": "ddba7a92486ff7641f2a6702170b3b7f7727f38ffbab7842e468e8ddeb00f23f", + "24": "c32780deef66415d82a880eee4d5cabc7c10ffc10dfe4fd98eb1c753b9e7a80f", + "25": "38d64fb6aa4e8c0d0645b04e4b73de3dd5ab60146e54dde82518e08cb4110566", + "26": "4168358296b0455249a8dac1ed1e269998ea428d07276c5a72435bb32e6df8f1", + "27": "0db54d6075e898e20b5048330007055aac78f2e886d64bef82d63a0b616c0bf5", + "28": "62d5862bad3bd1bae068167b06185809987c6e793b2fb1a6fafbdc8d8e97aff4", + "29": "bba78e2631fb4bea1442bb3bd3c4d52115208b91fd16439d82f7eb82affbe45b", "3": "bd9164bfbcff6da42e08428ca167eeb648967f4c40c019f79ef435be664b0d6a", - "30": "4cd7be6b98b0f5747d027785911b73215c1bddef985181479a12e18ada569569", - "31": "44b28380ffeb028a7f4a015cbb5d47fdd2dcfcf5587251224023d423ac68e182", - "32": "50da765925cf795cb660b1be5b9aac9b055a85238391059edf74ba8918da25ab", - "33": "031c4c29136a8098a7ceee16b23bee621055967e39dc0124e248a0c2d997dfbd", - "34": "46c42b31b70243156035efbb2b86d75be9c241158b7a25ec5233914b88e2d369", - "35": "dc5571167f0128ab98dd886a4e4d911b665990f0e6ec39859263c6ca9faf92e2", - "36": "0ebcde1b3cfa1f58d9ceda9ad1853a16a330af4f01a552e800d4dd2d2787b935", - "37": "84ab1d9930c114cb3c02f99939b521fbbd9b0da88497c8cc2cfd0d0481944b8f", - "38": "2e81ee4047e18140f4bb25c243c88c5cf8faf749c672f03903539458c4881c81", + "30": "1f29c04375229d4c169688ddfacba697b5365ab61ec2eb2f84ff30c28c4a457d", + "31": "90c0653f1a63d611d2e0017d52ba3cc2c514aea3ee74666bdf951a4b95da0ff6", + "32": "e9ea21292ab2b607e2f310fc9baab9d9758dc2335fafe574fb5fd0244146b924", + "33": "4c969d18d0a8f15a1f695139431d6ff683e6881ed1f400703912f4fc10718c8b", + "34": "48a04e385883585ca0091ae36c5b058bb70a25b92d26cb36b090cfec124d5cb7", + "35": "3ce5fdcec60a259fb34153e40979ee6a107b1467814ae4c42dc2ec304f3e77ef", + "36": "ac4cfbf66caf56627b5ac767d15d5b36402fcbd7d475bec143a6f36f1dab5ede", + "37": "beef9a230e154a9b5c53ce3dc0e9f3aa8ee5e974e0da989a6cd922117d7b134e", + "38": "69a35b3801b9107cebd83f2fa0c8b78022003350a193c85c0a30fe8667ceba8c", "4": "1b04fa2470af0aa59452389cb41125418154ab3939758ed4a38789ce290b33ab", "5": "f6e5cf8a0392c1bce3fd7d9ce4d0eccf9d39fe29f02ab9bcf5c342152eba4ffb", "6": "c5ef7876d05cc7b9ea1fd4a8fe807c660bb1102a5f198790aecfff165b017c28", @@ -2571,27 +2571,27 @@ "74": "d833ca18333f361c1c677dd9d1e59b506cfd1733a90a56c5c782a80a224867a5", "75": "c91136c4b793fba4b88cb3ce5ba0f88314ae0ab899493a6fae0460373d57b712", "76": "b6e22bf0098737c4fd607da275cec72c11266f82c9573d8d2d89bd446c32fdd8", - "77": "1a3b620d9a2bb5840afb59faac1b7dd7fc821a4d7c5aa5ff282a1cb560e1566b", - "78": "1f9a80e8681cd0a6f5cc37f23a067f038840136071ba0b71de5e0c80ab9569e8", - "79": "23ad78200e2b3aaf53c26ad5046b9f2b3cccc574763c27392ff7f9db2c2fd251", + "77": "58acd05c2c6a2621f79a87eec13f0fe304d6c911f888c096d5496db995b7d3f4", + "78": "549a09305249f70c8e8824905f35b0b7a5c3728d5c832d8a3944a39ae02b9eb8", + "79": "687303930848395a502c6036f285f4c071973a31544b8bf98a57821f10b4dc12", "8": "436a62f0670b97e464439f466724c5d911a96b10e4bb035429b37d5be8d85243", - "80": "6057d6bca37698f8c7395de1fdc2045236aa54a1f82d0d3a893a1b64b5ff85bb", - "81": "643b97a0d37d7e8d9a5d38d877203c1c1ab0375d5e1506647f50f939770a738d", - "82": "fea66f219ae9cc6c41a4a33e5ca1f503a7abee1385d8b41912484b02995345e4", - "83": "84de246ec691cf0b6e5f3e4554234d5b5b903f0e76707ed6c0225ed7d52c8b40", - "84": "ef4890338c25debe61a74a6d89bbef48f6ed1429bd411e34e880213c23fd78b4", - "85": "b4f184a5900954bd550deae2cb4b60d1e86b0288a20efbf4c00b6fb516402916", - "86": "04254bedc0589d70a64362fae0d36f294f57165f0606c464c81c6ba20ddce4c1", - "87": "e39e55a921db171cff4c174df58266e17a99a8d34f2988e36ef4502b555d5d48", - "88": "5721bd9a1d6c51e700c08a0b285690234cbb7864273a13716cb0cbef60fa19b6", - "89": "0d930412b81ad081beb7cbb38ff7e4ca008e70467e256ed73ed61d028eb5b38d", + "80": "6c6a2e94819e7165956dec4bf2e69ab33133b46f9c41624eef43cb7bc02f8f38", + "81": "0c04ef80a18a2e63bf5fb7a0c50eedc1b60fbc87c20377c6327e92f0bbb6e9ec", + "82": "e772f977a85f0e14a6e19c8d00a3c5ed1b355fc61a969d3c9b8bbccdd8a8784b", + "83": "980f972ea1935af331139a665f3d38e482a4d1ad7fa13e228a149d317c6b12e2", + "84": "76be08c992d232ebce1b15ab422247367ed502eabc587d6028a753751b10bdcf", + "85": "903edd0e7cb8eab6f4bcafd15da63cf5003e764722dc648a0e35152142e8417a", + "86": "d91e0c6b28325fc626bec0439ddd72ca716e4f542eea9cb3abe0bd2b2108007d", + "87": "260a04529e544f7e091167b9e3069e7799d5be8cfb45dcf1b8c184e9614ae96d", + "88": "dbc9edb05ae0e9e7dbc5ddceb25cc7ebfccb93d9b6902bdcc8960d59d608af09", + "89": "b28792bce54a9c25d8a338bfe656c83f53669f11e7e2370dd1e5877f3bbb9264", "9": "07eadd3cdcb25d33e4162b75d3543681a9f260e6a972c64ce4bfe3a28dee2bf9", - "90": "cd0705db3b7c69cf39dd5707b73482217e334ea704217040896b0564cf738b77", - "91": "0db1524200c5ef11d2aaa095895bc8caa9965dbdfb8be6f6a11885ffd970bc9f", - "92": "73ccde85f7d9b34e3979ffdba2fe04a88ce031a6b8443181c276e61df32e3f8b", - "93": "414fca3660471da8085502e8ce1ea61b9b3410233333031a26bc578ac2512689", - "94": "dc50b5df4a208071ad93b00a35dfb52947ab0d8bbbb748d49f09c8e8293b8386", - "95": "ba1b692f83d89f8522af1edb641a137360f7c1c4fafcc747f7e0a3fc952c6843" + "90": "70e79f9d1bee787dbd87c9255757291abd96d2d0b788090a19b8b6e2460a790d", + "91": "9e83bea39ac34a2d2ee63ec0d608fc46699cef90fc757acb5f287726848bfb6c", + "92": "dbeeb982d0239464c56349c4b52cb023c631da20fc44c675fbf848902b1246f0", + "93": "adc3839bcaaae547fc6b7f5cfb1fb5b97aafcdeb878bcffc055a081fd0bf3c20", + "94": "359eab4b78132c1e68a69b9497e3bdf7090e91444e77fdc0ecd28c018897628b", + "95": "5de6f30122331e8ff5ed19a897271c53f706eb2bec7064f029ee1899d7f5102c" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "52fef7be3f5b5752f4d62e09b0c9296df1abdaba39cc1d360d05e41e0b70edb3", @@ -3690,26 +3690,26 @@ "18": "eb020317c6d6bab712c0379731bdb9eab253ad67be3b1937c759c4ead5743c78", "19": "a8cc1af85ca357f2e5b109402706d4be4e6f9235839c3016290441ed7cdd6799", "2": "9b7b8d4ad0d7c67143c5887f561e08182cf9a095bed1a76ed53b406cbd45f768", - "20": "4ad5416d52c24c5e6380c83fc7d533c1ef797e6535d04aa30624c81a51b8603b", - "21": "245700c76983095caa20b852abc7bea7b2c79663e97caa399dfb71b1c18b9469", - "22": "a3713e079f5ea4593db05f0911e29258ce288e41e88c278506d321f5d2ddd85c", - "23": "cf47f97757c2bc6cf003c52d539b0d910de18d3e8fe62abe820056736c745c00", - "24": "fed016a7654a49fbf994e1f4a0ccec49e6c2bb1d3b15c2dcbd415ac5945aac05", - "25": "8e7aa4b626d01738738f7c7b51d3abb90c1011260d4f9ace8d4ab46a720097ef", - "26": "545be80aaf693682ddce9304a97d8536f6743eb9c88ebd7e2090485aa69cfa68", - "27": "4001210004065ff38eba9353ebd40d9c2dcb1bb89dcc86489a97b547d051d3d0", - "28": "612dc0e4b94794d14f15d01e960c8c5175032d858ddb2c365d7ede225614b623", - "29": "883dfade0ae93f6dea6c053bd63ce1c7df7b6c95bb408342ffe14bd4b70460cb", + "20": "5176a7ba5111f7e8883f1969f8c00010005f38e54f0df885e4bea24bdfa83902", + "21": "5fccf557bff0da50d20f3a242b156b2fa4a0851628c9908d4ffbc6466237d127", + "22": "ddf0baed580749d6466504f52390d3115965070d20ae8f5a98c1a3518e1f5f19", + "23": "0ebcbd3257a688137007a94ea3a284ef022ede96f42618dc7459f9b4a2069bab", + "24": "08c3a22db667e9c7f8d153ace36a098f2f398a02b1a1a930f56a6c7c68a34423", + "25": "830f689e6e87930060321f9f7dc4c37a91ef62c1b911f521f10cbd809c51bf31", + "26": "daad8544b6c4ca52b742eb92c406c079727ca7e9c9f9f366a69e86b96b22cbda", + "27": "7fa6fc51e5cd344e0b2ff677f409d717c090da95cd12bbc27e806a2deb158523", + "28": "4e79764f9448929f18d85e3239cea36164d5f0d0c33731c5308dc6d03e8a4c9b", + "29": "65f27a1733306f614fd54fa7fef5145071e18467f951e5451652a35993954445", "3": "04366ee133dbfc67fba244a8d80ef386386c288436c373fd2ba3fb34581287e7", - "30": "a11545b7cbed6875dcdd9eda6a7a5e286b24cdb77788e5dc2ec46189bb2f2a56", - "31": "848dce2fc8f727d37a262484fd31cf831eded44c2d1fe51f6acd11e454eb0146", - "32": "1d5524960dd53fc3c85b6589b19fdd4f365ba2da42563a4276629fd295a79db7", - "33": "be4dc1ddd5199c6b3c2fcadf309b0766f98471217658ef198a10a55ce31d3b6a", - "34": "380245de14920be23117b5dceaf1dba7f488946f9b04b09e12247f00e89f8bcf", - "35": "c7b64d3b4996d11219ba3a387ca110122694fb6ad6323d9a17351fbf81d5ebe4", - "36": "4db9c23a0e3b61b585a16a3a7a91a057ec8d6ef24bdc59c030062e5d80d60763", - "37": "e9f35a2a4a76dc34e5d1155681b4ce962b860a68617293177f26bce94b9b6993", - "38": "a4346f7e004e2e9f15039d6b2ceeb0cb57b0912c21a8debb7f4ffa1b959aed7c", + "30": "5fd0a380ae0b17d227e1df05d2f2324d94d600c188c9fc1c0622a3041448686f", + "31": "17f500e56adf13fb7dd35a1f0b329df7d85ef21de97496569dbaf68587914457", + "32": "76de9c9670c0b63f66fdbde5374694aa6a43825009256f7d21c1828988095e66", + "33": "93ff7e359c2c536c491f094558d418c8ccbfc56cb8aeaeab44aacc8b37085622", + "34": "2ba106cdf59a6f050a8de644a42015208c36290675d6611938b8e206ef52fd65", + "35": "4c14b6bbcfc8eb77c65ead93da1b19cd6c1c48477bc77a3a8f2e4ab51ee7f529", + "36": "324a8148aa908a912c92db936170c7ae16eb51c795e9845fd5dd3e116fd9f0d8", + "37": "6ee2d4c20393f75cefed53acb4667bd3630900cee5aac06c9c01340b2d417d1f", + "38": "d624e19a2d28469f3f12c28ffffc81b28e73c315bdfb12ff0ef792eb5298097b", "4": "f7627f88969eff7df1add5b6a54937fff1c2eb1f869cf4db71f51ab1657c72f8", "5": "3b8b9c52b4b74d31c9be73c6d0ba0c5e7549a0015ff4e3fffb86fa16968912e4", "6": "a42abe98ff959a8fec3fa4e6d733b7a7382fb99212f6c25846d80aa3fd6e734f", @@ -3880,27 +3880,27 @@ "74": "70a3199bf1a975e725d3fad3d15cb5e8845ac78d7d100894fe89876ea4efbad8", "75": "3c712353d43586a58692f93c9e78c052a39649d37cf2ba5112381ce2e5b87aea", "76": "3182e2624ad47469c4b206a6e66648217cdba883df598df700ccc194b236c2d3", - "77": "7b7a2af4d2914022770c8df97aec2d310e20a98f29299d0206fed5c7e093ce8e", - "78": "62e6674038b54d602a7e1e05e2fc00de67ffa2da4d89ccfc06e80b1fc3fc7a80", - "79": "b1826c1a6055d4f9c051ab76599701051cfb38b5f053e5c5837e0776deaa347a", + "77": "e343947f1e295c5c625e67d170b92d57ed789636fbd90e8a92bc623540ffb8fd", + "78": "43c0dee789525ef71b3c8c834b73bb1cad8d7b6c28bcca1c306034e568b46174", + "79": "1ded1cd6189c828599936af927fcbd76b5afdf4f555e3604244e6b403f912919", "8": "7d827babcb8192445726b06e4250deb674158b5a77d87ecdd9e873118dc0ec93", - "80": "633691a6f9697dcbb8bf3f791f5e35d0ce4dcfa2f820c5efc0a0911d22e9b685", - "81": "a4b1d8ffdf4a45e9df679b63cbf958eaa93d554eee8392c2d3fb9330a4cbb127", - "82": "5f3c94bc57302913b9969ce9ae9aea5a6b78ad79e45bf99826d5ef6d842d1395", - "83": "2f8a952fcf2bba0daecddd5361017ab54c92ee9ece942cec4b5dc80100611027", - "84": "7fa2df25a8460695da922fff0dddab1d817b15e13a35912ed83aa867da128425", - "85": "43594f76265e1e89ae18e198e92eb0d11afb1fb9422ebc1dd6892fbced25809e", - "86": "e88b68294463070b84a4930c6de5d2c20bb1227f2201600e10afca3bd5248169", - "87": "0078cec6682ba64bc1105f8b6c5250f7fca5540580437c32677b7a49085d7143", - "88": "76c827c667b52235b3967ff119c873ca547ac355d67e1385812e96147bed1ec5", - "89": "ca169efaefc94eca8c36eec18f79124785f908226c7b0a7a8f8ba0334d10ebb7", + "80": "de95fe108e0b4b8ef4f0c06f752186ab1c5531670f6098b0dfa341a857532bf1", + "81": "0bc86bcbad718767fe0f82f459b02689a2a2e7dd5f84d4978c1438ca18affcb6", + "82": "fa438ce9767e58b7cb2d1ad23b79c8a3a3a5dab160d13b4e9f7eea8fba989e8e", + "83": "fa34f75a170456ad2610bdc5e23e7f20b8fcc1506b9c7c6402afb41bcf84108d", + "84": "1765fb5bdb5cb2f09f8d0b132ebf1761b1169733b6ee013b6ddc7fc973bd4c29", + "85": "57c0459315dc8c380009eeee5788d8c9d66451763edecd378e1507dbc0a8cd52", + "86": "24d2401943e0706566d6a8b6394630e37da8aaef601c50cbef4da5bab9effe5e", + "87": "6eaf4414006dec90d1fa77b721d8718bb78256f88df25437df73bb18f0c20362", + "88": "764f194543825ee2173f9931e09fa41bafc8dfbb62bb96955b021fe0168852bd", + "89": "b3a3f1538cbd1ef0d85ec294c7ad2304183d5f6030af94f5a5e69a2762f067bc", "9": "5454f3658b3f3e436f29eb8a9f7184ed12eb0209155508c15d6d0b09eae9e2b0", - "90": "c215c852adab863ddd17d3f9a78d02e825688848c04614e1ef34e66407668d13", - "91": "bacda89a3aeae9be962e924c12fbb5d300c9aa85f2b3e3edf600e743da86cf36", - "92": "239460448be6f16c5cc0303c089e281e7b9a521ea1fe0f50074521423ed8fe8c", - "93": "d098676fa7c8fc55d276e1b826d2ed567bdf8a66508c2c11bac048e19ec61db2", - "94": "1316c4a698a7a5746c2768bb3a84bcbacf1669185d71f06f76d1c78ffeaf4989", - "95": "b358b885e2719c21b1d1d42f2ccacf55132c101ae664d6508ee2de00f30832b6" + "90": "8265e32360d732499d5be5f74421ca1255a982132c3d1d3442b9f6428b2662b4", + "91": "2cd944b9616d734e4f917c3aac468d7df9b87c7f0269e13b4fab274b2b67dc9f", + "92": "477f02afedf418c5e7765bf5ed737c25a573e25568ab74f4cca5c5aadeb712a6", + "93": "9bb9ff5fa5e2b3630e7c4c9d9eb3ba69c6d5c226afda6f67256e6f9787d13084", + "94": "d11e685b61b841e84a547c2db108f3a86dd7d7b99575e4b6585f582930815fc8", + "95": "e7dea586b4b59673ba16b3bd0d3376ede26cc6279015ef50208a35f79a4e7321" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "6f9c1088480f429bc5f275eac443b8bdeeb1bedc8113b3984c4abc00054969a1", @@ -5062,26 +5062,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", - "20": "738b857fa5b55cbfa82e6676b98c84260f3949540200cbd14c3ad07054019ac9", - "21": "a8d9e178af69d4075646d3d266ffbc0e19b9842c9e747c22d7a75fcaa0b063cf", - "22": "f13766b1e9ded060dab40e8bc089b8c41a8c0e246f94bff4c7f2f1497e80c511", - "23": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", - "24": "4c6955dcef8f7873a78c971e10f626ccdee092dd6276694978498f19cf6cfd01", - "25": "29ba1f0df5f4df07ecb72ce3a6a2955d03a0a26b06e315594dcfc6cf8b5955a2", - "26": "e7c074393fbefcf708245a82379bf05f653438799b219f72bb460f81b5bdb632", - "27": "70feee573cb4660824da23579ca445cde04accf9222ff29bae59e650b32665e9", - "28": "7f19d6830182ecd395c4b8fc480fbec61139b568f2e97202f4a513f3d81c3203", - "29": "efa7cb3c33b74eb9c2f34a3d7a070129e33ffd9d2bb0213d0cc661772c22934a", + "20": "2230c3aae93c09faac76a04c6d4ab43b7ed786ee3de44ad5c31a8987d6e27f59", + "21": "3bb59c4a121d5913fcc382dc550f081d7e71d4d4f30595cee90fefa7f42edf3e", + "22": "54c6a4a59cbdff603a95ba7b4c48b5e0f5a2cd4bfb2050f825447b9db2353632", + "23": "8b7f4bb5f824e6fad3e70bc21d6ef1c5ae13b9fbe1b7cdc767246f68d9a662a2", + "24": "56ddb4d3fe1d7989bd6731fdb68b9d86a7a9317c9f5e8dcd758989b6571bd8f0", + "25": "19af297c4cbeb40c1bbc31efe17ccd84e7127da444fe9715e481bfbc00f2bf47", + "26": "28191a9c513a956898b1c0bcdc6d638f8e9ab48c2c7380b00f57e6c668a4cf21", + "27": "f2ef2d18ed8f642f0396960c3a91ea2898b66d474c99cb04719ca3e678c55d57", + "28": "99667da65ccf40ae74e0bdbd3f6cc02c78fcafd02c189051db8e5d07daad216c", + "29": "810238696b9e2a712b564e996ab55da6e6bbb418c00727405aaa5a452be0c1fd", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", - "30": "6a0b393ed1cd99e78944054162878218a1ac30f70e8705a59ad07c9a53d80c85", - "31": "3c6ab43322d6bfa68400e8d7afa6bdc08303b5db491b50e5486043f69b1dd93d", - "32": "2f76aa086ece94e6c011aab498730b503188f90b2c64162b1d66d6f0dc584615", - "33": "78c45eb6a8213eaf395bf4557112fbe59a4cf6849364ef629f43769a03da16f6", - "34": "17b54f397c8a189e0bc8b9a3fdf37a41adab6f2cbeb29d6c01a017a96e24dab5", - "35": "18bebfa6c18ce2a1a42f9cbad07341351b54611c970cf7f1d571776797005fa4", - "36": "9af605d56bea5ba2efc585da99474b1062634cda64ca9d3b636a456092c8e93f", - "37": "f8d3f46d7e8774c699d6941d338158320c1df84e1ed0dcbf274576b31b19ec74", - "38": "7fbfbef2c94aad31a4d8d153975589d9e4e8fae05cefa52b2a9d6f29d568a17f", + "30": "4a65ee5b3528bd7548785534a6eaa742c8158144c5a825ef6d04a9af368c1f89", + "31": "4e5307c3a8d2aca8d87b588d4b0440d2d19d83d9b95a987d2cb8c27b383606d0", + "32": "0f97c111ef05d651425aa6bbfa3b57d87d896cd5dd0a7d0ce495a501213784fa", + "33": "94d168f7522c2d2f12a8a3535ce2ffb40e176e0602499f3d380ac0dd59886cbc", + "34": "2657c3b6e0b093bf976d70f32810669fd1a7d6a4f446b602226d0ccbd382f4aa", + "35": "4cd8a9f1b83aced6ccf02dd654d6c9b1203d54f7a7149a312d64a0ea8319ec16", + "36": "89fd4b0e8d63babc67f4e90408ef1e900239facfdd3dab7b5a9892f4d00077d8", + "37": "bf62d411f42003c6f6d386c51ed14039a4d2339a15100ba7f053aa0be44d2122", + "38": "b6aa08d96b4f6431155e4c009b5828844605272cad4d18ec7babe08fcd96bfaa", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -5252,27 +5252,27 @@ "74": "bb8b0a1e8e06e91044209b4407f8ddfc8dcb3c51d91d28f7673fc209c8d84bb0", "75": "95c373866387c3529e8d60536d70d0d6372d782f1c1e64b067fa86daf3ca0fdd", "76": "fd54658289a24225c4a5b7a7ea339f4337b9b297f599b482da8ce45367c466be", - "77": "d4f1697482e1491e731851689d6f31d92b2f5aed90b36e15e3eb6bc52d638134", - "78": "eb70ba4c300d33d544ba5986444a34030fbe7eb5c632da768b6dfa2b8db54d9e", - "79": "586a0d1ca0744c4e35ca05d8b28e9ed7b519389227085240a1332b1bc265e560", + "77": "453462d5c79abebc0a3c11a32e0dec5593b54a20eceeb862062f5c48de313c48", + "78": "b5ca9819239715029eeed3e010ae7c22285de81c4283bd38b6e5c20fde12b490", + "79": "8bb6e846ecc5be2458d6df617f528372e6dab756748baf4d6d3cca56347e40fd", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "80": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", - "81": "59f02cf30bd80cc88a7ddd45044bf322fd87f591a9fa559fc0b50e955de94f70", - "82": "6b1a31bb5875e1769bf088c5eca7ae099901653fdb09d3f1397095290cba2997", - "83": "c85b788d82efcb0cc90fb5dd0951577f07509d4f8576897ea09648f774f2d66d", - "84": "d4801212922fdbc3f92901f29896f5bdcea6a7019deffef0ea74f47727450b84", - "85": "6750f5d231aa29a824e1e4b63936c21eb45fd6e9595b3afc2114aaa02da039ea", - "86": "3cd48b8828e716b83be8edd0854bda3a9399ff6a60d33eafbdd59caef28de0c4", - "87": "bf6050f6fb92813daf9f519f02e0db67adac7fc5962837af322097c9621c8e8b", - "88": "01544ebdc62e031b9d2ed51caf0da5edbb3b1c93db7868bcbecee6acc4735fae", - "89": "30d64ab338efc3192c5f6b5a5dcc62c79d479bb295c467a7100eec70207d6895", + "80": "969e3f1ca771532273dc64125eeee6fcc1f459477c57e1a828bf688151b9eaa9", + "81": "f29ef6ec4cf99dd85a5417becc55bb218497808635e2fa72574ba5993eb8c05a", + "82": "d2d878bb04e0f0bb797a7d4bbe54110324dc1c5b22062c38f9a2da023d86da55", + "83": "0e12bd186691921dc982d43ebe2e82da0b42f1b9570df0593aeaf6d0dfec8dd4", + "84": "70f98ad6d8d00f6214efca098f765450ffc851c37ed86030015ff9b9528af92f", + "85": "5ad58ace0f8f4936f5ba6f058ef40d27c621a109f744537256ac67522e036210", + "86": "2529f71504bc1cd8289773ab9d8af82175405cf42ac16637a71e40d2a6fe1181", + "87": "976332249b905434f5f4a526b21c74aa20ea71754798600cd42571e8538890ba", + "88": "721896e77c5552778ec7c08af0d7264a5c73fd14eec1d38ef48ff8c9918741c8", + "89": "b312f0896a48b3bc32607c663912db44f2f5c34b64a2c8bf95880e98463a6226", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", - "90": "f17fb589a0523cf1fd000d9b5d9a77156c5217d0bf680a267f23f0007eff083b", - "91": "4e752e8b595690bdd29d8ce8f74dc2fe7df97f3f2a024520824947cb6cc05af6", - "92": "5697e781e6846b657b3f238ab08edde9312359897c62a164c674be436cc4a673", - "93": "d7f054eaac8fae438a3288e5dee683df62f1ab42a452ad3a11b7c69677783c30", - "94": "8293a32874210d967d598bda66401472d57bcb8187dd1b61bda301fb3dbbd991", - "95": "1996579136d6ec9668e45df3519c4ce567841e1f929402552c3d2cb5ada43b7f" + "90": "b70fcbf561da4e5ea81ff7ccb2e8453a2f6f53574d6b7481b26b553a0f47bfc7", + "91": "d9bd3bcb8e1f34099793ac90090dc79bb4471580d4d02531669cc47fbfe62d01", + "92": "affd3209eb5c8eabe9d467982f3e0d0b8e93485f21817d307247e60bb4145c94", + "93": "64f57bc8f2a06039f7192bf9a84a6770a9febf145713e8630e89f930a34dd581", + "94": "5e33ea96a313a76df9d88e55cac1297a19c29a2e6a5bad85006976a350d1c41a", + "95": "1c177bdbc96c27000df991b8bb66329825891dad4dba433fb93a0b7485d5bf82" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", @@ -6638,26 +6638,26 @@ "18": "6d6f02a547cd98da2c8c2961aa07a31551ead49bedb8ab041c1ac25e13e2950a", "19": "16015c221eb6a733534c1950dd21aafad2e4e2a0dbc4bcb02b642e2956803831", "2": "55c737ed7f81060d5f9202dd7f3fabe25917c8497e7fa03edd921e2e552be9e9", - "20": "738b857fa5b55cbfa82e6676b98c84260f3949540200cbd14c3ad07054019ac9", - "21": "a8d9e178af69d4075646d3d266ffbc0e19b9842c9e747c22d7a75fcaa0b063cf", - "22": "f13766b1e9ded060dab40e8bc089b8c41a8c0e246f94bff4c7f2f1497e80c511", - "23": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", - "24": "4c6955dcef8f7873a78c971e10f626ccdee092dd6276694978498f19cf6cfd01", - "25": "29ba1f0df5f4df07ecb72ce3a6a2955d03a0a26b06e315594dcfc6cf8b5955a2", - "26": "e7c074393fbefcf708245a82379bf05f653438799b219f72bb460f81b5bdb632", - "27": "70feee573cb4660824da23579ca445cde04accf9222ff29bae59e650b32665e9", - "28": "7f19d6830182ecd395c4b8fc480fbec61139b568f2e97202f4a513f3d81c3203", - "29": "efa7cb3c33b74eb9c2f34a3d7a070129e33ffd9d2bb0213d0cc661772c22934a", + "20": "2230c3aae93c09faac76a04c6d4ab43b7ed786ee3de44ad5c31a8987d6e27f59", + "21": "3bb59c4a121d5913fcc382dc550f081d7e71d4d4f30595cee90fefa7f42edf3e", + "22": "54c6a4a59cbdff603a95ba7b4c48b5e0f5a2cd4bfb2050f825447b9db2353632", + "23": "8b7f4bb5f824e6fad3e70bc21d6ef1c5ae13b9fbe1b7cdc767246f68d9a662a2", + "24": "56ddb4d3fe1d7989bd6731fdb68b9d86a7a9317c9f5e8dcd758989b6571bd8f0", + "25": "19af297c4cbeb40c1bbc31efe17ccd84e7127da444fe9715e481bfbc00f2bf47", + "26": "28191a9c513a956898b1c0bcdc6d638f8e9ab48c2c7380b00f57e6c668a4cf21", + "27": "f2ef2d18ed8f642f0396960c3a91ea2898b66d474c99cb04719ca3e678c55d57", + "28": "99667da65ccf40ae74e0bdbd3f6cc02c78fcafd02c189051db8e5d07daad216c", + "29": "810238696b9e2a712b564e996ab55da6e6bbb418c00727405aaa5a452be0c1fd", "3": "bc950eea70f3c80d7e64c6fdfad5c96ba3fb4da49a316168cfd1bf20f6b20f13", - "30": "6a0b393ed1cd99e78944054162878218a1ac30f70e8705a59ad07c9a53d80c85", - "31": "3c6ab43322d6bfa68400e8d7afa6bdc08303b5db491b50e5486043f69b1dd93d", - "32": "2f76aa086ece94e6c011aab498730b503188f90b2c64162b1d66d6f0dc584615", - "33": "78c45eb6a8213eaf395bf4557112fbe59a4cf6849364ef629f43769a03da16f6", - "34": "17b54f397c8a189e0bc8b9a3fdf37a41adab6f2cbeb29d6c01a017a96e24dab5", - "35": "18bebfa6c18ce2a1a42f9cbad07341351b54611c970cf7f1d571776797005fa4", - "36": "9af605d56bea5ba2efc585da99474b1062634cda64ca9d3b636a456092c8e93f", - "37": "f8d3f46d7e8774c699d6941d338158320c1df84e1ed0dcbf274576b31b19ec74", - "38": "7fbfbef2c94aad31a4d8d153975589d9e4e8fae05cefa52b2a9d6f29d568a17f", + "30": "4a65ee5b3528bd7548785534a6eaa742c8158144c5a825ef6d04a9af368c1f89", + "31": "4e5307c3a8d2aca8d87b588d4b0440d2d19d83d9b95a987d2cb8c27b383606d0", + "32": "0f97c111ef05d651425aa6bbfa3b57d87d896cd5dd0a7d0ce495a501213784fa", + "33": "94d168f7522c2d2f12a8a3535ce2ffb40e176e0602499f3d380ac0dd59886cbc", + "34": "2657c3b6e0b093bf976d70f32810669fd1a7d6a4f446b602226d0ccbd382f4aa", + "35": "4cd8a9f1b83aced6ccf02dd654d6c9b1203d54f7a7149a312d64a0ea8319ec16", + "36": "89fd4b0e8d63babc67f4e90408ef1e900239facfdd3dab7b5a9892f4d00077d8", + "37": "bf62d411f42003c6f6d386c51ed14039a4d2339a15100ba7f053aa0be44d2122", + "38": "b6aa08d96b4f6431155e4c009b5828844605272cad4d18ec7babe08fcd96bfaa", "4": "dbad6405c1fb6e15d364d61db3ea7a9aae57e32c8cb64cd0fabb96862c823d69", "5": "bda1d590f8870c8b1bf8a8fea4ffd99cdd1af6741fcd2d6224fa2286956230be", "6": "8458e403a87e59406586051bbf9b4498d67aea928e654eaaae67cf55b9b4dbfb", @@ -6828,27 +6828,27 @@ "74": "bb8b0a1e8e06e91044209b4407f8ddfc8dcb3c51d91d28f7673fc209c8d84bb0", "75": "95c373866387c3529e8d60536d70d0d6372d782f1c1e64b067fa86daf3ca0fdd", "76": "fd54658289a24225c4a5b7a7ea339f4337b9b297f599b482da8ce45367c466be", - "77": "d4f1697482e1491e731851689d6f31d92b2f5aed90b36e15e3eb6bc52d638134", - "78": "eb70ba4c300d33d544ba5986444a34030fbe7eb5c632da768b6dfa2b8db54d9e", - "79": "586a0d1ca0744c4e35ca05d8b28e9ed7b519389227085240a1332b1bc265e560", + "77": "453462d5c79abebc0a3c11a32e0dec5593b54a20eceeb862062f5c48de313c48", + "78": "b5ca9819239715029eeed3e010ae7c22285de81c4283bd38b6e5c20fde12b490", + "79": "8bb6e846ecc5be2458d6df617f528372e6dab756748baf4d6d3cca56347e40fd", "8": "9a4431d34fde7e376552fc757ff75be86b1c4c6194b3f95c93c0ab9fbbf9f2a4", - "80": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", - "81": "59f02cf30bd80cc88a7ddd45044bf322fd87f591a9fa559fc0b50e955de94f70", - "82": "6b1a31bb5875e1769bf088c5eca7ae099901653fdb09d3f1397095290cba2997", - "83": "c85b788d82efcb0cc90fb5dd0951577f07509d4f8576897ea09648f774f2d66d", - "84": "d4801212922fdbc3f92901f29896f5bdcea6a7019deffef0ea74f47727450b84", - "85": "6750f5d231aa29a824e1e4b63936c21eb45fd6e9595b3afc2114aaa02da039ea", - "86": "3cd48b8828e716b83be8edd0854bda3a9399ff6a60d33eafbdd59caef28de0c4", - "87": "bf6050f6fb92813daf9f519f02e0db67adac7fc5962837af322097c9621c8e8b", - "88": "01544ebdc62e031b9d2ed51caf0da5edbb3b1c93db7868bcbecee6acc4735fae", - "89": "30d64ab338efc3192c5f6b5a5dcc62c79d479bb295c467a7100eec70207d6895", + "80": "969e3f1ca771532273dc64125eeee6fcc1f459477c57e1a828bf688151b9eaa9", + "81": "f29ef6ec4cf99dd85a5417becc55bb218497808635e2fa72574ba5993eb8c05a", + "82": "d2d878bb04e0f0bb797a7d4bbe54110324dc1c5b22062c38f9a2da023d86da55", + "83": "0e12bd186691921dc982d43ebe2e82da0b42f1b9570df0593aeaf6d0dfec8dd4", + "84": "70f98ad6d8d00f6214efca098f765450ffc851c37ed86030015ff9b9528af92f", + "85": "5ad58ace0f8f4936f5ba6f058ef40d27c621a109f744537256ac67522e036210", + "86": "2529f71504bc1cd8289773ab9d8af82175405cf42ac16637a71e40d2a6fe1181", + "87": "976332249b905434f5f4a526b21c74aa20ea71754798600cd42571e8538890ba", + "88": "721896e77c5552778ec7c08af0d7264a5c73fd14eec1d38ef48ff8c9918741c8", + "89": "b312f0896a48b3bc32607c663912db44f2f5c34b64a2c8bf95880e98463a6226", "9": "6267b3845952589a6f3594a1e07902bfd52ec3ecfaa85d398c4b002570f37e07", - "90": "f17fb589a0523cf1fd000d9b5d9a77156c5217d0bf680a267f23f0007eff083b", - "91": "4e752e8b595690bdd29d8ce8f74dc2fe7df97f3f2a024520824947cb6cc05af6", - "92": "5697e781e6846b657b3f238ab08edde9312359897c62a164c674be436cc4a673", - "93": "d7f054eaac8fae438a3288e5dee683df62f1ab42a452ad3a11b7c69677783c30", - "94": "8293a32874210d967d598bda66401472d57bcb8187dd1b61bda301fb3dbbd991", - "95": "1996579136d6ec9668e45df3519c4ce567841e1f929402552c3d2cb5ada43b7f" + "90": "b70fcbf561da4e5ea81ff7ccb2e8453a2f6f53574d6b7481b26b553a0f47bfc7", + "91": "d9bd3bcb8e1f34099793ac90090dc79bb4471580d4d02531669cc47fbfe62d01", + "92": "affd3209eb5c8eabe9d467982f3e0d0b8e93485f21817d307247e60bb4145c94", + "93": "64f57bc8f2a06039f7192bf9a84a6770a9febf145713e8630e89f930a34dd581", + "94": "5e33ea96a313a76df9d88e55cac1297a19c29a2e6a5bad85006976a350d1c41a", + "95": "1c177bdbc96c27000df991b8bb66329825891dad4dba433fb93a0b7485d5bf82" }, "gfx950_attention_tiled_2d_fastkv_regp": { "0": "e1fadd21fc2e1e2701d08d91d04fbb52034b6bccb6205c6d28b42fb210a5d6ba", diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py index cc0edb2b71e7..fec6f1fb6e47 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_attention_tiled_2d_runtime_layout_gfx950.py @@ -165,6 +165,9 @@ class Scenario: window=16, kv_layout="nhd", ), + # One sequence: the table's row stride is not passed (0), so the length cap + # must come from its width. + Scenario("dense_l1_single_sequence", seq_lens=(100,), q_uniform_len=1), # One decode row whose origin lies past the first q-blocks: those blocks # find no sequence and write nothing (rows before off[0] keep the sentinel). Scenario( @@ -248,6 +251,7 @@ def _launcher( "q_block_grid", "sink_is_f32", "num_kv_blocks", + "block_table_width", ): sb.scalar(name, "i32") launcher = KernelLauncher( @@ -498,7 +502,10 @@ def upload(a: np.ndarray) -> DeviceMem: "out_scale": 1.0, "softcap": 0.0, "num_seqs": B, - "block_table_stride": bt_width, + # The engine passes the batch stride of hipDNN's page table, which is 0 for a + # batch of one (a unit extent's stride is irrelevant); the row width is its own + # argument. + "block_table_stride": bt_width if B > 1 else 0, "qq_bias_stride_0": 0, "seq_lens_q_ptr": slq_dev, "block_tables_v_ptr": v_bt_dev, @@ -520,6 +527,7 @@ def upload(a: np.ndarray) -> DeviceMem: "q_block_grid": grid_y, "sink_is_f32": int(sink_f32), "num_kv_blocks": num_blocks, + "block_table_width": bt_width, } launcher( values, diff --git a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py index c0b4ae058bb3..bd8d5f7bb728 100644 --- a/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py +++ b/dnn-providers/hip-kernel-provider/rocke/library/tests/test_gfx942_attention_runtime_layout.py @@ -252,6 +252,21 @@ def _launcher(spec): # token-stride padding), window (None = off), grid_y (None = full grid). def _scenarios(bs): return [ + # One sequence: the table's row stride is not passed (0), so the length cap + # must come from its width. + dict( + name="dense_L1_single_sequence", + mode="dense", + L=1, + has_lq=0, + seq_lens=[2 * bs + 20], + q_lens=None, + kv="vllm", + fused_q=False, + o_pad=0, + window=None, + grid_y=None, + ), dict( name="dense_L1_empty_seqs", mode="dense", @@ -651,7 +666,9 @@ def upload(a): out_scale=1.0, softcap=0.0, num_seqs=nseq, - block_table_stride=table.shape[1], + # The engine passes hipDNN's page-table batch stride, which is 0 for a batch of + # one (a unit extent's stride is irrelevant); the row width is its own argument. + block_table_stride=table.shape[1] if nseq > 1 else 0, qq_bias_stride_0=0, seq_lens_q_ptr=lq_dev if sc["has_lq"] else seq_lens_dev, block_tables_v_ptr=v_table_dev, @@ -673,6 +690,7 @@ def upload(a): q_block_grid=grid_y, sink_is_f32=int(sink_f32), num_kv_blocks=nb, + block_table_width=table.shape[1], ) _launcher(spec)( values, diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h index e1bcfdef7139..efa6de7c6187 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_helper_rocke.instances.gfx942.attention_tiled_2d.h @@ -188,7 +188,7 @@ typedef struct rocke_attention_tiled_2d_spec * "lse" token becomes "lsehm". Needs emit_lse. */ bool lse_head_major; /* False */ /* Runtime-layout mode (hipDNN paged/ragged SDPA): the Q/O/KV strides and a - * dense-or-ragged Q become 17 appended kernel arguments (after the runtime + * dense-or-ragged Q become 18 appended kernel arguments (after the runtime * head counts and window), * the page tables and lengths are read on the device and the q-block grid * is walked with a grid-stride loop. Off emits no new IR; on appends the diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h index eb041d2fc65e..8ee5e7e2be1c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_attention_tiled_2d_rtl_internal.h @@ -40,6 +40,7 @@ typedef enum rocke_attn2d_rtl_param ROCKE_ATTN2D_RTL_Q_BLOCK_GRID, ROCKE_ATTN2D_RTL_SINK_IS_F32, ROCKE_ATTN2D_RTL_NUM_KV_BLOCKS, + ROCKE_ATTN2D_RTL_BLOCK_TABLE_WIDTH, ROCKE_ATTN2D_RTL_NUM_PARAMS } rocke_attn2d_rtl_param_t; @@ -65,6 +66,7 @@ static inline void rocke_attn2d_rtl_declare_params(rocke_ir_builder_t* b, rocke_ "q_block_grid", "sink_is_f32", "num_kv_blocks", + "block_table_width", }; const rocke_type_t* ptr_i32 = rocke_ptr_type(b, rocke_i32(), "global"); for(int i = 0; i < ROCKE_ATTN2D_RTL_NUM_PARAMS; ++i) diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h index 43e691d4313e..d12b2630670c 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx942_attention_tiled_2d_internal.h @@ -185,7 +185,7 @@ typedef struct rocke_gfx942_attn2d_build_ctx rocke_value_t* sliding_window_p; /* Trailing lse_ptr (F32*), declared only when spec->emit_lse; else NULL. */ rocke_value_t* lse; - /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, + /* runtime_layout (spec->runtime_layout): the 18 appended kernel arguments, * indexed by ROCKE_ATTN2D_RTL_*; all NULL when off. */ bool RTL; rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h index c197380054a8..189a90196fcc 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_gfx950_attention_tiled_2d_internal.h @@ -184,7 +184,7 @@ typedef struct rocke_gfx950_attn2d_build_ctx rocke_value_t* num_kv_p; rocke_value_t* sliding_window_p; rocke_value_t* lse; /* lse_ptr (spec->emit_lse only, else NULL) */ - /* runtime_layout (spec->runtime_layout): the 17 appended kernel arguments, + /* runtime_layout (spec->runtime_layout): the 18 appended kernel arguments, * indexed by ROCKE_ATTN2D_RTL_* (Python _RTL_PARAMS); all NULL when off. */ bool RTL; rocke_value_t* rtl_p[ROCKE_ATTN2D_RTL_NUM_PARAMS]; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp index 6ae58773e34f..fa0375754922 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx942/attention_tiled_2d_ctx_prologue.cpp @@ -185,10 +185,13 @@ static void rocke_a2d_rtl_seq_lookup(rocke_gfx942_attn2d_build_ctx_t* ctx, int B ctx->q_block_local_idx = rocke_b_sub(b, qb, ctx->q_block_start_idx); ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, seq_idx, 0); /* A length past the table row would walk the page-table read off its end: - * bound it by the row's extent (block_table_stride * block_size). */ + * bound it by the row's width (block_table_width * block_size). The width is + * its own argument: block_table_stride is the row-to-row step, which a batch + * of one has no use for. */ { rocke_value_t* c_bs_cap = rocke_b_const_i32(b, ctx->BS); - rocke_value_t* bt_cap = rocke_b_mul(b, ctx->bt_stride_p, c_bs_cap); + rocke_value_t* bt_cap + = rocke_b_mul(b, ctx->rtl_p[ROCKE_ATTN2D_RTL_BLOCK_TABLE_WIDTH], c_bs_cap); rocke_value_t* in_cap = rocke_b_cmp_ult(b, ctx->seq_len, bt_cap); ctx->seq_len = rocke_b_select(b, in_cap, ctx->seq_len, bt_cap); } @@ -583,7 +586,7 @@ bool rocke_gfx942_attn2d_build_ctx_init(rocke_gfx942_attn2d_build_ctx_t* ctx, o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } - /* runtime_layout: the 17 appended arguments (RUNTIME_LAYOUT_EXTRA_ARGS). */ + /* runtime_layout: the 18 appended arguments (RUNTIME_LAYOUT_EXTRA_ARGS). */ if(spec->runtime_layout) { ctx->RTL = true; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp index 31ac590cf723..6f058fc51738 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp +++ b/dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/gfx950/attention_tiled_2d_public_entry_glue.cpp @@ -441,10 +441,13 @@ static void rocke_g950_rtl_seq_lookup(rocke_gfx950_attn2d_build_ctx_t* ctx, int ctx->q_block_local_idx = rocke_b_sub(b, qb, ctx->q_block_start_idx); ctx->seq_len = rocke_b_global_load_i32(b, ctx->seq_lens, seq_idx, 0); /* A length past the table row would walk the page-table read off its end: - * bound it by the row's extent (block_table_stride * block_size). */ + * bound it by the row's width (block_table_width * block_size). The width is + * its own argument: block_table_stride is the row-to-row step, which a batch + * of one has no use for. */ { rocke_value_t* c_bs_cap = rocke_b_const_i32(b, ctx->BS); - rocke_value_t* bt_cap = rocke_b_mul(b, ctx->bt_stride_p, c_bs_cap); + rocke_value_t* bt_cap + = rocke_b_mul(b, ctx->rtl_p[ROCKE_ATTN2D_RTL_BLOCK_TABLE_WIDTH], c_bs_cap); rocke_value_t* in_cap = rocke_b_cmp_ult(b, ctx->seq_len, bt_cap); ctx->seq_len = rocke_b_select(b, in_cap, ctx->seq_len, bt_cap); } @@ -866,7 +869,7 @@ static bool rocke_gfx950_attn2d_build_ctx_init(rocke_gfx950_attn2d_build_ctx_t* o.align_set = true; ctx->lse = rocke_b_param(b, "lse_ptr", ptr_f32, &o); } - /* runtime_layout: the 17 appended arguments (_RTL_PARAMS). */ + /* runtime_layout: the 18 appended arguments (_RTL_PARAMS). */ if(spec->runtime_layout) { ctx->RTL = true; diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md b/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md index 9b89d49d30be..e27f071bbc12 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md +++ b/dnn-providers/hip-kernel-provider/rocke/platform/dsl_docs/instances/attention.md @@ -434,8 +434,10 @@ dense or ragged Q over a paged K/V cache. The layout is read from kernargs appended after the fixed ones (`RUNTIME_LAYOUT_EXTRA_ARGS` in each arch's `attention_tiled_2d.py`): the Q/O/KV element strides, a separate V block table, `seq_lens_q`, the dense row count `q_uniform_len` (0 for a ragged Q), the -q-block grid size, and `sink_is_f32`, which says whether `sink_ptr` holds fp32 or -Q-dtype sink logits. Head counts and the sliding window are runtime kernargs as +q-block grid size, `sink_is_f32` (whether `sink_ptr` holds fp32 or Q-dtype sink +logits), and two bounds on device-read values: `num_kv_blocks` (a page id outside +`[0, num_kv_blocks)` reads as a masked page) and `block_table_width` (a length is +capped at `block_table_width * block_size`, the table row's width). Head counts and the sliding window are runtime kernargs as in the fixed-layout kernel. hip-kernel-provider's `hipkernel:AttentionPagedUnified` engine is the consumer. @@ -449,8 +451,11 @@ engine is the consumer. - A ragged Q needs non-decreasing offsets with `off[b+1] - off[b] >= seq_lens_q[b]`, and `off[B]` the end of the last block. - On gfx942, `supports_tiled_2d_spec` and both builders charge - `runtime_layout_lds_bytes` against `ArchTarget.lds_capacity_bytes`; on gfx950 - the shared tiled 2D LDS gate applies. + `runtime_layout_lds_bytes` against `ArchTarget.lds_capacity_bytes`. On gfx950 + no gate models the runtime_layout LDS pool: the catalog geometry (at most four + warps) fits, but a hand-built spec past it, such as head size 256 with eight + warps and block 32 or 64, needs more than the 160 KiB the arch holds and is + refused only when clang compiles it. Byte identity is checked by the parity emitters (`library/tests/parity/gfx94{2,50}_attention_tiled_2d_emit.*`), and diff --git a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json index 088f156f49a0..e82fcfbb304d 100644 --- a/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json +++ b/dnn-providers/hip-kernel-provider/rocke/platform/tests/golden/rocke_representative_ir_sha256/attention.json @@ -53,26 +53,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106631, + "bytes": 106654, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "ffd330e03c0bf9154bb9902062cf5b568901a7ef9d0c179b73b4fc154546169d", + "sha256": "ddba7a92486ff7641f2a6702170b3b7f7727f38ffbab7842e468e8ddeb00f23f", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 206897, + "bytes": 206920, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "3e1e805a6ef63a6ee5a7c0161a8b746193a41f0abbbe8dacfebb296d062764cc", + "sha256": "14eb699157c9d7e099aa9f5b44b85bd87dee6770ba51c2b125b633be70e59178", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 109624, + "bytes": 109647, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "1ce436e0725ae702c0fda74e06ce6e9e22f5a77e160021d50adad8f517ea5c48", + "sha256": "c7b8ac55fc17c6b0dcae418605f3e103bc6ece2a8ac5f017e959633d4cdbd8bb", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -269,26 +269,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 82107, + "bytes": 82130, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "6057d6bca37698f8c7395de1fdc2045236aa54a1f82d0d3a893a1b64b5ff85bb", + "sha256": "6c6a2e94819e7165956dec4bf2e69ab33133b46f9c41624eef43cb7bc02f8f38", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 240423, + "bytes": 240446, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "28808c37f703e2abe1781b35fddc3351b2f3a34737300037e7b679b518352368", + "sha256": "b911fb8d8dc9b7f284385bf4c77b4b7c69a22100bd0a6010f7c22368946bda8c", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 86656, + "bytes": 86679, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "9c46f1995c989128f0f96345d2fec7e3bee0f6985aa326f2379922e0b814039f", + "sha256": "681acb39ad635ecff6ef213735d950230e498f4e28bab8bc677f21bffc707c39", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -482,26 +482,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 106953, + "bytes": 106976, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "cf47f97757c2bc6cf003c52d539b0d910de18d3e8fe62abe820056736c745c00", + "sha256": "0ebcbd3257a688137007a94ea3a284ef022ede96f42618dc7459f9b4a2069bab", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 207208, + "bytes": 207231, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "a6538f57c98ccedff5f68b37377b0fd058834f64ebe4688fb012953b5bf54998", + "sha256": "dffee890474a7723370ca0ec982aab92bdc134004d26ea75f70b3384cf9cbb6f", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 109966, + "bytes": 109989, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "639249f03fccd43b250acf62c57ad7981014f8eb9dcf214228c177793fb56506", + "sha256": "33b9c25e2566c1da5608889822386427cfc1e8d0e6cebdb168505bbb8cacca13", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -698,26 +698,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 82332, + "bytes": 82355, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "633691a6f9697dcbb8bf3f791f5e35d0ce4dcfa2f820c5efc0a0911d22e9b685", + "sha256": "de95fe108e0b4b8ef4f0c06f752186ab1c5531670f6098b0dfa341a857532bf1", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 240648, + "bytes": 240671, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "3fc99b456a61a3b2a35411252cbf1335386f4241897a2736ec698ad3ef1c3cc9", + "sha256": "0f76a48d69f33bb681369b4f87853b08047308b1c55bd6319c39b381c2d05c04", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 86881, + "bytes": 86904, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "8bdc5e9c69455e75723552bc68c577354d3ac6674553e27f594469ad55e82837", + "sha256": "b8cd20eaad3c3b9c375f02e8e6fdf070bd0ebed3443ae0bc6b7ba85ef757eb1c", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -911,26 +911,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 107017, + "bytes": 107040, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", + "sha256": "8b7f4bb5f824e6fad3e70bc21d6ef1c5ae13b9fbe1b7cdc767246f68d9a662a2", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 207272, + "bytes": 207295, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "66e2005b1c4d833f81448ef9dcceb0737fe11e668b303864a830576b6a7549b7", + "sha256": "0dc3571efb93816449957df9154ef3d6bdc68dd3b182ed78559d426b7c38d0a2", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 110030, + "bytes": 110053, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "0a5b3e9bcfe64b2bf1963176a7c3f5b8cd503688e5b8764ff615468382b818d6", + "sha256": "df705bab630caf36bed01a78e215555bad1171bd2bb63378a96627e040e87872", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -1127,26 +1127,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 82396, + "bytes": 82419, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", + "sha256": "969e3f1ca771532273dc64125eeee6fcc1f459477c57e1a828bf688151b9eaa9", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 240712, + "bytes": 240735, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "d8bc0a23d4c7eca82400141d8244f268ea773d96efc2e16c5d932a54c0059fd1", + "sha256": "6edc45954a21466dddb772c5f6f347b36ca01047d998a3edf0fb6e74842e70a5", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 86945, + "bytes": 86968, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "7214385e9aab885e7644a9bc65919f5da74ae5f447f6e2135cbc047a9dad8dff", + "sha256": "e60e865ae109de88601ec3dd0fa1cbbedf342119f571c389911a8d89d3c80f78", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { @@ -1340,26 +1340,26 @@ }, "attention/gfx942/2d_rtl_bf16_d128_b16": { "arch": "gfx942", - "bytes": 107017, + "bytes": 107040, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "9a92d6370901487aad83618613c0b8f4a478e3b24e0fe6cafdfb4ff3c68d9411", + "sha256": "8b7f4bb5f824e6fad3e70bc21d6ef1c5ae13b9fbe1b7cdc767246f68d9a662a2", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_bf16_d256_b64_w2": { "arch": "gfx942", - "bytes": 207272, + "bytes": 207295, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_t16_g8_bf16_sinks_w2_rtl", - "sha256": "66e2005b1c4d833f81448ef9dcceb0737fe11e668b303864a830576b6a7549b7", + "sha256": "0dc3571efb93816449957df9154ef3d6bdc68dd3b182ed78559d426b7c38d0a2", "status": "ok" }, "attention/gfx942/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx942", - "bytes": 110030, + "bytes": 110053, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "0a5b3e9bcfe64b2bf1963176a7c3f5b8cd503688e5b8764ff615468382b818d6", + "sha256": "df705bab630caf36bed01a78e215555bad1171bd2bb63378a96627e040e87872", "status": "ok" }, "attention/gfx942/3d_bf16_d128_b64": { @@ -1556,26 +1556,26 @@ }, "attention/gfx950/2d_rtl_bf16_d128_b16": { "arch": "gfx950", - "bytes": 82396, + "bytes": 82419, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_bf16_w4_rtl", - "sha256": "fc3af51c692a3cd34592b58873bb9801969cd827235806dfbbcd623e10bcb5e3", + "sha256": "969e3f1ca771532273dc64125eeee6fcc1f459477c57e1a828bf688151b9eaa9", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_bf16_d256_b64": { "arch": "gfx950", - "bytes": 240712, + "bytes": 240735, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d256_b64_g8_bf16_sinks_w4_rtl", - "sha256": "d8bc0a23d4c7eca82400141d8244f268ea773d96efc2e16c5d932a54c0059fd1", + "sha256": "6edc45954a21466dddb772c5f6f347b36ca01047d998a3edf0fb6e74842e70a5", "status": "ok" }, "attention/gfx950/2d_rtl_sinks_fp16_d128_b16": { "arch": "gfx950", - "bytes": 86945, + "bytes": 86968, "family": "attention", "kernel_name": "rocke_uattn2d_tiled_d128_b16_g8_fp16_sinks_w4_rtl", - "sha256": "7214385e9aab885e7644a9bc65919f5da74ae5f447f6e2135cbc047a9dad8dff", + "sha256": "e60e865ae109de88601ec3dd0fa1cbbedf342119f571c389911a8d89d3c80f78", "status": "ok" }, "attention/gfx950/3d_bf16_d128_b64": { diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md index 1d65434e3b03..525decbcd6d2 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/descriptors/rocKE/attention_paged_unified/README.md @@ -44,7 +44,7 @@ A ragged Q needs vLLM's `query_start_loc` layout: non-decreasing origins with `ragged_offset[b+1] - ragged_offset[b] >= seq_len_q[b]` and `ragged_offset[B]` the end of the last block. The first origin need not be 0. The kernel finds each query block's sequence by a binary search over the offsets and sizes its grid from `ragged_offset[B]`. -RFC 0014 (#15080) also allows origins in any order and an unused `ragged_offset[B]` when +RFC 0014 also allows origins in any order and an unused `ragged_offset[B]` when `seq_len_q` is bound; those are valid graphs whose offset values this engine cannot see at match time, so it cannot decline them, and its output for them is wrong. The follow-up is a packed query-block numbering driven by `seq_len_q` (a wave prefix sum over the @@ -107,7 +107,7 @@ values live in SGPRs, and most kernels run out: the compiler spills SGPRs into V | Lane moves as a share of the kernel's instructions, median (max) | 1.7% (7.4%) | 1.5% (6.3%) | | Fixed-layout twins that spill | 0 of 192 that build | 4 of 288, 1 SGPR each | -The runtime head count, window and batch arguments of #15024 barely move the fixed layout +The runtime head count, window and batch arguments of the tiled 2D kernel barely move the fixed layout (gfx942: no spills before or after; gfx950: 2 kernels spilling 6 SGPRs before, 4 spilling 4 after), so the spills come from the runtime strides. The lane moves are a small part of each kernel, but the lanes they hold count against VGPRs: the VGPR-limited occupancy @@ -130,15 +130,16 @@ page tables (one tensor, `[B, 1, max_blocks, 1]`), `seq_lens` as `seq_len_kv`, t The page tables and lengths are read only on the device, so the engine cannot check their contents at execute without a device-to-host copy, which would break HIP graph capture. -The kernels contain them instead, with the container's block count passed as the -`num_kv_blocks` argument: +The kernels contain them instead, with the container's block count and the tables' width +passed as the `num_kv_blocks` and `block_table_width` arguments: - a K or V page id outside `[0, num_kv_blocks)` (negative included) reads as a masked page: block 0 with a zero-size buffer resource, so it touches no memory and the tile contributes zeros; -- `seq_len_kv[b]` is bounded by the table row's extent, `block_table_stride * block_size`, - so the page-table read stays inside its row. A longer length is a caller bug and attends - to masked pages past the table. +- `seq_len_kv[b]` is bounded by the table row's width, `block_table_width * block_size` + (`block_table_width` is the tables' `M`; it is not `block_table_stride`, the step + between rows, which a batch of one does not carry), so the page-table read stays inside + its row. A longer length is a caller bug and attends to masked pages past the table. An invalid page id or length makes that sequence's output wrong (no error is reported); it cannot read or write outside the cache, the table or the output. Other device-read values @@ -159,7 +160,7 @@ absent), the scale (any finite float, stored exactly as a double), every by-valu argument (`num_seqs`, `block_table_stride`, the head counts, `sliding_window`, `q_uniform_len` (`Sq` for a dense Q, 0 for a ragged one), the Q/O/KV strides, `kv_block_span_bytes`, `q_block_grid`, `sink_is_f32` (1 for a FLOAT sink, else 0), -`num_kv_blocks`) and +`num_kv_blocks`, `block_table_width`) and `block_threads`. The loaded plan launches the same grid, `(num_kv_heads, q_block_grid)`, with `block_threads` threads. A load refuses a value of another type, an extra or missing value, or one outside what the kernel diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp index 145680e8f780..064b50f2c992 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedLaunchValues.hpp @@ -73,6 +73,8 @@ inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_KV_BLOCK_SPAN_BYTES_VA inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_Q_BLOCK_GRID_VALUE = "q_block_grid"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_SINK_IS_F32_VALUE = "sink_is_f32"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_NUM_KV_BLOCKS_VALUE = "num_kv_blocks"; +inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_BLOCK_TABLE_WIDTH_VALUE + = "block_table_width"; inline constexpr std::string_view ATTENTION_PAGED_UNIFIED_BLOCK_THREADS_VALUE = "block_threads"; /// The tensor uids a launch binds to device buffers. raggedOffset is NO_UID for a dense Q; @@ -121,6 +123,7 @@ struct AttentionPagedUnifiedScalars int32_t sinkIsF32 = 0; ///< 1: the sink is FLOAT; 0: in the Q data type, or no sink int32_t numKvBlocks = 0; ///< the K/V container's block count; a page id at or past it reads as masked + int32_t blockTableWidth = 0; ///< the page tables' row width M; a length is capped at M * block }; /// Everything a launch is computed from: block = (blockThreads, 1, 1) and @@ -141,7 +144,8 @@ hipdnn_plugin_sdk::ingestor::MetadataValues /// value must be in the range the kernel takes (int32, positive where the kernel divides /// by it or indexes with it), `scale` must be a finite float stored exactly, the head /// counts must divide, a dense Q needs `q_uniform_len` >= 1 and a ragged one 0, -/// `sink_is_f32` must be 0 or 1, `num_kv_blocks` must be positive, and `block_threads` must be a whole number of waves. +/// `sink_is_f32` must be 0 or 1, `num_kv_blocks` and `block_table_width` must be positive, +/// and `block_threads` must be a whole number of waves. /// /// @throws HipdnnPluginException with a load refusal when the dispatch name is not the /// contract, or when a value is missing, extra, of another type or out of range. diff --git a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp index a0e56cd2af09..255b1187506e 100644 --- a/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp +++ b/dnn-providers/hip-kernel-provider/src/engines/kernel_ingestor_engine/packs/AttentionPagedUnifiedNative.cpp @@ -901,7 +901,8 @@ std::vector kernelSignature() "kv_block_span_bytes", "q_block_grid", "sink_is_f32", - "num_kv_blocks"}) + "num_kv_blocks", + "block_table_width"}) { appendKernelArgument(signature, "by_value", I32, name); } @@ -1076,6 +1077,9 @@ class AttentionPagedUnifiedDispatchHandler : public IKernelDispatchHandler reference(const Problem& p, const HostState& s, float scale) constexpr uint16_t SENTINEL = 0x7e00; // a NaN in fp16, a finite value in bf16; checked bitwise -/// hipDNN's own SDPA reference (CpuFpReferenceSdpa, the dense path #14358's paged graphs +/// hipDNN's own SDPA reference (CpuFpReferenceSdpa, the dense path the paged graph bundles /// run through) over the same host state, as float O laid out like the device O /// ([tokens, Hq, D]): K and V gathered through their page tables, Q and O dense padded /// [B, Hq, Sq, D] with seq_len_q / seq_len_kv padding, and the ragged layout mapped by @@ -876,6 +876,24 @@ TEST_F(IntegrationGpuAttentionPagedUnified, PagedDecodeWithMaxSeqLenKvUnset) run(p); } +/// A batch of one: the page table's batch extent is 1, so hipDNN reads its row stride as +/// irrelevant. The length cap must come from the table's width, not from that stride, or +/// the sequence reads as empty and its row comes back zero. +TEST_F(IntegrationGpuAttentionPagedUnified, DecodeOfASingleSequence) +{ + for(const int32_t kv : {1, 17, 100, 384}) + { + SCOPED_TRACE("seq_len_kv = " + std::to_string(kv)); + Problem p = decodeProblem(DataType::BFLOAT16); + p.kvLengths = {kv}; + run(p); + if(::testing::Test::HasFatalFailure()) + { + return; + } + } +} + TEST_F(IntegrationGpuAttentionPagedUnified, DecodeHeadSizes64And256) { Problem small = decodeProblem(DataType::HALF); diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp index 7cc6c3c76e45..152ef7e0fc47 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedLaunchValues.cpp @@ -76,6 +76,7 @@ AttentionPagedUnifiedLaunchInputs denseInputs() s.kvBlockSpanBytes = 131072; s.qBlockGrid = 18; s.numKvBlocks = 4096; + s.blockTableWidth = 24; launch.blockThreads = 256; return launch; } @@ -167,6 +168,7 @@ void expectSameLaunch(const AttentionPagedUnifiedLaunchInputs& read, EXPECT_EQ(r.qBlockGrid, e.qBlockGrid); EXPECT_EQ(r.sinkIsF32, e.sinkIsF32); EXPECT_EQ(r.numKvBlocks, e.numKvBlocks); + EXPECT_EQ(r.blockTableWidth, e.blockTableWidth); EXPECT_EQ(read.blockThreads, expected.blockThreads); } @@ -221,6 +223,7 @@ TEST(TestAttentionPagedUnifiedLaunchValues, ValuesMatchTheV1Contract) {"q_block_grid", int64_t{18}}, {"sink_is_f32", int64_t{0}}, {"num_kv_blocks", int64_t{4096}}, + {"block_table_width", int64_t{24}}, {"block_threads", int64_t{256}}}; EXPECT_EQ(values, expected); EXPECT_EQ(ATTENTION_PAGED_UNIFIED_DISPATCH_SYMBOL_V1, @@ -288,7 +291,12 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnotherContractName) TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAMissingOptionalOrFloatValue) { for(const char* name : - {"sink.uid", "ragged_offset.uid", "scale", "sink_is_f32", "num_kv_blocks"}) + {"sink.uid", + "ragged_offset.uid", + "scale", + "sink_is_f32", + "num_kv_blocks", + "block_table_width"}) { SCOPED_TRACE(name); auto missing = saved(denseInputs()); @@ -337,6 +345,10 @@ TEST(TestAttentionPagedUnifiedLaunchValues, RefusesAnIntegerOutsideWhatTheKernel {&dense, "num_kv_blocks", 0}, // a K/V container holds at least one block {&dense, "num_kv_blocks", -1}, {&dense, "num_kv_blocks", int64_t{2147483648}}, + // A page-table row is at least one entry wide; a length is capped at its width. + {&dense, "block_table_width", 0}, + {&dense, "block_table_width", -1}, + {&dense, "block_table_width", int64_t{2147483648}}, {&dense, "block_table_stride", -1}, {&dense, "q_tok_stride", -1}, {&dense, "o_head_stride", int64_t{2147483648}}, diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp index 1047b5fe52a5..bc5319c9971d 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/packs/TestAttentionPagedUnifiedMatchers.cpp @@ -350,7 +350,7 @@ TEST(TestAttentionPagedUnifiedMatchers, ServesSeparateKAndVPageTables) const auto shared = match(decodeGraph()); ASSERT_TRUE(shared.has_value()); EXPECT_EQ(tryGetBoundInt(*shared, "attention_paged_unified.page_table_v.uid"), PAGE_TABLE_UID); - // A ragged Q with an unset max_seq_len_kv, as #14358's paged bundles build it. + // A ragged Q with an unset max_seq_len_kv, as the paged graph bundles build it. EXPECT_TRUE(match(raggedGraph(), [](d::GraphT& g) { useSeparateVTable(g); attrs(g).max_seq_len_kv = flatbuffers::nullopt; diff --git a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp index b4e165ceaac6..bbd8a5e76ede 100644 --- a/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp +++ b/dnn-providers/hip-kernel-provider/src/tests/engines/kernel_ingestor_engine/serialization/TestIngestorPlanLaunchContractGoldens.cpp @@ -280,6 +280,7 @@ MetadataValues attentionPagedUnifiedSampleValues() {"q_block_grid", int64_t{21}}, {"sink_is_f32", int64_t{1}}, {"num_kv_blocks", int64_t{8192}}, + {"block_table_width", int64_t{24}}, {"block_threads", int64_t{128}}}; } @@ -1068,119 +1069,122 @@ constexpr std::array GFX942_ATTENTION_DENSE_V1_PERSISTENT_THREE_P 0x05, 0x00, 0x00, 0x00, 0x61, 0x5F, 0x70, 0x74, 0x72, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x5F, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x00, 0x00}; -constexpr std::array ATTENTION_PAGED_UNIFIED_V1_GOLDEN = { +constexpr std::array ATTENTION_PAGED_UNIFIED_V1_GOLDEN = { 0x48, 0x4B, 0x49, 0x50, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x50, 0x3C, 0x95, 0x32, 0xB8, 0x77, 0x9B, 0x75, 0x07, 0xA6, 0x2D, 0x90, 0xA1, 0x93, 0xE7, 0xD6, - 0x0F, 0x4B, 0x81, 0x58, 0xA7, 0x40, 0x06, 0x49, 0x69, 0x3F, 0xAB, 0x8E, 0xAE, 0x21, 0xAD, 0x1E, - 0x24, 0x00, 0x00, 0x00, 0x48, 0x4B, 0x53, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2C, 0x00, 0x1C, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0C, 0x00, - 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xFC, 0x06, 0x00, 0x00, - 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x05, 0x00, 0x00, 0x00, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x38, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x68, 0x69, 0x70, 0x6B, 0x65, 0x72, 0x6E, 0x65, - 0x6C, 0x2E, 0x61, 0x74, 0x74, 0x65, 0x6E, 0x74, 0x69, 0x6F, 0x6E, 0x5F, 0x70, 0x61, 0x67, 0x65, - 0x64, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2E, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, - 0x63, 0x68, 0x2E, 0x76, 0x31, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, - 0xEC, 0x05, 0x00, 0x00, 0xB8, 0x05, 0x00, 0x00, 0x7C, 0x05, 0x00, 0x00, 0x44, 0x05, 0x00, 0x00, + 0x96, 0x3C, 0x2C, 0xA9, 0x89, 0x4E, 0x53, 0xBE, 0x1A, 0x8B, 0x78, 0x04, 0xDF, 0xBD, 0x5F, 0x76, + 0x86, 0x2A, 0xC2, 0xB2, 0xE6, 0x45, 0x5A, 0xE5, 0x1F, 0x7C, 0x52, 0xDF, 0x12, 0x90, 0xF2, 0x74, + 0x1C, 0x00, 0x00, 0x00, 0x48, 0x4B, 0x53, 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, + 0x20, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x2C, 0x00, 0x00, 0x00, 0x34, 0x07, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x05, 0x00, 0x00, 0x00, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, + 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x2D, 0x00, 0x00, 0x00, 0x68, 0x69, 0x70, 0x6B, 0x65, 0x72, 0x6E, 0x65, 0x6C, 0x2E, 0x61, 0x74, + 0x74, 0x65, 0x6E, 0x74, 0x69, 0x6F, 0x6E, 0x5F, 0x70, 0x61, 0x67, 0x65, 0x64, 0x5F, 0x75, 0x6E, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2E, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2E, 0x76, + 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x64, 0x06, 0x00, 0x00, 0x1C, 0x06, 0x00, 0x00, + 0xE8, 0x05, 0x00, 0x00, 0xBC, 0x05, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x44, 0x05, 0x00, 0x00, 0x10, 0x05, 0x00, 0x00, 0xDC, 0x04, 0x00, 0x00, 0xA8, 0x04, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xAC, 0x03, 0x00, 0x00, 0x78, 0x03, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x0C, 0x03, 0x00, 0x00, 0xD0, 0x02, 0x00, 0x00, 0xA0, 0x02, 0x00, 0x00, 0x6C, 0x02, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0xD0, 0x01, 0x00, 0x00, 0xA0, 0x01, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x9C, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x56, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x76, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x3E, 0xFA, 0xFF, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7E, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x0E, 0xFA, 0xFF, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4E, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x73, 0x6C, 0x69, 0x64, 0x69, 0x6E, 0x67, 0x5F, 0x77, 0x69, 0x6E, 0x64, - 0x6F, 0x77, 0x00, 0x00, 0xEE, 0xFA, 0xFF, 0xFF, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xB2, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x6F, 0x77, 0x00, 0x00, 0x4E, 0xFB, 0xFF, 0xFF, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x82, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x73, 0x69, 0x6E, 0x6B, 0x5F, 0x69, 0x73, 0x5F, - 0x66, 0x33, 0x32, 0x00, 0x1E, 0xFB, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xE2, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x66, 0x33, 0x32, 0x00, 0x7E, 0xFB, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xB2, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x73, 0x69, 0x6E, 0x6B, 0x2E, 0x75, 0x69, 0x64, - 0x00, 0x00, 0x00, 0x00, 0xCE, 0xFA, 0xFF, 0xFF, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x9E, 0xFA, 0xFF, 0xFF, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xDE, 0xFA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x5F, 0x6C, 0x65, 0x6E, 0x5F, 0x71, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0xFE, 0xFA, 0xFF, 0xFF, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0xCE, 0xFA, 0xFF, 0xFF, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x5F, 0x6C, 0x65, 0x6E, 0x5F, 0x6B, 0x76, 0x2E, 0x75, - 0x69, 0x64, 0x00, 0x00, 0x2E, 0xFB, 0xFF, 0xFF, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x00, 0x00, 0x00, 0xD6, 0xFB, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xFB, 0xFF, 0xFF, + 0x69, 0x64, 0x00, 0x00, 0xFE, 0xFA, 0xFF, 0xFF, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x36, 0xFC, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x6A, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x72, 0x61, 0x67, 0x67, 0x65, 0x64, 0x5F, 0x6F, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x0E, 0xFC, 0xFF, 0xFF, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xD2, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x6E, 0xFC, 0xFF, 0xFF, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xA2, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x75, 0x6E, 0x69, 0x66, 0x6F, 0x72, 0x6D, 0x5F, 0x6C, 0x65, 0x6E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, - 0xFE, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0xCE, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x74, 0x6F, 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, - 0x00, 0x00, 0x00, 0x00, 0xEE, 0xFB, 0xFF, 0xFF, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xBE, 0xFB, 0xFF, 0xFF, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFE, 0xFB, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x73, 0x65, 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, - 0x00, 0x00, 0x00, 0x00, 0x1E, 0xFC, 0xFF, 0xFF, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xEE, 0xFB, 0xFF, 0xFF, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, - 0x65, 0x00, 0x00, 0x00, 0x4E, 0xFC, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x8E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x65, 0x00, 0x00, 0x00, 0x1E, 0xFC, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x71, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x67, 0x72, 0x69, 0x64, - 0x00, 0x00, 0x00, 0x00, 0x7E, 0xFC, 0xFF, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBE, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x71, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x26, 0xFD, 0xFF, 0xFF, - 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0xFC, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x4E, 0xFC, 0xFF, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8E, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x71, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x86, 0xFD, 0xFF, 0xFF, + 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x70, 0x61, 0x67, 0x65, 0x5F, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x5F, 0x76, 0x2E, 0x75, 0x69, 0x64, - 0x00, 0x00, 0x00, 0x00, 0x5E, 0xFD, 0xFF, 0xFF, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x22, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xBE, 0xFD, 0xFF, 0xFF, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF2, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x70, 0x61, 0x67, 0x65, 0x5F, 0x74, 0x61, 0x62, - 0x6C, 0x65, 0x5F, 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x16, 0xFD, 0xFF, 0xFF, - 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x6C, 0x65, 0x5F, 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFC, 0xFF, 0xFF, + 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x74, 0x6F, - 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x46, 0xFD, 0xFF, 0xFF, - 0x81, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x16, 0xFD, 0xFF, 0xFF, + 0x81, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x73, 0x65, - 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x76, 0xFD, 0xFF, 0xFF, - 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x71, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x46, 0xFD, 0xFF, 0xFF, + 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x6F, 0x5F, 0x68, 0x65, - 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0xA6, 0xFD, 0xFF, 0xFF, - 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x76, 0xFD, 0xFF, 0xFF, + 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6F, 0x2E, 0x75, 0x69, - 0x64, 0x00, 0x00, 0x00, 0x4E, 0xFE, 0xFF, 0xFF, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x12, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0xAE, 0xFE, 0xFF, 0xFF, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xE2, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x73, 0x65, 0x71, 0x73, - 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFD, 0xFF, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xCE, 0xFD, 0xFF, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5F, 0x68, 0x65, - 0x61, 0x64, 0x73, 0x00, 0x2E, 0xFE, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x61, 0x64, 0x73, 0x00, 0xFE, 0xFD, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x6B, 0x76, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x73, - 0x00, 0x00, 0x00, 0x00, 0x5E, 0xFE, 0xFF, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x2E, 0xFE, 0xFF, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x6E, 0x75, 0x6D, 0x5F, 0x6B, 0x76, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, - 0x73, 0x00, 0x00, 0x00, 0x8E, 0xFE, 0xFF, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xCE, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x73, 0x00, 0x00, 0x00, 0x5E, 0xFE, 0xFF, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9E, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x74, 0x6F, 0x6B, 0x5F, 0x73, 0x74, 0x72, 0x69, 0x64, - 0x65, 0x00, 0x00, 0x00, 0xBE, 0xFE, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFE, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x65, 0x00, 0x00, 0x00, 0x8E, 0xFE, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xCE, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x68, 0x65, 0x61, 0x64, 0x5F, 0x73, 0x74, 0x72, 0x69, - 0x64, 0x65, 0x00, 0x00, 0xEE, 0xFE, 0xFF, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2E, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x64, 0x65, 0x00, 0x00, 0xBE, 0xFE, 0xFF, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFE, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x73, 0x74, 0x72, - 0x69, 0x64, 0x65, 0x00, 0x9E, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x62, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, - 0x1C, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x6B, 0x76, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, - 0x5F, 0x73, 0x70, 0x61, 0x6E, 0x5F, 0x62, 0x79, 0x74, 0x65, 0x73, 0x00, 0xD6, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x06, 0x00, 0x10, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCA, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, - 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x00, 0x06, 0x00, - 0x0E, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x69, 0x64, 0x65, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x6B, 0x76, 0x5F, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x73, 0x70, 0x61, 0x6E, 0x5F, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x00, 0x2E, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6E, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x6B, 0x2E, 0x75, 0x69, 0x64, 0x00, 0x00, 0x00, 0x56, 0xFF, 0xFF, 0xFF, + 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x62, 0x6C, 0x6F, 0x63, + 0x6B, 0x5F, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x00, 0x00, 0x00, 0x86, 0xFF, 0xFF, 0xFF, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x62, 0x6C, 0x6F, 0x63, + 0x6B, 0x5F, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x5F, 0x77, 0x69, 0x64, 0x74, 0x68, 0x00, 0x06, 0x00, + 0x0E, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x5F, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x5F, 0x73, 0x74, 0x72, 0x69, @@ -1598,6 +1602,7 @@ TEST(TestIngestorPlanLaunchContractGoldens, AttentionPagedUnifiedV1SampleStillRe EXPECT_EQ(s.qBlockGrid, 21); EXPECT_EQ(s.sinkIsF32, 1); EXPECT_EQ(s.numKvBlocks, 8192); + EXPECT_EQ(s.blockTableWidth, 24); EXPECT_EQ(launch.blockThreads, 128); }