@pradheepraop: implemented the top-k kernel from the kernel design section in the msa paper. https://github.com/Mantissagithub/learn_c…
Summary
Implemented a top-k kernel from the kernel design section of the MSA paper, using exp-free comparison and warp-level tree merging with CUDA shuffles. The code is available on GitHub.
View Cached Full Text
Cached at: 06/15/26, 01:04 PM
implemented the top-k kernel from the kernel design section in the msa paper.
https://github.com/Mantissagithub/learn_cuda/blob/msa/07_projects/msa/top_k.cu…
it comes with two ideas:
- exp-free comparison: no need to compute softmax, since softmax preserves ordering
- each warp lane scans a 1/32 stride, keeps a small local top-k, and tree-merges the results with shuffles
ended up revising cuda the whole night and also cleaned up my learn_cuda repo, so any feedback/optimizations are welcome.
Mantissagithub/learn_cuda
Source: https://github.com/Mantissagithub/learn_cuda
learn_cuda
Learning cuda (aka gpu programming)
Similar Articles
MSLK kernel reference (Website)
Documentation reference for MSLK 1.3.0, a library of fused GPU kernels for transformer workloads including attention, quantization, GEMM, and MoE routing, supporting CUDA and ROCm with PyTorch integration.
AdaExplore: Failure-Driven Adaptation and Diversity-Preserving Search for Efficient Kernel Generation
Researchers from Carnegie Mellon, University of Washington, and Arm propose AdaExplore, an LLM agent framework for GPU kernel code generation that achieves 3.12× and 1.72× speedups on KernelBench Level-2 and Level-3 benchmarks through failure-driven adaptation and diversity-preserving search, without additional fine-tuning.
Auto-research with codex: How I achieved a 232x Faster Kernel
A blog post detailing how the author used Codex to optimize a kernel in a GPU Mode contest, achieving a 232x speedup in QR decomposition and sharing learnings on auto-research.
@dejavucoder: my latest blog post "auto-research with codex: how I achieved a 212x faster kernel over baseline with codex in GPU Mode…
Blog post by Sankalp detailing how he used Codex to achieve a 232x faster GPU kernel for QR decomposition in GPU Mode's contest, outlining his auto-research methodology.
@songhan_mit: Explore KDA (Kernel Design Agents): https://github.com/mit-han-lab/kernel-design-agents…
KDA (Kernel Design Agents) is an open-source agent-centric workflow from MIT HAN Lab for using coding agents to research, implement, verify, and iterate on performance-sensitive CUDA kernel tasks. It helped Databricks achieve rank #1 on NVIDIA's SOL-ExecBench leaderboard.