loopyt 29fed050cb feat(triton): port the paged KV cache read and write
store_kv_cache and load_paged_kv_cache, both byte-for-byte identical to the TileLang baseline on
the layouts SM90 uses: main/SWA KV (e4m3 values, ue8m0 scale bytes, 528 B per token) and index KV
(128 fp8 + one fp32 scale, 132 B per token). The store also covers fp32 scales, because the index
layout uses them. FP4 caches and the packed-ue8m0 index layout are refused instead of approximated.

Store cases compare the whole cache buffer, including the `-1` invalid-slot path and a block size
(134) that is not a power of two. Load cases cover dequantising to BF16, the index passthrough,
and holes expressed as `src_block_id == -1`.

Two traps worth recording:

The load kernel's `other=` default has to be a float literal. With an fp8 source pointer, `other=0`
fails to type-check with a message about casting an int32 tile to fp8e4nv, which points at the
wrong line.

The load cases originally filled the cache with random bytes. Random bytes decode as fp8 NaN and as
NaN scale factors, and NaN compares unequal to itself, so the harness reported mismatches that said
nothing about the kernel. The cases now build the cache with `store_kv_cache` and compare index
outputs as raw bytes, where a NaN bit pattern is just a byte pattern.

15 kernels and 62 cases agree.
2026-10-22 00:33:33 +08:00
..
asc initial commit 2026-10-20 12:09:42 +08:00
cuda initial commit 2026-10-20 12:09:42 +08:00
triton feat(triton): port the paged KV cache read and write 2026-10-22 00:33:33 +08:00
__init__.py initial commit 2026-10-20 12:09:42 +08:00
cache_common.py feat: add SM90 (Hopper) support for DeepSeek-V4.1 inference 2026-10-21 15:18:56 +08:00
candidate_blocks.py initial commit 2026-10-20 12:09:42 +08:00
common.py initial commit 2026-10-20 12:09:42 +08:00
compress.py initial commit 2026-10-20 12:09:42 +08:00
compute_seqlens_k_zos.py initial commit 2026-10-20 12:09:42 +08:00
conftest.py initial commit 2026-10-20 12:09:42 +08:00
dflash_copy.py initial commit 2026-10-20 12:09:42 +08:00
dflash.py initial commit 2026-10-20 12:09:42 +08:00
flash_mla_utils.py initial commit 2026-10-20 12:09:42 +08:00
fused_sample.py initial commit 2026-10-20 12:09:42 +08:00
fused_transform.py feat: add SM90 (Hopper) support for DeepSeek-V4.1 inference 2026-10-21 15:18:56 +08:00
gather_engram_tokens_zos.py initial commit 2026-10-20 12:09:42 +08:00
gather_input_ids_zos.py initial commit 2026-10-20 12:09:42 +08:00
gather.py initial commit 2026-10-20 12:09:42 +08:00
get_kv_index.py initial commit 2026-10-20 12:09:42 +08:00
image_embed_ops.py initial commit 2026-10-20 12:09:42 +08:00
kv_index_cat.py initial commit 2026-10-20 12:09:42 +08:00
load_paged_kv_cache.py initial commit 2026-10-20 12:09:42 +08:00
norm.py initial commit 2026-10-20 12:09:42 +08:00
ops.py feat(triton): complete P1 with norm, lookup and metadata kernels 2026-10-22 00:28:38 +08:00
outlier_detection.py initial commit 2026-10-20 12:09:42 +08:00
prepare_cp_mirror.py initial commit 2026-10-20 12:09:42 +08:00
prepare_v4_decode_metadata.py initial commit 2026-10-20 12:09:42 +08:00
random_sampling.py initial commit 2026-10-20 12:09:42 +08:00
sampler.py initial commit 2026-10-20 12:09:42 +08:00
schedule_mtp_varlen.py initial commit 2026-10-20 12:09:42 +08:00
state_cache.py initial commit 2026-10-20 12:09:42 +08:00
store_kv_cache.py initial commit 2026-10-20 12:09:42 +08:00
store_mtp_info.py initial commit 2026-10-20 12:09:42 +08:00
structure_output.py initial commit 2026-10-20 12:09:42 +08:00
sum_smaller_probs.py initial commit 2026-10-20 12:09:42 +08:00
swa_index.py initial commit 2026-10-20 12:09:42 +08:00