Live data from Hacker News

Why Use an FPGA Instead of a CPU or GPU?

blog.esciencecenter.nl

71–80 of 130 posts

Re: Why Use an FPGA Instead of a CPU or GPU?

#71

The author isn't aware apparently of over a decade of work done in FPGA/CPU integration. Both in more sequential languages like System C[1] or in extended instruction set computing like the Stretch[2]. Not to mention the Zynq[3] series where the CPU is right there next to the FPGA fabric. For "classic" CPUs (aka x86 cpus with a proprietary frontside bus and southbridge bus) it can be challenging to work an FPGA into…

Yeah, the High-Level Synthesis work goes back to the 1990's. Wikipedia has a nice list:

https://en.wikipedia.org/wiki/High-level_synthesis

They didn't really pan out in terms of large uptake. They did solve some problems pretty well with shorter, developer time. There's also been open source ones designed. Here's a few:

http://legup.eecg.utoronto.ca

https://www.synflow.com

Many of the other ones seem dead or don't have a software page. I'm not sure what's current in FOSS HLS with C-like languages. Anyone know of other developments at least as good as the two I linked?

Re: Why Use an FPGA Instead of a CPU or GPU?

#73

Does anyone have experience of Reconfigure.io [1] and their toolchain that transpiles Go for execution on FPGAs [2]? I am curious how it feels from the developer perspective, how it works in practice, and what types of applications it is a good fit for. [1] https://reconfigure.io [2] http://docs.reconfigure.io/overview.html

It's so far outside the model of FPGAs, that I wouldn't even consider putting in the effort. It's like how regular code doesn't run well on the GPU, but much worse.

Re: Why Use an FPGA Instead of a CPU or GPU?

#74

The author isn't aware apparently of over a decade of work done in FPGA/CPU integration. Both in more sequential languages like System C[1] or in extended instruction set computing like the Stretch[2]. Not to mention the Zynq[3] series where the CPU is right there next to the FPGA fabric. For "classic" CPUs (aka x86 cpus with a proprietary frontside bus and southbridge bus) it can be challenging to work an FPGA into…

Yeah, the High-Level Synthesis work goes back to the 1990's. Wikipedia has a nice list: https://en.wikipedia.org/wiki/High-level_synthesis They didn't really pan out in terms of large uptake. They did solve some problems pretty well with shorter, developer time. There's also been open source ones designed. Here's a few: http://legup.eecg.utoronto.ca https://www.synflow.com Many of the other ones seem dead or don't ha…

Nitpick: LegUp is published under a "no commercial use" license. Synflow mentions they use a "open-source language" but it is not clear how much of the tool chain is open source.

Re: Why Use an FPGA Instead of a CPU or GPU?

#75

One clarification on the comment about latency. FPGAs are typically clocked much slower than a modern CPU. Typically, they run somewhere in the low 100's of MHz, whereas an Intel CPU clocks in at around 3GHz last time I went to the Apple Store. With a typical x86 multiply instruction having a latency of about, say, 3 cycles, putting that workload on an FPGA would result in a ~10x slow-down! The real benefit of an FPG…

> One clarification on the comment about latency. FPGAs are typically clocked much slower than a modern CPU. Typically, they run somewhere in the low 100's of MHz, whereas an Intel CPU clocks in at around 3GHz last time I went to the Apple Store. With a typical x86 multiply instruction having a latency of about, say, 3 cycles, putting that workload on an FPGA would result in a ~10x slow-down!

No, not that latency. Latency from external input to external output.

Like the latency of receiving an ethernet frame to the point you can decide what to do with it, forward, modify, etc. Or reacting to sensor input.

CPUs process interrupts slowly: X86 CPUs running a non-realtime OS can take sweet 50 microseconds+ just to get to run interrupt service routine let alone doing something useful with the data. Oh, and generally no FPU, SIMD, etc. is available in this ISR [0]. So ISR generally queues the event (on Linux a Bottom Half and on Windows a DPC, deferred procedure call) to actually process the event. The queued events might execute tens of milliseconds later in bad cases.

Microcontrollers can sometimes process external interrupts pretty quickly, it's not impossible to be done in 100 nanoseconds. But it really depends, and you usually have to be pretty careful to achieve this. And even then you often have significant jitter in the processing time.

FPGAs can start to handle an external I/O event on the same clock cycle, and might very well be driving I/O output pin a clock cycle later, if no pipelining is required.

So an FPGA might be done in mere 10 nanoseconds in some ideal cases. With little to no jitter.

[0]: Well, you can do FPU/SIMD in interrupt service routine, but need to handle all register state storage on your own, and if you mess up, it'll cause very interesting bugs in the userland application software.

Re: Why Use an FPGA Instead of a CPU or GPU?

#76
post #11
post #3

Is there high performance FPGA that does not depend on proprietary bloated windows-only toolchain?

Every FPGA I have used has offered their proprietary bloated incredibly expensive toolchain on Linux. There's icestorm but the supported hardware is not exactly high performance, IIRC the biggest chips supported have around 8K LUTs.

The proprietary bloated toolchains are free to use for lower end to mid range parts, even on Linux.

Re: Why Use an FPGA Instead of a CPU or GPU?

#77
post #62
post #55

Earlier quoted context omitted.

FPGA latency is also much more predictable. Since you have cycle level control, you can know exactly how long any given operation will take. In a multi-threaded CPU, it's likely that the operation may be interrupted or delayed because of another process using the same resourt. It's also worth noting that FPGAs are often much closer to the I/O than a CPU on a motherboard. Pin to pin latencies are much reduced in a sit…

>In a multi-threaded CPU, it's likely that the operation may be interrupted or delayed because of another process using the same resourt. If you're considering an FPGA, isn't the alternative likely bare-metal CPU programming? In that case, you have just as much control over thread scheduling as you do over FPGA timing don't you?

SMM code from your firmware can still take over and add random latencies at the worst times.

Re: Why Use an FPGA Instead of a CPU or GPU?

#78

Earlier quoted context omitted.

> Aren't FPGA's used mostly to test/design a circuit that you would then go on to actually fabricate/build? We use FPGAs in cell sorting because we need to make decisions off of high dimensional data with low latency. The cells moving through our system have velocities higher than 1 m/s. They flow past a set of lasers and wind up in a droplet less than a millisecond later so we need to make a decision whether or not…

Are you doing this in a commercial context, or in a university lab or similar? I've seen a few papers come out of universities using this technique but I haven't gotten to look at any commercial gear to see how it works under the hood.

The company I work at manufactures these instruments. There are a bunch of videos on Youtube explaining how these systems work if you search for "flow sorting". I can also answer questions if you have them.

Re: Why Use an FPGA Instead of a CPU or GPU?

#79
post #74

Earlier quoted context omitted.

Yeah, the High-Level Synthesis work goes back to the 1990's. Wikipedia has a nice list: https://en.wikipedia.org/wiki/High-level_synthesis They didn't really pan out in terms of large uptake. They did solve some problems pretty well with shorter, developer time. There's also been open source ones designed. Here's a few: http://legup.eecg.utoronto.ca https://www.synflow.com Many of the other ones seem dead or don't ha…

Nitpick: LegUp is published under a "no commercial use" license. Synflow mentions they use a "open-source language" but it is not clear how much of the tool chain is open source.

Didn't know about LegUp restriction. Thanks!

Re: Why Use an FPGA Instead of a CPU or GPU?

#80
post #11

Earlier quoted context omitted.

Every FPGA I have used has offered their proprietary bloated incredibly expensive toolchain on Linux. There's icestorm but the supported hardware is not exactly high performance, IIRC the biggest chips supported have around 8K LUTs.

The proprietary bloated toolchains are free to use for lower end to mid range parts, even on Linux.

Yes but as as soon as you hit the limits of i.e. Quartus Lite it's $4k per seat per year. Then another $2k for Modelsim. And another $2k if you want the DSP package, etc.
Post reply on HN