Hacker News
Show HN: A tiny LLM running at 21,000 tok/s on a $250 FPGA (Live Demo)
tomex
|next
[-]
mikeayles
|root
|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!
variadix
|next
|previous
[-]
dahnhiller
|next
|previous
[-]
peter_d_sherman
|next
|previous
[-]
Any article, even the really good ones on HN, while they get positive comments, for whatever reason, always get a lot of negative ones, too...
That is, the negative comments are absolutely unavoidable, even for people accomplishing great things!
I personally think that what you've done is brilliant, absolutely brilliant!
I can't wait to see more in this space...
Brilliant, absolutely brilliant!
RetroTechie
|root
|parent
|next
[-]
But model(s) implemented are clearly too small to be useful as a 'chat partner'. Tried a couple of sentences - replies is just some gibberish coming out.
This really needs a bigger FPGA, or some other application(s) where a tiny LLM does actually useful work. Barring that, generated tokens/sec is kind of a meaningless measure imho.
M4R5H4LL
|root
|parent
|previous
[-]
stevefan1999
|next
|previous
[-]
Sure, you can go ASIC and go even faster, but the thing around GPU is that they scale well for both training and inference, and the technical floor is low.
The level to get into FPGA design is insanely high, you've got to read timing diagrams, you need to know combinatorial and sequential logics and good sense of boolean algebra, you need to have an asynchronous signal based mindset which is vastly different from CPU/GPU, you need to know netlist and you need to endure the time it takes for the EDA to finish generating it. Yosys is still years behind Xilinx
There is a reason GPUs are called accelerators; it sacrifices and does not try to really specialize on one particular thing, except high parallel dataflow and branch-free calculation. Otherwise we will all be using DSPs
cgyvbunji
|root
|parent
|next
[-]
adrian_b
|root
|parent
|next
[-]
A GPU is much more efficient than an FPGA for what a GPU does. On the other hand for applications for which the set of primitive operations implemented in hardware by a GPU is not a good fit, an FPGA can be much more power efficient than a GPU.
For applications that involve a massive amount of computations with FP32, FP16 or BF16 numbers, for which GPUs have special hardware execution units, i.e. for training and for inference with non-quantized models, there is no chance for an FPGA to be more efficient.
If the GPU is recent enough to have good support for more heavily quantized data types, e.g. INT8, FP8, NVFP4 etc. an FPGA also does not have chances to be competitive.
An FPGA could be more efficient than a GPU if either it is some special AI-oriented FPGA, which instead of having traditional arithmetic units oriented for DSP applications, has execution units implementing the quantized data types popular in ML/AI, or if it implements inference using some new not yet standardized data type, for which GPUs do not have dedicated support yet.
cgyvbunji
|root
|parent
[-]
imtringued
|root
|parent
|next
[-]
The more application specific you get, the smaller the total volume of chips. The very nature of application specifity ruins the economics of ASICs.
Every time someone tells me an ASIC is more energy efficient I'm thinking, you just ruined the business case. The vast majority of application specific designs are not economically viable unless you use FPGAs to implement them.
stevefan1999
|root
|parent
|next
|previous
[-]
Anything else is added and unintentional benefits.
imtringued
|root
|parent
|previous
[-]
FPGAs win against MCUs in terms of performance and they only lose in terms of static power consumption, not on performance per watt.
Also, there was a company doing LLM inference on FPGAs and their entire selling point was that they were more energy efficient than Nvidia so you can add more FPGAs onto the same rack.
Finally, the ASIC Vs FPGA battle is kind of meaningless because the moment you decide to reprogram your FPGA for any reason, ASICs aren't even in the same market anymore.
Then there is the fact that FPGAs tends to have insane amounts of SRAM bandwidth compared to most chips.
IshKebab
|root
|parent
|previous
[-]
The hardest bit is probably SystemVerilog - it's just such a terrible language for hardware design. Full of footguns and gotchas and weird limitations and undocumented or tool-dependent stuff that you have to just know (like what is synthesizable).
Approximately nobody uses Yosys.
avmich
|root
|parent
|next
[-]
anitil
|root
|parent
|next
|previous
[-]
imtringued
|root
|parent
|previous
[-]
The goal of an FPGA vendor isn't to make FPGAs mainstream, no. Their goal is to sell you the biggest FPGA they can get away with even though from the customer's perspective you want to use the smallest FPGA possible to make the economics work.
haeseong
|next
|previous
[-]
all2
|root
|parent
|next
[-]
[0] https://news.ycombinator.com/item?id=49244312
@dang, the creator of this idea is having his comments killed off for some reason.
mikeayles
|root
|parent
|previous
[-]
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.
useiris
|root
|parent
[-]
serf
|next
|previous
[-]
practically the results seem about as coherent as
import random; print(random.choice(list(my_dict)))
..but way sloweris there a practical use to a model this small?
mikeayles
|root
|parent
[-]
Plus I treated it as a good learning experience to get better with FPGA's but also system design.
mikeayles
|next
|previous
[-]
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.