Skip to main content

A Datalog Engine for GPUs

  • Conference paper
  • First Online:
Declarative Programming and Knowledge Management (INAP 2013, WLP 2013, WFLP 2013)

Abstract

We present the design and evaluation of a Datalog engine for execution in Graphics Processing Units (GPUs). The engine evaluates recursive and non-recursive Datalog queries using a bottom-up approach based on typical relational operators. It includes a memory management scheme that automatically swaps data between memory in the host platform (a multicore) and memory in the GPU in order to reduce the number of memory transfers. To evaluate the performance of the engine, four Datalog queries were run on the engine and on a single CPU in the multicore host. One query runs up to 200 times faster on the (GPU) engine than on the CPU.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

References

  1. CUDA, C Best Practices Guide. http://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html

  2. CUDA, C Programming Guide. http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html

  3. Datalog by the MITRE Corporation. http://datalog.sourceforge.net/

  4. Red Fox: A Compilation Environment for Data Warehousing. http://gpuocelot.gatech.edu/projects/red-fox-a-compilation-environment-for-data-warehousing/

  5. Thrust: A Parallel Template Library. http://thrust.github.io/

  6. Abiteboul, S., et al.: Foundations of Databases. Addison-Wesley, Boston (1995)

    MATH  Google Scholar 

  7. Afrati, F.N., Borkar, V., Carey, M., Polyzotis, N., Ullman, J.D.: Cluster Computing, Recursion and Datalog. In: de Moor, O., Gottlob, G., Furche, T., Sellers, A. (eds.) Datalog 2010. LNCS, vol. 6702, pp. 120–144. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  8. Beeri, C., Ramakrishnan, R.: On the power of magic. J. Log. Program. 10(3–4), 255–299 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  9. Bravenboer, M., Smaragdakis, Y.: Strictly declarative specification of sophisticated points-to analyses. In: OOPSLA, pp. 243–262 (2009)

    Google Scholar 

  10. Costa, V.S., et al.: The YAP prolog system. TPLP 12(1–2), 5–34 (2012)

    MATH  Google Scholar 

  11. Diamos, G., et al.: Efficient relational algebra algorithms and data structures for GPU. Technical report, Georgia Institute of Technology (2012)

    Google Scholar 

  12. Diamos G. et al.: Relational algorithms for multi-bulk-synchronous processors. In: 18th Symposium on Principles and Practice of Parallel Programming (2013)

    Google Scholar 

  13. Dong, G., Jianwen, S., Topor, R.W.: Nonrecursive incremental evaluation of datalog queries. Ann. Math. Artif. Intell. 14(2–4), 187–223 (1995)

    Article  MATH  Google Scholar 

  14. Green, T.J., Aref, M., Karvounarakis, G.: LogicBlox, Platform and Language: A Tutorial. In: Barceló, P., Pichler, R. (eds.) Datalog 2.0 2012. LNCS, vol. 7494, pp. 1–8. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  15. Harris, M., et al.: Parallel prefix sum (scan) with CUDA. In: Nguyen, H. (ed.) GPU Gems 3, pp. 851–876. Addison Wesley, Boston (2007)

    Google Scholar 

  16. He, B., et al.: Relational joins on graphics processors. In: SIGMOD Conference, pp. 511–524 (2008)

    Google Scholar 

  17. He, B., et al.: Relational query coprocessing on graphics processors. ACM Trans. Database Syst. (TODS) 34(4), 21:1–21:39 (2009)

    Article  Google Scholar 

  18. Huang, S.S., et al.: Datalog and emerging applications: an interactive tutorial. In: SIGMOD Conference. pp. 1213–1216 (2011)

    Google Scholar 

  19. Loo, B.T., et al.: Declarative networking: language, execution and optimization. In: SIGMOD Conference, pp. 97–108 (2006)

    Google Scholar 

  20. Marczak W.R., et al.: Secureblox: customizable secure distributed data processing. In: SIGMOD Conference, pp. 723–734 (2010)

    Google Scholar 

  21. Musser, D.R., Derge, G.J., Saini, A.: STL Tutorial and Reference Guide: C++ Programming With The Standard Template Library, 2nd edn. Addison-Wesley Longman Publishing Co. Inc., Boston (2001)

    Google Scholar 

  22. Rao, J., Ross, K.A.: Cache conscious indexing for decision-support in main memory. In: 25th VLDB Conference, San Francisco., CA, USA, pp. 78–89 (1999)

    Google Scholar 

  23. Shen, W., et al.: Declarative information extraction using datalog with embedded extraction predicates. In: VLDB, pp. 1033–1044 (2007)

    Google Scholar 

  24. Swift, T., Warren, D.S.: Xsb: Extending prolog with tabled logic programming. TPLP 12(1–2), 157–187 (2012)

    MATH  MathSciNet  Google Scholar 

  25. Tekle, K.T., Liu, Y.A.: More efficient datalog queries: subsumptive tabling beats magic sets. In: SIGMOD Conference, pp. 661–672 (2011)

    Google Scholar 

  26. Ullman, J.D.: Principles of Database and Knowledge-Base Systems, vol. 1. Computer Science Press, Beijing (1988)

    Google Scholar 

  27. Ullman, J.D.: Principles of Database and Knowledge-Base Systems, vol. 2. Computer Science Press, Beijing (1989)

    Google Scholar 

  28. Valiant, L.G.: A bridging model for parallel computation. Commun. ACM 33(8), 103–111 (1990)

    Article  Google Scholar 

  29. Wu, H., et al.: Kernel weaver: Automatically fusing database primitives for efficient GPU computation. In: 45th International Symposium on Microarchitecture (2012)

    Google Scholar 

  30. Wu, H., et al.: Optimizing data warehousing applications for GPUs using kernel fusion/fission. In: IEEE 26th International Parallel and Distributed Processing Symposium Workshops and PhD Forum (2012)

    Google Scholar 

  31. Young, J., et al.: Satisfying data-intensive queries using GPU clusters. In: 2nd Annual Workshop on High-Performance Computing meets Databases (2012)

    Google Scholar 

Download references

Acknowledgments

CMA thanks the support during his MSc studies from: the University of Porto, the Centre for Research and Postgraduate Studies of the National Polytechnic Institute (CINVESTAV-IPN) of Mexico, and the Mexican Council of Science and Technology (CONACyT). ICD and VSC were partially supported by: the European Regional Development Fund (ERDF), COMPETE Programme; the Portuguese Foundation for Science and Technology (FCT), project LEAP FCOMP-01-0124-FEDER-015008; and project ABLe PTDC/EEI-SII/2094/2012.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jorge Buenabad-Chávez .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Martínez-Angeles, C.A., Dutra, I., Costa, V.S., Buenabad-Chávez, J. (2014). A Datalog Engine for GPUs. In: Hanus, M., Rocha, R. (eds) Declarative Programming and Knowledge Management. INAP WLP WFLP 2013 2013 2013. Lecture Notes in Computer Science(), vol 8439. Springer, Cham. https://doi.org/10.1007/978-3-319-08909-6_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-08909-6_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-08908-9

  • Online ISBN: 978-3-319-08909-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics