HeadlinesBriefing favicon HeadlinesBriefing.com

SQL for Neural Networks: A New Frontier

Hacker News •
×

While on a babymoon in Corfu, Greece, the author of Xarray-SQL, an array database library, had a revelation: common geospatial and climate science operations, even at the 100 TB scale, could be expressed as relational operations in SQL. This insight was spurred by a GSoC intern's addition of a `to_dataset()` feature, enabling roundtrip conversions between array and tabular data models.

Key to this discovery was realizing that regridding, a core operation, is essentially a sparse matrix-vector product, expressible in SQL as a `SUM(val * val) JOIN GROUP BY` operation. This led to the idea of pushing physics calculations, not just post-processing, into the database. By implementing autograd on top of DataFusion, the author found that partial differentiation operations, crucial for neural networks, simplified to row-wise operations in their array model.

This work, presented at DataFusion's showcase, suggests SQL's potential for building neural networks. The author posits that the relational database's logical-physical layer independence could facilitate the creation of state-of-the-art distributed systems for training, potentially managing over 1000+ GPUs. Scientists and engineers are exploring this concept at xql.systems.