frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: I built a tensor library from scratch in C++/CUDA

https://github.com/nirw4nna/dsc
55•nirw4nna•4h ago
Hi HN,

Over the past few months, I've been building `dsc`, a tensor library from scratch in C++/CUDA. My main focus has been on getting the basics right, prioritizing a clean API, simplicity, and clear observability for running small LLMs locally.

The key features are: - C++ core with CUDA support written from scratch. - A familiar, PyTorch-like Python API. - Runs real models: it's complete enough to load a model like Qwen from HuggingFace and run inference on both CUDA and CPU with a single line change[1]. - Simple, built-in observability for both Python and C++.

Next on the roadmap is adding BF16 support and then I'll be working on visualization for GPU workloads.

The project is still early and I would be incredibly grateful for any feedback, code reviews, or questions from the HN community!

GitHub Repo: https://github.com/nirw4nna/dsc

[1]: https://github.com/nirw4nna/dsc/blob/main/examples/models/qw...

Comments

helltone•3h ago
This is very cool. I'm wondering if some of the templates and switch statements would be nicer if there was an intermediate representation and a compiler-like architecture.

I'm also curious about how this compares to something like Jax.

Also curious about how this compares to zml.

kajecounterhack•1h ago
Cool stuff! Is the goal of this project personal learning, inference performance, or something else?

Would be nice to see how inference speed stacks up against say llama.cpp

liuliu•1h ago
Both uses cublas under the hood. So I think it is similar for prefilling (of course, this framework is too early and don't have FP16 / BF16 support for GEMM it seems). Hand-roll gemv is faster for token generation hence llama.cpp is better.
aklein•55m ago
I noticed you interface with the native code via ctypes. I think cffi is generally preferred (eg, https://cffi.readthedocs.io/en/stable/overview.html#api-mode...). Although you'd have more flexibility if you build your own python extension module (eg using pybind), which will free you from a simple/strict ABI. Curious if this strict separation of C & Python was a deliberate design choice.

What Is the Most Realistic Submarine Movie Ever Made? [U.S. Naval]

https://www.usni.org/magazines/proceedings/2019/october/what-most-realistic-submarine-movie-ever-made
1•bookofjoe•16s ago•0 comments

Ubuntu Adopts Chrony and NTS for Secure Network Time

https://www.omgubuntu.co.uk/2025/06/ubuntu-chrony-nts-default-25-10
1•ulrischa•1m ago•0 comments

I Built a Kubernetes Cluster at Home (and Why You Should Too)

https://subnetsavy.com/wp-content/uploads/articles/build-k8-pi.html
1•subnetsavy•3m ago•0 comments

Midjourney launches its first AI video generation model, V1

https://techcrunch.com/2025/06/18/midjourney-launches-its-first-ai-video-generation-model-v1/
1•minimaxir•3m ago•0 comments

Stop Using Dangerous Faucets, Regulator Warns

https://www.consumerreports.org/home-garden/faucets/stop-using-kitchen-faucets-due-to-lead-exposure-risks-a4216002752/
2•perihelions•5m ago•0 comments

Silicon Valley Execs Join the Army as Officers (But Won't Attend Boot Camp)

https://gizmodo.com/silicon-valley-execs-join-the-army-as-officers-but-wont-have-to-attend-boot-camp-2000617223
1•ks2048•5m ago•0 comments

Building AI Agents

1•wander8jackson•7m ago•0 comments

Online game proven to reduce partisan animosity

https://phys.org/news/2025-06-online-game-proven-partisan-animosity.html
1•PaulHoule•12m ago•0 comments

UI Component Testing Revisited: Modern Implementation with Visual Verification

https://paulhammant.com/2025/06/17/ui-component-testing-revisited/
1•Bigpet•12m ago•1 comments

Your Brain on ChatGPT: Accumulation of Cognitive Debt

https://twitter.com/itsalexvacca/status/1935343874421178762
1•mgh2•12m ago•1 comments

The Genius Act Will Bring Economic Chaos

https://www.nytimes.com/2025/06/17/opinion/genius-act-stablecoin-crypto.html
1•paulpauper•12m ago•0 comments

Bordeaux Observations

https://marginalrevolution.com/marginalrevolution/2025/06/bordeaux-observations.html
1•paulpauper•13m ago•0 comments

The Joneses Aren't That Happy

https://awealthofcommonsense.com/2025/06/the-jonese-arent-that-happy/
1•paulpauper•14m ago•0 comments

Comprehensive sovereign solutions empowering European organizations

https://blogs.microsoft.com/blog/2025/06/16/announcing-comprehensive-sovereign-solutions-empowering-european-organizations/
1•ajdude•14m ago•0 comments

Off with Their Heads: Illustrations of Blemmyes (ca. 1175–1724)

https://publicdomainreview.org/collection/blemmyes
1•crescit_eundo•17m ago•0 comments

The Language of Form: Lothar Schreyer's Kreuzigung (1920)

https://publicdomainreview.org/collection/kreuzigung
1•crescit_eundo•18m ago•0 comments

Revolut Integrates Lightspark for Fast Bitcoin Payments in Europe

https://www.nasdaq.com/articles/revolut-integrates-lightspark-lightning-fast-bitcoin-payments-uk-and-europe
1•janandonly•18m ago•0 comments

xAI faces legal threat over alleged Colossus data center pollution in Memphis

https://arstechnica.com/tech-policy/2025/06/xai-faces-legal-threat-over-alleged-colossus-data-center-pollution-in-memphis/
4•Bluestein•19m ago•0 comments

Dancing Naked on the Head of a Pin: The Early History of Microphotography

https://publicdomainreview.org/essay/dancing-naked-on-the-head-of-a-pin
2•crescit_eundo•19m ago•0 comments

Andrej Karpathy on Software 3.0: Software in the Age of AI

https://www.latent.space/p/s3
1•swah•19m ago•0 comments

Semcache: Semantic Caching for LLMs

https://semcache.io/
1•handfuloflight•20m ago•0 comments

Show HN: Workflow builder for realtime voice agents

3•nikkwong•20m ago•0 comments

Why Is Google Still in One Piece?

https://www.thebignewsletter.com/p/why-is-google-still-in-one-piece
1•babelfish•20m ago•0 comments

When can I use Temporal?

https://computus.org/when-can-i-use-temporal/
1•fantunes•21m ago•0 comments

Libxml2's Readme Security Caption

https://github.com/GNOME/libxml2
1•danielovichdk•22m ago•0 comments

ARR growth: Has the game changed that much or is there more behind it?

2•MenesJo•22m ago•0 comments

Women are not dolls

https://thecritic.co.uk/women-are-not-dolls/
2•drankl•23m ago•1 comments

An interview with Liberux about their made-in-EU OSHW Linux Phone

https://linmob.net/liberux-nexx-an-interview-with-liberux/
1•LorenDB•23m ago•0 comments

ReqVis – Request Visualization

https://www.ibrahimdiallo.com/reqvis/
1•foxfired•25m ago•0 comments

I hacked Priceline's express deals

http://expdeals.com
2•coolwulf•26m ago•3 comments