Alternatives
Products that do what PyTorch K-Means GPU-friendly, single-file, hierarchical and resampling does
I built a small, self-contained K-Means implementation in pure PyTorch: https://gitlab.com/hassonofer/pt_kmeans I was working on dataset sampling and approximate nearest neighbor search, and tried several existing libraries for large-scale K-Means. I couldn't find something that was fast, simple, and would run comfortably on my own workstation without hitting memory limits. Maybe I missed an existing solution, but I ended up writing one that fit my needs. The core insight: Keep your data on CPU (where you have more RAM) and intelligently move only the necessary chunks to…
- 1IS
2022 · github.com
- 2WS
Want something better than k-means? I'm happy to announce our SOTA k-medoids algorithm from NeurIPS 2020, BanditPAM, is now publicly available! `pip install banditpam` or `install.packages("banditpam")` and you're good to go! k-means is one of the most widely-used algorithms to cluster data. However, it has several limitations: a) it requires the use of L2 distance for efficient clustering, which also b) restricts the data you're clustering to be vectors, and c) doesn't require the means to be datapoints in the dataset. Unlike in k-means, the k-medoids problem requires cluster centers to be…
2023 · github.com
- 3

- 4RT
I ported Microsoft's TRELLIS.2 (4B parameter image-to-3D model) to run on Apple Silicon via PyTorch MPS. The original requires CUDA with flash_attn, nvdiffrast, and custom sparse convolution kernels: none of which work on Mac. I replaced the CUDA-specific ops with pure-PyTorch alternatives: a gather-scatter sparse 3D convolution, SDPA attention for sparse transformers, and a Python-based mesh extraction replacing CUDA hashmap operations. Total changes are a few hundred lines across 9 files. Generates ~400K vertex meshes from single photos in about 3.5 minutes on M4 Pro (24GB). Not as fast as…
Apr 2026 · github.com
- 5

- 6AG
This is a vector index I built that supports insertion and k-nearest neighbors (k-NN) querying, optimized for GPUs. It operates entirely in CUDA and can process queries on half a billion vectors in under 200 milliseconds. The codebase is structured as a standalone library with an HTTP API for remote access. It’s intended for high-performance search tasks—think similarity search, AI model retrieval, or reinforcement learning replay buffers. The codebase is located at https://github.com/rodlaf/BinaryGPUIndex.
2025 · rlafuente.com
- 7GF
Hello HN, We are pleased to introduce you graphlearn-for-pytorch (https://github.com/alibaba/graphlearn-for-pytorch), an open-source distributed graph neural network library based on PyTorch and compatible with PyG. Our library is designed to make it easy for developers to build and train large-scale graph models in a distributed environment. With graphlearn-for-pytorch, you can leverage GPUs to accelerate graph sampling and utilize UVA to reduce the overheads of feature collection. Following a scalable design, graphlearn-for-pytorch supports training GNN models on…
2023 · github.com
- 8FR
Fresh and (I think) clean implementations of Faster R-CNN in PyTorch and TensorFlow 2/Keras. I wanted to learn about object detectors and decided to understand and implement a foundational model in the field, Faster R-CNN (elements of which are still used in modern models to this day), using the paper alone. That proved to be more difficult than expected and I had to relent and take a peak at existing implementations to fill in some important gaps. I've documented my struggles and learnings in the README for others to benefit from. I also wanted to solidify my understanding of…
2022 · github.com
- 9

- 10

- 11TL
Hello HN! For the past 6 months I've been working on an open source python library that implements differentiable geometric optics in PyTorch. It's very experimental still, but eventually the goal is to use it to design optical systems with a state of the art optimization framework and a beautiful code based API. Think OpenSCAD, but for optical systems. Not only is PyTorch's autograd an amazing general purpose optimizer, but torch.nn (the neural network building blocks) can be used pretty much out of the box to model an optical system. This is because there is a strong analogy to be made…
2025 · victorpoughon.github.io
- 12CA
I'm a machine learning engineer and researcher. I got fed up with how difficult it is to understand why neural networks behave the way they do, so i wrote a library to help with it. Comgra (computation graph analysis) is a library you can use with pytorch to extract all the tensor data you care about and visualize it graphically in a browser. This allows for a much more detailed analysis of what is happening than the usual approach of using tensorboard. You can go investigate tensors as training proceeds, drill down into individual neurons, inspect single data sets that are of special…
2023 · github.com
- 13

- 14II
Aug 2026 · github.com
- 15IB
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…
2025 · github.com
- 16LF
We're excited to announce that we've open-sourced LeanRL, a lightweight PyTorch reinforcement learning library that provides recipes for fast RL training using torch.compile and CUDA graphs. By leveraging these tools, we've achieved significant speed-ups compared to the original CleanRL implementations - up to 6x faster! Reinforcement learning is notoriously CPU-bound due to the high frequency of small CPU operations. PyTorch's powerful compiler can help alleviate these issues, but comes with its own costs. LeanRL addresses this challenge by providing simple recipes to accelerate your…
2024 · github.com
- 17AC
built a tiny pytorch clone in c after going through prof. vijay janapa reddi's mlsys book: mlsysbook.ai/tinytorch/ perfect for learning how ml frameworks work under the hood :)
Dec 2025 · github.com
- 18KY
2025 · github.com
- 19II
Two weeks ago I was on my babymoon in Corfu, Greece. While in transit, I was overseeing a GSoC intern submit an important feature to my array database library, Xarray-SQL. He added `to_dataset()`, which completed the roundtrip between thinking of array data in a tabular model simultaneously as gridded rasters (the premise of the project is that every Nd array can be mapped to 2d, where orthogonal dims of the Nd array are just primary keys of a tabular representation). We discussed in chat, now that this feature existed, what demos could we make that would prove this data model works? With…
Jul 2026 · github.com
- 20OS
We're a group of engineers, AI/ML enthusiasts, and author of this paper https://openreview.net/forum?id=0pxiMpCyBtr who saw a closed door in AI/ML and decided to open it. This project is a PyTorch reimagining of Google's TensorFlow Lattice models, which despite being labeled open-source, were previously open in name only (you have to be a Googler to contribute). Also, side point…TensorFlow is dying https://thenextweb.com/news/why-tensorflow-for-python-is-dyi... Here's the deal: Lattice models excel in making AI interpretable—key for sectors where…
2023 · github.com
- 21

- 22LO
Hi HN, I’m Joe. My friends Matthew, Jake and I are building Luminal (https://luminalai.com/), a GPU compiler for automatically generating fast GPU kernels for AI models. It uses search-based compilation to achieve high performance. We take high level model code, like you'd have in PyTorch, and generate very fast GPU code. We do that without using LLMs or AI - rather, we pose it as a search problem. Our compiler builds a search space, generates millions of possible kernels, and then searches through it to minimize runtime. You can try out a demo in `demos/matmul` on mac to…
2025 · github.com
- 23

- 24DE
tl;dr we built an embeddable stream processing engine in Rust using apache DataFusion, check us out at https://github.com/probably-nothing-labs/denormalized Hey HN, We’d like to showcase a very early version of our embeddable stream processing engine called Denormalized. The rise of DuckDB has abundantly made it clear that even for many workloads of Terabyte scale, a single node system outshines the distributed query engines of previous generation such as Spark, Snowflake etc in terms of both performance and cost. Now a lot of workloads DuckDB is used for were normally…
2024 · github.com
Ranked by how close each launch is in meaning, then by votes. Refine with a description →