DumPy: A Simpler Array Language for GPUs, Ditching the NumPy Brain Drain

2025-05-24
DumPy: A Simpler Array Language for GPUs, Ditching the NumPy Brain Drain

The author criticizes NumPy's complexity and inefficiency in handling higher-dimensional arrays, particularly its intricate broadcasting and indexing rules, forcing programmers to constantly think about array shapes and function behaviors. To address this, they propose DumPy, a simpler array language that leverages the syntax of loops and indices, secretly compiling them into vectorized operations for GPU acceleration, thereby avoiding the complexities introduced in NumPy to circumvent slow loops. DumPy's core idea is to map dimensions to labels and use JAX's `vmap` function for vectorization, simplifying code and boosting efficiency. The author provides examples comparing DumPy, NumPy, JAX, and pure loops, demonstrating DumPy's superior conciseness and performance.

Development