automatically exploiting cross-invocation parallelism using runtime ...
automatically exploiting cross-invocation parallelism using runtime ... automatically exploiting cross-invocation parallelism using runtime ...
to T i . DOMORE’s MTCG follows these three rules, and requires two more rules: (d)a BB is relevant to T w only if it belongs to the original inner loop; and (e) inner loopheader is always relevant to both T s and T w . Rule (d) simplifies the control flowof code generated for T w . However, since produce and consume instructionsare placed at the point where dependent values are defined, worker thread may notcontain the corresponding BB because of rule (d). Rule (e) guarantees that any valuethat is defined in BBs which are not duplicated in T w can be communicated at thebeginning of the duplicated inner loop headers.2. 2. Create the BBs for each partition. Place instructions assigned to the partition inthe corresponding BB, maintaining their original relative order within the BB. Add aloop preheader BB and a loop return BB to T w .3. 3. Fix branch targets. In cases where the original target does not have a correspondingBB in the same thread, the new target is set to be the BB corresponding tothe closest relevant post-dominator BB of the original target. Insert a sync BB to T w ,which serves as the closest post-dominator BB for BBs which do not have a relevantpost-dominator BB in T w . Branch the sync BB in T w to the loop header.4. 4. Insert produce and consume instructions. For Loop flow dependences,produce and consume instructions are inserted in the BB where the value is defined,if that BB is duplicated in both threads. Since inner loop live-in values areused but not defined inside the inner loop, the respective BB are not duplicated inT w . To reduce the amount of communications, live-in values which are outer loopinvariants are communicated at the end of the inner loop preheader. And the otherlive-ins will be communicated at the beginning of inner loop header. According tothe partition rules, since instructions generating inner loop live-outs to the outer loopare partitioned to the scheduler thread, DOMORE does not need to handle those liveoutvalues. Finally, a timestamp is communicated at the beginning of the inner loop36
header. This timestamp value gives a global order for iterations from all invocationsand will be used for scheduling and synchronizing iterations.5. 5. Finalize the communication. To control when each worker thread should return,an END TOKEN is broadcasted when exiting the outer loop in T s . That value willbe captured by the first consume instruction in T w ’s duplicated loop header. Two instructionsare inserted to decide when to return from T w : (1) a comparison instructionto check whether that value is an END TOKEN; (2) a branch instruction targeting thereturn BB if the comparison instruction generates true value.Up to this point, DOMORE has generated the initial code for scheduler thread andworker thread (Figure 3.6(d) and (e)). Later steps generate scheduling code, computeAddrcode which will be inserted into the scheduler function and workerSync code which willbe inserted into the worker function.37
- Page 1 and 2: AUTOMATICALLY EXPLOITINGCROSS-INVOC
- Page 4 and 5: techniques. Among twenty programs f
- Page 6 and 7: in particular. Their professionalis
- Page 8 and 9: ContentsAbstract . . . . . . . . .
- Page 10 and 11: 4.5.4 Load Balancing Techniques . .
- Page 12 and 13: 2.4 Sequential Loop Example for DOA
- Page 14 and 15: 4.5 Overview of SPECCROSS: At compi
- Page 16 and 17: 1.1 Limitations of Existing Approac
- Page 18 and 19: advanced forms of parallelism (MPI,
- Page 20 and 21: the graph stands for an iteration i
- Page 22 and 23: 1.2 ContributionsFigure 1.5 demonst
- Page 24 and 25: 1.3 Dissertation OrganizationChapte
- Page 26 and 27: alias the array regular via inter-p
- Page 28 and 29: 1 for (i = 0; i < M; i++){2 node =
- Page 30 and 31: 1 cost = 0;2 node = list->head;3 Wh
- Page 32 and 33: example which cannot benefit from e
- Page 34 and 35: These techniques are referred to as
- Page 36 and 37: unnecessary overhead at runtime.Tab
- Page 38 and 39: Chapter 3Non-Speculatively Exploiti
- Page 40 and 41: for a variety of reasons. For insta
- Page 42 and 43: 12x11x10xDOMOREPthread Barrier9xLoo
- Page 44 and 45: Algorithm 1: Pseudo-code for schedu
- Page 46 and 47: Algorithm 2: Pseudo-code for worker
- Page 48 and 49: 3.3 Compiler ImplementationThe DOMO
- Page 52 and 53: Outer_Preheaderbr BB1ABB1A:ind1 = P
- Page 54 and 55: Algorithm 3: Pseudo-code for genera
- Page 56 and 57: Scheduler Function SchedulerSync Fu
- Page 58 and 59: SchedulerWorker1 Worker2Worker3Work
- Page 60 and 61: 3.5 Related Work3.5.1 Cross-invocat
- Page 62 and 63: ations during the inspecting proces
- Page 64 and 65: for (t = 0; t < STEP; t++) {L1: for
- Page 66 and 67: sequential_func() {for (t = 0; t <
- Page 68 and 69: Workerthread 1Workerthread 2Workert
- Page 70 and 71: library provides efficient misspecu
- Page 72 and 73: Workerthread 1TimeFigure 4.6: Timin
- Page 74 and 75: 4.2 SPECCROSS Runtime System4.2.1 M
- Page 76 and 77: takes up to 200MB memory space.To d
- Page 78 and 79: checkpoint, the child spawns new wo
- Page 80 and 81: Operation DescriptionFunctions for
- Page 82 and 83: Main thread:main() {init();create_t
- Page 84 and 85: implemented in the Liberty parallel
- Page 86 and 87: Algorithm 5: Pseudo-code for SPECCR
- Page 88 and 89: CROSS, since SPECCROSS can be appli
- Page 90 and 91: techniques.Synchronization via sche
- Page 92 and 93: Source Benchmark Function % of exec
- Page 94 and 95: applied to the outermost loop, gene
- Page 96 and 97: 5.2 SPECCROSS Performance Evaluatio
- Page 98 and 99: and the number of checking requests
to T i . DOMORE’s MTCG follows these three rules, and requires two more rules: (d)a BB is relevant to T w only if it belongs to the original inner loop; and (e) inner loopheader is always relevant to both T s and T w . Rule (d) simplifies the control flowof code generated for T w . However, since produce and consume instructionsare placed at the point where dependent values are defined, worker thread may notcontain the corresponding BB because of rule (d). Rule (e) guarantees that any valuethat is defined in BBs which are not duplicated in T w can be communicated at thebeginning of the duplicated inner loop headers.2. 2. Create the BBs for each partition. Place instructions assigned to the partition inthe corresponding BB, maintaining their original relative order within the BB. Add aloop preheader BB and a loop return BB to T w .3. 3. Fix branch targets. In cases where the original target does not have a correspondingBB in the same thread, the new target is set to be the BB corresponding tothe closest relevant post-dominator BB of the original target. Insert a sync BB to T w ,which serves as the closest post-dominator BB for BBs which do not have a relevantpost-dominator BB in T w . Branch the sync BB in T w to the loop header.4. 4. Insert produce and consume instructions. For Loop flow dependences,produce and consume instructions are inserted in the BB where the value is defined,if that BB is duplicated in both threads. Since inner loop live-in values areused but not defined inside the inner loop, the respective BB are not duplicated inT w . To reduce the amount of communications, live-in values which are outer loopinvariants are communicated at the end of the inner loop preheader. And the otherlive-ins will be communicated at the beginning of inner loop header. According tothe partition rules, since instructions generating inner loop live-outs to the outer loopare partitioned to the scheduler thread, DOMORE does not need to handle those liveoutvalues. Finally, a timestamp is communicated at the beginning of the inner loop36