Repository navigation
Releases
MXFrame v0.6.0
MXFrame 0.6.0: a native Mojo CPU engine
The CPU engine is now a native Mojo executor. Each query stage (the scan, filter, joins, group-by,
DISTINCT, top-N and COUNT(DISTINCT)) runs in one call to an ahead-of-time compiled shared library,
directly on Arrow memory. Python only plans the query.
Numbers (engine-only, first run, one build, quiet machine)
Loading data is staging. The clock covers the query and its materialized result, in a fresh
process, on the first run. Every MXFrame result equals DuckDB's.
| TPC-H, total of 22 queries | MXFrame (CPU) | Polars | DuckDB |
|---|---|---|---|
| SF10 | 3.15 s | 14.40 s | 5.08 s |
| SF1 | 0.47 s | 1.31 s | 0.63 s |
| SF10, rows shuffled | 4.97 s | 15.06 s | 5.55 s |
| SF1, rows shuffled | 0.61 s | 1.41 s | 0.66 s |
Seeded random queries over the TPC-H tables (filters, group-bys, joins, top-N, DISTINCT,
COUNT(DISTINCT), HAVING). Each figure is the geometric mean of DuckDB time / MXFrame time, so
above 1x means MXFrame is faster:
| SF1 | SF1, rows shuffled | SF10 | |
|---|---|---|---|
| all queries | 0.83x | 1.21x | 1.09x |
Read honestly:
- Much of the TPC-H lead over DuckDB comes from Q21. Leaving Q21 out, DuckDB's SF10 total is
lower: 2.27 s against 2.41 s on stored rows, and 2.79 s against 3.63 s on shuffled rows. - DuckDB is still faster on 12 of the 22 TPC-H queries at SF10, mostly joins.
- On random queries DuckDB still leads at SF1 (0.83x overall). At both SF1 and SF10 it also leads
on SELECT DISTINCT, COUNT(DISTINCT), top-N and joins. - MXFrame is faster than Polars on 20 of the 21 verified TPC-H queries at SF10.
Details: How the CPU engine got fast
and docs/optimizations.md.
What's new
- Native Mojo executor (
libmxexec_cpu.so, over the Arrow C Data Interface):- a bytecode interpreter for predicates and expressions;
- a group-by specialized at compile time;
- joins fused into the scan (star, semi, anti and nested);
- native DISTINCT, ORDER BY ... LIMIT, WHERE + ORDER BY + LIMIT in one pass, and
COUNT(DISTINCT); - one thread per physical core.
- Dictionary strings stay as codes through joins, filters, SELECT DISTINCT and
COUNT(DISTINCT). Only the rows that reach the output are decoded. - Many-group aggregation into one shared output; a runtime join filter for large semi-join
partners; nativestr_sliceand utf8isin. - Parquet, SQL and planning:
mx.scan_parquetwith projection and filter pushdown;- an
mx.sqlfront end; - the
device="auto"planner with explain and fallback.
- Benchmarks:
- an engine-only TPC-H scoreboard (
scripts/bench_user_felt.py --mode engine [--shuffle]); - a seeded random-query suite (
scripts/bench_random/); - all results checked against DuckDB.
- an engine-only TPC-H scoreboard (
Full list: CHANGELOG.md.
Known limits
- MXFrame still reads Parquet through PyArrow (F-021). Times that include the read are reported
separately and have not been re-run. - The COUNT(DISTINCT) on dictionary codes applies to
device="cpu".device="auto"decodes the
counted column first. HAVINGinmx.sqlis dropped without an error (open bug).
MXFrame v0.5.0
v0.3.0 — Docs restructure, fresh-join benchmarks, Mojo 26.4
What's new in v0.3.0
This is a documentation and benchmark accuracy release built on top of the v0.2.3 engine (Mojo 26.4 + AOT join/sort pipeline).
📚 Docs restructure
- README trimmed from 543 → 119 lines — focused intro, quick start, 4-row teaser, links to detailed docs
- New
docs/benchmarks.md— full 22-query TPC-H tables (1 M + 10 M rows), Mojo kernel catalogue, current limitations, roadmap, reproduce instructions - New
docs/api.md— LazyFrame methods, expression syntax, SQL frontend, supported operations, project structure, running tests docs/vision-and-architecture.md— fixed garbled sections; all milestones marked ✅ donedocs/archive/gitignored — old dev notes removed from published repo
📊 Benchmark accuracy
- Q5/Q7/Q8/Q10/Q13/Q19 re-measured with per-run join-cache clearing (fresh-join)
- Previous v0.2.0 numbers for those queries were warm join-cache hits — now corrected
- Summary: CPU 20/22 (Q13 loses fresh-join), GPU 12/22 at 1 M rows
- Q8 GPU marked
—(MAX Graphyear()groupby JIT too slow; Phase 6 target)
🔧 Dependency update
modular >= 26.4now declared inpyproject.tomlruntime deps
⚡ Engine (carried from v0.2.3)
All v0.2.3 engine improvements are included:
- Mojo 26.4 migration,
_atomic.mojoMLIR shim, AOTabi("C")fix - Phase 4: AOT GPU join pipeline (cold-start 300 ms → 70 ms)
- Phase 5: AOT GPU sort + top-k (bitonic sort,
ORDER BY … LIMIT kfused) group_count_f32_gpushared-mem fix (Q1 GPU: 87 ms → 42 ms)
📦 Install
# TestPyPI
pip install -i https://test.pypi.org/simple/ mxframe==0.3.0
# PyPI
pip install mxframe==0.3.0Requires modular >= 26.4 for GPU support. See docs/benchmarks.md for full TPC-H results.
v0.2.3 — Mojo 26.4 migration + AOT GPU join & sort pipeline
What's new in v0.2.3
🚀 Mojo 26.4 (1.0.0b2) migration
- Full migration from Mojo 26.2 → 26.4 across all kernels and AOT files
- New
_atomic.mojoshim using MLIRllvm.atomicrmw/llvm.cmpxchg(replaces removedstd.os.atomic.Atomic) - Added
abi("C")to all@exportfunctions — required by Mojo 26.4 (fixes CI segfault) - Removed
@always_inlinefrom Atomic struct methods — eliminates 2-min JIT blowup on large kernels - Requires
modular >= 26.4
⚡ Phase 4 — Device-resident AOT GPU join pipeline
join_count_i32_gpu+join_scatter_i32_gpureplace MAX Graph JIT for all GPU inner joins- Cold-start latency: ~300 ms → ~70 ms
AOTKernelsGPU.gather_table()gathers all numeric columns with a single index H2D upload
🔀 Phase 5 — AOT GPU sort + top-k
sort_topk_i32_gpufull bitonic sort with top-k truncationORDER BY … LIMIT kfuses sort+limit into one kernel call — downloads onlyk×4bytes- Fixes crash: previous GPU sort called
gather_f32as an unregistered MAX Graph custom op
🐛 Bug fixes
- Q1 GPU 87 ms → 42 ms:
group_count_f32_gpuwas missing shared-memory privatisation — global atomics from 1M threads serialised. Added same shared-mem fast path asgroup_sum/min/max - Q13 GPU cold compile 2 min → 1.4 s: removed
@always_inlinefrom MLIR Atomic struct - String column conversion overhead (~1.5 s/call): skip non-numeric columns when building AOT mini_table
- Phase 3 vectorised rank: replaced Python for-loop in
_encode_sort_keywith NumPy scatter (~1.5× speedup)
📊 Benchmark highlights (1 M rows, fresh-join)
| Query | v0.2.2 GPU | v0.2.3 GPU | Improvement |
|---|---|---|---|
| Q1 Filter + 8 aggs | 87 ms | 42 ms | 2× |
| Q3 3-table join | 23 ms | 8.7 ms | 2.6× |
| Q13 cold compile | ~120 s | 1.4 s | 86× |
MX CPU beats Polars on 20/22 TPC-H queries. MX GPU beats Polars on 12/22 at 1 M rows, scaling to 15/22 at 10 M rows.
Full benchmark tables: see docs/benchmarks.md
📚 Docs restructure
- README trimmed to 119 lines (intro + quick start + teaser only)
- New
docs/benchmarks.md: full 22-query tables (1 M + 10 M), kernel catalogue, roadmap, reproduce instructions - New
docs/api.md: LazyFrame API, expressions, SQL frontend, project structure
📦 Install
# TestPyPI
pip install -i https://test.pypi.org/simple/ mxframe==0.2.3
# PyPI (after promotion)
pip install mxframe==0.2.3Requires modular >= 26.4 for GPU support.
mxframe 0.1.2 — First public PyPI release
🚀 mxframe 0.1.2 — First public PyPI release
mxframe is a GPU-accelerated DataFrame engine with a Polars-style Python API and pre-compiled Mojo AOT kernels. Same code runs on NVIDIA, AMD, and Apple Silicon — no CUDA required, no JIT compilation at query time.
This is the first release available on PyPI. Versions 0.1.0 and 0.1.1 were internal validation builds — 0.1.2 is the one you should install.
✨ Highlights
- ✅ All 22 TPC-H queries working on CPU and GPU paths
- ⚡ Up to 128× faster than Polars on CPU at 10 M rows (Q9); 26.5× faster on GPU (Q12)
- 🔌 Polars-style API —
LazyFrame,col(),groupby().agg(),join(),sort(), lazycompute() - 🧠 AOT-compiled Mojo kernels — loaded once from a
.soat import (~1 ms), pure dispatch per query - 🌐 Cross-vendor GPU via Modular's MAX engine (not tied to CUDA)
- 🗃️ SQL frontend (optional extra) — parse SQL with
sqlglot, execute on the same engine
📦 Install
# Standard install (pulls in Modular's MAX engine as a PyPI dep)
pip install "mxframe[runtime]"
# With SQL frontend
pip install "mxframe[runtime,sql]"
# For pixi users (MAX comes from the Modular conda channel — skip the extra)
pixi install| Command | What gets installed |
|---|---|
pip install mxframe |
just mxframe (no MAX engine → import will fail at runtime) |
pip install "mxframe[runtime]" |
mxframe + modular (the MAX engine) ← what most users want |
pip install "mxframe[sql]" |
mxframe + sqlglot |
pip install "mxframe[runtime,sql]" |
mxframe + both |
Python 3.10+, Linux x86_64 (macOS / Windows via WSL).
🚀 Quick example
import pyarrow as pa
from mxframe import LazyFrame, col
t = pa.table({
"dept": ["eng", "eng", "mkt", "mkt", "eng"],
"salary": [120.0, 95.0, 80.0, 110.0, 130.0],
})
result = (
LazyFrame(t)
.groupby("dept")
.agg(col("salary").sum().alias("total"))
.compute()
)
print(result.to_pydict())
# {'dept': ['eng', 'mkt'], 'total': [345.0, 190.0]}📊 Benchmarks (1 M & 10 M rows, warm median of 3)
- MX CPU beats Polars: 21/22 queries at 1 M, 18/22 at 10 M
Headlines @10 M: Q9 128× · Q12 89× · Q7 42× · Q8 31× · Q17 24× · Q5 22× - MX GPU beats Polars: 16/22 queries at 1 M, 15/22 at 10 M
Headlines @10 M: Q12 26.5× · Q9 12× · Q8 10.8× · Q17 9.7× · Q7 4.7×
Full table and methodology in the README.
🛠 What's fixed since 0.1.0/0.1.1
pip install mxframenow actually works on a clean environment (modularruntime dep was missing)import mxframeno longer requiressqlglot— SQL is loaded lazily__version__is now kept in sync with the wheel version- PyPI project page renders the real README (not an internal doc)
AOTKernelsGPUinit is safe on CPU-only machines (no moreCUDA driver unavailablecrash)- Several test scripts no longer hard-code developer paths
Full changelog: CHANGELOG.md
🙏 Feedback welcome
This is an early public release — architecture is stable, rough edges will show. Please file issues for anything surprising:
👉 https://github.com/abhisheksreesaila/mxframe/issues
📎 Links
- 📘 README · User guide · Vision & architecture
- 🗺️ Roadmap
- 🤝 Contributing
---
**Settings for the release form:**
- Tag: `v0.1.2`
- Title: `mxframe 0.1.2 — First public PyPI release`
- ☑️ Set as the latest release
- ☐ Set as a pre-release (leave unchecked — this *is* your launch)
- Don't tick "Create a discussion" unless you want launch discussion threads
**One thing to double-check before hitting Publish:** do you want to mark this as a pre-release? It's `0.1.x` so semver-wise it's pre-1.0 and the API may change. Many projects mark early-0.1 as pre-release to set expectations. Your call — "latest release" gives more visibility, "pre-release" signals "still iterating."
Want me to tone anything down (e.g., the benchmark numbers) or add/remove sections? ---
**Settings for the release form:**
- Tag: `v0.1.2`
- Title: `mxframe 0.1.2 — First public PyPI release`
- ☑️ Set as the latest release
- ☐ Set as a pre-release (leave unchecked — this *is* your launch)
- Don't tick "Create a discussion" unless you want launch discussion threads
**One thing to double-check before hitting Publish:** do you want to mark this as a pre-release? It's `0.1.x` so semver-wise it's pre-1.0 and the API may change. Many projects mark early-0.1 as pre-release to set expectations. Your call — "latest release" gives more visibility, "pre-release" signals "still iterating."