nowfound

Life & fun · November 6, 2021

How does JAX allocate memory on a TPU? An interactive C++ walkthrough

JAX C++ stack trace walkthrough for TpuExecutor_Allocate - What happens when you allocate a JAX tensor on a TPU.md

How does JAX allocate memory on a TPU? An interactive C++ walkthrough launched on November 6, 2021 with 78 votes, #748 of 2,925 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 4 years on.

In plain words

This is an interactive C++ walkthrough explaining JAX's memory allocation mechanisms on TPUs. It serves developers and researchers working with JAX who need to understand how the framework manages memory at a low level. The resource breaks down technical concepts through code examples and step-by-step explanations, making complex TPU memory management accessible to those learning the system's internals.

written from the facts on this page · September 2026

From the sources

Search Gists Search Gists Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} Instantly share code, notes, and snippets. Clone this repository at <script src=&quot;https://gist.github.com/shawwn/0e524d4a7a5d8fb152a86616559cc02a.js&quot;></script> Save shawwn/0e524d4a7a5d8fb152a86616559cc02a to your computer and use it in GitHub Desktop. Embed Select an option Embed Embed this gist in your website. Share Copy sharable link for this gist. Clone via HTTPS Clone using the web…from gist.github.com

Does a similar job

all alternatives →
  • I wrote a tool in Rust for tracking all allocations in a Linux process2023 · github.com · ▲113

    allocscope - a memory tracking tool. Contribute to matt-kimball/allocscope development by creating an account on GitHub.

  • MemoriMay 2026 · memorilabs.ai · ▲168

    Persistent memory from agent trace, not just conversation

  • I wrote a minimal memory allocator in CNov 2025 · github.com · ▲137

    A fun toy memory allocator (not thread safe, that's a future TODO). I also wanted to explain how I approached it, so I also wrote a tutorial blog post (~20 minute read) covering the code which you can find the link to in the README.

  • I built a small browser engine from scratch in C++Jan 2026 · github.com · ▲146

    Hi HN! Korean high school senior here, about to start CS in college. I built a browser engine from scratch in C++ to understand how browsers work. First time using C++, 8 weeks of development, lots of debugging—but it works! Features: - HTML parsing with error correction - CSS cascade and inheritance - Block&#x2F;inline layout engine - Async image loading + caching - Link navigation + history Hardest parts: - String parsing(html, css) - Rendering - Image Caching & Layout Reflowing What I learned (beyond code): - Systematic debugging is crucial - Ship with known bugs rather than chase…

  • IB
    I built a toy TPU that can do inference and training on the XOR problem2025 · tinytpu.com · ▲134

    We wanted to do something very challenging to prove to ourselves that we can do anything we put our mind to. The reasoning for why we chose to build a toy TPU specifically is fairly simple: - Building a chip for ML workloads seemed cool - There was no well-documented open source repo for an ML accelerator that performed both inference and training None of us have real professional experience in hardware design, which, in a way, made the TPU even more appealing since we weren't able to estimate exactly how difficult it would be. As we worked on the initial stages of this project, we…

  • Txeo – A Modern C++ Wrapper for TensorFlow2025 · github.com · ▲52

    Txeo is a lightweight and intuitive C++ wrapper for TensorFlow, designed to simplify TensorFlow C++ development while preserving high performance and flexibility. Built entirely with Modern C++, Txeo allows developers to use TensorFlow with the ease of a high-level API, eliminating the complexity of its low-level C++ interface.

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, November 2021

the whole month →