426 karma · joined Nov 25, 2025 (12mo ago) · 81 submissions
The DOOM on Engineering Tools Series:
OpenSCAD-DOOM: Raycasting in a parametric CAD language, now playable in browser. (The Register)
KiDoom: DOOM rendered on PCB traces. #1 on HN. (The Register, Hackaday)
ScopeDoom: Vector rendering on an oscilloscope via audio DAC. #1 on HN. (The Register, Hackaday)
The Serious Work:
Phaestus: Compiler for physical products. Generates schematics, PCBs, enclosures, and firmware from natural language.
Bitwise-MCP: MCP server for embedded systems. Indexes 1000+ page reference manuals with hybrid keyword/semantic search.
TOKN: Token-Optimised KiCad Notation. A compact encoding format that reduces schematic token count by 92%, enabling LLM circuit generation. Includes benchmark suite comparing model performance on hardware tasks.
Engine Simulator: Thermodynamic diesel engine model at 0.1° crank resolution, vanilla JS in browser.
I specialise in solving "impossible" technical problems and shipping validated products.
mike@mikeayles.com | mikeayles.com
comment 4d ago · link · parent
FPGAs should only really be used for:
Pre-silicon verification
Designs where power/cost aren't important (a lot of high end industrial or military for example)
Or low quantity designs that won't make an ROI when taping out an ASIC.
That said, I'm currently designing one into a product because at the moment, the cost of an ASIC is too much of a gamble (and also makes it too much of a black box for functional safety certification)
I also got a couple of different LLM's running on a commodity FPGA, and hit 59,000tok/s with t=1, and 23,000tok/s with t=128. I say LLM, but the model was 3M params, so pretty dumb! But, to hit that speed, I couldn't use the DDR4 as it's bandwidth was the bottleneck.
I currently have an 8b model running with the DDR in the loop, but it's stuck at 14ish tok/s, but the model is usable.
Hbm really is the magic that makes it work (economically)
comment 1w ago · link · parent
https://www.mikeayles.com/blog/on-chip-llm-kv260/
Its right up against the wall of DDR bandwidth, so I'm trying every trick in the book to get the speed up
comment 2mo ago · link · parent
Flux.ai being the incumbent Silixon based out of the UK have been showing demos Quilter and DeepPCB for layout The recent OpenAI demo...
I went the other way and pre-designed sub circuits with a set of rules that allows simple merge assembly, unfortunately I didn't have the time or budget to continue with it, but I took the constrained approach as with hardware, things can't be 99%.
The one thing I will say, is that my experience of hardware engineers is very gatekeepy.
Any questions about the use of AI for any form of automation on forums/Reddit get shot down instantly and the OP's told 'skill issue' more or less. In my opinion, just as with software, most work is simple and should be automated, there will always be a need for the real engineering when it comes to high specification work, high volume optimisation and hardware debug (although Claude code is pretty handy at driving a Jlink)
comment 3mo ago · link · parent
The swap needs a fresh bitstream at all only because four little ROMs are baked at synthesis: layernorm gammas, the activation-quant scale, two dequant tables. the embeddings already ride the boot-streamed weight image. make those four boot-loadable through the same path and a same-arch model hot-swaps with no reconfigure. There is basically zero margin at the moment to implement this.
which is a decent excuse for a 24h telemetry update.
Peak 46 concurrent connections monday afternoon, 61 uniques in the busiest half hour, ~6,600 requests / ~400k tokens total. At no instant did more than 2 inferences overlap (although it came close once). the fabric finishes a ~100-char reply in ~2ms of compute (end-to-end round-trip is ~20-60ms once you add network + server), so even with 40+ people connected the queue sits empty ~100% of the time. Worst 30-second window of the whole day was p95 59.9ms, and the heaviest burst (~200 requests in 5 minutes from one enthusiastic visitor) didn't even produce it. still ticking at ~37 connections this morning, latency flat.
That's the counterintuitive bit about a 20k tok/s model with short replies: the "single stream" is busy for milliseconds per request, so it timeshares across human typing speed essentially for free. the synthetic ceiling (2,000 concurrent requesters, p95 ~9.4s, zero errors) is ~40x past anything real traffic did. every actual visitor had the chip to themselves.
After this is all over, I'll do a post-mortem to see how it held up. I was really hoping for FP with the amount of effort this one took compared to my other submissions, which really would have stressed it, but I guess it was just a bit too niche!
comment 3mo ago · link · parent
Plus I treated it as a good learning experience to get better with FPGA's but also system design.
comment 3mo ago · link · parent
However, if no-one made anything that was useless on the same thesis, a lot of these concepts would have never got off the ground. I would hazard a guess that people like taalas would have started with a (much much bigger) fpga to validate whether the approach was possible before committing to designing a chip big enough to fit an 8B model in it.
I just nerd sniped myself...
VP1902 could fit around a 500m model in, whereas a cadence protium rack of them could squeeze in a ~6B at 8bit, or a ~13B at 4bit. So accounting for the headroom of distributed compute, Llama 3.1 8B at 4bit. I don't want to even estimate how long synthesis and place and route would take on that!
comment 3mo ago · link · parent
The benchmark sweep is 2,000 concurrent active requesters hammering it constantly, real traffic is mostly lurkers, which cost a file descriptor and nothing else. the interactive feel actually gives out earlier than the queue math. The speculative-typing UI wants sub-second replies, and that budget blows around 100–150 simultaneous typists.
I've been logging the stats since it went live, unfortunately it didn't hit FP. Peak was 10 concurrent connections (13 uniques in the busiest half hour), ~580 requests and ~37k tokens served, and at no point did two people actually have an inference in flight at the same moment which would have been the real test for the queue, every visitor got the fabric to themselves, p50 ~23ms. so the 2,000-conn drill was not stressed today. the one blemish: a single window with p95 ~57s, which lines up with the model-rotation FPGA reconfigure rather than load. A request that arrives mid-reflash waits out the ~25s swap. if this thread sends 50× more people, the queue math above says it holds.
I need to discard the requests that overlap the model changeover for a truer result.
comment 3mo ago · link · parent
Writeup and demo here: https://www.mikeayles.com/blog/on-chip-llm-kv260/
Source and HDL here: https://github.com/MichaelAyles/kev-gpt
Show HN here: https://news.ycombinator.com/item?id=49242475
comment 3mo ago · link · parent
The annoying part: I wanted this live last week, which would have landed the same day as the AMD acquisition news, on AMD's own silicon no less. Life got in the way, so here it is a week late instead.
14.
Show HN: A tiny LLM running at 21,000 tok/s on a $250 FPGA (Live Demo)(mikeayles.com ↗)
79 points · by mikeayles · 3mo ago · 33 comments
comment 3mo ago · link · parent
The K26 has a quad core A53 core alongside the programmable logic (PL, or Fabric). The A53 is pretty weak, and doesn't have any hardware matmul operations, so despite the KV260 being sold as a 'vision ai starter kit' and the vitis object detection running on the arm cores, they're pretty weak cores for anything AI.
For my use, I need true determinism, so my vision pipeline is all implemented in the PL, and it was pretty disapointing that the vitis libraries are basically just opencv on linux, rather than really pushing the fabric. If I wanted probabalistic AI running on a CPU, then I sure as heck wouldn't choose a quad core A53.
Which led me to have a play with this, I saw the taalas/chatjimmy demo and wondered what I could push the fabric to.
The round trip time to DDR or CPU via AXI meant I had to keep the entire inference engine in fabric. The A53 is simply a pipe that gets a request from my server (which has a cloudflare tunnel to the real world for the live demo in the blog post) and manages a queue. So it feeds a string in, and gets a hopefully longer string back a few uS later.
It's all in verilog, because that's what i'm more used to. I did get Claude Code to do a moderate amount, as it's a side project on a side project after all, but pushing an FPGA to it's limit is definitely not as comfortable for it as it is writing a crud app in TS.
I'm using tinystories, as we are talking about megabytes of URAM/BRAM. If I used the DDR, it definitely would have been a real model, but that wasn't my goal. My goal was to hit 100,000tok/s, and even when I conceded on absolutely everything, with a token prediction size of 1tok, I topped out at 60,000tok/s. ?But increasing the window to make an actually plausible chat (story generator, it doesn't understand questions, you need to prompt it with 'once upon a time...' and it finishes it for example) I managed to break 20k tok/s.
I also created the lemmatised version, which was inspired by Kevin from the office (why use many word when few do trick) and trained a new model, I was expecting the output model to be smaller, but was suprised that it came out the same size, but it ran 30%ish faster. In hindsight it makes sense, the parameter count is fixed by the architecture, not the corpus, so training on compressed text doesn't shrink the model at all. What it does is compress the output distribution. The same story takes ~30% fewer characters to tell, so the effective speed goes up even though the per-token rate is identical. The dumbness is the optimisation.
Fully agree on publish early. The blog post with the live demo (a websocket straight to the board through a cloudflare tunnel, so you're genuinely talking to the fabric) is written and sitting in drafts while I fiddle with it. This thread is my peer pressure, it goes live in the next day or two.
comment 3mo ago · link · parent
I don't think anything I did was particularly novel, as I really just wanted to see how fast I could push a commodity FPGA to it's limit.
Scaling to an ASIC or getting into the billions of params is where the real engineering is! This was just a side project for a side project for me while the FPGA was idle
comment 3mo ago · link · parent
Caveats stacked high, obviously. It's 3.16M parameters (tinystories, and I also have a kevin-speak lemmatised version), the tokens are characters, and the 60k record is 16 streams that each remember exactly one token of context, so it's blisteringly fast at saying nothing. The honest build with full context and KV caching still does ~19k tok/s on one stream though.
I keep messing with the blogpost with the live demo, but I'm planning on flipping it to live in the next day or two
18.
Are you sure OneDrive has got your back(up)?(mikeayles.com ↗)
2 points · by mikeayles · 4mo ago · discuss
19.
Are you sure OneDrive has got your back(up)?(mikeayles.com ↗)
3 points · by mikeayles · 4mo ago · discuss
comment 5mo ago · link · parent
I've been trying to hit 100,000tokens/s with a 3.28m dumb model, and even this is an order of magnitude too large to benefit.
It appears to be focussed more on latency, than throughput. Happy to be corrected?
comment 7mo ago · link · parent
Edit: Forgot I also got doom running in openscad: https://www.mikeayles.com/blog/openscad-doom/
and doom running in openscad in the browser at https://doom.mikeayles.com/
comment 7mo ago · link · parent
RAG didn't make search more accurate on Claude Code, but it cut token consumption by 28%. On Copilot, it cut time to resolution by 44% and improved F1 by 19.5%.
The bigger finding: controlling for model, tool design alone accounts for a 30pp recall gap between the two tools. Benchmark code and data are open source.
23.
Does RAG Help AI Coding Tools?(mikeayles.com ↗)
2 points · by mikeayles · 7mo ago · 1 comment
24.
Show HN: I reproduced the CL1 DOOM demo in 132 parameters(mikeayles.com ↗)
1 points · by mikeayles · 8mo ago · discuss
comment 8mo ago · link · parent
The problem was the ML dependencies. The backend uses BGE-small-en-v1.5 for embeddings and FAISS for vector search. Both are C++/Python. Using them from Go means CGO, which means a C toolchain in your build, platform-specific binaries, and the end of go get && go build.
So I wrote both from scratch in pure Go.
goformer (https://www.mikeayles.com/blog/goformer/) loads HuggingFace safetensors directly and runs BERT inference. No ONNX export step, no Python in the build pipeline. It produces embeddings that match the Python reference to cosine similarity > 0.9999. It's 10-50x slower than ONNX Runtime, but for my workload (embed one short query at search time, batch ingest at deploy time) 154ms per embedding is noise.
goformersearch (https://www.mikeayles.com/blog/goformersearch/) is the vector index. Brute-force and HNSW, same interface, swap with one line. I couldn't justify pulling in FAISS for the index sizes I'm dealing with (10k-50k vectors), and the pure Go HNSW searches in under 0.5ms at 50k vectors. Had to settle for HNSW over FAISS's IVF-PQ, but at this scale the recall tradeoff is fine.
The interesting bit was finding the crossover point where HNSW beats brute-force. At 384 dimensions it's around 2,400 vectors. Below that, just scan everything, the graph overhead isn't worth it. I wrote it up with benchmarks against FAISS for reference.
Together they're a zero-dependency semantic search stack. go get both libraries, download a model from HuggingFace, and you have embedding generation + vector search in a single static binary. No Python, no Docker, no CGO.
Is it better than ONNX/FAISS? Heck no. I just did it because I wanted to try out Go.
goformer: https://github.com/MichaelAyles/goformer
goformersearch: https://github.com/MichaelAyles/goformersearch
comment 9mo ago · link · parent