automatically exploiting cross-invocation parallelism using runtime ...
automatically exploiting cross-invocation parallelism using runtime ... automatically exploiting cross-invocation parallelism using runtime ...
Algorithm 1: Pseudo-code for scheduler synchronizationInput: iterNum : global iteration numberaddrSet ← computeAddr(iterNum)tid ← schedule(iterNum, addrSet)foreach addr ∈ addrSet do< depTid, depIterNum > ← shadow[addr]if depIterNum ≠ −1 thenif depTid ≠ tid thenproduce(tid, < depTid, depIterNum >)shadow[addr] ← < tid, iterNum >produce(tid, < NO SYNC, iterNum >)thread finds no additional dependences, it will send (NO SYNC,i) to thread T1.3.2.3 Synchronizing IterationsWorkers receive synchronization conditions and coordinate with each other to respect dynamicdependences. A status array is used to assist this: latestFinished recordsthe latest iteration finished by each thread. A worker thread waiting on synchronizationcondition (depId, depIterNum) will stall until latestFinished[depId] ≥depIterNum. After each worker thread finishes an iteration, it needs to update its statusin latestFinished to allow threads waiting on it to continue executing.Synchronization conditions are forwarded using produce and consume primitivesprovided by a lock-free queue design [31], which provides an efficient way to communicateinformation between scheduler and worker threads.3.2.4 Walkthrough ExampleThe program CG illustrates DOMORE’s synchronization scheme. Figure 3.5(a) shows theaccess pattern (value j) in each iteration for two invocations. Iterations are scheduled totwo worker threads in round-robin order. Figure 3.5(b) shows the change of the helper datastructures throughout the execution.30
InputSequentialProgramCompile TimeDetect Target Loop NestPartitionerCode GenerationOutputSchedulerCodeWorkerCodeRuntimeSchedulerThreadWorkerThreadsSynchronization SchemeFigure 3.4: Overview of DOMORE compile-time transformation and runtime synchronizationIteration I1 accesses array element A1, the scheduler finds shadow[A1] = meaning no dependence exists. It constructs a synchronization condition (NO SYNC,I1)and produces it to worker thread T1.It then updates shadow[A1] to be ,implying thread T1 has accessed array element A1 in iteration I1.consumes the condition and executes iteration I1 without waiting.Worker thread T1After it finishes, itupdates latestFinished[T1] to be I1. Iteration I2 accesses array element A3 andno dependence is detected.A synchronization condition (NO SYNC,I2) is producedto worker thread T2, and worker thread T2 consumes the condition and executes iterationI2 immediately.Iteration I1 in the second invocation accesses element A3 again.Since shadow[A3] = , a dependence is detected.So the scheduler produces(T2,I2) and (NO SYNC,I3) to worker thread T1. Worker thread T1 then waits31
- 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 46 and 47: Algorithm 2: Pseudo-code for worker
- Page 48 and 49: 3.3 Compiler ImplementationThe DOMO
- Page 50 and 51: to T i . DOMORE’s MTCG follows th
- 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
InputSequentialProgramCompile TimeDetect Target Loop NestPartitionerCode GenerationOutputSchedulerCodeWorkerCodeRuntimeSchedulerThreadWorkerThreadsSynchronization SchemeFigure 3.4: Overview of DOMORE compile-time transformation and <strong>runtime</strong> synchronizationIteration I1 accesses array element A1, the scheduler finds shadow[A1] = meaning no dependence exists. It constructs a synchronization condition (NO SYNC,I1)and produces it to worker thread T1.It then updates shadow[A1] to be ,implying thread T1 has accessed array element A1 in iteration I1.consumes the condition and executes iteration I1 without waiting.Worker thread T1After it finishes, itupdates latestFinished[T1] to be I1. Iteration I2 accesses array element A3 andno dependence is detected.A synchronization condition (NO SYNC,I2) is producedto worker thread T2, and worker thread T2 consumes the condition and executes iterationI2 immediately.Iteration I1 in the second <strong>invocation</strong> accesses element A3 again.Since shadow[A3] = , a dependence is detected.So the scheduler produces(T2,I2) and (NO SYNC,I3) to worker thread T1. Worker thread T1 then waits31