Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exploiting Multithreaded Architectures to Improve Data Management Operations Layali Rashid The Advanced Computer Architecture U of C (ACAG) Department.

Similar presentations


Presentation on theme: "Exploiting Multithreaded Architectures to Improve Data Management Operations Layali Rashid The Advanced Computer Architecture U of C (ACAG) Department."— Presentation transcript:

1 Exploiting Multithreaded Architectures to Improve Data Management Operations Layali Rashid The Advanced Computer Architecture Group @ U of C (ACAG) Department of Electrical and Computer Engineering University of Calgary

2 2 Outline The SMT and the CMP Architectures Join (Hash Join) Motivation Algorithm Results Sort (Radix and Quick Sorts) Motivation Algorithms Results Index (CSB+-Tree) Motivation Algorithm Results Conclusions

3 3 The SMT and the CMP Architectures Simultaneous Multithreading (SMT): multiple threads run simultaneously on a single processor. Chip Multiprocessor (CMP): more than one processor are integrated on a single chip.

4 4 Hash Join Motivation Hash join is one of the most important operations commonly used in current commercial DBMSs. The L2 cache load miss rate is a critical factor in main-memory hash join performance. Increase level of parallelism in hash join.

5 5 Architecture-Aware Hash Join (AA_HJ) Build Index Partition Phase Tuples divided equally between threads, each thread has its own set of L2-cache size clusters The Build and Probe Index Partition Phase One thread builds a hash table from each key-range, other threads index partition the probe relation similar to the previous phase. Probe Phase See figure.

6 6 AA_HJ Results We achieve speedups ranging from 2 to 4.6 compared to PT on Quad Intel Xeon Dual Core server. Speedups for the Pentium 4 with HT ranges between 2.1 to 2.9 compared to PT.

7 7 Memory-Analysis for Multithreaded AA_HJ A decrease in L2 load miss rate is due to the cache-sized index partitioning, constructive cache sharing and Group Prefetching. A minor increase in L1 data cache load miss rate from 1.5% to 4%.

8 8 The Sort Motivation Some researches find that the sort algorithms suffer from high level two cache miss rates. Whereas others pointed out that radix sort has high TLB miss rates. In addition, the fact that most sort algorithms are sequential has high impact on generating efficient parallel sort algorithms. In our work we target Radix Sort (distribution-based sort) and Quick Sort (comparison-based sort).

9 9 Our Parallel Sorts Radix Sort A hybrid radix sort between Partition Parallel Radix Sort and Cache-Conscious Radix Sort. Repartitioning large destination buckets only when they are significantly larger than the L2 cache size. Quick Sort Use Fast Parallel Quick Sort. Dynamically balancing the load across threads. Improve thread parallelism during the sequential cleaning up sorting. Stop the recursive partitioning process when the size of the subarray is almost equal to the largest cache size.

10 10 The Sort Timing for the Random Datasets on the SMT Arhcitecure Radix Sort and Quick Sort shows low L1 and L2 caches miss rates on our machines. Radix Sort has a DTLB Store miss rate up to 26%. Radix Sort accomplishes slight speedup on SMT architectures that doesn’t exceed 3%, due to its CPU-intensive nature. Enhancements in execution time for quick sort are about 25% to 30%. Quick SortRadix Sort

11 11 The Sort Timing for the Random Datasets on the CMP Architecture Radix SortQuick Sort Our speedups for the Radix sort range from 54% for two threads up to 300% for threads from 2 to 8. Our speedups for the Quick Sort range from 34% to 417%.

12 12 The Index Motivation Despite the fact that CSB+-tree proves to have significant speedup over B+-trees, experiments show that a large fraction of its execution time is still spent waiting for data. The L2 load miss rate for single-threaded CSB+-tree is as high as 42%.

13 13 Dual-threaded CSB+-Tree One CSB+-Tree. Single thread for the bulkloading. Two threads for probing. Unlike inserts and deletes, search needs no synchronization since it involves reads only.

14 14 Index Results Speedups for dual-threaded CSB+-tree range from 19% to 68% compared to single-threaded CSB+-tree. Two threads for memory-bound operations propose more chances to keep the functional units working. Sharing one CSB+-tree amongst both of our threads result in constructive behaviour and reduction of 6% -8% in the L2 miss rate.

15 15 Conclusions State-of-the-art parallel architectures (SMT and CMP) have opened opportunities for the improvement of software operations to better utilize the underlying hardware resources. It is essential to have efficient implementations of database operations. We propose architecture-aware multithreaded database algorithms of the most important database operations (joins, sorts and indexes). We characterize the timing and memory behaviour of these database operations.

16 16 The End

17 17 Backup Slides

18 18 Figure ‎1 ‑ 1: The SMT Architecture

19 19 Figure ‎1 ‑ 2: Comparison between the SMT and the Dual Core Architectures

20 20 Figure ‎1 ‑ 3: Combining the SMT and the CMP Architectures

21 21 Figure ‎2 ‑ 1: The L1 Data Cache Load Miss Rate for Hash Join

22 22 Figure ‎2 ‑ 2: The L2 Cache Load Miss Rate for Hash Join

23 23 Figure ‎2 ‑ 3: The Trace Cache Miss Rate for Hash Join

24 24 Figure ‎2 ‑ 4: Typical Relational Table in RDBMS

25 25 Figure ‎2 ‑ 5: Database Join

26 26 Figure ‎2 ‑ 6: Hash Equi-join Process

27 27 Figure ‎2 ‑ 7: Hash Table Structure

28 28 Figure ‎2 ‑ 8: Hash Join Base Algorithm partition R into R0, R1,…, Rn-1 partition S into S0, S1,…, Sn-1 for i = 0 until i = n-1 use Ri to build hash-tablei for i = 0 until i = n-1 probe Si using hash-tablei

29 29 Figure ‎2 ‑ 9: AA_HJ Build Phase Executed by one Thread

30 30 Figure ‎2 ‑ 10: AA_HJ Probe Index Partitioning Phase Executed by one Thread

31 31 Figure ‎2 ‑ 11: AA_HJ S-Relation Partitioning and Probing Phases

32 32 Figure ‎2 ‑ 12: AA_HJ Multithreaded Probing Algorithm

33 33 Table ‎2 ‑ 1: Machines Specifications

34 34 Table ‎2 ‑ 2: Number of Tuples for Machine 1

35 35 Table ‎2 ‑ 3: Number of Tuples for Machine 2

36 36 Figure ‎2 ‑ 13: Timing for three Hash Join Partitioning Techniques

37 37 Figure ‎2 ‑ 14: Memory Usage for three Hash Join Partitioning Techniques

38 38 Figure ‎2 ‑ 15: Timing for Dual-threaded Hash Join

39 39 Figure ‎2 ‑ 16: Memory Usage for Dual-threaded Hash Join

40 40 Figure ‎2 ‑ 17: Timing Comparison of all Hash Join Algorithms

41 41 Figure ‎2 ‑ 18: Memory Usage Comparison of all Hash Join Algorithms

42 42 Figure ‎2 ‑ 19: Speedups due to the AA_HJ+SMT and the AA_HJ+GP+SMT Algorithms

43 43 Figure ‎2 ‑ 20: Varying Number of Clusters for the AA_HJ+GP+SMT

44 44 Figure ‎2 ‑ 21: Varying the Selectivity for Tuple Size = 100Bytes

45 45 Figure ‎2 ‑ 22: Time Breakdown Comparison for the Hash Join Algorithms for tuple sizes 20Bytes and 100Bytes

46 46 Figure ‎2 ‑ 23: Timing for the Multi-threaded Architecture-Aware Hash Join

47 47 Figure ‎2 ‑ 24: Speedups for the Multi-Threaded Architecture-Aware Hash Join

48 48 Figure ‎2 ‑ 25: Memory Usage for the Multi- Threaded Architecture-Aware Hash Join

49 49 Figure ‎2 ‑ 26: Time Breakdown Comparison for Hash Join Algorithms

50 50 Figure ‎2 ‑ 27: The L1 Data Cache Load Miss Rate for NPT and AA_HJ

51 51 Figure ‎2 ‑ 28: Number of Loads for NPT and AA_HJ

52 52 Figure ‎2 ‑ 29: The L2 Cache Load Miss Rate for NPT and AA_HJ

53 53 Figure ‎2 ‑ 30: The Trace Cache Miss Rate for NPT and AA_HJ

54 54 Figure ‎2 ‑ 31: The DTLB Load Miss Rate for NPT and AA_HJ

55 55 Figure ‎3 ‑ 1: The LSD Radix Sort 1 for (i= 0; i < number_of_digits; i ++) 2sort source-array based on digiti;

56 56 Figure ‎3 ‑ 2: The Counting LSD Radix Sort Algorithm

57 57 Figure ‎3 ‑ 3: Parallel Radix Sort Algorithm

58 58 Table ‎3 ‑ 1: Memory Characterization for LSD Radix Sort with Different Datasets

59 59 Figure ‎3 ‑ 4: Radix Sort Timing for the Random Datasets on Machine 2

60 60 Figure ‎3 ‑ 5: Radix Sort Timing for the Gaussian Datasets on Machine 2

61 61 Figure ‎3 ‑ 6: Radix Sort Timing for Zero Datasets on Machine 2

62 62 Figure ‎3 ‑ 7: Radix Sort Timing for the Random Datasets on Machine 1

63 63 Figure ‎3 ‑ 8: Radix Sort Timing for the Gaussian Datasets on Machine 1

64 64 Figure ‎3 ‑ 9: Radix Sort Timing for the Zero Datasets on Machine 1

65 65 Figure ‎3 ‑ 10: The DTLB Stores Miss Rate for the Radix Sort on Machine 2 (Random Datasets)

66 66 Figure ‎3 ‑ 11: The L1 Data Cache Load Miss Rate for the Radix Sort on Machine 2 (Random Datasets)

67 67 Table ‎3 ‑ 2: Memory Characterization for Memory-Tuned Quick Sort with Different Datasets

68 68 Figure ‎3 ‑ 12: Quicksort Timing for the Random Datasets on Machine 2

69 69 Figure ‎3 ‑ 13: Quicksort Timing for the Random Dataset on Machine 1

70 70 Figure ‎3 ‑ 14: Quicksort Timing for the Gaussian Datasets on Machine 2

71 71 Figure ‎3 ‑ 15: Quicksort Timing for the Gaussian Dataset on Machine 1

72 72 Figure ‎3 ‑ 16: Quicksort Timing for the Zero Datasets on Machine 2

73 73 Figure ‎3 ‑ 17: Quicksort Timing for the Zero Dataset on Machine 1

74 74 Table ‎3 ‑ 3: The Sort Results for Machine 1

75 75 Table ‎3 ‑ 4: The Sort Results for Machine 2

76 76 Figure ‎4 ‑ 1: Search Operation on an Index Tree

77 77 Figure ‎4 ‑ 2: Differences between the B+-Tree and the CSB+-Tree

78 78 Figure ‎4 ‑ 3: Dual-Threaded CSB+-Tree for the SMT Architectures

79 79 Figure ‎4 ‑ 4: Timing for the Single and Dual- Threaded CSB+-Tree

80 80 Figure ‎4 ‑ 5: The L1 Data Cache Load Miss Rate for the Single and Dual-Threaded CSB+- Tree

81 81 Figure ‎4 ‑ 6: The Trace Cache Miss Rate for the Single and Dual-Threaded CSB+-Tree

82 82 Figure ‎4 ‑ 7: The L2 Load Miss Rate for the Single and Dual-Threaded CSB+-Tree

83 83 Figure ‎4 ‑ 8: The DTLB Load Miss Rate for the Single and Dual-Threaded CSB+-Tree

84 84 Figure ‎4 ‑ 9: The ITLB Load Miss Rate for the Single and Dual-Threaded CSB+-Tree


Download ppt "Exploiting Multithreaded Architectures to Improve Data Management Operations Layali Rashid The Advanced Computer Architecture U of C (ACAG) Department."

Similar presentations


Ads by Google