Developer builds Python PTX compiler for GPU kernels, debugging a silent hang
A developer describes building a PTX compiler in plain Python for the Emmy Hackathon 2026, which converts a kernel IR in JSON into NVIDIA PTX assembly on stdout. The rules banned using existing toolchains such as Emmy's CUDA C++ emitter, nvcc, or LLVM, so the translation had to be written from scratch, with only deserialization provided. The author says all 15 benchmark problems pass on an RTX 5090, and argues that single-pass lowering avoids the 100 to 300 millisecond frontend overhead that LLVM-based pipelines impose on autotuning workloads. The compiler is organized into a driver, a codegen context, expression lowering, and statement lowering, with details such as a table-driven accumulation mapping and big-endian float constant encoding. The post focuses on small, specific failures encountered along the way.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in