Vibecoding an inference chip ankitg.me · 176 points · 76 comments · HN thread TL...

@best30

Vibecoding an inference chip ankitg.me · 176 points · 76 comments · HN thread

TL;DR A blog post by Ankit Gupta recounts using coding agents (Codex and Claude models) to build a bit-exact, ternary-weight LLM inference engine on an AWS F2 FPGA with 16 GB HBM, reaching 213 tokens/s after a 33x speedup over the first working image. The run took several days and about $10,000 in API tokens, and the author argues agents can now handle low-level hardware work.

  • The agent got a full ternary-weight model running on an AWS F2 FPGA (16 GB HBM) and then raised decode speed from 6.43 to 213.13 tokens/s, about 33x, over roughly 14 optimization steps.
  • Gains came as many modest compounding improvements (typically 1.1x to 1.6x each), such as host overhead cuts, burst attention, parallel routing, speculative decoding with a draft model, and memory port doubling.
  • The author gave mostly generic prompts ('make it faster'); a design prompt from the DeepGrove founders was adopted but the agent's retrospective said most of its ideas were already planned, and the numerics shortcuts were rejected to keep bit-exactness.
  • Process guidance (avoid multi-hour simulations, run quick synthesis and logic-depth checks, do place-and-route only at integration) was judged the most useful human input.
  • On a bit-exact benchmark, the FPGA at $1.98/hour beat CPU twins at similar prices (e.g. 213 vs 129.5 tokens/s on a $1.95/hour 32-core Zen 5 instance); GPU ports were faster but not bit-exact.
  • The author says the project is a curiosity with no plan to use this architecture in production.

Discussion The thread is a mix of technical skepticism about FPGAs versus ASICs and GPUs, cost arguments about the $10,000 token spend, and general enthusiasm about what coding agents can now build. Many commenters note that FPGAs pay a large area, power and cost penalty for reconfigurability, while others point to HBM and niche uses. A recurring side argument is who actually pays for heavily used API tokens versus subscriptions. The tone is mostly curious and somewhat skeptical, with a sharp exchange between a few commenters who doubt the efficiency claims.

  • FPGAs are the wrong tool for mass-market inference (many): Commenters argue reconfigurability costs area, power and speed compared with ASICs, so FPGAs only make sense for low volume, prototyping, or certified niche designs. One commenter says they are building an FPGA into a product because ASIC costs and functional safety concerns are too risky.
  • Impressive that agents can do hardware work (many): Several commenters are impressed by how far agents now go in unfamiliar domains such as Verilog, transformers in C, and FPGA designs, and see verification and automated feedback as the key enabler.
  • The $10,000 token cost is excessive or unrealistic (some): Some commenters question the cost for a curiosity project, while others note the startup credits made it free for the author. Debate follows about whether API prices reflect real costs or subsidies, and whether subscriptions are profitable.
  • Repeated 'make it faster' prompting is weak engineering (some): A few commenters see the autoresearch loop as trial-and-error prompting that a skilled engineer would replace with informed guidance, though others counter that it still helps for people without deep background.
  • Skeptical about FPGA power and performance claims (a few): A hardware-focused commenter argues FPGAs cannot match GPUs in matmul throughput or match a 5 W power budget for a large model, since fabric clocks are much lower; they also doubt that GPU-based LUT simulation performs well.
  • FPGA-based and ternary inference shows promise for edge use (a few): Some commenters see the approach as promising for small models and edge devices, citing a tiny model reaching tens of thousands of tokens/s on a commodity FPGA, and interest in ternary weights.

Links from the comments

#fpga #llmInference #vibeCoding #ternaryWeights #hardware #aiAgents