loopyt a6c3e69e67 feat(triton): port eight P1 kernels, all A/B identical to TileLang
gather, gather_input_ids_zos, gather_engram_tokens_zos, expand_swa_index, kv_index_cat,
convert_kv_index, load_kv_index, store_mtp_info. 45 cases, every one bitwise identical to the
TileLang baseline through the shared interface function.

`scripts/h20_ops_ab.py` swaps `ops.<name>_tl` between the two backends and runs the public call
once per side, so the comparison exercises the interface layer's shape handling too, not just the
kernel. `scripts/ab_cases.py` holds the cases: real engine widths and dtypes, negative indices
for gather, -1 padding for the index kernels, page-boundary lengths, the slot-0 no-write path,
and the engram image-sentinel rule.

Five Triton semantics traps worth writing down, all documented in the plan:

- `tl.where` evaluates both arms, so `tl.where(i == 0, 0, LOAD(i - 1))` really reads `LOAD[-1]`;
  that was an illegal memory access, fixed by clamping the index instead.
- A scalar pointer cannot carry a block-shaped mask; it has to be broadcast with
  `+ tl.zeros((BLOCK,), tl.int32)` first.
- Two arms of one kernel cannot use different tile shapes, which is why `kv_index_cat` became two
  launches rather than one fused kernel with a column-block branch.
- Triton's `data_ptr()` already includes a view's storage offset, so passing `out[:, w:w+k]` and
  adding `w` again double-counts -- that showed up as 0x01010101 in the second half.
- Test-case capacity matters: `store_mtp_info` addresses `slot * nextn + step`, so the pool needs
  `(max_slot + 1) * nextn` rows; too few rows let both backends write out of bounds and disagree.
2026-10-22 00:11:45 +08:00
..
tilelang_ops feat(triton): port eight P1 kernels, all A/B identical to TileLang 2026-10-22 00:11:45 +08:00
__init__.py initial commit 2026-10-20 12:09:42 +08:00
attention_backend.py initial commit 2026-10-20 12:09:42 +08:00
layernorm.py initial commit 2026-10-20 12:09:42 +08:00
linear.py feat: add SM90 (Hopper) support for DeepSeek-V4.1 inference 2026-10-21 15:18:56 +08:00
mtp_info_pool.py initial commit 2026-10-20 12:09:42 +08:00
rotary_embedding.py initial commit 2026-10-20 12:09:42 +08:00
sampler_utils.py initial commit 2026-10-20 12:09:42 +08:00
sampler.py fix(debug): move debug_dump out of h20_ops so other platforms can import it 2026-10-21 22:37:49 +08:00
vocab_parallel_embedding.py initial commit 2026-10-20 12:09:42 +08:00