Skip to main content

Junyi's Lab

deciax: Running a Decision Model on TPU with JAX and Pallas

Laya is a Decision Model that handles choice, score, and yes/no questions in a single forward pass. I ported its inference path to JAX and built deciax to run these models on TPU, then optimized the computation with Pallas.

In this benchmark1, a single TPU v6e chip reached a single-question p50 of 2.18 ms for the English model and 1.55 ms for the multilingual model. The fastest measured results on A100 SXM4, H100 PCIe, and H200 NVL were 6.4 / 4.0 ms, 4.8 / 3.2 ms, and 5.8 / 4.1 ms, respectively (English / multilingual).

At 50 questions per call, v6e Pallas reached 33.69 / 17.83 ms, roughly 2.3× faster than plain JAX. The fastest measured A100, H100, and H200 results were 68.8 / 36.2 ms, 44.0 / 23.2 ms, and 39.8 / 21.2 ms, respectively.

HLO Visualizer: Learn XLA HLO by Exploring It

When working with JAX on TPU, you eventually need to read HLO. You want to know what a computation became after compilation, why extra copies appeared, or what is inside a fusion. The answers start with a compiler-generated text file.

Instructions pack together shapes, layouts, tiling, memory spaces, and references to other computations.

I built HLO Visualizer to make that easier. It turns HLO text into an explorable graph, with explanations of the instruction you select, piece by piece.

LLM Inference on TPU v6e-4: Small Dense, Large MoE, and Large Dense Models

# Abstract

We benchmark LLM inference on one Google TPU v6e-4 host (four chips, one VM). We use vLLM 0.20.0 with the tpu-inference backend and an fp8 KV cache.

We test three Qwen3 models:

ModelTypeParamsParallelismChips
Qwen3.5-4Bdense4B activetp11
Qwen3-30B-A3BMoE30B total / 3B activetp44
Qwen3-32Bdense32B activetp44

We measure three parts of inference: prefill, decode, and end-to-end online serving.

Claude Code Asks to Re-login in tmux? It’s Probably macOS Keychain

claude works fine in my terminal — Team Account, auth, everything. Open tmux, run claude, and it wants me to log in again. Took a bit of digging to figure out it’s a macOS Security Session thing.

Agent Mesh: My Thoughts on Multi-AI Collaborative Workflows

AI coding assistants are everywhere now, from chat windows to CLI Agents. After using a bunch of them, my biggest takeaway is: no single Agent is the best at everything.

I mainly use Claude Code, Google Gemini CLI, and Moonshot Kimi Code day-to-day. At first I treated them as standalone tools, but soon realized that was a waste — each has distinct strengths, and if you let them collaborate and delegate tasks based on those strengths, the results are much better. I call this approach Agent Mesh.

nerdctl + Tailscale Sidecar Exit Node: A Complete Pitfall Guide

In containerized deployments, sometimes you need all outbound traffic from a container to go through a specific network exit. Tailscale’s sidecar pattern makes this possible: a Tailscale container acts as a sidecar, other containers share its network namespace, and traffic flows through a WireGuard tunnel via a remote exit node.

This setup is well-documented for Docker Compose, but migrating to nerdctl (containerd) introduced a series of pitfalls. Here’s what I ran into so others can avoid the same traps.

From Pixel to Pigment: A Decade with Impressionism

into-the-modern
INTO THE MODERN

In early 2026, at the “INTO THE MODERN” Impressionist exhibition in Singapore, I stood before an original Monet for the first time.

Layers of pigment were stacked high, brushstrokes clearly visible, as if freezing a moment of shimmering dawn or fading dusk from a century ago. At that moment, my mind drifted back to a quiet Sunday exactly ten years prior (2016). I was sitting in front of a computer, flipping through images on the screen one by one, selecting paintings to present for my art class. The theme was “From Tradition to Modernity.” At that time, the word “Impressionism” was still foreign to me, and I could never have imagined that one day I would come face to face with these masterpieces that had once only existed for me as pixels.

From Raspberry Pi to NUC: An Upgrade of My Toy

I replaced the Raspberry Pi 4B I used for lightweight services with an Intel NUC, moving from ARM to x86 and from a TF card to an SSD.

MacBook Pro M1 Keycap Replacement Guide

As we all know, once keycaps get greasy and shiny (“oiled”), it’s almost impossible to restore them by simply wiping. I once tried sanding the keycaps, but not only did it make things worse, the plastic debris also fell into the gaps between the keys. (You can see my sanded Shift and Space keys in the photo — they look terrible.)

While some say you can go to an Apple Store to get them replaced1, it’s said they only allow a few keycaps to be replaced each time. For someone like me whose entire keyboard is shiny, DIY replacement is clearly the more practical option.

I’m writing this blog post because I found it incredibly difficult to locate a complete guide on how to replace MacBook Pro M1 keycaps. Most of the videos online2 only show how to remove regular letter and number keys. They don’t cover the longer keys like Space, Caps Lock, ESC, or the arrow keys. These keys have different internal structures and require a different disassembly approach.