Handling JAX
Oghenevwogaga Ebresafe, Daniel Zheng, Gordon Plotkin, Ningning Xie
Abstract
Languages that target hardware accelerators typically expose a restricted, first-order core without recursion or first-class functions, leaving programmers without a principled way to express computational effects. This paper presents a technique for compiling effect handlers to such a constrained target. We introduce a novel translation that statically eliminates effect handlers, and prove that it preserves both typing and semantics. Moreover, we address the challenges of integrating effect handlers with structured control flow, where continuations cannot be constructed statically. The calculus and all our results are fully mechanized in the Lean 4 proof assistant. Finally, we implement our design as a library for JAX, a Python domain-specific language for accelerator programming, and demonstrate its expressiveness through practical case studies.
Create a lesson
Related papers
Silent Degradation during Auto-Vectorization of bf16/fp16 on RISC-V Under LLVM
Vaishnavi Kouru, Robert Chun
Functional Logic Programming: Improving Logic Programs with Ease
Michael Hanus
Vectorizing Recurrences over Semirings
Yihong Zhang, Bala Vinaithirthan, Karima Ma et al.
MBUndo: Sound, Automatic, and Efficient Measurement-Based Uncomputation for Quantum Circuits
Shengyuan Yang, Charles Yuan
te-comp: A Complete MLIR Compiler Generating Self-Contained C Inference Engines for MCUs
Van Chan Ngo
Stochastic Summaries: Characterizing Structured Datasets Using Probabilistic Programs
Jack Stanek, Adithya Murali