Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2935764.2935800acmconferencesArticle/Chapter ViewAbstractPublication PagesspaaConference Proceedingsconference-collections
research-article
Public Access

Parallel Approaches to the String Matching Problem on the GPU

Published: 11 July 2016 Publication History

Abstract

We design a family of parallel algorithms and GPU implementations for the exact string matching problem, based on Rabin-Karp (RK) randomized string matching. We describe and analyze three primary parallel approaches to binary string matching: cooperative (CRK), divide-and-conquer (DRK), and a novel hybrid of both (HRK). The CRK is most effective for large patterns (>8K characters), while the DRK approach is superior for shorter patterns. We then generalize the DRK to support any alphabet size without loss of performance. Our DRK method achieves up to a 64 GB/s processing rate on 8-character patterns from an 8-bit alphabet on an NVIDIA Tesla K40c GPU. We next demonstrate a novel parallel two-stage matching method (DRK-2S), which first skims the text for a smaller subset of the pattern and then verifies all potential matches in parallel. Our DRK-2S method is superior for pattern sizes up to 64k compared to the fastest CPU-based string matching implementations. With an 8-bit alphabet and up to 1k-character patterns, we get a geometric mean speedup of 4.81x against the best CPU methods, and can achieve a processing rate of at least 53 GB/s.

References

[1]
M. C. Schatz and C. Trapnell, "Fast exact string matching on the GPU," University of Maryland, Tech. Rep., 2007.
[2]
C.-H. Lin, C.-H. Liu, and S.-C. Chang, "Accelerating regular expression matching using hierarchical parallel machines on GPU," in IEEE Global Telecommunications Conference, ser. GLOBECOMM 2011. IEEE, Dec. 2011, pp. 1--5.
[3]
R. M. Karp and M. O. Rabin, "Efficient randomized pattern-matching algorithms," IBM Journal of Research and Development, vol. 31, no. 2, pp. 249--260, Mar. 1987.
[4]
D. E. Knuth, J. H. Morris, Jr, and V. R. Pratt, "Fast pattern matching in strings," SIAM Journal on Computing, vol. 6, no. 2, pp. 323--350, 1977.
[5]
R. S. Boyer and J. S. Moore, "A fast string searching algorithm," Communications of the ACM, vol. 20, no. 10, pp. 762--772, Oct. 1977.
[6]
T. Lecroq, "Fast exact string matching algorithms," Information Processing Letters, vol. 102, no. 6, pp. 229--235, Jun. 2007.
[7]
S. Faro and T. Lecroq, "The exact online string matching problem: A review of the most recent results," ACM Computing Surveys (CSUR), vol. 45, no. 2, p. 13, Feb. 2013.
[8]
Z. Galil, "Optimal parallel algorithms for string matching," Information and Control, vol. 67, no. 1--3, pp. 144--157, Oct.--Dec. 1985.
[9]
U. Vishkin, "Optimal parallel pattern matching in strings," Information and Control, vol. 67, no. 1--3, pp. 91--113, Oct.--Dec. 1985.
[10]
X. Zha and S. Sahni, "GPU-to-GPU and host-to-host multipattern string matching on a GPU," IEEE Transactions on Computers, vol. 62, no. 6, pp. 1156--1169, Jun. 2013.
[11]
E. Seamans and T. Alexander, "Fast virus signature matching on the GPU," in GPU Gems 3, H. Nguyen, Ed. Addison-Wesley, Aug. 2007, ch. 35, pp. 771--783.
[12]
C. S. Kouzinopoulos and K. G. Margaritis, "String matching on a multicore GPU using CUDA," in ph13th Panhellenic Conference on Informatics, ser. PCI '09. IEEE, Sep. 2009, pp. 14--18.
[13]
J. Nickolls, I. Buck, M. Garland, and K. Skadron, "Scalable parallel programming with CUDA," ACM Queue, pp. 40--53, Mar. Apr. 2008.
[14]
G. E. Blelloch, "Prefix sums and their applications," School of Computer Science, Carnegie Mellon University, Tech. Rep. Carnegie Mellon University-CS-90--190, Nov. 1990.
[15]
N. Bell and J. Hoberock, "Thrust: A productivity-oriented library for CUDA," in GPU Computing Gems, W. W. Hwu, Ed. Morgan Kaufmann, Oct. 2011, vol. 2, ch. 26, pp. 359--371.
[16]
NVIDIA Corporation, "NVIDIA CUDA C programming guide," Sep. 2015, pG-02829-001_v7.5.
[17]
D. Merrill, "CUB," 2011. {Online}. Available: nvlabs.github.io/cub/
[18]
S. Faro and T. Lecroq, "Smart: a string matching algorithm research tool," 2011. {Online}. Available: http://www.dmi.unict.it/faro/smart/

Cited By

View all
  • (2020)A Rabin-Karp Implementation for Handling Multiple Pattern-Matching on the GPUIEICE Transactions on Information and Systems10.1587/transinf.2020PAP0002E103.D:12(2412-2420)Online publication date: 1-Dec-2020
  • (2020)Optimizing Performance of Text Searching Using CPU and GPUsProgress in Computing, Analytics and Networking10.1007/978-981-15-2414-1_15(141-150)Online publication date: 27-Mar-2020
  • (2019)Two-Phase PFAC Algorithm for Multiple Patterns Matching on CUDA GPUsElectronics10.3390/electronics80302708:3(270)Online publication date: 1-Mar-2019
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SPAA '16: Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures
July 2016
492 pages
ISBN:9781450342100
DOI:10.1145/2935764
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 July 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. divide and conquer
  2. graphics processing unit (GPU)
  3. rabin-karp algorithm
  4. string matching
  5. warp-synchronous programming

Qualifiers

  • Research-article

Funding Sources

Conference

SPAA '16

Acceptance Rates

Overall Acceptance Rate 447 of 1,461 submissions, 31%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)63
  • Downloads (Last 6 weeks)12
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2020)A Rabin-Karp Implementation for Handling Multiple Pattern-Matching on the GPUIEICE Transactions on Information and Systems10.1587/transinf.2020PAP0002E103.D:12(2412-2420)Online publication date: 1-Dec-2020
  • (2020)Optimizing Performance of Text Searching Using CPU and GPUsProgress in Computing, Analytics and Networking10.1007/978-981-15-2414-1_15(141-150)Online publication date: 27-Mar-2020
  • (2019)Two-Phase PFAC Algorithm for Multiple Patterns Matching on CUDA GPUsElectronics10.3390/electronics80302708:3(270)Online publication date: 1-Mar-2019
  • (2018)CPU/GPU Hybrid Detection for Malware Signatures for Battery-Powered Devices Using OpenCLRecent Trends in Computer Applications10.1007/978-3-319-89914-5_9(139-152)Online publication date: 20-Nov-2018
  • (2017)CPU/GPU Hybrid Detection for Malware Signatures2017 International Conference on Computer and Applications (ICCA)10.1109/COMAPP.2017.8079736(85-89)Online publication date: Sep-2017

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media