OCANNL: OCaml Compiles Algorithms for Neural Networks Learning
OCANNL (OCaml Compiles Algorithms for Neural Networks Learning) is a from-scratch compiled deep learning framework with an optimizing compiler, built in OCaml. The system comprises two main packages: arrayjit, which provides low-level intermediate representation, lowering, scheduling, and backend code generation for CPU and GPUs (CUDA, HIP, Metal); and neural_nets_lib, which offers a high-level tensor domain-specific language, shape inference, automatic differentiation, and reusable neural network blocks. The project is designed for users to build and train models through tensor expressions that are compiled down to optimized machine code, with support for multiple hardware backends and a comprehensive test suite including cross-framework benchmarks against PyTorch and tinygrad.