automatically exploiting cross-invocation parallelism using runtime ...
automatically exploiting cross-invocation parallelism using runtime ... automatically exploiting cross-invocation parallelism using runtime ...
takes up to 200MB memory space.To detect misspeculation, the checker thread needs the memory access signatures, theworker thread’s epoch and task numbers and the epoch and task numbers of the otherworker threads when the task began. After sending the data to the checker thread, a workerthread may stall to wait for other worker threads if continuing execution would exceed thespeculative range. In Figure 4.6, thread 4 stalls after executing task . When thread4 tries to start task , it determines the distance to thread 3’s task is three. Inthe example, the speculative range limit is two, so thread 4 stalls until thread 3 finishes task. The example is simplified, since in real programs the speculative range is alwaysat least the number of threads and usually much larger.There are two subtle memory consistency issues with the checking scheme describedabove. First, the checking scheme assumes that updates to the epoch and task numberswill be globally visible after all other stores in the previous task. If the memory consistencymodel allows the architecture to reorder stores, this assumption will be false. In otherwords, the checking methodology assumes a Total Store Order (TSO) architecture. ModernTSO architectures include: x86, x86-64, SPARC, and the IBM zSeries [41]. For architecturesthat do not support TSO, such as ARM and POWER, each thread should execute amemory fence before updating the epoch and task numbers. The costs of memory fencesmay be greater than the costs of speculative barriers when the number of tasks per epoch ishigh.Second, the epoch and task numbers must update together atomically. The easiest wayto accomplish this is to store these numbers as the high and low bits of a 64-bit word anduse an atomic write operation. For x86-64, 64-bit writes are atomic by default, so no specialhandling is required.62
log entriesWorker1 Log...Worker2 Log...epoch1epoch2epochNtask1task2task3s1.1 s1.2 s1.3s2.1.......................................taskM...task1task2task3s1.1 s1.2 epoch1.......................................taskM...epoch2epochNSignature LogFigure 4.8: Data structure for Signature Log4.2.2 Checkpointing and RecoveryPeriodically, the worker threads checkpoint so that their state can be restored after misspeculation.Infrequent checkpointing reduces the overhead of the runtime system, butincreases the cost of misspeculation. SPECCROSS’s profiling library enables very low ratesof misspeculation, thus infrequent checkpointing is efficient in practice. By default, SPEC-CROSS checkpoints at every thousandth speculative barrier, though it can be re-configuredbased on program characteristics. Checkpoints act as non-speculative barriers. All workerthreads synchronize at the checkpoint waiting for the checker thread to finish all checkingrequests before the checkpoint, ensuring the checkpoint’s state is safe.In SPECCROSS, checkpointing is divided into two parts. SPECCROSS first saves theregister state of each thread, and then saves the memory of the entire process. The Cstandard library’s setjmp function is used to save the register state of each thread. Aftereach thread is saved, the process forks, duplicating the state of the entire process. Thenewly forked child sleeps until the checker thread detects misspeculation. To restore a63
- 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 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 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
- Page 100 and 101: 8x7xno misspec.with misspec.Geomean
- Page 102 and 103: This thesisPrevious workSpeedup (x)
- Page 104 and 105: Program Speedup6x5x4x3x2xLOCALWRITE
- Page 106 and 107: for DOMORE and SPECCROSS. Others (e
- Page 108 and 109: programs and it achieves a geomean
- Page 110 and 111: Bibliography[1] R. Allen and K. Ken
- Page 112 and 113: [15] R. Cytron. DOACROSS: Beyond ve
- Page 114 and 115: [31] T. B. Jablin, Y. Zhang, J. A.
- Page 116 and 117: [47] A. Nicolau, G. Li, A. V. Veide
- Page 118 and 119: [62] L. Rauchwerger and D. Padua. T
- Page 120: national conference on Parallel Arc
log entriesWorker1 Log...Worker2 Log...epoch1epoch2epochNtask1task2task3s1.1 s1.2 s1.3s2.1.......................................taskM...task1task2task3s1.1 s1.2 epoch1.......................................taskM...epoch2epochNSignature LogFigure 4.8: Data structure for Signature Log4.2.2 Checkpointing and RecoveryPeriodically, the worker threads checkpoint so that their state can be restored after misspeculation.Infrequent checkpointing reduces the overhead of the <strong>runtime</strong> system, butincreases the cost of misspeculation. SPECCROSS’s profiling library enables very low ratesof misspeculation, thus infrequent checkpointing is efficient in practice. By default, SPEC-CROSS checkpoints at every thousandth speculative barrier, though it can be re-configuredbased on program characteristics. Checkpoints act as non-speculative barriers. All workerthreads synchronize at the checkpoint waiting for the checker thread to finish all checkingrequests before the checkpoint, ensuring the checkpoint’s state is safe.In SPECCROSS, checkpointing is divided into two parts. SPECCROSS first saves theregister state of each thread, and then saves the memory of the entire process. The Cstandard library’s setjmp function is used to save the register state of each thread. Aftereach thread is saved, the process forks, duplicating the state of the entire process. Thenewly forked child sleeps until the checker thread detects misspeculation. To restore a63