FPGA-based hardware acceleration for a key-value store database (2014)
dspace.mit.edu
dspace.mit.edu
In my grad program a Dr. Jason Dahlstrom [1] just graduated and his work with FPGAs to provide a limited attack vector surface is some of the more interesting FPGA work I have seen. The 10k' overview is you put some of the core features of the operating system inside FPGA hardware and define a controlled interface to it. You leverage the mass parallelism of the FPGA to have multiple instances running simultaneously and use a consensus protocol for output. Further you enable kill of each of these processes in a pseudorandom fashion and restarts from PROM so in case any one of them gets corrupted it won't have an effect for a long. I can't speak to all of the details but that is what I gleaned from a couple talks I attended in the past 2-3 years. Cool stuff.
[1] https://engineering.dartmouth.edu/people/faculty/jason-dahls...
edit: a space
If it's a very specific problem domain you can get a temporary advantage but you have to stay on the treadmill constantly to stay ahead. It also seems that there's a middle road that isn't often taken (possibly with the exception of gaming) where you can use assembly language (at least for performance critical sections). It's probably less difficult than designing for FPGAs and you still get a boost with new chips, assuming Intel doesn't destroy your optimisations.
This is the same reason a lot of deep packet inspection and do-X-with-a-packet-on-the-wire hardware is built around FPGA. Moore's law speeds up FPGAs the same as other ASICs. Newest Xilinx FPGAs are 16nm FinFET.
It may not make much sense to deploy this for a small shop but at Google or AWS scale having a hardware based key/value store has many advantages.
My impression of FPGAs is that yes, Moore's law does help, but at this point it's mostly by adding transistors. If your design doesn't take advantage of them, don't they just sit idle? Whereas Intel puts a lot of effort into making those extra transistors speed up even single threaded legacy code.
Your example of network hardware is interesting where you can keep the whole problem domain local I imagine it's a better use case.
That is difficult to match for a regular CPU system. You'll find that a lot of high-throughput CPU systems end up using FPGAs on PCIe cards to the same thing in order to achieve the needed performance.
Is using assembly really a meaningful advantage though? I think FPGAs have the advantage of being a completely different architecture which allows different algorithms with non-constant factor speedups. Assembly is going to give at most something like a constant factor 5% speedup and that's being pretty optimistic (assuming C baseline).
Also, don't some link time optimizers help with pessimizations related to calling conventions?
In general, Moore's law works just as well for FPGAs as it does CPUs & ASICs. FPGA expertise is definitely in short supply, but, as an example, with HFT, you see a lot of FPGAs.
MapReduce on FPGA: http://nics.ee.tsinghua.edu.cn/people/wangyu/conference/Yi%2...
Memcached on FPGA: http://zhehaomao.com/papers/memcached-fpga-accel.pdf
Hashtable design for 10Gbps on FPGA: https://people.inf.ethz.ch/zistvan/doc/paperM3C_3.pdf
One thing I realized long ago is that FPGA and CPU have very nearly the same design constraints. CPU has cache, FPGA has block-ram. CPU has a DRAM interface, as does an FPGA. CPU has serdes (PCIe), as does an FPGA. CPU has a lot of overhead for Tomasulo's algorithm (it boils down access to many-port memories), but FPGA has a lot of overhead for configuration memory.
Except for some massively parallel simple algorithms, CPU is just as capable as FPGA (and in fact is usually much more versatile and easier to program).
Skimming their summary, conclusion & comparison I can't really find a a good answer to it. Not saying it's a cool project but I don't see a practical case / nor pushing anything forward.
I imagine a pretty low-end server class x86 processor should be able to saturate most network links. There prob is a fair overhead going from network device, memory, OS, process and back out. But you could have your KV run in kernel space or as a real time process with dedicated core(s) / network device (memory mapped).
And DPDK: https://www.usenix.org/conference/nsdi14/technical-sessions/...
And DPDK+GPU: http://kay21s.github.io/megakv/
It would be interesting to see a fair comparison of these to determine the real value of exotic technology.
You mean like when you are implementing a massive key-value store? ;-)
1. FPGAs have between 1-2 orders of magnitude higher on-chip memory bandwidth. Imagine lighting up all of the block RAMs on your chip. That blows away the memory performance of a CPU. It's not even close.
2. FPGAs have significantly more parallel compute resources (if your problem isn't purely memory bandwidth limited). Even if it's not stupidly data-parallel, there are several clever design choices you can make to extract a lot of parallelism.
It is, as you point out, much harder to program an FPGA. God save me if I have to run SP&R tools again in my life. However, if you have the resources and know what you are doing you will get 10-1000x more performance from an FPGA. Just look at any FCCM paper from the last 20 years.
The more apt comparison is FPGAs vs ASSPs. Those are what have been eating FPGA's lunch for the last decade.
Intel bough Altera and will integrate FPGAs into the Xeon this year so expect to see this expand.
[0] https://newsroom.intel.com/news-releases/intel-completes-acq...
If you sandbox it you lose some flexibility.
Also, as you said, demand and cost are the problems I think of. The regular FPGA developer usually has no idea of how to interact with the cloud.
I worked with FPGA for five years before going to python / backend. Most of FPGA people develop in windows and don't know web at all in the application layer.
I think FPGA as a service can be something really interesting. But it's really hard to find the customers. GPU programmers are software developers, whereas FPGA people aren't.
https://dspace.mit.edu/bitstream/handle/1721.1/91829/8942284...
I don't think that this is really a relevant result, my old Core i3 with 2.5 GHz easily achieves their five million operation per second when I just use an in-memory hash map - tested with the simplest possible C# program adding ten million strings into a Dictionary<String, String>.
If a key value store uses concurrency well it might continue to benefit from better hardware and likewise if an FPGA key value store builds in more concurrency it might be able to perform substantially in overall throughput.
Throughput is going to mean concurrency and that could mean a lot more happens with the same resources in an FPGA since it is dedicated.