Skip to main content
MXFrame MX lightning mark

🚀 MXFrame

GPU-accelerated DataFrames — Python ergonomics, Mojo AOT kernels.

MXFrame is a DataFrame query engine that pairs a Polars-style Python API with pre-compiled Mojo AOT kernels. The current GPU build is validated on NVIDIA; AMD and Apple Silicon validation remain on the roadmap.

TPC-H Python Platform License


✨ Why MXFrame?

pandas Polars cuDF (RAPIDS) MXFrame
GPU support ✅ NVIDIA NVIDIA validated
Compiled kernels ✅ Rust ✅ CUDA Mojo AOT
Install complexity pip pip CUDA + RAPIDS stack pip or pixi
TPC-H coverage reference 22/22
Portable kernel design CPU CUDA ✅ NVIDIA today; AMD/Apple planned

MXFrame uses a portable Mojo kernel architecture rather than CUDA-specific source. Kernels compile once to shared libraries and dispatch directly at runtime.

What changed in v0.4 and v0.5

  • v0.4.0 — correct string/composite joins: shared dictionaries assign identical dense IDs across both join sides; mixed composite keys and SQL null semantics are preserved.
  • v0.5.0 — native GPU UTF-8 predicates: startswith, literal contains, string equality/inequality, and packed non-null literal isin operate directly on Arrow offsets and byte buffers.
  • v0.5.0 — weak-query fusion: dedicated compact GPU paths remove expanded intermediates from Q4, Q6, Q13, and Q21.
  • v0.5.0 — bounded benchmarking and visualization: every query/engine runs in an isolated process; Q4, Q6, Q12, Q13, Q14, and Q21 have step-by-step kernel visualizations.

See v0.5.0 release notes for measured gains, limitations, and the parity roadmap.


⚡ Quick Start

# 1. Install pixi (Modular's package manager)
curl -fsSL https://pixi.sh/install.sh | bash

# 2. Clone and set up
git clone https://github.com/abhisheksreesaila/mxframe
cd mxframe
pixi install

# 3. Verify GPU is working
pixi run python3 scripts/_check_gpu.py
import pyarrow as pa
from mxframe import LazyFrame, Scan, col, lit

data = pa.table({
    "dept":   pa.array(["eng", "eng", "mkt", "mkt", "eng"]),
    "salary": pa.array([120.0, 95.0, 80.0, 110.0, 130.0], pa.float32()),
    "age":    pa.array([32, 28, 35, 29, 40], pa.int32()),
})

result = (
    LazyFrame(Scan(data))
    .filter(col("age") > lit(28))
    .groupby("dept")
    .agg(
        col("salary").sum().alias("total_salary"),
        col("age").count().alias("headcount"),
    )
    .sort(col("total_salary"), descending=True)
    .compute(device="gpu")   # or "cpu"
)
print(result.to_pandas())
  dept  total_salary  headcount
0  eng         345.0          3
1  mkt         110.0          1

📊 Performance — bounded v0.5.0 benchmark

RTX 3090, warm median of three runs. Every query and engine ran in its own process so Arrow, Pandas, and CUDA allocations were released between measurements.

  • 1M: MX CPU beat Polars on 22/22; MX GPU beat Polars on 15/17 comparable paths.
  • 10M: MX CPU beat Polars on 18/22; MX GPU beat Polars on 14/17 comparable paths.
  • Q8 GPU remains N/A:JIT; Q15, Q17, Q18, and Q20 GPU workers exceeded the bounded timeout.
  • cuDF was unavailable on this machine, so RAPIDS remains N/A and no RAPIDS parity claim is made.

1M representative queries

Query MX CPU MX GPU Polars Best MX speedup
Q4 · Order priority 12.8 ms 3.4 ms 20.2 ms 5.9× GPU
Q6 · Discounted revenue 6.7 ms 6.8 ms 10.8 ms 1.6× CPU
Q12 · Shipping modes 0.6 ms 6.1 ms 26.6 ms 44.3× CPU
Q13 · Customer distribution 20.4 ms 1.8 ms 26.5 ms 14.7× GPU
Q21 · Waiting suppliers 27.1 ms 6.6 ms 30.2 ms 4.6× GPU

10M representative queries

Query MX CPU MX GPU Polars Best MX speedup
Q4 · Order priority 265.1 ms 28.6 ms 105.4 ms 3.7× GPU
Q9 · Product profit 2.0 ms 16.5 ms 109.7 ms 54.9× CPU
Q12 · Shipping modes 1.5 ms 8.2 ms 128.0 ms 85.3× CPU
Q13 · Customer distribution 368.8 ms 28.5 ms 442.0 ms 15.5× GPU
Q21 · Waiting suppliers 1068.7 ms 49.8 ms 99.1 ms 2.0× GPU

Full matrices: 1M CSV · 10M CSV · methodology and kernel catalogue

What remains for parity

Performance parity: replace Q8's JIT path; fix Q15/Q17/Q18/Q20 GPU timeouts; improve Q1 and Q14 GPU execution; run synchronized 1M/10M measurements on a compatible RAPIDS/cuDF environment.

Feature parity: native GPU UTF-8 dictionary construction and string/date gather; GPU windows; semi/anti/as-of/range joins; broader string/regex, datetime, nested-type, reshape, SQL, streaming, and I/O pushdown coverage.


📚 Docs

v0.5.0 Release Notes v0.4/v0.5 gains, benchmark evidence, known gaps, and parity roadmap
API Reference LazyFrame, expressions, SQL frontend, supported operations, running tests
Benchmarks Full TPC-H tables, kernel catalogue, limitations, roadmap, reproduce instructions
Architecture Design philosophy, internal layers, how MAX Graph fits in
Kernel Visualizer Interactive plans, dispatch boundaries, GPU threads, and output masks
Contributing Dev setup, writing Mojo kernels, adding queries

📦 Dependencies

Package Required Purpose
pyarrow >= 14 Column storage, zero-copy NumPy bridge
numpy >= 1.24 Vectorized pre/post processing
pandas >= 2.0 Reference implementations
modular >= 26.4 GPU only MAX Engine runtime, Mojo GPU dispatch
polars >= 0.20 optional Benchmark comparison
sqlglot >= 25 optional SQL frontend parsing

📄 License

Apache 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mxframe-0.5.0.tar.gz (354.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mxframe-0.5.0-py3-none-manylinux_2_34_x86_64.whl (347.2 kB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

File details

Details for the file mxframe-0.5.0.tar.gz.

File metadata

  • Download URL: mxframe-0.5.0.tar.gz
  • Upload date:
  • Size: 354.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mxframe-0.5.0.tar.gz
Algorithm Hash digest
SHA256 5d86d3b5d85f24c743bfef1dce1fd635a2fb741f239fa20229c9523e65db3401
MD5 e754d8fb45786c8fa50105dcdcb49b8b
BLAKE2b-256 c96d011b318e5e8660fa54d24fd480be0110d21f6737ac203adf819da91e0eca

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxframe-0.5.0.tar.gz:

Publisher: publish.yml on abhisheksreesaila/mxframe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxframe-0.5.0-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for mxframe-0.5.0-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 742a6ec5e501e25d10c5260a1e46e6c3818a506981a4bab4b89fa16047af1805
MD5 7fd2466f1e1c6cc145b7e47c82a3dd94
BLAKE2b-256 5b681d0843f25d92da31ed697dd40bbdd28dc8b98a6c8e4d26aeae163c9eeaff

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxframe-0.5.0-py3-none-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on abhisheksreesaila/mxframe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.3.0

2 files

0.2.3

2 files

0.2.1

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page