Skip to main content

SimdFSM: An Adaptive Vectorization of Finite State Machines for Speculative Execution

  • Conference paper
  • First Online:
Parallel and Distributed Computing, Applications and Technologies (PDCAT 2022)

Abstract

Parallel execution of a Finite State Machine (FSM) is challenging due to strong data dependency. Previous work proposed speculative execution to distribute the workload to multiple threads. While without dependent data, threads working from the middle of the input speculate multiple states, possibly resulting in redundant computations. Advanced efforts have achieved significant performance improvements in each thread using SIMD gather/shuffle instructions.

This paper studies various SIMD-based strategies in depth, with the following factors considered: (1) FSM size, (2) processor microarchitectures, and (3) SIMD instructions used. We present SimdFSM incorporating various methods and profile their performances using a real-world FSM collection under different configurations of these factors. The results show that the performance differences among these methods can be significant, and the winner varies depending on these factors. Thus, a wrong choice can result in unexpectedly poor performance.

Therefore, we design an adaptive strategy using the profiling data to select the best method among the ones available under the current execution environment. The adaptive strategy further samples states’ distribution in an input fragment to improve speculation success probability. The results show that it can always select the best method with an ignorable overhead.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://github.com/lile-riraku/simdfsm/blob/main/supplementary.pdf.

References

  1. Abel, A., Reineke, J.: Uops.info: characterizing latency, throughput, and port usage of instructions on intel microarchitectures. In: ASPLOS 2019, pp. 673–686 (2019)

    Google Scholar 

  2. Dlugosch, P., Brown, D., Glendenning, P., Leventhal, M., Noyes, H.: An efficient and scalable semiconductor architecture for parallel automata processing. IEEE Trans. Parallel Distrib. Syst. 25(12), 3088–3098 (2014)

    Article  Google Scholar 

  3. Intel Guide. https://intel.com/content/www/us/en/docs/intrinsics-guide/index.html

  4. Jiang, P., Agrawal, G.: Combining SIMD and many/multi-core parallelism for finite state machines with enumerative speculation. SIGPLAN Not. 52(8), 179–191 (2017)

    Article  Google Scholar 

  5. Li, L., Sato, S., Liu, Q., Taura, K.: Plex: scaling parallel lexing with backtrack-free prescanning. In: 2021 IEEE International Parallel and Distributed Processing Symposium (IPDPS)

    Google Scholar 

  6. Mytkowicz, T., Musuvathi, M., Schulte, W.: Data-parallel finite-state machines. In: ASPLOS 2014, Association for Computing Machinery (2014)

    Google Scholar 

  7. Jiang, P.: (2022). https://github.com/jiangohiostate/ppopp17_artifact

  8. uops.info. https://uops.info/table.html

  9. Yelp Dataset. https://www.kaggle.com/yelp-dataset/yelp-dataset

  10. Ren, G., Wu, P., Padua, D.: Optimizing data permutations for SIMD devices. In: PLDI 2006, pp. 118–131 (2006)

    Google Scholar 

  11. Reps, T.: Maximal-munch tokenization in linear time 20(2), 259–273 (1998)

    Google Scholar 

  12. Sinya, R., Matsuzaki, K., Sassa, M.: Simultaneous finite automata: an efficient data-parallel model for regular expression matching. In: ICPP 2013, pp. 220–229 (2013)

    Google Scholar 

  13. Wadden, J., et al.: ANMLzoo: a benchmark suite for exploring bottlenecks in automata processing engines and architectures. In: IISWC 2016, pp. 1–12 (2016)

    Google Scholar 

  14. Xia, Y., Jiang, P., Agrawal, G.: Scaling out Speculative Execution of Finite-State Machines with Parallel Merge. Association for Computing Machinery, New York, NY, USA (2020)

    Book  Google Scholar 

  15. Yu, F., Chen, Z., Diao, Y., Lakshman, T.V., Katz, R.H.: Fast and memory-efficient regular expression matching for deep packet inspection. In: ANCS ’06

    Google Scholar 

  16. Zhao, Z., Shen, X.: On-the-fly principled speculation for FSM parallelization. SIGPLAN Not. 50(4), 619–630 (2015)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Le Li .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Li, L., Taura, K. (2023). SimdFSM: An Adaptive Vectorization of Finite State Machines for Speculative Execution. In: Takizawa, H., Shen, H., Hanawa, T., Hyuk Park, J., Tian, H., Egawa, R. (eds) Parallel and Distributed Computing, Applications and Technologies. PDCAT 2022. Lecture Notes in Computer Science, vol 13798. Springer, Cham. https://doi.org/10.1007/978-3-031-29927-8_37

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-29927-8_37

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-29926-1

  • Online ISBN: 978-3-031-29927-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics