eclipse-qvtd / org.eclipse.qvtd

Eclipse Public License 2.0
0 stars 0 forks source link

[qvts] Improve schedule indexing to facilitate late merging. #249

Closed eclipse-qvtd-bot closed 3 weeks ago

eclipse-qvtd-bot commented 3 weeks ago

| --- | --- | | Bugzilla Link | 508669 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Dec 05, 2016 08:22 EDT | | Modified | Oct 22, 2018 18:30 EDT | | Depends on | 510344 | | Reporter | Ed Willink |

Description

The ScheduleIndexer makes some attempts to make sensible mappings consecutive which helps the late merger. It could probably do much better. The ScheduleIndexer is quadratic. Can this be improved?

eclipse-qvtd-bot commented 3 weeks ago

By Ed Willink on Dec 12, 2016 05:06

The current processing to identify the schedule is indexing/call stack then connections. In the same way that focusing on connections makes incremental execution tractable, focusing on connections could make the processing less local and reduce many of the impediments to a parallel schedule.

The current schedule is often largely flat, one connection after another loped over by the root (in the right order). The current quadratic/worse efforts at finding hierarachy could be abandoned. Instead.

Create the connections first linked to their producers and consumers; the dependencies establish a partial order.

Group compatible consumers into clusters so that the late consumer merger can merge them. Compatible: same inputs, no partial order violations. Better: perform the late consumer merge here, so that compatible excludes incompatible failure predicates. Better still perform the alternator here too so that switch cases do not inhibit clustering.

Conflict: clustering A-consumers may inhibit clustering B-consumers and vice-versa. Which is better? Potentially NP-complete. Simple heuristic, biggest cluster is best. Better heuristic, determine a profit/loss metric for each clustering choice.

Optimization: single-source connections can be migrated from the root to the source. This may be beneficial if it partitions the connection (e.g. rather than all UML Classes at root, loop over child Classes at each Package.) Alternatively it may be beneficial if the partial order permits the consumers to be called from the producer perhaps facilitating a late producer merge.

Multiple-source connections can also be migrated if there is some common hierarchy.

Overall, it would seem that discovering hierarchy in a flat schedule should be more efficient and more global and more parallel than trying to create it directly.

eclipse-qvtd-bot commented 3 weeks ago

By Ed Willink on Jan 12, 2017 02:24

The PN2SC initialization has some obvious order that the indexing misses.

Currently working forwards is continually choosing from 1:N choices; the follow-ions are not obvious. Creating the inverse schedule may be better N:1 should naturally uncover predecessors. The blocking conditions in the inverse schedule are also much simpler and so lookahead may be less costly.

eclipse-qvtd-bot commented 3 weeks ago

By Ed Willink on Jan 12, 2017 05:07

Breaking cycles adds complexity. Ultimately cycles are solved by dynamic scheduling that just requires that relevant connections are installed rather than invoked.

At one point cycles were recursively extracted to create a CyclicScheduledRegion with a nested schedule. This isn't necessary.

The overall dependencies establish a directed cyclic graph. Firstly we break the cycles to leave a directed acyclic graph (Bug 510344), then we select the tree edges.

eclipse-qvtd-bot commented 3 weeks ago

By Ed Willink on May 17, 2018 09:44

(In reply to Ed Willink from comment #1)

Group compatible consumers into clusters so that the late consumer merger can merge them. Compatible: same inputs, no partial order violations. Better: perform the late consumer merge here, so that compatible excludes incompatible failure predicates. Better still perform the alternator here too so that switch cases do not inhibit clustering.

Overriding relations create non-trivial groups of same-input Activator regions. These define the alternator and can be very beneficially hoisted into the one caller/merged for single invocation from the many callers.

eclipse-qvtd-bot commented 3 weeks ago

By Ed Willink on Aug 09, 2018 04:11

(In reply to Ed Willink from comment #3)

At one point cycles were recursively extracted to create a CyclicScheduledRegion with a nested schedule. This isn't necessary.

Hmm..

The current select-the-next-region schedule indexer creates an inherently sequential and unsatisfactory schedule that misses merge opportunities.

As outlined in Bug 510344#c1, removing cycles by encapsulating them as CyclicRegions gives an acyclic producer-consumer graph that is a parallel schedule. Siblings are horizontal merge candidates, children are vertical merge candidates; far fewer than the current choice and unconstrained by accidental child ordering.

eclipse-qvtd-bot commented 3 weeks ago

By Ed Willink on Oct 22, 2018 18:30

Parallel schedule pushed to master for M2.