3 ms·
What is the purpose of this card? I'm familiar with using GPUs and even TPUs for some task specific acceleration but what's the point of a chip like this? Does
by debbiedowner 6y ago
What is the purpose of this card? I'm familiar with using GPUs and even TPUs for some task specific acceleration but what's the point of a chip like this? Does this speed up arbitrary C code? I understand that an FPGA is in the middle of the CPU - ASIC spectrum, but what are the potential speedups for various types of code?
- ganzuul 6y agoShuffles lots of bits in parallel, low latency.
- nitrogen 6y agoE.g. for FPGAs in general: multiplexing I/O, such as audio hardware managing hundreds of channels of digital audio for a theme park parade PA system over several different busses including Ethernet.
- sgtnoodle 6y agoAn FPGA can be thought of as programmable hardware. An FPGA chip has many many thousands of very flexible logic blocks, and a matrix of interconnects to connect those logic blocks together arbitrarily. Software tools allow you to describe a complex digital circuit, and the design is compiled down into a bitstream that configures the FPGA's blocks and interconnects to implement the circuit. In addition to internal connections, the circuits can be connected to external IO pins. The logic blocks and interconnects are relatively slow compared to a tailor made ASIC, but they're still generally capable of propagating signals approaching GHz clock rates. As an example, with a really nice CPU you might be able to run billions of instructions per second, but you are limited to what those instructions can do. If you want to sum a bunch of integers, you need to do it sequentially by implementing a loop. Maybe you can sum 1 billion integers per second. With an FPGA, you could instead use the available blocks to implement a thousand adders in a logarithmic pyramid, able to sum 500 numbers at once at say 100Mhz, and the circuitry to speak to a CPU and its memory directly over PCI-E. Now, you can sum 50 billion integers per second, assuming the RAM can even keep up. I can't imagine there's any automatic speed up of C code with this specific card, unless the card maker implemented a really fancy compiler. More likely, there's a specific algorithm that the card was designed to do in parallel faster than a CPU can. Someone had to implement that algorithm in a language that could be compiled down to the FPGA bitstream. On top of that, it's possible the card wasn't even meant to be tightly coupled to a traditional CPU. It's possible that the FPGA was meant to participate directly on a data center network and respond to requests directly. The whole "program" could be implemented as state machines in digital logic, including the TCP/IP stack. Also, "soft" CPUs can be implemented inside an FPGA, making it possible to run traditional programs too. You can generally use an FPGA to implement any algorithm that's parallelizable to some degree. As a master's project 11 years ago, my team accelerated stereo disparity calculations with an FPGA. The idea is that you match similar pixels between two spatially separated images in order to generate a depth map. It's an expensive calculation. At the time, a CPU could manage a few frames per second from 480p webcam streams. The FPGA version could handle hundreds of frames per second. We couldn't feed it in video fast enough. Of course, nowdays a modern GPU running a shader program might be faster.
- debbiedowner 6y agoThanks for the detailed response. I was just about to say: when to use an FPGA over a gpu? There are a few GPU gems books that describe what kind of code runs best on GPUs, and you can buy 30TFlops for $700 these days. I know gpu is not so good beyond single precision. Is that the application? Do you recommend a similar FPGA gems book/website? I see there is: designing with xilinx fpgas, design warriors guide to fpgas
- sgtnoodle 6y agoIt really comes down to how well a GPU's capabilities align with the problem you're trying to solve. A modern GPU is basically thousands of really simple CPUs that all run the exact same program but on different input data. Communication between those CPUs while the program is running is incredibly bad for performance. If your problem is solvable within those limitations, then a GPU is a good choice. An FPGA gives you more flexibility because you can dedicate hardware exactly where you need it. You don't even need to stick with common data widths. If you only need 11 bits, then there's no need to do 32 bit math, for example. An ASIC with custom circuitry will generally be the fastest, lowest power way to solve a problem, with the lowest per-unit cost, but it has absurdly high development and initial tooling cost. An FPGA gives you the benefits of custom circuitry with significantly lower development cost (than an ASIC), but it's less power efficient and the unit cost is relatively high for what you're getting. A GPU gives you good power efficiency, good development cost, and good unit cost if your problem maps well to what GPUs can do. A CPU gives you the lowest development cost, but sets a mediocre baseline for power efficiency and unit cost.
- fouc 6y agomiddle of the CPU-ASIC spectrum? Not sure that's true, bitcoin miners started out on CPU, moved to GPU, and during that period also did some mining with FPGAs before quickly moving to custom ASICs.