Vibecoding an inference chip ankitg.me · 45 points · 11 comments · HN thread TL;...
HN Best 200 @best
Vibecoding an inference chip ankitg.me · 45 points · 11 comments · HN thread
TL;DR The author, with no prior FPGA or Verilog experience, used a coding agent over several days to build a bit-exact ternary-weight LLM inference engine on an AWS F2 FPGA, reaching 213 tokens/s on an 8,192-token context. The agent ran an autoresearch loop that took the baseline from 6.4 to 213 tokens/s (33x) for about $10,000 in API tokens, and the author argues this shows agents can handle new low-level domains with the human mostly setting direction and correctness criteria.
- Target was a ternary-weight model (DeepGrove architecture) on an F2 instance with 16 GB FPGA HBM, with a bit-exact requirement against a CPU reference.
- Optimization ran for several days through a cloud agent in Conductor, producing about 3M lines of code and processing 30M lines of output, at roughly $10,000 in Claude and OpenAI tokens across hundreds of experiments.
- Gains came as a series of modest steps, each roughly 1.1x to 1.6x, including burst attention, a parallel router, speculative decoding with prompt lookup and then a draft model, and doubled memory ports.
- Final image r9 reached 213.13 tok/s on f2.6xlarge at $1.98/hour, versus 129.5 tok/s for an exact CPU twin on a 32-core instance at $1.95/hour; GPU ports were faster but not bit-exact.
- A pasted expert prompt was the largest human guidance; the agent's retrospective said it adopted mostly ideas it had already planned and rejected the numerics shortcuts that would have broken bit-exactness.
- The author notes the work is not a recommendation for production use and that the process advice (short iteration loops, separating simulation from hardware claims) mattered most.
Discussion The thread is short and mostly reacts to the feasibility and cost of the project. Commenters treat implementing a transformer as a new rite of passage for AI-assisted coding, point to a similar earlier project, ask for the code, and question who pays for $10,000 of tokens. The mood is impressed but skeptical about the economics and about what the result proves.
- Impressive that agents can now do FPGA work end to end (many): Commenters see the project as a sign that low-level hardware work is now within reach of coding agents. One notes that implementing transformers is becoming the new hello world of AI-assisted coding, and another that a prior similar project was done with Opus 4.5.
- Speed of about 70+ tok/s is good for the model size (some): One commenter identifies the model as Maple, a 20B model, from a trace in the article, and considers the throughput quite good for that size, while noting the article does not state model size directly.
- The $10,000 cost is questionable or paid by others (some): Commenters point out that the token spend equals a $200 monthly subscription's usage many times over, and ask who bears the cost, with the reply that corporate customers do.
- Verifiable domains make agents effective (a few): One commenter argues FPGA work is essentially software-driven, so the model can check its own output easily, which explains why the agent succeeded here.
- Requests for code and follow-up work (a few): Commenters ask the author to share the code and suggest next steps such as post-training the model for a specific FPGA architecture, or emulating an FPGA on consumer GPU hardware to reduce cloud cost.
Links from the comments
#fpga #llmInference #vibeCoding #aiAgents #hardwareAcceleration