Hi, I'm Nguyên.
Notes on software, systems, and things I learn along the way.
Writing
- I have a big slab of DRAM at homemmmllm, part 1. SGLang shipped a unified radix cache for managing a big slab of GPU memory. I have a big slab of DRAM at home: a Mac mini whose CPU, GPU and Neural Engine all share it. So I built an LLM server around it, for fun.
- A bunch of matmuls fighting over 273 GB/smmmllm, part 2. Every token is a pile of matrix multiplications fighting over one memory bus. The loops an LLM server runs, why decode needs bandwidth and prefill needs math, what attention leaves behind in each 2 MiB block, and how the Neural Engine borrows the GPU's weights.
- Sharing and running ahead: a prefix cache on an async GPUmmmllm, part 3. Reusing a prompt's memory across requests, why a hybrid model's state must be copied, and how the counters stay right while the CPU runs a step ahead of the GPU.
- Use RBAC to protect your gRPC service right on the proto definitionDeclare which roles may call each gRPC method with a custom MethodOptions extension, then enforce it with a single interceptor that reads the proto descriptor.
- Simulate Let’s Encrypt certificate issuing in local KubernetesSimulate Let’s Encrypt HTTPS certificate issuing with the HTTP-01 challenge in your local k8s cluster, using cert-manager, Pebble and a CoreDNS hack.
- Snapshot test your PostgreSQL in Golang pgx driverWrite unit tests for your repository layer using query snapshots: parse your SQL with pg_query_go and check it without starting a database.
- Dependency Injection in Go without the help of convenience containers?After a few weeks of Spring Boot's @Autowired magic, how hard is dependency injection in Go without a container? Interfaces, factories, and a lazy container of your own.