Hash aggregation operations
A hardware accelerator with a two-level memory subsystem and concurrency management enhances hash aggregation performance by optimizing data flow and parallel processing, addressing memory-intensive challenges in data analytics.
Patent Information
- Application Number
- PCT/CN2025/094949
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2026-11-19
AI Technical Summary
Hash aggregation operations in data analytics are memory-intensive and face performance constraints due to latency and bandwidth issues when the total state size exceeds the capacity of fast local memory, necessitating efficient management of data movement and access patterns across the memory hierarchy.
A hardware accelerator with a two-level memory subsystem, comprising a fast on-chip SRAM staging hash table for initial aggregation and a larger off-chip DRAM persistent hash table, utilizes hash-derived and synchronization identifiers to enable parallel processing and concurrency, along with finite state machines and hardware queues to manage pipeline stages, reducing synchronization barriers and optimizing data flow.
The solution significantly improves performance and efficiency by exploiting temporal locality, maximizing parallelism, and ensuring data integrity during hash aggregation tasks, thereby reducing latency and enhancing throughput.
Smart Images

Figure CN2025094949_19112026_PF_FP_ABST
Abstract
Description
HASH AGGREGATION OPERATIONSTechnical Field
[0001] The present disclosure relates, in general, to hardware acceleration solutions for hash aggregation operations in data analytics.Background
[0002] Data processing systems frequently employ hash aggregation to summarize large volumes of data. This operation involves grouping data records based on specified key fields and applying aggregation functions to associated value fields. It is a cornerstone of analytical query processing in database systems and large-scale data analysis platforms, enabling efficient summarization and reporting.
[0003] Executing hash aggregation efficiently presents several technical hurdles. The operation is often memory-intensive, as the system must maintain aggregation states for potentially millions or billions of distinct groups. When the total state size exceeds the capacity of fast local memory, performance becomes constrained by the latency and bandwidth of accessing larger, slower main memory. Efficiently managing data movement and access patterns across the memory hierarchy is critical for achieving high performance.Summary
[0004] An objective of the present disclosure is to provide performance improvements for hash aggregation by optimizing concurrent merging operations to reduce synchronization barriers and their performance impact.
[0005] The foregoing and other objectives are achieved by the features of the independent claims.
[0006] Further implementation forms are apparent from the dependent claims, the description and the Figures.
[0007] A first aspect of the present disclosure provides a hardware accelerator for hash aggregation operations, comprising a first memory subsystem integrated within the hardware, wherein the first memory subsystem is configured to store a staging hash table, wherein the staging hash table comprises a high-speed buffer structure with parallel access capabilities that serves as an intermediate aggregation point to exploit temporal locality before controlled merging operations, a second memory subsystem external to the hardware accelerator and accessible using a memory interface, the second memory subsystem comprising a persistent aggregation hash table with a base table for direct-mapped entries and an extended table for collision resolution through linked chains, wherein the persistent aggregation hash table is configured to persist aggregation results across multiple processing iterations, an entry classification and tracking system configured to append each entry of the staging hash table in the first memory subsystem with a hash-derived mapping identifier that identifies a target location in the persistent aggregation hash table where an entry from the staging hash table is to be merged, and a synchronization classification identifier configured to enable entries to be partitioned into non-conflicting execution groups based on their hash-derived mapping identifiers, multiple finite state machines, FSMs, configured to implement a pipeline of stages for hash aggregation operations, and multiple hardware queues implemented in the first memory subsystem to provide asynchronous execution isolation between pipeline stages through hardware-implemented producer-consumer queues with independent flow control.
[0008] There is therefore an improvement in the performance and efficiency in hash aggregation tasks. By using dedicated hardware, operations are faster than general-purpose software execution. The specialized memory hierarchy ensures that frequently accessed data is close to the processing units, reducing latency.
[0009] The system architecture provides a robust and high-performance solution for accelerating hash aggregation. The first memory subsystem, typically implemented with fast on-chip SRAM, serves as a staging area (staging hash table) to exploit temporal locality and perform initial aggregations rapidly. The second memory subsystem, usually larger capacity off-chip DRAM, stores the persistent aggregation results. The entry classification and tracking system, using hash-derived and synchronization identifiers, enables high degrees of parallelism during merge operations from the first memory (SRAM) to the second memory (DRAM) . Multiple FSMs allow for parallel processing of different data entries or pipeline stages, and hardware queues decouple these stages, maximizing throughput and hardware utilization by allowing stages to operate independently and hide latencies associated with memory accesses, especially to the slower second memory subsystem (DRAM) .
[0010] In an implementation of the first aspect, the FSMs can process, in a hash phase, input data rows from an input table and store the processed input data rows in the staging hash table in the first memory subsystem, merge, in a merge phase, entries from the staging hash table in the first memory subsystem to the persistent aggregation hash table in the second memory subsystem, and create, in a rehash phase, a larger persistent aggregation hash table in the second memory subsystem when the current persistent aggregation hash table becomes full.
[0011] Defining distinct hash, merge, and rehash phases allows for a structured and optimized approach to the aggregation lifecycle. The hash phase efficiently processes input rows into the fast first memory subsystem (SRAM-based staging hash table) . The merge phase systematically transfers and aggregates data from the first memory (SRAM) to the more persistent second memory (DRAM-based persistent aggregation hash table) , using the concurrency mechanisms. The rehash phase provides a mechanism to handle overflow in the second memory (DRAM) by expanding it, ensuring the system can process very large datasets that exceed initial capacity, thus maintaining scalability and robustness.
[0012] The entry classification and tracking system can calculate and store the hash-derived mapping identifier for each entry inserted into the staging hash table in the first memory subsystem, compare the hash-derived mapping identifier of a new entry with hash-derived mapping identifiers of existing entries of the staging hash table in the first memory subsystem, assign the same synchronization classification identifier to entries with different hash-derived mapping identifiers, and assign different synchronization classification identifiers to entries with the same hash-derived mapping identifier to prevent race conditions during parallel processing.
[0013] This specific logic for assigning identifiers enables enhanced concurrency. By assigning the same synchronization classification identifier to entries destined for different locations in the second memory (DRAM-based persistent hash table) and different identifiers to entries destined for the same location, the system can precisely determine which merge operations can occur in parallel without conflict. This maximizes parallelism during the merge from the first memory (SRAM) to the second memory (DRAM) while guaranteeing data integrity by preventing race conditions, leading to significant performance gains.
[0014] Entries with the same synchronization classification identifier can be merged concurrently to the persistent aggregation hash table in the second memory subsystem during the merge phase.
[0015] This directly enables highly parallel merge operations. Grouping entries by their synchronization classification identifier allows the accelerator to issue multiple merge requests simultaneously from the first memory (SRAM-based staging hash table) to the second memory (DRAM-based persistent aggregation hash table) . This substantially reduces the time spent in the merge phase, which is often a bottleneck, by effectively utilizing the available bandwidth to the second memory subsystem.
[0016] The hash-derived mapping identifier can be calculated by applying a hash function to a group key of an entry and performing a modulo operation with the size of the persistent aggregation hash table in the second memory subsystem.
[0017] This ensures a deterministic and efficient way to map entries from the first memory (SRAM-based staging hash table) to their target buckets in the second memory (DRAM-based persistent aggregation hash table) .
[0018] During the merge phase, the FSMs can group entries from the staging hash table in the first memory subsystem into non-conflicting execution groups based on their synchronization classification identifiers, merge entries within each non-conflicting execution group concurrently to the persistent aggregation hash table in the second memory subsystem, and implement a barrier between non-conflicting execution groups to ensure all entries in a previous group have been merged before processing entries in a subsequent group.
[0019] This ensures both high performance and correctness. Grouping entries based on synchronization classification identifiers allows for maximum safe concurrency when writing from the first memory (SRAM) to the second memory (DRAM) . The explicit barrier between processing different groups guarantees that all operations for one set of non-conflicting entries are completed before moving to the next, preventing out-of-order execution issues and ensuring deterministic results.
[0020] The hardware accelerator can further comprise a locking mechanism with one bit per hash table index to enable concurrent accesses to the staging hash table in the first memory subsystem during the hash phase.
[0021] Such a locking mechanism for the first memory subsystem (SRAM-based staging hash table) , such as one bit per hash table index, allows multiple FSMs or processing units to safely access and update the staging hash table concurrently during the hash phase. This increases the rate at which input rows can be processed and ingested into the accelerator, improving the overall throughput of the initial hashing stage.
[0022] The multiple hardware queues can provide a buffering mechanism that allows each pipeline stage to process entries at respective predefined rates through first-in-first-ready scheduling.
[0023] The use of hardware queues with specific scheduling (like first-in-first-ready) between pipeline stages enhances decoupling. This allows stages to operate at their natural rates, smoothing out variations in processing times and preventing stalls. For example, a stage accessing the faster first memory (SRAM) can proceed without being unduly delayed by a stage interacting with the slower second memory (DRAM) , improving overall pipeline efficiency and throughput.
[0024] The hardware accelerator can further comprise a column to row, C2R, module configured to fetch values stored in columnar format and convert them to rows of input data, and a row to column, R2C, module configured to convert output entries stored in the persistent aggregation hash table in the second memory subsystem to columnar format.
[0025] Including Column-to-Row (C2R) and Row-to-Column (R2C) modules makes the accelerator more versatile and easier to integrate into systems that use columnar storage, which is common in analytical databases. The C2R module efficiently prepares input data for the row-based processing typical in hash aggregation, while the R2C module converts results back to the columnar format expected by many downstream systems. This offloads data format conversion from the CPU, further enhancing overall system performance.
[0026] During the rehash phase, the FSMs can allocate memory for a larger persistent aggregation hash table in the second memory subsystem, merge each valid entry in the current persistent aggregation hash table with a corresponding entry in the larger persistent aggregation hash table, and use the larger persistent aggregation hash table for subsequent operations.
[0027] The rehash phase ensures the accelerator can handle datasets that grow beyond the initial capacity of the second memory subsystem (DRAM-based persistent aggregation hash table) . By allocating a larger table and efficiently merging entries from the old table to the new one, the system maintains its ability to process large-scale aggregations without failure, providing robustness and scalability for demanding workloads.
[0028] A second aspect of the present disclosure provides a method for accelerating hash aggregation operations, the method comprising receiving input data in columnar format, converting the input data from columnar format to row format, during a hash phase, processing input rows from the converted input data, and storing the processed input rows in a staging hash table in a first memory subsystem integrated within a hardware accelerator, wherein the staging hash table comprises a temporary processing data structure for initial aggregation of the input rows before transferring results of the processing to a persistent aggregation hash table in a second memory subsystem external to the hardware accelerator, wherein the persistent aggregation hash table is a memory-resident data organization structure that maintains a global aggregation state by storing unique group keys and their corresponding accumulated values with provisions for dynamic expansion through rehashing, for each entry inserted into the staging hash table, calculating and storing a hash-derived mapping identifier that maintains correspondence between entries in the staging hash table and respective destination locations in the persistent aggregation hash table, and assigning synchronization classification identifiers to entries that can be processed concurrently without race conditions using a synchronization classification identifier configured to provide conflict-free parallel processing, during a merge phase, grouping entries from the staging hash table in the first memory subsystem into non-conflicting execution groups based on their synchronization classification identifiers, merging entries within each non-conflicting execution group concurrently to the persistent aggregation hash table in the second memory subsystem, and implementing a barrier between non-conflicting execution groups to ensure all entries in a previous group have been merged before processing entries in a subsequent group.
[0029] This provides a comprehensive, high-performance approach to hash aggregation. Storing processed input rows initially in a staging hash table within a first memory subsystem (typically fast on-chip SRAM) allows for rapid initial aggregation and exploitation of temporal locality. The assignment of hash-derived and synchronization classification identifiers enables highly concurrent and conflict-free merging of these staged entries into the persistent aggregation hash table located in a second memory subsystem (typically larger off-chip DRAM) . Implementing barriers between non-conflicting execution groups ensures correctness while maximizing parallelism.
[0030] In an implementation of the second aspect, calculating the synchronization classification identifier can comprise comparing the hash-derived mapping identifier of a new entry with hash-derived mapping identifiers of existing entries of the staging hash table in the first memory subsystem, assigning the same synchronization classification identifier to entries with different hash-derived mapping identifiers, and assigning different synchronization classification identifiers to entries with the same hash-derived mapping identifier to prevent race conditions during parallel processing.
[0031] This ensures that entries destined for different locations in the second memory (DRAM-based persistent hash table) can be processed in parallel (same identifier) , while entries targeting the same location are serialized (different identifiers) . This precise control over concurrency prevents race conditions during the merge from the first memory (SRAM) to the second memory (DRAM) , thereby maximizing merge throughput safely.
[0032] The hash-derived mapping identifier can be calculated by applying a hash function to the group key of an entry and performing a modulo operation with the size of the persistent aggregation hash table in the second memory subsystem.
[0033] The method can further comprise during a rehash phase, allocating memory for a larger persistent aggregation hash table in the second memory subsystem, merging each valid entry in the current persistent aggregation hash table with a corresponding entry in the larger persistent aggregation hash table, and using the larger persistent aggregation hash table for subsequent operations.
[0034] The hash phase, merge phase, and rehash phase can be performed by a pipeline of finite state machines, FSMs, decoupled by hardware queues that provide a data transfer architecture enabling independent execution timing between pipeline stages while preserving execution order dependencies.
[0035] Performing the hash, merge, and rehash phases using a pipeline of FSMs decoupled by hardware queues enables significant parallelism and efficiency. Each FSM can work on a different part of the process, and the queues allow these stages to operate at their own pace, absorbing temporary bottlenecks and ensuring a smooth flow of data. This architecture maximizes the utilization of the hardware accelerator, including efficient use of both the first memory (SRAM for queues and staging) and the second memory (DRAM for persistent storage) , leading to higher overall throughput.
[0036] A third aspect of the present disclosure provides a system comprising at least one processor, and at least one memory, and a hardware accelerator for hash aggregation operations according to the first aspect.
[0037] In an implementation of the third aspect, the hardware accelerator can be integrated into an input / output (I / O) die of the at least one processor.
[0038] The system can further comprise a software interface configured to configure the hardware accelerator for analytics operations, configure data-path parameters based on input width, and configure data structures in both the first memory subsystem and the second memory subsystem.
[0039] These and other aspects of the invention will be apparent from the embodiment (s) described below.Brief Description of the Drawings
[0040] In order that the present disclosure may be more readily understood, embodiments will now be described, by way of example, with reference to the accompanying drawings, in which:
[0041] Figure 1 is a schematic representation of a hash aggregation operation;
[0042] Figure 2 is a schematic representation of overview for a process used in a hardware accelerator for hash aggregation operations, according to an example;
[0043] Figure 3 is a schematic representation of an architecture for a hardware accelerator for hash aggregation operations, according to an example;
[0044] Figure 4 is a schematic representation of a hash phase according to an example;
[0045] Figure 5 is a schematic representation of a merge phase according to an example;
[0046] Figure 6 is a schematic representation of enhanced concurrency during a Merge phase of a hash aggregation process according to an example;
[0047] Figures 7a and 7b are flowcharts illustrating a three-phase process (Hash, Merge, and Rehash) employed by the hash aggregation accelerator for processing input data and managing aggregation state, according to an example; and
[0048] Figure 8 is a schematic representation of a machine according to an example.Detailed Description
[0049] Example embodiments are described below in sufficient detail to enable those of ordinary skill in the art to embody and implement the systems and processes herein described. It is important to understand that embodiments can be provided in many alternate forms and should not be construed as limited to the examples set forth herein.
[0050] Accordingly, while embodiments can be modified in various ways and take on various alternative forms, specific embodiments thereof are shown in the drawings and described in detail below as examples. There is no intent to limit to the particular forms disclosed. On the contrary, all modifications, equivalents, and alternatives falling within the scope of the appended claims should be included. Elements of the example embodiments are consistently denoted by the same reference numerals throughout the drawings and detailed description where appropriate.
[0051] The terminology used herein to describe embodiments is not intended to limit the scope. The articles “a, ” “an, ” and “the” are singular in that they have a single referent, however the use of the singular form in the present document should not preclude the presence of more than one referent. In other words, elements referred to in the singular can number one or more, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises, ” “comprising, ” “includes, ” and / or “including, ” when used herein, specify the presence of stated features, items, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, items, steps, operations, elements, components, and / or groups thereof. The term “and / or” is only an association relationship for describing associated objects and represents that three relationships may exist such that A and / or B may indicate that A exists alone, A and B exist at the same time, or B exists alone. The character “ / ” generally represents that the associated objects are in an “or” relationship.
[0052] Unless otherwise defined, all terms (including technical and scientific terms) used herein are to be interpreted as is customary in the art. It will be further understood that terms in common usage should also be interpreted as is customary in the relevant art and not in an idealized or overly formal sense unless expressly so defined herein.
[0053] The following contains specific information related to implementations of the present disclosure. The drawings and their accompanying detailed disclosure are merely directed to implementations. However, the present disclosure is not limited to these implementations. Other variations and implementations of the present disclosure will be obvious to those skilled in the art.
[0054] The phrases “in one implementation, ” or “in some implementations, ” may each refer to one or more of the same or different implementations. The term “coupled” is defined as connected whether directly or indirectly through intervening components and is not necessarily limited to physical connections. The expression “at least one of A, B and C” or “at least one of the following: A, B and C” means “only A, or only B, or only C, or any combination of A, B and C. ”
[0055] The terms “system” and “network” may be used interchangeably.
[0056] For the purposes of explanation and non-limitation, specific details such as functional entities, techniques, protocols, and standards are set forth for providing an understanding of the present disclosure. In other examples, detailed disclosure of well-known methods, technologies, systems, and architectures are omitted so as not to obscure the present disclosure with unnecessary details.
[0057] Persons skilled in the art will immediately recognize that any network function (s) or algorithm (s) disclosed may be implemented by hardware, software or a combination of software and hardware. Disclosed functions may correspond to modules which may be software, hardware, firmware, or any combination thereof.
[0058] A software implementation may include machine-and / or computer-readable and / or executable instructions stored on a machine-and / or computer-readable medium such as memory or other types of storage devices. One or more microprocessors or general-purpose computers with communication processing capability may be programmed with corresponding executable instructions and perform the disclosed network function (s) or algorithm (s) .
[0059] The microprocessors or general-purpose computers may include Applications Specific Integrated Circuitry (ASIC) , programmable logic arrays, and / or using one or more Digital Signal Processor (DSPs) . Although some of the disclosed implementations are oriented to software installed and executing on computer hardware, alternative implementations implemented as firmware or as hardware or as a combination of hardware and software are well within the scope of the present disclosure. The computer readable medium includes but is not limited to Random Access Memory (RAM) , Read Only Memory (ROM) , Erasable Programmable Read-Only Memory (EPROM) , Electrically Erasable Programmable Read-Only Memory (EEPROM) , flash memory, Compact Disc Read-Only Memory (CD-ROM) , magnetic cassettes, magnetic tape, magnetic disk storage, or any other equivalent medium capable of storing computer-readable instructions.
[0060] Businesses typically store their data in Online Transaction Processing (OLTP) databases, which is in row format (all fields of a particular transaction are stored consecutively) . This data is then transformed into columnar format (each field’s data items are store consecutively) for batch processing of analytical SQL queries. A database consists of many tables, each comprising of multiple fields. An analytical query comprises of many different operations performed on the data, such as scan, filter, hash join, hash aggregate, sort, shuffle, etc. A significant portion of execution time is spent on hash aggregate operations.
[0061] Figure 1 is a schematic representation of a hash aggregation operation. In the example of figure 1, a Structured Query Language (SQL) query tries to find the number of units sold by each salesman and report the result with a table comprising each unique salesman (group) and their total aggregate sales (value) . The hash aggregate algorithm goes through each data item (comprising of Sales_ID, Salesman, Units) . For example, the first data item is <1, John, 2>. For each data item, the algorithm hashes the group key (in this case Salesman field) and finds the corresponding index in the hash table. For example, “John” maps to index 1 in the hash table. The algorithm then searches for any entry in that bucket that matches the group “John” . If there is none, an entry is added to the bucket with a group-value tuple <John, 2> indicating the Salesman and the units sold.
[0062] When processing the third item in the database <3, John, 2>, “John” is encountered again. In this case, the algorithm find an entry with the same group already present in the hash table, so the value (Units) is added to the existing entry in the hash table, thereby updating the group-value tuple to <John, 4>. This way, the algorithm is able to find matching entries in the SQL query Group field quickly using a hash table and aggregate the corresponding Value fields. In the above example, when processing the fourth item <4, Tom , 1>, the algorithm encounters a conflict, because “Tom” maps to index 1 in the hash table, same as “John” . In this case, a new entry is created for “Tom” using available memory space from the extended table, and the entry is linked to the “John” entry using a pointer such that all entries within a hash table bucket can be searched when processing new items. The final state of the hash table is read out with all valid group-value tuple as different rows of the output table.
[0063] Many hash-aggregation tasks are memory bound: a hash table storing large number of unique groups does not fit in a cache of an apparatus.
[0064] Aspects of the present disclosure provide a hardware accelerator configured to improve the performance of hash aggregation operations. In an example, the accelerator implements a sophisticated multi-phase algorithm and a specialized hardware architecture to address the challenges of memory latency and concurrency management inherent in hash aggregation.
[0065] According to an example, a hardware accelerator as described herein employs a multi-phase process (Hash, Merge, and Rehash) and utilizes a two-level hash table structure, comprising a smaller, fast on-chip hash table (OCHT) and a larger, main memory-resident in-memory hash table (IMHT) . Both the OCHT and IMHT are structured with a base table and an extended table to handle collisions efficiently.
[0066] Figure 2 is a schematic representation of overview for a process used in a hardware accelerator for hash aggregation operations, according to an example.
[0067] According to an example, a hardware accelerator for hash aggregation operations can process rows 201 from an input table, and maintain a smaller On-Chip Hash Table (OCHT) within the SRAM of the accelerator. The hash table has a Base Table (BT) consisting of one entry for each hash index, and an Extended Table (ET) consisting of entries that can be borrowed whenever there is a hash collision. In the “Hash” phase 203, the algorithm keeps aggregating using the OCHT. When the OCHT is full (when there is no more space in the ET) , the algorithm transitions to the “Merge” phase 205.
[0068] The In-Memory Hash Table (IMHT) also consists of a Base Table (BT) and an Extended Table (ET) . In the “Merge” phase 205, each valid entry in the OCHT is merged with the corresponding entry in the IMHT. If there is no existing entry in the IMHT, a new entry is created. This allows flushing the OCHT and creating room in the SRAM for the next round of “Hash” phase. At the end of the “Merge” phase, a check is performed to see if the IMHT is full (when there is no more space in the ET for new round of OCHT merge operations) , the algorithm transitions to “Rehash” phase 207.
[0069] A Rehashed In-Memory Hash Table (RIMHT) also consists of a Base Table (BT) and an Extended Table (ET) . In the “Rehash” phase 207, memory is allocated for a larger in-memory hash table. Then, each valid entry in the IMHT is merged with the corresponding entry in the RIMHT. If there is no existing entry in the RIMHT, a new entry is created. Then all entries are merged, RIMHT is assigned as the IMHT for subsequent operations. The algorithm then transitions to the “Hash” phase 203.
[0070] If there are no more input rows to be processed, the algorithm transitions from “Merge” phase 205 to termination 207.
[0071] Figure 3 is a schematic representation of an architecture for a hardware accelerator for hash aggregation operations, according to an example.
[0072] The hardware accelerator of figure 3 comprises an Advanced eXtensible Interface (AXI) interface 301 configured to handle communication with an external system, including, e.g., receiving input data columns and configuration parameters, and outputting aggregated results.
[0073] The AXI Interface 301 comprises a pathway through which the accelerator receives input data columns (e.g., from main memory 303 via DMA) , sends output aggregated results, and potentially interacts with configuration registers or other system resources.
[0074] Input data, typically stored in columnar format in DDR main memory 303, is processed by a Column-to-Row (C2R) Module 305, which converts it into a row-based format suitable for aggregation processing. Conversely, a Row-to-Column (R2C) Module 307 converts a final aggregated result from the internal row-based format back to columnar format for output.
[0075] Accelerator 300 comprises a two-level hash table system. The first level comprises an On-Chip Hash Table (OCHT) 309, implemented using, e.g., fast SRAM banks. The OCHT 309 consists of a Base Table and an Extended Table. The Base Table stores a first Group-Aggregation Tuple (GAT) that maps to a particular hash bucket, while the Extended Table stores subsequent GATs that collide with the same bucket, forming a chain. A Base Index Lock mechanism (e.g., 1 bit per index) is provided for the OCHT Base Table to manage concurrent access during a Hash phase, as will be described in more detail below.
[0076] In the context of a hash aggregation accelerator according to the present disclosure, a GAT comprises a data structure that stores the result of an aggregation operation for a specific group. It can comprise two main parts:
[0077] 1. Group Key (s) : values from one or more columns that define a unique group. For example, in the SQL query SELECT Salesman, SUM (Units) FROM Sales GROUP BY Salesman, the "Salesman" value (e.g., "John" , "Sam" ) would be the group key.
[0078] 2. Aggregate Value (s) : accumulated results of the aggregation function (e.g., SUM, COUNT, AVG, MAX, MIN) applied to the value fields for that specific group. In the example above, if John sold 2 units and then another 2 units, the aggregate value for the group "John" would become 4 (for SUM (Units) ) .
[0079] The second level is a larger In-Memory Hash Table (IMHT) 311, residing in the main DDR memory 303, which also features a Base Table and an Extended Table structure similar to the OCHT 309. This IMHT 311 stores a complete aggregation state when the OCHT 309 overflows or when all input rows are processed.
[0080] A Hash Generation Module 313 is responsible for computing hash values from the group key (s) of input rows to determine the appropriate bucket indices in both the OCHT 309 and IMHT 311.
[0081] To manage the flow of data and operations, the accelerator 300 employs several Staging Queues 315, also implemented in, e.g., SRAM banks. These include an On-Chip Hash Node Ready Queue 317, an In-Memory Hash Node Read Queue 319, and an In-Memory Hash Node Write Queue 321. Each queue is managed by a respective scheduler (e.g., First-In-Round-Robin (FIRR) or First-In-First-Ready (FIFR) ) to enable decoupled and pipelined execution of different processing stages. This decoupling allows different parts of the accelerator to operate in parallel, maximizing throughput.
[0082] The overall operation is orchestrated by a set of Finite State Machines (FSMs) 323, with multiple instances of FSMs for different stages to enable parallel processing of multiple GATs. Configuration registers allow the software to set up and control the accelerator.
[0083] According to an example, the accelerator 300 operates in three main phases: Hash, Merge, and Rehash.
[0084] Figure 4 is a schematic representation of a hash phase according to an example. In the example of figure 4, input rows 401, converted by the C2R module 305, are processed. The group key (s) of an input row (Ri) are hashed to an index in the OCHT 309. A lock is acquired on the OCHT base table index. If the corresponding bucket in OCHT base table 317 (OCHT_BT) is empty (no collision) , the GAT for Ri, along with its calculated In-Memory Hash Bucket ID (IMHB#) and an initial Concurrent Box ID (CB#, typically 0) , is written to OCHT_BT 317.
[0085] If there is a collision, the accelerator 300 searches the chain in OCHT extended table (OCHT_ET) 319 for an entry with a matching group value. If a match is found, the aggregate value is updated.
[0086] While searching this chain, the IMHB#of each GAT in the chain is compared with the IMHB#of the input row. If they are the same, the CB#for the input row (CB#_input, initially 0) is incremented; otherwise, it remains unchanged. This CB#assignment is decisive for the subsequent Merge phase. If no match is found after searching the chain, a new GAT entry (with Ri_GAT, IMHB#, and the determined CB#_input) is appended to the end of the bucket chain in OCHT_ET 319. The lock on the OCHT index is released after the update. If the OCHT_ET 319 becomes full, the algorithm transitions to the Merge phase 205.
[0087] Figure 5 is a schematic representation of a merge phase according to an example. In this phase, valid GAT entries from the OCHT 309 are merged into the IMHT 311. In an example, concurrent merging occurs based on the CB#. That is, GAT entries from the OCHT 309 that belong to the same CB#can be merged concurrently to the IMHT 311. The accelerator 300 processes entries starting with CB#=0, then CB#=1, and so on, implementing a barrier between different CB#groups to ensure correctness. When merging an OCHT GAT entry, its IMHB#determines the target bucket in the IMHT 311.
[0088] The process of checking for collisions, updating existing entries, or inserting new entries in the IMHT 311 (IMHT base table (IMHT_BT) and IMHT extended table (IMHT_ET) ) is similar to the Hash phase logic, including the assignment of, e.g., a Rehash In-Memory Hash Bucket ID (RIMHB#) and a new CB# (initially 0, incremented on RIMHB#collision within the IMHT chain) for entries being written into the IMHT 311.
[0089] If the IMHT_ET becomes almost full, the accelerator transitions to the Rehash phase. Otherwise, if there are more input rows to process, it transitions back to the Hash phase. If all input rows are processed and merged, the IMHT 311 contains the final aggregated results, which can then be read out by the R2C module.
[0090] If the IMHT 311 becomes too full, a Rehash phase is initiated. According to an example, a new, larger hash table (Rehash In-Memory Hash Table, RIMHT, e.g., 4x larger) is allocated in main memory 303. Each valid GAT entry from the current IMHT 311 is rehashed into this RIMHT. Similar to the Merge phase, GAT entries belonging to the same CB# (from their IMHT metadata) can be rehashed concurrently. The process of inserting into RIMHT_BT and RIMHT_ET, including assigning new RIMHB#and CB#values, mirrors the logic of the Merge phase. Once all IMHT GAT entries are processed, the RIMHT becomes the new IMHT, and the accelerator transitions back to the Hash phase to process any remaining input rows.
[0091] According to an example, the metadata (IMHB#and CB#) stored with each GAT in the OCHT 309 enables efficient concurrent merge operations. By grouping OCHT 309 entries into concurrent boxes (CBs) , the accelerator 300 can issue multiple merge operations in parallel to the IMHT 311, as long as the entries belong to the same CB#. This significantly reduces the number of synchronization barriers compared to approaches that might process buckets or individual entries sequentially, thereby improving performance by better utilizing available memory bandwidth.
[0092] The queue-based dataflow architecture, with FIRR / FIFR schedulers 323 for the On-Chip Hash Node Ready Queue 317, In-Memory Hash Node Read Queue 319, and In-Memory Hash Node Write Queue 321, allows different stages of the pipeline (e.g., locking, reading OCHT nodes, reading / writing IMHT nodes, aggregation logic) to operate with a degree of independence. This decoupling helps to hide latencies and keep the various processing units (FSMs) busy, contributing to overall memory level parallelism.
[0093] Figure 6 is a schematic representation of enhanced concurrency during a Merge phase of a hash aggregation process according to an example. As described above, traditionally, merging entries from an on-chip hash table to an in-memory hash table can create performance bottlenecks due to potential collisions to the same in-memory hash bucket, often requiring significant synchronization and processing barriers.
[0094] In the example of figure 6, augmenting each on-chip hash table node (or Group-Aggregation Tuple, GAT) with two pieces of metadata-an In-Memory Hash Bucket ID (IMHB#) and a Concurrent Box ID (CB#) -can overcome this. The IMHB#indicates the specific bucket in the larger in-memory hash table where the GAT is destined. The CB#is assigned during the Hash phase (or when entries are prepared for merging) such that GATs that might collide in the in-memory hash table (i.e., have the same IMHB#) are assigned different CB#s, while GATs destined for different IMHB#scan share the same CB#.
[0095] This classification allows the system to process all GATs belonging to the same CB#concurrently during the Merge phase, as they are guaranteed not to conflict with each other in the in-memory hash table. For instance, as shown, all nodes with CB#0 can be merged in one parallel step, followed by all nodes with CB#1 in another parallel step, thus reducing the total number of synchronization barriers (e.g., from potentially many, one per conflicting group, to just one barrier between CB#0 and CB#1 processing) . This metadata-driven approach significantly improves parallelism and efficiency when transferring aggregated data from the on-chip cache to main memory.
[0096] An accelerator 300 can be provided as part of a larger apparatus, such as by way of integration into the I / O die of a server processor (e.g., a SoC) . Software can submit hash aggregation tasks by writing to memory-mapped job queues. Control registers are used to configure the FSMs and other operational parameters of the accelerator. A Direct Memory Access (DMA) engine within the accelerator handles memory accesses for input, output, and intermediate data (the IMHT) . An IOMMU (Input / Output Memory Management Unit) outside the accelerator complex can support memory accesses using virtual addresses, facilitating integration into modern operating system environments.
[0097] The number of processing FSMs, queue entries, and hash table slots can be configured based on the size of a GAT entry, which is typically an integer multiple of a cache line size (e.g., 32B or 64B) , allowing for flexibility and optimization based on available hardware resources.
[0098] The architecture described herein is therefore structured as a pipeline of stages (each stage implemented using, e.g., FSM (s) ) . The stages are decoupled using hardware queues (implemented in, e.g., SRAM) , each queue has a corresponding scheduler that schedules one ready item. According to an example, all the stages run in parallel, getting an item from its input queue if possible, processing the item, and then either sending it to the output queue (if operation was successful) or keeping the item in its input queue to try again later. There can be multiple copies of the pipeline (as denoted by the multiple boxes in the figures, e.g., Figs. 4 and 5) to improve parallelism. To enable concurrent accesses to the hash table without any correctness issues, an on-chip lock can be used with 1 bit per hash table index.
[0099] In the Merge phase, each valid entry in the OCHT is merged with the IMHT. To perform this operation with functional correctness, items in the same OCHT bucket cannot be merged concurrently as they might map to the same bucket in IMHT, thus causing a hardware race condition.
[0100] With reference to figure 6, in the OCHT table 601, items x, y, and z, all map to the same bucket forming the chain x → y → z. In the IMHT table 603, items x and z map to the same bucket. If x and z where to merged concurrently to the IMHT for the first time (when there is no existing valid x and z entry yet in IMHT) , each merge request might end up writing to the same location in IMHT Base table (instead of creating a pointer chain) , thus causing incorrect execution.
[0101] However, concurrency is a key requirement for performance. The more the number of concurrent requests, the better the memory level parallelism, which in turn utilizes memory bandwidth more efficiently. To improve concurrency, a approach would be to concurrently merge items at the same index in each bucket. To explain this, the OCHT is visually unrolled in figure 6, shown at 605. All items in the same box can be merged concurrently (we term each box as a Concurrent Box) . At the end of each Concurrent Box, a barrier is needed to ensure that all items in the previous box have been merged and flushed down the micro-architectural pipeline. Barriers however decrease performance, because the architecture needs to wait for all memory operations to commit before issuing new instructions, thus stalling compute resources. The more the number of barriers, the worse the performance.
[0102] According to an example, t reduce the number of barriers, two metadata per item in the OCHT. As described above, these metadata are In Memory Hash Bucket id (IMHB#) and Concurrent Box id (CB#) .
[0103] Referring again to figure 6 and the bucket with items x, y, and z. When x is inserted to OCHT, its corresponding IMHT bucket id is also calculated (e.g., with simple modulo arithmetic over the OCHT bucket id) and stored in the IMHB#metadata field. The CB#of x is set to 0, meaning it belongs to the 0th concurrent box to be merged. When y is inserted, at first the IMHB#field of x is compared with that of y. Since they are not the same, it means during merge x and y can be merged concurrent without any correctness issues. Hence, the CB#of y is kept same as x (=0) . When z is inserted, its IMHB#is first compared with that of x. Since both x and z map to the same IMHB#, a collision is detected, and z’s CB#is incremented by 1. This ensures that x and z belong to different concurrent boxes, thus being merges separately. When z’s IMHB#is compared next with that of y, since they map to different buckets, z’s CB#is kept unchanged at 1.
[0104] The metadata helps in packing more items of OCHT in each concurrent box, thereby reducing the total number of concurrent boxes, and hence the total number of barriers. In the above example, with the metadata, there are only 2 concurrent boxes (0 and 1) instead of 4 concurrent boxes in the approach.
[0105] Figures 7a and 7b are flowcharts illustrating a three-phase process (Hash, Merge, and Rehash) employed by the hash aggregation accelerator for processing input data and managing aggregation state, according to an example.
[0106] Referring to figure 7a, an input table 701 in columnar format is provided, which is converted to input rows (Ri) 703 by a Column-to-Row (C2R) module 305.
[0107] In a hash phase 203, an input row (Ri) 703 is taken for processing. The system checks if all input rows have been processed. If yes, and the On-Chip Hash Table (OCHT) is empty (all GATs merged) , the process stops (moving to the merge phase 205) . Otherwise, it proceeds as follows.
[0108] The group key of Ri is hashed (H (Ri) ) 705 and moduloed by the number of base table entries in the OCHT (#BT_OCHT) to find an OCHT index. A lock is acquired on this index.
[0109] The system checks 707 for a collision at this OCHT index. If no Collision: The Group-Aggregation Tuple (Ri_GAT) for the input row is written to the OCHT Base Table (BT_OCHT) 709. Metadata, including the In-Memory Hash Bucket ID (IMHB#) for Ri and an initial Concurrent Box ID (CB#= 0) , is stored with Ri_GAT. The lock is released 711.
[0110] If there is collision: The accelerator searches the linked chain in the OCHT Extended Table (ET_OCHT) starting from the OCHT_BT entry for a GAT with a matching group key.
[0111] If a match is found: The existing GAT's aggregate value is updated with Ri's value (Aggregate and Write Back) 713. The lock is released 711.
[0112] If no match is found (end of chain) : While traversing the chain, the IMHB#of each GAT in the chain is compared with the IMHB#of Ri. If they are the same, a local CB#counter (cb#_input, initialized to 0 for Ri) is incremented 715.
[0113] If they are different, cb#_input remains unchanged. After reaching the end of the chain, Ri_GAT is written to a new entry in OCHT_ET, along with its IMHB#and the final determined cb#_input 707. The lock is released 711.
[0114] After processing an input row in the Hash Phase, the system checks if the OCHT Extended Table (ET_OCHT) is full.
[0115] If the ET_OCHT is full: The algorithm transitions to the Merge Phase 205. The current CB#for merging is reset to 0 (cb#= 0) .
[0116] If the ET_OCHT is not full: The system loops back to process the next input row.
[0117] Accordingly, after an input row (Ri) is processed in the Hash Phase (either by writing a new GAT to OCHT_BT or OCHT_ET, or by updating an existing GAT) , the system needs to decide whether it can continue adding more entries to the OCHT or if it needs to start emptying the OCHT by merging its contents to the IMHT.
[0118] After the OCHT update / insertion steps, the process can transition to the Merge Phase. The condition that typically triggers the transition from the Hash Phase to the Merge Phase is when the on-chip capacity, specifically the OCHT Extended Table (ET_OCHT) , reaches its limit or a high-water mark.
[0119] In the merge phase 205, GATs from the OCHT are processed and merged into the In-Memory Hash Table (IMHT) . This phase iterates through OCHT_GATs, processing those whose CB#matches the current global CB#value (initially 0) .
[0120] For each selected OCHT_GAT:
[0121] Its IMHB#is used to fetch the corresponding entry / bucket from the IMHT Base Table (BT_IMHT) .
[0122] Collision handling in IMHT (BT_IMHT and ET_IMHT) mirrors the OCHT logic: that is, check for collision, search chain on collision, update if match found, or insert new GAT if no match. When inserting a new GAT into IMHT, it is also assigned a Rehash In-Memory Hash Bucket ID (RIMHB#) and a new CB# (initialized to 0, and incremented if its RIMHB#matches an existing GAT's RIMHB#in the IMHT chain being traversed) .
[0123] After attempting to merge all OCHT_GATs for the current global CB#value, the system checks 720 if all GATs in the OCHT have been processed.
[0124] When not all OCHT_GATs are processed: The global CB#is incremented 719 (cb#=cb#+ 1) , and the merge phase loops back to process OCHT_GATs for the new CB#723.
[0125] When all OCHT_GATs are processed: The system checks 721 if the IMHT is almost full. When the IMHT is almost full, there is transition to the Rehash Phase (see figure 7b) . The current CB#for rehashing is reset to 0 (cb#= 0) .
[0126] When the IMHT is not almost full: transition back to the Hash Phase 203 to continue processing input rows.
[0127] If all input rows have been processed (checked at the beginning of the Hash Phase) and all OCHT_GATs have been merged, the process stops. The final results are in the IMHT.
[0128] Referring to figure 7b, showing a flowchart for the rehash phase 207, this phase is triggered when the IMHT is almost full. It rehashes GATs from the current IMHT to a new, larger Rehash In-Memory Hash Table (RIMHT) .
[0129] According to an example, it iterates through IMHT_GATs, processing those whose CB#(assigned during their insertion into IMHT) matches the current global CB#value (initially 0) .
[0130] For each selected IMHT_GAT, its RIMHB#is used to fetch the corresponding entry / bucket from the RIMHT Base Table (BT_RIMHT) . Collision handling in RIMHT (BT_RIMHT and ET_RIMHT) mirrors the OCHT / IMHT logic: check for collision, search chain, update on match, or insert new GAT.
[0131] When inserting a new GAT into RIMHT, it is assigned its RIMHB# (which is effectively its destination bucket in RIMHT) and a new CB# (initialized to 0, and incremented if its RIMHB#matches an existing GAT's RIMHB#in the RIMHT chain being traversed) .
[0132] After attempting to rehash all IMHT_GATs for the current global CB#value, the system checks 750 if all GATs in the IMHT have been processed.
[0133] If not all IMHT_GATs have been processed: The global CB#is incremented 751 (cb#=cb#+ 1) , and the Rehash Phase 207 loops back to process IMHT_GATs for the new CB#.
[0134] When all IMHT_GATs are processed: The RIMHT becomes the new IMHT (IMHT =RIMHT) 753. The algorithm transitions back to the Hash Phase 203 to continue processing any remaining input rows or to finalize if all rows are done.
[0135] This iterative, three-phase process with its detailed logic for handling GATs, collisions, and metadata (IMHB#, CB#, RIMHB#) allows the accelerator to manage aggregation state efficiently across the on-chip and in-memory hash tables while maximizing concurrency.
[0136] Thus, according to aspects of the present disclosure, for an accelerator, such as that depicted in figure 3 for example:
[0137] In a ‘Hash’ phase:
[0138] ● Group column (s) of input rows are hashed to a bucket in the on-chip hash table.
[0139] ● Get lock on the OCHT base table index.
[0140] ● If there is no collision, write the GAT entry, IMHB#and CB# (=0) to OCHT_BT.
[0141] ● If there is a collision, search for the entry in the bucket chain that matches with the group value (s) .
[0142] ● If there is a match, perform aggregation and write back result.
[0143] ● While searching, compare IMHB#of each GAT entry in the chain with IMHB# of the input row. If they are the same, increment CB#_input else keep it unchanged (CB#_input is initially set to zero) .
[0144] ● If there is no match, get a free entry from OCHT_ET and append the GAT entry, IMHB#and CB#to the end of the bucket chain.
[0145] ● Release the lock after updating OCHT.
[0146] ● If the on-chip extended table is full, the algorithm transitions to the ‘Merge’ phase.
[0147] In a ‘Merge’ phase:
[0148] ● Each valid OCHT GAT entry is merged with IMHT.
[0149] ● GAT entries belonging to a concurrent box (CB) can be merged concurrently starting with CB#=0.
[0150] ● When merging an OCHT GAT entry (input) , fetch the bucket entry from the corresponding IMHB.
[0151] ● If there is no collision, write the GAT entry, RIMHB#and CB# (=0) to IMHT_BT.
[0152] ● If there is a collision, search for the entry in IMHT bucket chain that matches with the group value (s) .
[0153] ● If there is a match, perform aggregation and write back result.
[0154] ● While searching, compare RIMHB#of each GAT entry in the chain with RIMHB#of the input row. If they are the same, increment CB#_input else keep it unchanged (CB#_input is initially set to zero) .
[0155] ● If there is no match, get a free entry from IMHT_ET and append the GAT entry, RIMHB#and CB#to the end of the bucket chain.
[0156] ● If the in-memory extended table is almost full, transition to the ‘Rehash’ phase, else transition to ‘Hash’ phase.
[0157] ● If all input rows are processed and merged, the IMHT can be read out by to create columnar view of the output table.
[0158] In a ‘Rehash’ phase:
[0159] ● Each valid GAT entry in IMHT is rehashed to a larger hash table RIMHT (e.g. 4x larger) .
[0160] ● GAT entries belonging to a concurrent box (CB) can be rehashed concurrently starting with CB#=0.
[0161] ● When merging an IMHT GAT entry (input) , fetch the bucket entry from the corresponding RIMHB.
[0162] ● If there is no collision, write the GAT entry, RIMHB#and CB# (=0) to RIMHT_BT.
[0163] ● If there is a collision, search for the entry in RIMHT bucket chain that matches with the group value (s) .
[0164] ● If there is a match, perform aggregation and write back result.
[0165] ● While searching, compare RIMHB#of each GAT entry in the chain with RIMHB#of the input row. If they are the same, increment CB#_input else keep it unchanged (CB#_input is initially set to zero) .
[0166] ● If there is no match, get a free entry from RIMHT_ET and append the GAT entry, RIMHB#and CB#to the end of the bucket chain.
[0167] ● When all IMHT GAT entries are processed, assign RIMHT as the new IMHT.
[0168] ● Transition to ‘Hash’ phase.
[0169] Examples in the present disclosure can be provided as methods, systems or machine-readable instructions, such as any combination of software, hardware, firmware or the like. Such machine-readable instructions may be included on a computer readable storage medium (including but not limited to disc storage, CD-ROM, optical storage, etc. ) having computer readable program codes therein or thereon.
[0170] The present disclosure is described with reference to flow charts and / or block diagrams of the method, devices and systems according to examples of the present disclosure. Although the flow diagrams described above show a specific order of execution, the order of execution may differ from that which is depicted. Blocks described in relation to one flow chart may be combined with those of another flow chart. In some examples, some blocks of the flow diagrams may not be necessary and / or additional blocks may be added. It shall be understood that each flow and / or block in the flow charts and / or block diagrams, as well as combinations of the flows and / or diagrams in the flow charts and / or block diagrams can be realized by machine readable instructions.
[0171] The machine-readable instructions may, for example, be executed by a machine such as a general-purpose computer, a platform comprising user equipment such as a smart device, e.g., a smart phone, a hardware accelerator, a special purpose computer, an embedded processor or processors of other programmable data processing devices to realize the functions described in the description and diagrams. In particular, a processor or processing apparatus may execute the machine-readable instructions. Thus, modules of apparatus may be implemented by a processor executing machine readable instructions stored in a memory, or a processor operating in accordance with instructions embedded in logic circuitry. The term 'processor' is to be interpreted broadly to include a CPU, processing unit, ASIC, logic unit, or programmable gate set etc. The methods and modules may all be performed by a single processor or divided amongst several processors.
[0172] Such machine-readable instructions may also be stored in a computer readable storage that can guide the computer or other programmable data processing devices to operate in a specific mode. For example, the instructions may be provided on a non-transitory computer readable storage medium encoded with instructions, executable by a processor.
[0173] Figure 8 is a schematic representation of a machine according to an example. The machine 800 can be, e.g., a system or apparatus, user equipment, or part thereof, or an accelerator. The machine 800 comprises a processor 803, and a memory 805 to store instructions 802, executable by the processor 803. The machine comprises a storage 809 that can be used to store data 801 as described above with reference to figures 1 to 7 for example.
[0174] The instructions 807, executable by the processor 803, can cause the machine 800 to receive input data in columnar format, convert the input data from columnar format to row format, during a hash phase, process input rows from the converted input data, and store the processed input rows in a staging hash table in a first memory subsystem integrated within a hardware accelerator, wherein the staging hash table comprises a temporary processing data structure for initial aggregation of the input rows before transferring results of the processing to a persistent aggregation hash table in a second memory subsystem external to the hardware accelerator, wherein the persistent aggregation hash table is a memory-resident data organization structure that maintains a global aggregation state by storing unique group keys and their corresponding accumulated values with provisions for dynamic expansion through rehashing, for each entry inserted into the staging hash table, calculate and store a hash-derived mapping identifier that maintains correspondence between entries in the staging hash table and respective destination locations in the persistent aggregation hash table, and assign synchronization classification identifiers to entries that can be processed concurrently without race conditions using a synchronization classification identifier configured to provide conflict-free parallel processing, during a merge phase, group entries from the staging hash table in the first memory subsystem into non-conflicting execution groups based on their synchronization classification identifiers, merge entries within each non-conflicting execution group concurrently to the persistent aggregation hash table in the second memory subsystem, and implement a barrier between non-conflicting execution groups to ensure all entries in a previous group have been merged before processing entries in a subsequent group.
[0175] Accordingly, the machine 800 can implement a method for accelerating hash aggregation operations.
[0176] Such machine-readable instructions may also be loaded onto a computer or other programmable data processing devices, so that the computer or other programmable data processing devices perform a series of operations to produce computer-implemented processing, thus the instructions executed on the computer or other programmable devices provide an operation for realizing functions specified by flow (s) in the flow charts and / or block (s) in the block diagrams.
[0177] Further, the teachings herein may be implemented in the form of a computer or software product, such as a non-transitory machine-readable storage medium, the computer software or product being stored in a storage medium and comprising a plurality of instructions, e.g., machine readable instructions, for making a computer device implement the methods recited in the examples of the present disclosure.
[0178] In some examples, some methods can be performed in a cloud-computing or network-based environment. Cloud-computing environments may provide various services and applications via the Internet. These cloud-based services (e.g., software as a service, platform as a service, infrastructure as a service, etc. ) may be accessible through a web browser or other remote interface of the user equipment for example. Various functions described herein may be provided through a remote desktop environment or any other cloud-based computing environment.
[0179] While various embodiments have been described and / or illustrated herein in the context of fully functional computing systems, one or more of these exemplary embodiments may be distributed as a program product in a variety of forms, regardless of the particular type of computer-readable-storage media used to actually carry out the distribution. The embodiments disclosed herein may also be implemented using software modules that perform certain tasks. These software modules may include script, batch, or other executable files that may be stored on a computer-readable storage medium or in a computing system. In some embodiments, these software modules may configure a computing system to perform one or more of the exemplary embodiments disclosed herein. In addition, one or more of the modules described herein may transform data, physical devices, and / or representations of physical devices from one form to another.
[0180] The preceding description has been provided to enable others skilled in the art to best utilize various aspects of the exemplary embodiments disclosed herein. This exemplary description is not intended to be exhaustive or to be limited to any precise form disclosed. Many modifications and variations are possible without departing from the spirit and scope of the instant disclosure. The embodiments disclosed herein should be considered in all respects illustrative and not restrictive. Reference should be made to the appended claims and their equivalents in determining the scope of the instant disclosure.
Claims
1.A hardware accelerator for hash aggregation operations, comprising:a first memory subsystem integrated within the hardware, wherein the first memory subsystem is configured to store a staging hash table, wherein the staging hash table comprises a high-speed buffer structure with parallel access capabilities that serves as an intermediate aggregation point to exploit temporal locality before controlled merging operations;a second memory subsystem external to the hardware accelerator and accessible using a memory interface, the second memory subsystem comprising a persistent aggregation hash table with a base table for direct-mapped entries and an extended table for collision resolution through linked chains, wherein the persistent aggregation hash table is configured to persist aggregation results across multiple processing iterations;an entry classification and tracking system configured to append each entry of the staging hash table in the first memory subsystem with:a hash-derived mapping identifier that identifies a target location in the persistent aggregation hash table where an entry from the staging hash table is to be merged; anda synchronization classification identifier configured to enable entries to be partitioned into non-conflicting execution groups based on their hash-derived mapping identifiers;multiple finite state machines, FSMs, configured to implement a pipeline of stages for hash aggregation operations; andmultiple hardware queues implemented in the first memory subsystem to provide asynchronous execution isolation between pipeline stages through hardware-implemented producer-consumer queues with independent flow control.2.The hardware accelerator of claim 1, wherein the FSMs are configured to:process, in a hash phase, input data rows from an input table and store the processed input data rows in the staging hash table in the first memory subsystem;merge, in a merge phase, entries from the staging hash table in the first memory subsystem to the persistent aggregation hash table in the second memory subsystem; andcreate, in a rehash phase, a larger persistent aggregation hash table in the second memory subsystem when the current persistent aggregation hash table becomes full.3.The hardware accelerator of claim 1 or 2, wherein the entry classification and tracking system is configured to:calculate and store the hash-derived mapping identifier for each entry inserted into the staging hash table in the first memory subsystem;compare the hash-derived mapping identifier of a new entry with hash-derived mapping identifiers of existing entries of the staging hash table in the first memory subsystem;assign the same synchronization classification identifier to entries with different hash-derived mapping identifiers; andassign different synchronization classification identifiers to entries with the same hash-derived mapping identifier to prevent race conditions during parallel processing.4.The hardware accelerator of claim 3, wherein entries with the same synchronization classification identifier are configured to be merged concurrently to the persistent aggregation hash table in the second memory subsystem during the merge phase.5.The hardware accelerator of any preceding claim, wherein the hash-derived mapping identifier is calculated by applying a hash function to a group key of an entry and performing a modulo operation with the size of the persistent aggregation hash table in the second memory subsystem.6.The hardware accelerator of claim 2, wherein during the merge phase, the FSMs are configured to:group entries from the staging hash table in the first memory subsystem into non-conflicting execution groups based on their synchronization classification identifiers;merge entries within each non-conflicting execution group concurrently to the persistent aggregation hash table in the second memory subsystem; andimplement a barrier between non-conflicting execution groups to ensure all entries in a previous group have been merged before processing entries in a subsequent group.7.The hardware accelerator of any preceding claim, further comprising:a locking mechanism with one bit per hash table index to enable concurrent accesses to the staging hash table in the first memory subsystem during the hash phase.8.The hardware accelerator of any preceding claim, wherein the multiple hardware queues provide a buffering mechanism that allows each pipeline stage to process entries at respective predefined rates through first-in-first-ready scheduling.9.The hardware accelerator of any preceding claim, further comprising:a column to row, C2R, module configured to fetch values stored in columnar format and convert them to rows of input data; anda row to column, R2C, module configured to convert output entries stored in the persistent aggregation hash table in the second memory subsystem to columnar format.10.The hardware accelerator of any of claims 2 to 6, wherein during the rehash phase, the FSMs are configured to:allocate memory for a larger persistent aggregation hash table in the second memory subsystem;merge each valid entry in the current persistent aggregation hash table with a corresponding entry in the larger persistent aggregation hash table; anduse the larger persistent aggregation hash table for subsequent operations.11.A method for accelerating hash aggregation operations, the method comprising:receiving input data in columnar format;converting the input data from columnar format to row format;during a hash phase, processing input rows from the converted input data, and storing the processed input rows in a staging hash table in a first memory subsystem integrated within a hardware accelerator, wherein the staging hash table comprises a temporary processing data structure for initial aggregation of the input rows before transferring results of the processing to a persistent aggregation hash table in a second memory subsystem external to the hardware accelerator, wherein the persistent aggregation hash table is a memory-resident data organization structure that maintains a global aggregation state by storing unique group keys and their corresponding accumulated values with provisions for dynamic expansion through rehashing;for each entry inserted into the staging hash table, calculating and storing a hash-derived mapping identifier that maintains correspondence between entries in the staging hash table and respective destination locations in the persistent aggregation hash table; andassigning synchronization classification identifiers to entries that can be processed concurrently without race conditions using a synchronization classification identifier configured to provide conflict-free parallel processing;during a merge phase, grouping entries from the staging hash table in the first memory subsystem into non-conflicting execution groups based on their synchronization classification identifiers;merging entries within each non-conflicting execution group concurrently to the persistent aggregation hash table in the second memory subsystem; andimplementing a barrier between non-conflicting execution groups to ensure all entries in a previous group have been merged before processing entries in a subsequent group.12.The method of claim 11, wherein calculating the synchronization classification identifier comprises:comparing the hash-derived mapping identifier of a new entry with hash-derived mapping identifiers of existing entries of the staging hash table in the first memory subsystem;assigning the same synchronization classification identifier to entries with different hash-derived mapping identifiers; andassigning different synchronization classification identifiers to entries with the same hash-derived mapping identifier to prevent race conditions during parallel processing.13.The method of claim 11 or 12, wherein the hash-derived mapping identifier is calculated by applying a hash function to the group key of an entry and performing a modulo operation with the size of the persistent aggregation hash table in the second memory subsystem.14.The method of any of claims 11 to 13, further comprising:during a rehash phase, allocating memory for a larger persistent aggregation hash table in the second memory subsystem;merging each valid entry in the current persistent aggregation hash table with a corresponding entry in the larger persistent aggregation hash table; andusing the larger persistent aggregation hash table for subsequent operations.15.The method of any of claims 11 to 14, wherein the hash phase, merge phase, and rehash phase are performed by a pipeline of finite state machines, FSMs, decoupled by hardware queues that provide a data transfer architecture enabling independent execution timing between pipeline stages while preserving execution order dependencies.16.A system comprising:at least one processor, and at least one memory; anda hardware accelerator for hash aggregation operations according to any of claims 1 to 10.17.The system of claim 16, wherein the hardware accelerator is integrated into an input / output (I / O) die of the at least one processor.18.The system of claim 16 or 17, further comprising:a software interface configured to:configure the hardware accelerator for analytics operations;configure data-path parameters based on input width; andconfigure data structures in both the first memory subsystem and the second memory subsystem.
