Doppiodb: a Hardware Accelerated Database

Doppiodb: a Hardware Accelerated Database

doppioDB: A Hardware Accelerated Database David Sidler, Zsolt István, Muhsen Owaida, Kaan Kara, and Gustavo Alonso Systems Group, Dept. of Computer Science ETH Zürich, Switzerland {firstname.lastname}@inf.ethz.ch ABSTRACT intensive, resulting easily in a performance difference of an Relational databases provide a wealth of functionality to a order of magnitude between the two operators. wide range of applications. Yet, there are tasks for which With the increasing amount of user-generated data stored they are less than optimal, for instance when processing be- in relational databases. There is not only the need to an- comes more complex (e.g., matching regular expressions) or alyze unstructured text data, but general analytical opera- the data is less structured (e.g., text or long strings). In tions in the context of machine learning become gradually this demonstration we show the benefit of using specialized more important to extract useful information from the waste hardware for such tasks, and highlight the importance of a amount of data collected. Many of these analytical opera- flexible, reusable mechanism for extending database engines tions incur a significant compute complexity not suitable to with hardware-based operators. database engines where multiple queries share the available As an example, we extend MonetDB, a main-memory col- resources. umn store, with a Hardware User Defined Function (HUDF) One way to address this trend is to use accelerators such to provide seamless acceleration of two string operators, as Xeon-Phi, GPUs, or FPGAs. Such approaches will of- LIKE and REGEXP_LIKE, and two analytics operators, SKY- ten promise orders of magnitude performance improvements, LINE and SGD (stochastic gradient descent). however in many cases the integration into a real system We evaluate our idea on an emerging hybrid multicore voids these improvements because 1) the data needs to be re- architecture, the Intel's Xeon+FPGA platform, where the formatted to the execution model of the accelerator (GPUs, CPU and FPGA have cache-coherent access to the same SIMD on Xeon Phi) and 2) the data needs to be partitioned memory and the hardware operators can directly access the between the host and accelerator memory. Indeed the inte- tables. For integration we rely on Hardware UDFs (HUDF), gration into the database and addressing challenges related as a unit of scheduling and management on the FPGA. In to data consistency and management is still an open prob- the demonstration we show the acceleration benefits of hard- lem. ware operators, but also their flexibility in accommodating Hybrid multicore architectures, such as Intel's Xeon+FPGA changing workloads. platform [1] and IBM's CAPI for Power8 [4], try to address these limitations. In these architectures, the accelerator is treated as another processor in the system and has direct ac- 1. INTRODUCTION AND MOTIVATION cess to shared memory. This architecture has the potential Relational engines exhibit great performance for a wide of removing both the data-reformatting and -partition over- range of tasks. There are, however, well known operations head. In our work we take advantage of this tight coupling and data types that cause problems. One of these data types and implement Hardware User Defined Functions (HUDFs) is character strings which are both unstructured and expen- which can access data in the database without explicitly sive to process for anything but the simplest forms of pattern moving data to and from the accelerator. By implementing matching. the UDF interface the HUDF becomes just another opera- Most databases implement the SQL LIKE operator which tor from the point of the database engine and hides all the can match multiple substrings divided by a wildcard '%'. complexity of interacting with the hardware accelerator. For more complex string matching, some engines provide a In this work we demonstrate the integration of multi- vendor-specific regular expression operator, e.g. REGEXP_LIKE. ple FPGA-based hardware operators, regular expression [3], In contrast to the string matching with a LIKE operator, skyline [5], and stochastic gradient descent, into MonetDB regular expression evaluation is significantly more compute- as explained in [3]. The hardware operators are fully runtime parameterizable, i.e., the chip does not need to be repro- grammed for executing new queries using the same operator. 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 Thanks to their integration into MonetDB as HUDFs, they for profit or commercial advantage and that copies bear this notice and the full cita- can be used seamlessly in queries. As we will demonstrate, tion on the first page. Copyrights for components of this work owned by others than our FPGA-based operators achieve at least 2-3x speed up ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re- publish, to post on servers or to redistribute to lists, requires prior specific permission over software running on a 10-core CPU, reaching more than and/or a fee. Request permissions from [email protected]. an order of magnitude improvement in many cases. c 2017 ACM. ISBN 978-1-4503-2138-9. DOI: 10.1145/1235 Shared Memory 2.3 Execution Walkthrough MonetDB Job 6 BATs Queues We want to illustrate the functionality of our system and 7 the interaction of the three main components: MonetDB, Parameters HAL, and Hardware Engines through an execution walk- Result 8 BATs Status through. The walkthrough explains the execution of a reg- CPU 3 9 5 4 4 ular expression query, but the same steps apply to other FPGA hardware operators. The following steps are required when MonetDB Skyline SGD processing a user query, while the corresponding numbers in User 1 HAL HAL Eng 1 Eng 1 Figure 1 show where in the system they take place: Query Job 1. A query containing a regular expression is submitted. 3 Dist. 2. As part of executing the query, MonetDB calls the 2 6 UDF. The regular expression string and the input BAT UDF Regex Regex AAL AAL Eng 1 Eng 2 are provided as parameters. 3. The UDF converts the regular expression into a config- Figure 1: Overview of the system, the numbers show the uration vector, allocates memory for the result BAT, steps of executing a regular expression query on the FPGA and calls the HAL to create a new FPGA job. 4. The HAL allocates memory for the job parameters and job status data structures and populates them. 2. SYSTEM OVERVIEW 5. The HAL enqueues a job into the corresponding shared The system used in the demonstration is described in [3]. memory job queue. As shown in Figure 1, it consists of three main parts: 1) 6. The Job Distributor logic inside the HAL on the FPGA MonetDB extended with our Hardware User Defined Func- fetches the job from the job queue and assigns it to an tion (HUDF), 2) the Hardware Operator Abstraction Layer idle Regex Engine (Engine 1 in this example). (HAL) provides a simple software API to execute jobs on the 7. The Regex Engine reads the parameters from shared FPGA and 3) four hardware engines which implement either memory and configures itself with the configuration the regular expression, skyline or stochastic gradient descent vector. It then starts the execution and processes the operator. Each hardware engine is runtime parameterizable input BAT. such that it can adapt to the current query. 8. After the engine terminates, it sets the done bit in its 2.1 MonetDB status memory and updates various statistics about the execution. We integrate hardware operators into MonetDB using its 9. The UDF waits on the done bit and then hands the native UDF interface. Unlike most databases which re- result BAT over to MonetDB. quire the invocation of the UDF for each tuple, in MonetDB Thanks to the standard UDF interface, HAL abstraction, UDFs can operate on complete columns, called binary as- and parameterizable regular expression operators on the FPGA, sociation tables (BATs). To guarantee that the operators any regular expression given by a user query can be offloaded on the FPGA can access the data in MonetDB, we altered to hardware. MonetDB's memory allocation to use a custom memory al- locator which manages the CPU-FPGA shared memory. In the current prototype system this region is limited to 4 GB, 2.4 Regular Expression Engines but this is not a fundamental limitation and should be lifted Each regular expression engine is capable of processing in future generations of the Xeon+FPGA system. strings at 6.4 GB/s, with up to four engines leading to an aggregated bandwidth of 25.6 GB/s. However on the current 2.2 Hardware Operator Abstraction Layer platform the throughput is limited by the QPI link to around The HAL provides two main functionalities an API to con- 6.5 GB/s, therefore deploying more than one shows only a struct and monitor jobs on the FPGA and the custom mem- slight improvement and deploying more than two shows no ory allocator for the CPU-FPGA shared memory region. further improvement. The regular expression engines are After the initial handshake between software and hardware parametrized before each query with a 512 bit configuration which is executed through Intel's AAL (Accelerator Abstrac- vector. This configuration vector is generated on the soft- tion Layer) library, all control communication is handled ware side in the HUDF, more details can be found in [3]. by the HAL. The HAL allocates all control data structures Therefore the FPGA does not have to be reprogrammed to such as the job queue, job parameters, and job status in the support multiple different queries.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us