An Efficient and Wear-Leveling-Aware Frequent-Pattern Mining on Non-Volatile Memory
aa r X i v : . [ c s . D B ] J a n An Efficient and Wear-Leveling-AwareFrequent-Pattern Mining on Non-Volatile Memory
Jiaqi Dong, Runyu Zhang, Chaoshu Yang
College of Computer Science, Chongqing University
Abstract
Frequent-pattern mining is a common approach to reveal the valuable hiddentrends behind data. However, existing frequent-pattern mining algorithms aredesigned for DRAM, instead of persistent memories (PMs), which can lead tosevere performance and energy overhead due to the utterly different characteris-tics between DRAM and PMs when they are running on PMs. In this paper, wepropose an efficient and Wear-leveling-aware Frequent-Pattern Mining scheme,WFPM, to solve this problem. The proposed WFPM is evaluated by a seriesof experiments based on realistic datasets from diversified application scenarios,where WFPM achieves 32.0% performance improvement and prolongs the NVMlifetime of header table by 7.4 × over the EvFP-Tree. Keywords:
Frequent-pattern mining , NVM , Wear-leveling ∗ Corresponding author
Email address: [email protected] (Jiaqi Dong, Runyu Zhang, Chaoshu Yang)
Preprint submitted to Journal of L A TEX Templates January 16, 2020 . Introduction
Data mining is a highlighted technology to reveal the valuable trends behindthe large datasets [1, 2]. The frequent-pattern mining is an active area of datamining, which is used to identify the frequent-occurring itemsets and patterns ina given dataset [1, 3]. Several prefix-tree based approaches, such as AFPIM [4],CFP-tree [5], CATS tree [6], CanTree [7], and CP-tree [8], have been proposedto optimize the mining tree structure for both space efficiency and performance.However, these frequent-pattern mining algorithms are designed for volatile andenergy-inefficient DRAM.The emerging Non-Volatile Memories (NVMs), such as Phase-Change Mem-ory (PCM) [9] and 3D-XPoint [10], are considered as the promising DRAM re-placement for computer main memory. However, they have intrinsic drawbacksin write activities [11]. To our best knowledge, there are only a few NVM-oriented frequent-pattern mining methods, such as EvFP-tree [1, 12] and theparallel version of EvFP-tree (PevFP-tree) [13], designed for NVMs. In detail,EvFP-tree proposed the MBA encoding scheme and Lazy Counter to reducethe bits change of Header table while reducing the writes of support counter ofthe FP-tree nodes. Moreover, PevFP-tree adopts the hash-walk algorithm toreduce the redundant reads on NVM. Accordingly, both EvFP-tree and PevFP-tree can achieve high mining performance by reducing the writes and reads onNVM. However, the MBA encoding scheme still makes low bits wear larger thanhigh bits for an item in the header table. Moreover, they also do not considerthe double writes problem when the FP-tree construction algorithm sorts theitems of transactions. Finally, both EvFP-tree and PevFP-tree failed to fullytake advantages of the counted frequencies of items.In this paper, we present an efficient and Wear-leveling-aware Frequent-Pattern Mining scheme, called WFPM, to solve these problems. The WFPMconsists of Wear-leveling-aware Sliding Counter for header table (WSC), Copy-free Growth Mechanism (CGM), and Sorted Hash Walk (SHW), which is usedto reduce the write operations on Header Table, reduce the write and read times2n FP-tree construction process, respectively. The proposed WFPM is evaluatedby a series of experiments based on realistic datasets, where WFPM achieves32.0% performance improvement and 30.6% write reductions compared withEvFP-tree, the state-of-the-art NVM-oriented FP-tree. The main contributionsof this paper are summarised as follows: • The proposed SCW of WFPM adopts a sliding counter scheme to achievewear-leveling for the header table area of NVM. • The CGM of WFPM is proposed to bypass the sorting process to solvethe double writes problem of FP-tree construction, which can significantlyreduce the write traffics to NVM. • The proposed SHW of WFPM constructs low-overhead ordered linkedlists of the hash table to accelerate the FP-tree traversal, which can sig-nificantly reduce the read traffics to NVM.The rest of this paper is organized as follows. In Section 2, we introduce thebackground and discuss the motivation. We present the design and implemen-tation of WFPM in Section 3. The experimental results are detailed in Section4. Finally, we draw a conclusion in Section 5.3 . Background and Motivation
Frequent-pattern mining is an important area of data mining, which is usedto discover the valuable trends behind large datasets. To improve the spaceefficiency of Apriori [14], the frequent-pattern tree (FP-tree) [3] adopts a prefixtree structure to compactly maintain the candidates of frequent patterns. Asshown in Figure 1. In the example dataset, each row represents a transactionwith its transaction ID (TID) and the associated data items (called itemset).FP-construct only needs to scan the database twice [3]. Firstly, FP-constructscans the database to discover all frequent 1-itemsets and sorts these 1-itemsetsin order of descending frequency of occurrence in the Header table. Secondly,as shown in Figure 1(c), FP-construct reads transactions in the database andsorts them in descending order.For the FP-tree construction, in the beginning, only the root node of the FP-tree exists, and the corresponding pattern of the root node is simply an emptypattern, ¡null¿. As the first pattern ¡a, c, d¿ is discovered, the correspondingnode for the pattern a will be created since no node other than the root nodeexists in the FP-tree. The support counters of the newly created nodes areinitialized to 1, as the corresponding pattern ¡a, c, d¿ has occurred for thefirst time (Figure 1(d)). Likewise, the discovery of the pattern ¡a, c¿ createsa new node for the patterns ¡c¿, as shown in Figure 1(d), the support countof node a is 2 and node c is initialized to 1, and so on. We can observe thatFP-construct needs to add supporter count in a node when a pattern is beinginserted into FP-tree. To overcome these problems, EvFP-tree proposed anMBA encoding scheme to reduce the wear of the Header table on NVM, as shownin Table 1. Moreover, EvFP-tree adopts the lazy counter scheme to reduce thewrites on NVM, which removes all unnecessary node updates by postponing thesummarizing of support counters until the whole dataset is scanned. Once alltransactions have been processed, a depth-first search is carried out to walk theFP-tree to update the support counter of every node as the sum of the present4alue of the support counter and the support counters of all children of thepresent node. To improve both the space efficiency and performance of FP-treetraversal, as shown in Figure 2, PevFP-tree proposes a hash-walk algorithmwhich employs a hash table in each FP-tree node to preliminarily classify thechild nodes, so that we do not need to perform an inefficient linear search in allchild nodes.
Firstly, as mentioned above, we can observe that the classical FP-constructcan cause large writes of the Header table on NVM. Meanwhile, the MBAencoding scheme of EvFP-tree still makes low bits wear larger than high bits foran item in the header table. Secondly, the double writes problem of sorting itemsof discovering a transaction cause largely unnecessary writes, which can seriouslyreduce the performance of frequent-pattern mining. Finally, PevFP-tree uses thehash table to link all child nodes and the sequence of nodes according to theemergency order instead of occurrence. Accordingly, the hash-walk algorithmstill leads to large unnecessary read times on NVM.5 . Design and implementation
We propose wear-leveling-aware sliding counters to substitute for the vulner-able regular counters in the header table. As illustrated in Figure 3, we dividethe 64-bit area into a 4-bit metadata region and a 60-bit sliding region. Figure3 (a) shows the initial state of a sliding counter, of which the highest countingblock is the 8th block in the counting region. When , each counting block willbe moved to their left block. The highest counting block will finally reach theborder of the counting region, as shown in Figure 3 (b). As shown in Figure 3(c), we invert the direction of these counting blocks. To be specific, the serialnumber of the lowest counting block is 7, while that of the highest countingis 14. For i from 1 to 4, we swap each pair of (i+6)th and (15-i)th countingblocks. The direction bit is set to 0, indicating the direction of movements is tothe right. As a consequence, the packing order of these counting blocks has re-versed, in which the high blocks occupy the previous low blocks and vice versa.Subsequently, as shown in Figure 3 (d), the counting blocks move to the rightas the counter value increases, opposite to the previous direction of movement.
The WFPM bypasses the sorting process to conduct insertions without extrawrite activities. As illustrated in Figure 4, WFPM traverses the header table indescending order to fetch the order of items in transactions. When encounteringan item that also appears in the transactions, we search down the tree from rootto keep track of the pattern. Once inserting a new item into the tree, we createa new node with an initialized sliding counter. After processing the wholetransaction, we only add one to the value of the last sliding counter, akin to thelazy counter mechanism in EvFP-Tree.
The PevFP-Tree has failed to fully take advantages of the counted frequen-cies of items. We construct a sorted hash walk mechanism to minimize the6verhead of traversing the pointers in hash walks. As demonstrated in Figure5, when inserting a new item pointer to the linked list in a hash table, we com-pare the frequency of the inserted item with that of items in the linked list.Finally, the new item pointer will be linked just after the older one with a largerfrequency. Consequently, the item pointers are linked in descending order ac-cording to their frequencies, which provides fast accesses to most frequent itemsin the search down process. 7 . Evaluation
We have implemented traditional EvFP-Tree and WFPM for experiments.We have also integrated the hash walk mechanism into EvFP-Tree for fair-ness. To evaluate the efficacy of the WFPM, we perform a series of trace-drivensimulations based on publicly-available practical datasets from several reposi-tories [15, 16, 17]. The experiments are conducted on a workstation runningRedHat Linux 6.0 with two eight-core processors clocked at 2.6 GHz and 64 GBof DRAM. We assumed that the PCM is used in the experiments to store theFP-trees. The performance statistics of the PCM are obtained from [18], wherea PCM read and write (SET/RESET) take 6.82 ns and 152.20/12.20 ns of time,respectively. As for energy consumption, a PCM read and write (SET/RESET)operation takes 64 pJ and 70.0/876 pJ, respectively. To simulate the resource-limited embedded environment, we also assumed a 32-KB, four-way associativecache with the least-recently used (LRU) replacement policy [19] is available.An SRAM read or write operation takes 1.41 ns [18].
This subsection will conduct comparisons in terms of NVM write activitiesfrom various aspects. We first compare the times of NVM write activities todemonstrate the mitigation of imbalanced wears on counters in the header table.Figure 6 shows the maximum bit flips of counters in the header table. In thisfigure, the Total columns represent the numbers of write activities on counters,which equals to the times of last-bit flips in the traditional FP-Tree. We canobserve from Figure 6 that the WFPM gains 1.9 × × reductions on themaximum bit flips compared with EvFP-Tree. Moreover, the times of reductionsincrease with the total number of write activities. These results highlight theeffectiveness of the proposed wear-leveling-aware sliding counters.The total times of NVM write activities are shown in Figure 7. Benefitfrom the copy-free growth mechanism, our WFPM achieves 10.4% 41.9% reduc-tions on total write activities compared with EvFP-Tree. This is because the8FPM avoids the sorting process of transactions, and thereby eliminates thedouble write of each transaction. Figure 8 shows the total times of NVM readactivities of two schemes. WFPM reduces 7.6% 85.3% NVM reads comparedto EvFP-Tree. This improvement is mainly attributed to the sorted hash walkmechanism. The WFPM intrinsically decreases the times of read activities inthe search down process, which form the majority of NVM reads.Figure 9 and Figure 10 show the total elapsed time and energy consumptionof WFPM and EvFP-Tree. We can observe that WFPM constantly outper-forms EvFP-Tree with all realistic workloads in terms of timing performanceand energy consumption. Specifically, WFPM achieves 12.8% 41.3% reductionson total elapsed time and 14.3% 40.9% reductions on energy consumption com-pared to EvFP-Tree, respectively. These results demonstrate the efficiency ofWFPM. 9 . Conclusion We have conducted in-depth investigations on existing FP-Trees and revealedthe drawbacks of them deployed on NVMs. We have proposed efficient mecha-nisms to address these issues. Comprehensive evaluations have shown that ourscheme significantly outperforms EvFP-Tree from various aspects.10 eferencesReferences [1] Y. Lin, P.-C. Huang, D. Liu, X. Zhu, L. Liang, Making in-memory frequentpattern mining durable and energy efficient, in: to appear in InternationalConference on Parallel Processing (ICPP), 2016.[2] H. Zhang et al., In-memory big data management and processing: A sur-vey, IEEE Transactions on Knowledge and Data Engineering (TKDE’15)27 (7) (2015) 1920–1948. doi:10.1109/TKDE.2015.2427795 .[3] J. Han, J. Pei, Y. Yin, Mining frequent patterns without candidate generation,ACM SIGMOD International Conference on Management of Data (SIG-MOD’00) 29 (2) (2000) 1–12. doi:10.1145/335191.335372 .URL http://doi.acm.org/10.1145/335191.335372 [4] J. L. Koh, S. F. Shieh, An efficient approach for maintaining associationrules based on adjusting FP-Tree structures, Springer (2004) 417–424.[5] Y. G. Sucahyo, R. P. Gopalan, CT-PRO: A bottom-up non recursive fre-quent itemset mining algorithm using compressed fp-tree data structure.,FIMI.[6] W. Cheung, O. Zaiane, Incremental mining of frequent patterns with-out candidate generation or support constraint, in: Proceedings of the7th IEEE International Database Engineering & Applications Symposium(IDEAS’03), 2003, pp. 111–116. doi:10.1109/IDEAS.2003.1214917 .[7] C. K. S. Leung, Q. I. Khan, Z. Li, T. Hoque, CanTree: a canonical-ordertree for incremental frequent-pattern mining, Knowledge and InformationSystems 11 (3) (2007) 287–311.[8] S. K. Tanbeer, C. F. Ahmed, B. S. J. Y. K. Lee, CP-Tree: A tree struc-ture for single-pass frequent pattern mining, in: Proceedings of the 12th11acific-Asia conference on Advances in knowledge discovery and data min-ing (PAKDD’08), 2008, pp. 1022–1027.[9] P. M. Palangappa, J. Li, K. Mohanram, Wom-code solutions for low la-tency and high endurance in phase change memory, IEEE Transactions onComputers 65 (4) (2015) 1025–1040.[10] 3d xpoint technology revolutionizes storage memory, doi:10.1109/TC.2001.970573doi:10.1109/TC.2001.970573