Parallelization is "free" on hardware #1276
Replies: 2 comments 5 replies
-
This is assuming your hardware constraints are already known, and not part of the cost model? |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's an interesting way of framing it! I might restrict the statement to something like: "resource-preserving parallelism is free," in the sense that you might as well parallelize if you already have the hardware resources to parallelize, you might as well do it. But of course, many good parallelism strategies really do entail duplicating hardware—that's the default notion with HLS loop unrolling, for instance. |
Beta Was this translation helpful? Give feedback.
-
I was just chatting with @andrewb1999 about the interplay between unsharing and auto-parallelization---unsharing a bunch of components may expose extra parallelization in the design---and realized that you probably don't need a cost model when deciding to parallelize a program or not. In other words, parallelization is "free" in hardware because everything is already parallel anyways.
Consider the standard dilemma in software: parallelization is good but often comes with substantial coordination costs if you're not careful. Furthermore, it is limited by the amount of hardware support for parallelism in a normal processor. In contrast, when we generate circuits, we pay a cost when we sequentialize a computation---we have to build the FSM that tracks which state is active when. If we parallelize something, we're getting rid of that cost because all we need is some mechanism to wait for all the threads to join.
In other words, the cost of "spawning a thread" in hardware is much lower which means we should be aggressively parallelizing when we can.
Beta Was this translation helpful? Give feedback.
All reactions