← Fri, Nov 20 digest

Vibecoding an inference chip

read article ↗ hn thread ↗

An engineer with no FPGA or Verilog experience used coding agents to write millions of lines of code and build a 213 token/sec ternary model inference engine on an AWS FPGA.

read it The detailed build log of using AI agents to write low-level code for an FPGA inference engine offers fascinating insights into agent-driven hardware design.

summary

An engineer leveraged AI coding agents to build a high-performance LLM inference engine on an AWS FPGA using ternary weights, despite having zero prior Verilog experience. Over a multi-day optimization loop costing roughly $10,000 in API tokens, the agent wrote millions of lines of code and iterated through 14 distinct performance enhancements. The final setup achieved 213 tokens per second, outperforming multi-core CPU baselines while maintaining bit-exact accuracy. The project demonstrates how large token budgets allow engineers to conquer entirely new, low-level hardware domains.

key points

  1. The AI agent iterated through a 14-step optimization loop—improving streaming weights, parallel routing, and memory packing—to boost baseline inference speed 33-fold up to 213 tokens per second.
  2. The build required writing roughly 3 million lines of C++ and Verilog code and consumed about $10,000 in model tokens using startup credits.
  3. The final FPGA implementation matched or beat multi-core CPU setups while preserving complete bit-exact accuracy.

who should read it

Hardware engineers, AI developers, and practitioners interested in agentic coding workflows.

discussion positive

consensus

Commenters are fascinated by the capabilities of agentic coding for complex hardware tasks, though many debate the economic viability of FPGAs for AI inference compared to GPUs and ASICs.

pushback

Some critics note that spending $10,000 in raw API tokens for a curiosity is excessive, though others point out it was likely covered by startup credits.

best comment by mikeayles ↗

With FPGAs, you're paying for reconfigurability, which hurts in terms of cost, speed and power.

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 …

Provides professional context on FPGA limitations and explains why high-bandwidth memory is crucial for making ternary LLM inference viable.

Generated by an LLM from the article and thread. Check the sources before relying on it.