# KernIt_Raj

- **Event:** [PyTorch Helion Hackathon](https://cerebralvalley.ai/e/helion-hackathon)
- **When:** Sat, Mar 14 at 9:00 AM – 10:00 PM (PDT)
- **Where:** Shack15, San Francisco, CA
- **Team:** [Raj Kolamuri](https://cerebralvalley.ai/u/rajkolamuri)
- **GitHub:** https://github.com/rajk97/helion-hackathon-kernels/blob/main/problems/helion/causal_conv1d_py/submission.py
- **Gallery:** https://cerebralvalley.ai/e/helion-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/helion-hackathon/hackathon/gallery/10

Leaderboard name: bloomberg9383

All 5 kernels implemented in Helion DSL for Gated DeltaNet on B200:

1. fp8_quant: FP8 group quantization — computes per-group absmax and scales, quantizes to float8_e4m3fn. Straightforward elementwise kernel.

2. causal_conv1d: Causal depthwise 1D convolution — eliminated input padding by computing directly on raw input with clamped indices and validity masking, halving memory bandwidth. Uses [1,512] block tiling with 1 warp for maximum S-dimension coalescing. ~10.5μs geomean across benchmark shapes.

3. gated_deltanet_chunk_fwd_h: Inter-chunk state recurrence (h = decay * h + key^T * value) — sequential across chunks with hl.dot() matmuls. Autotuned per-shape configs with pointer indexing.

4. gated_deltanet_chunk_fwd_o: Intra/inter-chunk output computation with causal attention masking — uses hl.dot() for all matmuls (QK^T, attention*V, state contribution). Optimized with persistent_blocked scheduling, block_ptr indexing, and range flattening. ~17.7μs geomean.

5. gated_deltanet_recompute_w_u: WY-transform forward pass — parallel matmul-heavy kernel using hl.dot() for matrix products. Autotuned with per-shape block sizes and warp counts.

Key optimizations: removed baseline redundant computations, replaced element-wise accumulation with hl.dot(), per-shape autotuned configs with static_shapes=True, persistent_blocked PID scheduling for L2 locality.

---

Markdown version of https://cerebralvalley.ai/e/helion-hackathon/hackathon/gallery/10. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
