Fractal: An Execution Model for Fine-Grain Nested Speculative Parallelism [pdf]
Hi all. This is Suvinay Subramanian from MIT. I am one of the authors on the Fractal paper. I wanted to provide some context for this work, and briefly summarize our paper. I hope this will address some of the comments on this thread. And I am happy to answer any further queries you may have.<p>You may also be interested in the slides of this work presented at the International Symposium on Computer Architecture (ISCA) last week: <a href="http:&#x2F;&#x2F;bit.ly&#x2F;fractal-slides" rel="nofollow">http:&#x2F;&#x2F;bit.ly&#x2F;fractal-slides</a><p>What motivated this work?                                                                                                               
While multi-cores are pervasive today, programming these systems and extracting performance on a range of real world applications remains challenging. Systems that support speculative parallelization, such as Transactional Memory (supported in hardware in commercial processors today, such as Intel Haswell, IBM&#x27;s Power 8 etc.) help simplify parallel programming, by allowing programmers to designate blocks of code as atomic, in contrast to using complex synchronization using locks, semaphores etc.<p>However, their performance on real world applications remains poor. This is because real world applications are complex, and often have large atomic tasks either due to necessity or convenience. For example, in database workloads, transactions have to remain atomic (i.e. all actions within a transaction have to &quot;appear as a single unit&quot;). But each transaction can be long (~few million cycles) -- such large tasks are prone to aborts, and are expensive to track (in software or hardware).<p>Now, there is often abundant parallelism inside such large tasks (as has been noted in prior work). But the challenge is how to extract this parallelism while also keeping the entire unit atomic. Prior approaches, including nested Transactional Memory, and Thread-Level-Speculation (TLS) have been unsuccessful in extracting this parallelism -- section 7 of our paper explains why (or see slides).<p>Fractal provides a new execution model that addresses the limitations of prior approaches, and proposes a hardware architecture that can successfully scale several challenging workloads -- some of which have eluded successful parallelization for decades. Importantly, Fractal allows us to operate at the granularity of &quot;small&quot; tasks that are easy to track. Further Fractal enables programmers to seamlessly compose speculative parallel algorithms.<p>What are the key ideas of Fractal?
There are two key insights:
1. Decouple atomicity from parallelism -- We introduce the notion of a domain, where all tasks belonging to a domain appear to execute as a single atomic unit. By doing this, we can execute the &quot;subtasks&quot; in parallel, while ensuring atomicity of the &quot;collection of subtasks&quot; via other mechanisms.<p>2. Ordering to enforce atomicity -- Unlike prior techniques that &quot;merge&quot; subtasks to enforce atomicity, we leverage ordering to enforce atomicity.<p>Tell me more about the hardware, aka the Swarm architecture.                                                                            
Conventional wisdom dictates that ordering limits parallelism. Now ordered parallelism is hard -- there have been several attempts at taming this beast, including Thread-Level Speculation (TLS), as alluded to in one of the comments.<p>In our prior work, Swarm, we demonstrated that it is possible to extract parallelism even in the presence of ordering constraints, with a more expressive execution model, and some nifty hardware tricks.<p>At a high level, the Swarm hardware executes tasks speculatively, and elides ordering constraints. Only true data dependences force an &quot;ordered&quot; execution.  On the hardware side, Swarm has large hardware task queues to manage tasks, and a high-throughput commit protocol and speculation mechanisms that allow it to scale.<p>You can read more on Swarm at: <a href="http:&#x2F;&#x2F;bit.ly&#x2F;swarmarch" rel="nofollow">http:&#x2F;&#x2F;bit.ly&#x2F;swarmarch</a><p>Fractal relies on the Swarm hardware to enforce ordering guarantees while extracting parallelism. The key challenges were how to assign a suitable ordering to the subtasks that also maintains the atomicity of &quot;domains&quot; of subtasks, how to assign this ordering dynamically, and how to support &quot;unbounded nesting&quot;, eg: if your subtask makes a library call, that itself could be parallelized (but must still remain atomic), and so on (supporting unbounded nesting is essential for software composition of algorithms).<p>Is Fractal &#x2F; Swarm just an accelerator?
We believe that Fractal and Swarm are a more general solution to some of the hardest parallel computing problems. We have shown that the ideas presented in these works are applicable in a wide range of domains ranging from databases, to discrete-event simulation, to machine learning, and graph analytics.<p>When will we see this in hardware?
Currently, we evaluate our ideas in simulation. But our group is working on prototyping this on an FPGA in the coming year. So stay tuned!