# Clio AI

- **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:** [Ankit Maloo](https://cerebralvalley.ai/u/ankitm)
- **GitHub:** https://github.com/ankitmaloo/helionhack/blob/main/helion_targets/gated_deltanet_recompute_w_u/submission/submission.py
- **Gallery:** https://cerebralvalley.ai/e/helion-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/helion-hackathon/hackathon/gallery/5

gated_deltanet_recompute_w_u/submission/submission.py in the repo computes the Gated DeltaNet WY-transform forward outputs (w, u) from raw inputs (k, v, beta, A, g). Functionally, it applies the per-chunk WY matrix A over sequence tiles of size 64, producing u = A @ (v * beta) and w = A @ (k * beta * exp(g)). The optimized kernel runs directly on the original [B, T, H, D] layout, fuses both output paths in one kernel, and computes the gating terms inside the kernel instead of materializing chunked or pre-scaled temporaries on the host.

Performance-wise, the final promoted version is in the low single-digit microsecond range on the tuned benchmark shapes. On the official evaluator it measured about 7.07 us mean runtime with correctness passing. The main gains came from three structural improvements: removing chunk/unchunk materialization, removing pre-scaled 4D temporaries, and moving beta * exp(g) formation into the kernel hot path. The final round also showed that the best large-shape config uses block_sizes=[64, 64], which brought the tuned kernel down from about 7.97 us to about 7.10 us.

---

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