MPLLang / mpl

The MaPLe compiler for efficient and scalable parallel functional programming
Other
306 stars 18 forks source link

Fast entanglement detection based on entanglement candidates (suspects) #154

Closed shwestrick closed 2 years ago

shwestrick commented 2 years ago

Implements a heap-local candidate (a.k.a. suspect) set of objects that might contain a down-pointer. Candidates have a bit in their header which is marked by the write-barrier when a down-pointer is created. This is then used to accelerate the read-barrier for entanglement detection:

The fast path is supported by the compiler: in ssa2-to-rssa, we generate the code for the fast path, avoiding a runtime call in the case of a non-candidate.

Whenever a heap becomes a leaf, we clear the candidates within that heap (because at this point, those objects are guaranteed to no longer have down-pointers).

Performance Improvement

The fast path works incredibly well. Here are some results from our recent experiments, measuring the performance improvement due to the fast path.

Screen Shot 2022-05-23 at 11 37 11 AM

Running time improvements are as much as 4x at scale.

Notice also:

Overall performance

Due to fast path improvements, the overall cost of entanglement detection is now essentially zero. Space overhead appears to be negligible across the board. In terms of time overhead, we measured approximately 1% on average across 23 benchmarks, and a max of 7%. A majority of benchmarks (18 out of 23) incur less than 2% time overhead.

shwestrick commented 2 years ago

Did a bit of testing for this merge today and everything looks good.