frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Axiom – C++ tensor library with NumPys API, optimized for Apple Silicon

https://github.com/Frikallo/axiom
2•noahkay13•1h ago
I kept hitting the same wall: prototype something in NumPy or PyTorch, then rewrite it in C++ for edge deployment. The rewrite always took longer than the original work. Eigen's fixed-size matrix API doesn't map to tensor workloads, xtensor is CPU-only with compile-time templated types that produce unreadable errors, and none of them have GPU support on Mac. Worse, Eigen was often slower than the Python version because PyTorch bundles optimized BLAS while Eigen uses its own limited implementation.

So I built Axiom to make that rewrite mechanical. The API mirrors NumPy/PyTorch as closely as I could — same method names, broadcasting rules, operator overloading, dynamic shapes, runtime dtypes. Code that looks like this in PyTorch:

    scores = Q.matmul(K.transpose(-2, -1)) / math.sqrt(64)
    output = scores.softmax(-1).matmul(V)
looks like this in Axiom:

    auto scores = Q.matmul(K.transpose(-2, -1)) / std::sqrt(64.0f);
    auto output = scores.softmax(-1).matmul(V);
No mental translation. No debugging subtle API differences.

What's in the box (28k LOC):

- 100+ operations: arithmetic, reductions, activations (relu, gelu, silu, softmax), pooling, FFT, full LAPACK linear algebra (SVD, QR, Cholesky, eigendecomposition, solvers) - Metal GPU via MPSGraph — all ops run on GPU, not just matmul. Compiled graphs are cached by (shape, dtype) to avoid recompilation - Seamless CPU ↔ GPU: `auto g = tensor.gpu();` — unified memory on Apple Silicon avoids copies entirely - Built-in einops: `tensor.rearrange("b h w c -> b c h w")` - Highway SIMD across architectures (NEON, AVX2, AVX-512, SSE, WASM, RISC-V) - Runtime dtypes via variant (readable errors, not template explosions) - Row-major default, column-major supported via as_f_contiguous() - Works on macOS, Linux, Windows, and WebAssembly

Performance on M4 Pro (vs Eigen with OpenBLAS, PyTorch, NumPy):

- Matmul 2048×2048: 3,196 GFLOPS (Eigen 2,911 / PyTorch 2,433) - ReLU 4096×4096: 123 GB/s (Eigen 117 / PyTorch 70) - FFT2 2048×2048: 14.9ms (PyTorch 27.6ms / NumPy 63.5ms)

To try it:

    git clone https://github.com/frikallo/axiom.git
    cd axiom && make release
Or add to your CMake project via FetchContent. Example files in examples/.

Happy to answer questions about the internals or take feedback on the API.

Comments

DenisDolya•6m ago
This is an impressive piece of engineering, no doubt. The API is clean, performance work is serious, and it’s clear a lot of effort went into making this fast. But let’s be honest: without autograd and a real training ecosystem, this is not a PyTorch replacement, it’s a very nice numerical toolbox. Also, tying GPU acceleration mostly to Metal makes this far less useful outside the Apple ecosystem. Right now, it looks like a technically excellent project searching for its real-world niche. If you add proper differentiation, broader GPU support, and prove that this scales with real users, then it could become something truly important. Until then, it’s great work — but not a revolution.

AI Incident Roundup – November and December 2025 and January 2026

https://incidentdatabase.ai/blog/incident-report-2025-november-december-2026-january/
1•YeGoblynQueenne•3m ago•0 comments

TikTok hit with charges by EU for its addictive features

https://www.reuters.com/business/media-telecom/tiktok-hit-with-charges-breaching-eu-online-conten...
1•hackerbeat•5m ago•0 comments

Signy: Signed URLs for Small Devices

https://github.com/golioth/signy
1•hasheddan•6m ago•0 comments

Shadcn/Create in Figma

https://www.shadcndesign.com/blog/shadcn-create-in-figma
1•figmaster•7m ago•0 comments

Show HN: Langraph Networks as Equations

https://github.com/kummahiih/python-langgraph-equations
1•kummap•8m ago•0 comments

Bui – TUI for painless Bubblewrap sandboxing

https://smaller.fish/posts/bubblewrap_tui
1•smallerfish•8m ago•0 comments

John Haugeland on the failure of micro-worlds

https://blog.plover.com/tech/gpt/micro-worlds.html
1•robinhouston•12m ago•0 comments

EC preliminarily finds TikTok's addictive design is Digital Services Act breach

https://ec.europa.eu/commission/presscorner/home/en
2•u1hcw9nx•14m ago•0 comments

Ask HN: XCancel but for Instagram?

2•Nurbek-F•14m ago•0 comments

Toyota retains top auto crown in 2025 with record sales

https://www.reuters.com/business/autos-transportation/toyota-retains-top-auto-crown-2025-with-rec...
2•breve•16m ago•0 comments

Iranian regime propaganda floods Wikipedia

https://www.neutralpov.com/p/a-flood-of-iranian-propaganda-on
1•ukblewis•18m ago•0 comments

Show HN: Gazill – Save your code, it's live. Built for vibe coders and agents

1•niklai•18m ago•0 comments

Show HN: Grok Prompts – AI image and video generator with 500 curated prompts

https://grokprompts.app/
1•Yreminder•21m ago•0 comments

Library of Babel 3D

https://library-of-babel-3d.netlify.app/
1•m-hodges•24m ago•0 comments

Amara

https://amara.01c.ai/
2•ashkan01c•24m ago•2 comments

A curated list of best Python books

https://github.com/lara-west/PythonBooks
1•mahsima•25m ago•0 comments

Monty – A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
2•areski•26m ago•0 comments

A startup copied my landing page (and then gave me great feedback on it)

https://blog.dahl.dev/posts/startup-copied-my-design/
2•aleda145•29m ago•0 comments

US Immigration on the Easiest Setting

https://pluralistic.net/2026/02/06/doge-ball/#n-600
4•headalgorithm•29m ago•1 comments

Trois-Rivières, le jeu vidéO

https://www.trois-rivieres.net/
2•JeanKage•29m ago•0 comments

Show HN: PromptHub – 2000 Free AI Prompts for ChatGPT and Midjourney

https://promptshub.shop
1•meimeixoxi•29m ago•0 comments

First Proof: Research-Level Math for AI Evaluation

https://1stproof.org
1•panic•32m ago•0 comments

Show HN: An app to use Instagram without Reels on iOS

https://apps.apple.com/us/app/timecap-limit-screen-time/id6737515680
1•antoferra•34m ago•0 comments

Need feedback for AI tool that lets non-technical users query Postgres

2•dimitsapis•40m ago•0 comments

Ask HN: What you want in a travel planner app?

1•shubhwicked•41m ago•1 comments

Western Digital details 14-platter 3.5-inch HAMR HDD designs with 140 TB plus

https://www.tomshardware.com/pc-components/hdds/western-digital-details-14-platter-3-5-inch-hamr-...
2•asdefghyk•42m ago•1 comments

So, your developers use AI now – here's what to know

https://evilmartians.com/chronicles/so-your-developers-use-ai-now-here-is-what-to-know
1•rudolftheone•43m ago•0 comments

Against Markdown

https://aartaka.me/markdown.html
1•nemoniac•44m ago•0 comments

What causes surprise infra costs in your org?

1•frmalmaty•45m ago•0 comments

Show HN: Nano Banana Presentation Editor

https://www.presentia.ai/
1•roodrallec•46m ago•0 comments