Skip to content
LATEST
Technology

xqlsystems demo infers FlashAttention kernel from 25 SQL lines

A Hacker News post and GitHub file describe a database-style route to tensor optimization, but provide no independent performance benchmark.

xqlsystems demo infers FlashAttention kernel from 25 SQL lines

xqlsystems published a Hacker News “Show HN” post on Oct. 30 saying its demo can infer a FlashAttention-style kernel from about 25 lines of SQL expressing vanilla attention.

The claim matters because the linked GitHub file is a 322-line Python demo, including 282 lines of code, that presents query planning as an alternative route to writing accelerator-oriented tensor programs directly.

The post said the demo depends on three portable SQL extensions under development: xarray-sql, ddx and einfold. It described xarray-sql as representing petabyte-scale array datasets in cloud tables, ddx as adding automatic differentiation to SQL, and einfold as planning tensor contractions in SQL.

“My hope is that the relational model and algebra provide fresh perspectives on how we might do accelerator programming,” the Hacker News post said. It added that its thesis is to separate the logical layers of a tensor program from the physical layers.

The GitHub file describes attention, the transformer operation commonly written as softmax(Q·Kᵀ/√d)·V, using tables for Q, K and V. In the demo, the feature dimension is 64, so scores are scaled by 1/√64, or 1/8.

The file says a naive SQL plan stores all N×N attention scores. It says FlashAttention, citing Dao et al. 2022, computes the same result without storing those scores by streaming blocks and keeping a running softmax.

The demo says einfold finds a fused plan from two SQL spellings of attention, one using a window expression and one using a group-by form. It also includes a Nadaraya–Watson estimator as a non-attention control and says the same fusion rule applies there.

The script checks forward results against JAX, Google’s differentiable array-programming library, and uses ddx to compute gradients with respect to Q, K and V. Automatic differentiation means computing derivatives of a program, a core operation in training neural networks.

The material is a developer demo and repository file, not an independent benchmark. The supplied Hacker News snapshot showed 5 points and 0 comments, and the GitHub page said the file did not exist on the default branch.

Source: Hacker News “Show HN” post and GitHub repository file, Oct. 30, 2026

More stories

Latest news