Why’s FPGA Instead of CPU or GPU? In the recent past, Intel purchased Altera, which is one of the largest producers of FPGAs. Intel company bought this at around $16.7 billion, making it their largest acquisition ever.
On the other hand, Microsoft is using FPGAs in its data centers while Amazon on other hand is providing them with its cloud services.
These FPGAs in the past were mainly used in electronics engineering but not that much in software engineering.
In our guide today, we are going to look at why use an FPGA instead of a CPU or GPU.
What is the meaning of an FPGA
In case you want to do something in computing, the most common way to do it is through writing some software for an instruction-based architecture ie a CPU or GPU.
The other tedious way could be designing a special circuit for a specific kind of computation, which is completely the opposite of writing instructions for a general purpose circuit such as a CPU or GPU.
After you finish designing this circuit, you will have to implement the design so that you can compute something. One way that requires quite deep pockets is to produce a circuit that implements this design.
The best alternative here to implement your circuit is through the use of an FPGA(Field Programmable Gate Array) which is a reconfigurable integrated circuit.
You can easily configure the FPGA so that it becomes any circuit that you would like to have as long as it fits on the FPGA.
This is completely the opposite of the instruction-based hardware most programmers are used to ie CPUs and GPUs.
Instruction-based hardware is configured through software, on the other hand, FPGAs are configured by specifying a hardware circuit.
Advantages of FPGAs
Why do many people choose to use an FPGA for their computation more than their common CPU or GPU? The advantages of using an FPGA are as the following.
- FPGAs are good when it comes to latency.
- Connectivity with FPGA can be done directly through the inputs and can offer very high bandwidth.
- The engineering cost is slightly higher than the instructions-based architectures, so the advantages must be worth it.
- The energy needed to do the computation in FPGA is most of the time listed as its large benefit, but whether FPGAs are better than CPUs or GPUs depends on the application mostly.
Let us look at these factors in detail so that you can understand.
This is what you need if you are programming the autopilot of a jet fighter or a high-frequency algorithmic trading engine: The time between an input and its response is as short as possible. This is where FPGAs are much better than CPUs.
With an FPGA, it is very possible to get a latency below 1 microsecond while with CPUs on the other hand a latency of fewer than 50 microseconds is already good.
However, the latency of an FPGA is much more deterministic. The main reason for this is that FPGAs can be much more specialized, they do not depend on the generic operating system and communication does not have to go through generic buses such as USB.
On an FPGA, you can easily hook up any data source such as a network interface or sensor directly to the pins of the chip.
This is the complete opposite of GPUs and CPUs, where you need to connect your source through standardized buses such as USB and depend on the operating system to deliver your application A connection that is direct to the pins of the chip offers you high bandwidth.
This bandwidth is what is needed for radio astronomy applications for example such as LOFAR and SKA.
There are lots of specialized sensors in these applications that generate a large amount of data. The volume of data is supposed to be reduced before being sent off to make it manageable.
Before diving into the issue of engineering cost, let us first take a look at the main disadvantages of FPGAs;
Programming them is much harder than instruction-based architectures such as CPUs.
The reason why it is hard to program FPGAs is the long compilation times. If you are using Intel’s OpenCL for example, it will take around 4 and 12 hours to do a compilation of a typical program for the FPGA.
This is due to the place and route phase: the custom circuit that we want needs to be mapped to the FPGA resources that we have, with paths as short as possible.
This is a complete program that needs significant computation. Intel does offer an emulator, therefore testing for correctness does not need this long step, but determining and optimizing performance do need these overnight compile phases.
Overview and outlook
In some areas, it is not easy to do away with FPGAs. In the military application for example, such as missile guidance systems, FPGAs are used due to their low latency.
However, Intel did not just spend $16.7 billion on Altera for these somewhat niche markets, they have bigger plans for it.
The two markets they want to infiltrate as far as I can tell, are high-performance computing and cloud computing.
FPGAs for high-performance computing
In my view, I do not think that FPGAs will in any way make a big splash in the high-performance computing market in the coming years.
Even if they become slightly more energy-efficient GPUs, the development of software for FPGAs is still a lot harder than you can imagine.
The HPC community is already used to GPUs, getting people to switch from GPUs and FPGAs requires larger benefits.
In more than 5 years, it might turn out that FPGAs do offer such large benefits which is what Intel seems to be expecting.
Why use an FPGA instead of CPUs or GPUs? From our discussions above, we have seen how using FPGA is better than using CPUs and GPUs.
A task that can take a CPU more than 5 hours can easily be done using FPGA in just a few minutes.