Hash aggregation operations

The cache-based hardware accelerator with a hierarchical locking mechanism addresses memory-intensive hash aggregation challenges by enhancing concurrency and temporal locality, improving performance and efficiency through a dual-memory approach and pipelined finite state machines.

WO2026236982A1PCT designated stage Publication Date: 2026-11-19HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/094957
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2026-11-19

AI Technical Summary

Technical Problem

Hash aggregation operations in data processing systems are memory-intensive, leading to performance constraints due to latency and bandwidth limitations of accessing larger, slower main memory, and require efficient management of data movement and access patterns across the memory hierarchy.

Method used

A cache-based hardware accelerator with a hierarchical locking mechanism, featuring a high-speed cache structure and a persistent aggregation hash table, utilizes a dual-memory approach managed by a hierarchical locking mechanism and pipelined finite state machines to enhance concurrency and temporal locality, thereby improving performance and efficiency.

Benefits of technology

The solution significantly mitigates processing bottlenecks by maximizing parallelism and efficiently managing concurrent data access, resulting in reduced latency and improved throughput for hash aggregation tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025094957_19112026_PF_FP_ABST
    Figure CN2025094957_19112026_PF_FP_ABST
Patent Text Reader

Abstract

A hardware accelerator for hash aggregation operations comprises a first memory subsystem integrated within the hardware, a second memory subsystem external to the hardware accelerator, and a hierarchical locking mechanism.
Need to check novelty before this filing date? Find Prior Art

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 a cache-based architecture for accelerating hash aggregation operations with a hierarchical locking mechanism to enable high concurrency and exploit temporal locality, thereby improving performance and efficiency.

[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 accelerator and configured to store aggregation records, wherein the first memory subsystem comprises a high-speed cache structure with parallel access capabilities that exploits temporal locality for frequently accessed aggregation records, wherein the high-speed cache structure is organized into multiple sets, wherein each set is a subdivision of the high-speed cache that can contain multiple entries and is addressable by a hash of group key fields, a second memory subsystem external to the hardware accelerator and accessible using a memory interface, wherein the second memory subsystem comprises 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, a hierarchical locking mechanism comprising a first-level lock with one bit per set in the first memory subsystem, and a second-level lock implemented using a bloom filter for the persistent aggregation hash table in the second memory subsystem, 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] An apparatus with a first memory subsystem, specifically a high-speed on-chip cache structure organized into multiple sets for parallel access to frequently used aggregation records, and a second, external memory subsystem for a persistent aggregation hash table featuring base and extended tables for collision resolution, offers enhanced performance. This dual-memory approach, managed by a hierarchical locking mechanism (including a first-level lock per cache set and a second-level bloom filter for the persistent table) and orchestrated by multiple pipelined finite state machines decoupled by hardware queues, facilitates high-throughput hash aggregation. Such an architecture excels by maximizing parallelism and efficiently managing concurrent data access across different memory levels, thereby significantly mitigating processing bottlenecks common in memory-intensive aggregation tasks.

[0009] In an implementation of the first aspect, the pipeline of stages can comprise a lock cache index stage configured to hash group key fields of input data rows from an input table and acquire locks on cache indices and / or, an aggregate and write stage configured to compare tags, wherein tags are identifiers stored with each entry in a cache set that are derived from group key fields and used to determine whether a particular entry matches the requested data, and perform one of aggregating and writing back on hit, when a matching tag is found, inserting on miss, when no matching tag is found, or evicting an entry if no invalid entry is present and / or, a lock hash table index stage configured to lock hash table indices for merging evictions and / or, a read hash node stage configured to generate read requests for hash nodes, and / or an aggregate and write to hash table stage configured to compare and perform one of aggregating and writing back, searching next node, or inserting new aggregation records.

[0010] Defining a pipeline of stages that includes specific operations like locking a cache index, performing aggregation and writing directly within the cache upon a hit or managing misses and evictions, and subsequently handling the locking of hash table indices for merging evicted items or reading hash nodes, results in a highly specialized and efficient processing workflow. This operational specialization within the pipeline contributes to reduced latency for individual steps and a notable improvement in the overall throughput of the aggregation process, ensuring rapid processing of analytical queries.

[0011] The bloom filter can increment counters when acquiring locks on hash table indices, and decrement the same counters when releasing locks on hash table indices.

[0012] The utilization of a bloom filter that manages locks on hash table indices by incrementing and decrementing associated counters upon lock acquisition and release, respectively, presents a particularly space-efficient and rapid mechanism for concurrency control. This is especially beneficial when dealing with a very large number of entries in the persistent aggregation hash table, as it circumvents the substantial hardware overhead that would be incurred by maintaining individual lock bits for every hash table entry, while still effectively managing concurrent access.

[0013] 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 aggregation records stored in the persistent aggregation hash table to columnar format.

[0014] Dedicated Column-to-Row (C2R) and Row-to-Column (R2C) conversion modules within the hardware accelerator allows for seamless integration with data typically stored in columnar formats, a common practice in modern analytical databases and data warehouses. By performing these conversions in hardware, a task that is often computationally intensive in software is offloaded, leading to an acceleration of the entire end-to-end data processing pipeline for analytical workloads.

[0015] The hardware queues can comprise at least one cache ready queue configured to store requests waiting on locking a set in the first memory subsystem, at least one hash table ready queue configured to store requests waiting on hash table index locks, at least one hash node read queue configured to store requests waiting on reading hash table entries, and at least one hash node write queue configured to store requests waiting on writing hash table entries.

[0016] Employing a variety of distinct hardware queues, such as at least one cache ready queue for requests targeting the first memory subsystem, at least one hash table ready queue for requests awaiting hash table index locks, and separate hash node read and write queues, fosters a highly decoupled and parallel execution environment. This granular approach to queuing allows different segments of the aggregation process to operate independently and concurrently, effectively smoothing out variations in processing times for different operations and maximizing the utilization of the accelerator’s diverse resources.

[0017] The hardware queues can provide a buffering mechanism that allows each pipeline stage to process entries respective predefined rates while maintaining sequential consistency through first-in-first-ready scheduling.

[0018] A buffering mechanism provided by the hardware queues, when combined with a scheduling policy like first-in-first-ready, ensures that while individual pipeline stages can process entries at their own predefined, optimal rates, the overall sequential consistency of data operations is rigorously maintained. This synergy offers the dual benefits of high performance, derived from inherent parallelism, and guaranteed correctness in the final aggregation results.

[0019] The FSMs can execute a two-phase process comprising a hash-and-merge phase wherein hashing input data rows from an input table and merging evicted records occur in parallel, and a rehash phase triggered when the persistent aggregation hash table extended table is full.

[0020] Structuring the accelerator's operation into a two-phase process, comprising a hash-and-merge phase where the hashing of input data rows and the merging of evicted aggregation records occur in parallel, and a distinct rehash phase activated when the persistent aggregation hash table's extended table reaches capacity, optimizes for continuous high throughput. The inherent parallelism of the hash-and-merge phase significantly reduces processing stalls, while the rehash phase offers a robust and scalable solution for managing large datasets that might exceed initial memory allocations.

[0021] During the hash-and-merge phase, the FSMs can hash group key fields of input data rows to a set in the first memory subsystem, acquire a lock on the set, compare tags in parallel and, upon finding a match, perform aggregation and write back results, wherein tags are identifiers stored with each entry in a cache set that are derived from group key fields and used to determine whether a particular entry matches the requested data, upon finding no match, insert an aggregation record in an empty way, wherein a way is an individual storage location within a set that can hold one aggregation record, and release the lock, upon finding no empty way, evict an entry from the first memory subsystem, insert the aggregation record, and release the lock, and merge aggregation records that are evicted or flushed in parallel to hashing input data rows.

[0022] During the hash-and-merge phase, the capability to hash group key fields of input data rows to a specific set in the first memory subsystem, acquire a lock on that set, perform parallel tag comparisons for swift hit detection, and subsequently perform aggregation and write back on a match, or insert an aggregation record in an empty way (or evict an existing entry if no empty way is found) on a miss, all while concurrently merging aggregation records that are evicted or flushed, results in an exceptionally efficient utilization of the on-chip cache. This strategy maximizes the advantages of temporal data locality and substantially reduces the frequency of accesses to the slower second memory subsystem.

[0023] 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.

[0024] The operational design of the rehash phase, which involves allocating memory for a larger persistent aggregation hash table in the second memory subsystem, systematically merging each valid entry from the current, full persistent aggregation hash table into this new, larger table, and then designating the larger table for subsequent operations, ensures that the aggregation process can effectively scale to accommodate datasets with a high cardinality of group keys. This dynamic resizing capability is crucial for preventing premature termination due to memory overflow and allows the accelerator to adeptly handle growing and unpredictable data volumes.

[0025] A second aspect of the present disclosure provides a method for accelerating hash aggregation operations, the method comprising receiving input data in columnar format from an input table, converting the input data from columnar format to row format to generate input data rows, wherein each input data row comprises one or more group key fields and one or more value fields to be aggregated, hashing group key fields of the input data rows to identify corresponding sets in a first memory subsystem integrated within a hardware accelerator, wherein each set is a subdivision of a cache memory that can contain multiple entries and is addressable by a hash of the group key fields, and wherein the first memory subsystem comprises a high-speed cache structure that exploits temporal locality for frequently accessed aggregation records, acquiring locks on the identified sets using a first-level locking mechanism, comparing tags, wherein tags are identifiers stored with each entry in a cache set that are derived from group key fields and used to determine whether a particular entry matches the requested data, performing operations on the first memory subsystem comprising one of aggregating and writing back on hit, inserting on miss, or evicting an entry if no invalid entry is present, wherein inserting comprises storing an aggregation record in an empty way, wherein a way comprises an individual storage location within a set that can hold one aggregation record, acquiring locks on hash table indices in a persistent aggregation hash table in a second memory subsystem external to the hardware accelerator using a second-level locking mechanism implemented as a bloom filter, 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, merging evicted entries with the persistent aggregation hash table in the second memory subsystem, and executing the hashing and merging operations in parallel.

[0026] This delivers sustained high-performance aggregation. The concurrent execution of hashing new data and merging older, evicted data into the persistent aggregation hash table is a factor in achieving this enhanced performance and efficiency.

[0027] In an implementation of the second aspect, the bloom filter can increment counters when acquiring locks on hash table indices, and decrement the same counters when releasing locks on hash table indices.

[0028] Configuring the bloom filter, used for the second-level locking mechanism, to operate by incrementing counters when acquiring locks on hash table indices and decrementing the same counters upon their release, provides a low-overhead and highly scalable solution for managing concurrent access to the persistent aggregation hash table. This counter-based approach is computationally straightforward and efficient for tracking the state of numerous locks with minimal hardware complexity.

[0029] The method can further comprise when the persistent aggregation hash table becomes full, 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.

[0030] The ability within the method, upon the persistent aggregation hash table becoming full, to allocate memory for a larger persistent aggregation hash table, merge each valid entry from the current table into this newly allocated larger table, and then seamlessly continue subsequent operations using this expanded table, introduces a scalability feature. This ensures that the aggregation process is not constrained by initial memory capacity estimations and can dynamically adapt to the demands of large and complex datasets.

[0031] The operations on the first memory subsystem and hash table operations 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.

[0032] Performing the operations on the first memory subsystem and the hash table operations using a pipeline of finite state machines (FSMs) that are effectively decoupled by hardware queues, which in turn provide a data transfer architecture enabling independent execution timing between these pipeline stages while preserving execution order dependencies (e.g., through first-in-first-ready scheduling) , leads to a highly efficient, orderly, and high-throughput processing flow. This architectural method maximizes parallelism while ensuring the correctness and integrity of the aggregation results.

[0033] 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.

[0034] In an implementation of the third aspect, the hardware accelerator can be integrated into an input / output die of the at least one processor.

[0035] The integration of such a hardware accelerator directly into an input / output (I / O) die of the at least one processor within the system offers distinct advantages related to reduced communication latency and increased data transfer bandwidth between the processor cores and the accelerator. This tighter coupling can yield further performance enhancements for aggregation tasks when compared to an accelerator implemented as a discrete component on a separate bus.

[0036] 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.

[0037] These and other aspects of the invention will be apparent from the embodiment (s) described below.Brief Description of the Drawings

[0038] 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:

[0039] Figure 1 is a schematic representation of a hash aggregation operation;

[0040] Figure 2 is a schematic representation of overview for a process used in a hardware accelerator for hash aggregation operations, according to an example;

[0041] Figure 3 is a schematic representation of an architecture for a hardware accelerator for hash aggregation operations, according to an example;

[0042] Figure 4 is a schematic representation of a process according to an example;

[0043] Figure 5 is a flowchart illustrating a method for processing input data, according to an example; and

[0044] Figure 6 is a schematic representation of a machine according to an example.Detailed Description

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] 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. ”

[0051] The terms “system” and “network” may be used interchangeably.

[0052] 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.

[0053] 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.

[0054] 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) .

[0055] 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.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] 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.

[0060] 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.

[0061] According to an example, an on-chip associative cache, implemented in, e.g., static random-access memory (SRAM) , for storing frequently accessed group-aggregate tuples is provided. This cache operates in conjunction with a larger in-memory hash table (IMHT) residing in main system memory (e.g., DRAM) .

[0062] Figure 2 is a schematic representation of overview for a process hash aggregation operations, according to an example.

[0063] An accelerator according to example starts 201 receiving or fetching input data rows that need to be aggregated.

[0064] The Hash 203 and Merge 205 phases comprise two primary operations that occur in parallel. That is, according to an example, these phases can execute concurrently to maximize throughput and efficiency.

[0065] The first parallel path is the Hash 203 operation. As input rows are processed, the group key from each row is hashed. For example, the group key is hashed to determine its corresponding set within the cache. If the group key is found within that cache set (a cache hit) , the associated aggregate value in the cache entry is updated (merged with the new value from the input row) . If the group key is not found (a cache miss) , a new group-aggregate tuple (GAT) is created and an attempt is made to insert it into an available "way" (or slot) within the identified cache set.

[0066] If a cache miss occurs and the target cache set has no empty ways to accommodate the new GAT, an existing GAT within that set is evicted. This eviction can be based on either a Least Recently Used (LRU) or Least Frequently Used (LFU) policy.

[0067] The second parallel path, triggered by cache evictions, is the Merge 205 operation. GATs evicted from the on-chip cache are written to the larger In-Memory Hash Table (IMHT) residing in main system memory.

[0068] According to an example, acquiring a lock on the target index (or bucket) of the IMHT corresponds to the second-level locking mechanism, which can employ a bloom filter for efficiency. Once the lock is secured, the evicted GAT is merged into the IMHT. This involves either updating an existing entry if the group key is already present in the IMHT or creating a new entry for the group key.

[0069] In a Rehash Phase 207, a mechanism to handle situations where the IMHT itself reaches its capacity is provided. For example, a check is performed for the IMHT's capacity. If the IMHT is found to be full, the Rehash phase 207 is initiated.

[0070] A new, significantly larger IMHT (e.g., four times the size of the current one) is allocated and then all valid GAT entries from the old, full IMHT are systematically transferred to this new, larger IMHT. This process typically involves re-calculating hash values based on the new table size. The overall process concludes 209 when all input data has been processed.

[0071] Accordingly, an In-Memory Hash Table (IMHT) is maintained in a main system memory (e.g., DRAM) . The IMHT is typically larger than an on-chip cache and serves as a persistent store for aggregation results that do not fit or are evicted from the on-chip cache. The IMHT may consist of a base table (BT) and an extended table (ET) to handle hash collisions, where colliding entries are linked in a chain.

[0072] Processing is structured as a two-phase algorithm: a "Hash-&-Merge" phase and a "Rehash" phase. During the Hash-&-Merge phase, input data rows are processed by hashing their group key fields. The resulting group-aggregate tuples are inserted into or updated in the on-chip cache. Cache eviction policies (e.g., LRU or LFU) are employed when a cache set is full. Evicted items are then merged into the IMHT. Notably, the hashing operations (populating the cache) and the merge operations (updating the IMHT with evicted items) are executed in parallel, allowing for continuous processing and minimizing pipeline stalls.

[0073] Concurrency is managed through a hierarchical locking mechanism. A first-level lock, typically one bit per cache set, controls concurrent access to the on-chip cache. A second-level lock mechanism manages concurrent access to the IMHT. This second-level lock can be implemented as a direct 1-bit lock per IMHT bucket or, to reduce area overhead for a large number of IMHT buckets, as a bloom filter. The bloom filter, an approximate data structure, tracks locked IMHT buckets, potentially indicating a bucket is locked even if it is not (a false positive) , which maintains correctness while optimizing for performance.

[0074] The architecture employs a pipelined design with stages decoupled by hardware queues. These queues, implemented in, e.g., SRAM, along with their schedulers, allow different pipeline stages to operate in parallel and asynchronously. Multiple instances of the processing pipeline can be implemented to further enhance parallelism.

[0075] If the IMHT reaches its capacity, the algorithm transitions to the Rehash phase. In this phase, a larger rehashed in-memory hash table (RIMHT) is allocated, and valid entries from the current IMHT are merged into the RIMHT. The RIMHT then becomes the active IMHT for subsequent Hash-&-Merge operations.

[0076] The system also includes modules for converting data between columnar and row formats (C2R and R2C) , a DMA engine for memory access, and a well-defined hardware-software interface for configuration and job submission.

[0077] Figure 3 is a schematic representation of an architecture for a hardware accelerator for hash aggregation operations, according to an example.

[0078] A set of Stage FSMs (Finite State Machines) 301 provide core control logic of the accelerator 300. It comprises multiple distinct FSMs, each responsible for a specific stage in the hash aggregation pipeline. For example:

[0079] A "Lock Cache Index" 303: Manages the acquisition of locks for specific sets / indices within the on-chip associative cache before access.

[0080] An "Aggregate and Write in Cache" 305: Performs the aggregation logic (e.g., sum, count) and writes the updated Group-Aggregate Tuple (GAT) back to the on-chip cache.

[0081] A "Lock In-Memory Hash Table Index" 307: Manages the acquisition of locks for specific buckets / indices within the In-Memory Hash Table (IMHT) located in main memory.

[0082] A "Read In-Memory Hash Node" 309: Controls the process of reading GATs or collision chain nodes from the IMHT.

[0083] An "Aggregate and Write to In-Memory Table" 311: Performs aggregation for entries being merged into the IMHT and controls the writing of these GATs to main memory.

[0084] These FSMs collectively orchestrate the complex data flow and synchronization required for the Hash-&-Merge and Rehash phases of the invention.

[0085] Staging Queues (SRAM Banks) 313 comprise several hardware queues implemented using on-chip SRAM. These queues enable decoupling the various pipeline stages managed by the FSMs, enabling asynchronous operation and improving overall throughput. In an example, each queue is managed by a specific scheduler (FIRR or FIFR) :

[0086] ● Cache Ready Queue: Scheduled by an FIRR scheduler, this queue holds input GATs (Inp_GAT) along with their metadata (MD) and lock status / requests (Lock) that are ready for processing by the on-chip cache subsystem.

[0087] ● In-Memory Hash Table Ready Queue: Also scheduled by an FIRR scheduler, this queue holds GATs evicted from the cache (Evict_GAT) , their metadata (MD) , and lock status / requests (Lock) , preparing them for merging into the IMHT.

[0088] ● In-Memory Hash Node Read Queue: Managed by an FIFR scheduler, this queue handles requests for reading data from the IMHT. It contains entries indicating the GAT being processed (Evict_GAT or Out_GAT) , metadata (MD) , and a ready status (Rdy) .

[0089] ● In-Memory Hash Node Write Queue: Also managed by an FIFR scheduler, this queue holds GATs (Out_GAT) and their metadata (MD) that are ready to be written to the IMHT, along with a done status (Done) indicating completion of processing for that entry before the write.

[0090] Associative Cache (SRAM Banks) 315 comprises an on-chip set-associative cache. A Cache Index Lock manages locks for individual cache indices (sets) , ensuring exclusive access during read / write operations to a particular cache set. A Tag Array stores the address tags associated with the GATs currently residing in the cache. This is used to determine cache hits or misses, and a Data Array stores the actual GAT data (group keys and their corresponding aggregate values) . In an example, the cache 315 leverages SRAM for fast access and exploitation of temporal locality in the input data stream.

[0091] Ext Table Index Lock (Bloom Filter) 317 serves as the locking mechanism for indices in the In-Memory Hash Table (particularly for its extended portion used in collision handling, or the IMHT more broadly) . The Bloom Filter provides a space-efficient probabilistic method for managing a large number of locks.

[0092] A Hash Generation Module 319 is responsible for computing hash values from the group keys of GATs. These hash values are used to determine the target set in the on-chip cache and the target bucket in the IMHT.

[0093] Column to Row Module (C2R) 321 converts input data, which is typically fetched from main memory in a columnar format (as shown in the DDR Main Memory block 327) , into a row-oriented format. This row-based format is more amenable to the tuple-at-a-time processing within the aggregation pipeline.

[0094] Row to Column Module (R2C) 323 converts the final aggregated GATs (which are row-oriented) back into a columnar format before they are written out to main memory. This is often required for compatibility with subsequent data processing stages or analytical database storage formats.

[0095] AXI Interface 325 provides a standardized Advanced eXtensible Interface for communication between the on-chip accelerator and the external DDR Main Memory 327. It handles the complexities of memory transactions, ensuring efficient data transfer for reading input columns, reading / writing the IMHT, and writing output columns.

[0096] Configuration registers 329 are typically used by software to configure operational parameters of the accelerator, such as cache policies, bloom filter settings, or enabling / disabling specific features.

[0097] The External DDR Main Memory 327 can store:

[0098] ● Input Data: "Input column 0" , "Input column 1" , "Input column 2" , representing the source data for aggregation.

[0099] ● In-Memory hash table: The large, persistent hash table where GATs are stored, especially those that do not fit in the on-chip cache or have been evicted.

[0100] ● Output Data: "Output group" and "Output aggregate" , representing the final results of the aggregation process, stored in a columnar fashion.

[0101] Figure 4 is a schematic representation of a hash phase according to an example. In the example of figure 4, a pipelined process is depicted, starting from the arrival of an input row and detailing its journey through the cache and, if necessary, the main memory hash table system.

[0102] With reference to figure 4, an "Input Row" initiates the process. This row contains a group key and value (s) to be aggregated. The request derived from the input row is enqueued into a "Cache Ready FIRR Queue" . The FIRR (First In Round Robin) scheduling policy ensures fair access for multiple pending requests. From the queue, the request is processed by the on-chip cache logic. This involves two main steps:

[0103] (1) Hash and get lock: The group key of the input row is hashed to determine the target set within the on-chip cache. Simultaneously, a lock for this specific cache set is acquired. In an example, this can comprise a 1 bit lock per set and the cache can be a 4-way cache (4-way set-associative organization) .

[0104] (2) Compare all tags, RMW on hit, insert on miss: Once the set is locked and identified, the tags of all ways within that set are compared against the input row's group key tag. If a matching tag is found (a cache hit) , a Read-Modify-Write (RMW) operation is performed on the Group-Aggregate Tuple (GAT) stored in that cache way to update its aggregate value. If no matching tag is found (a cache miss) , a new GAT for the input row is inserted into an available way within the locked set.

[0105] Following the successful write operation (either RMW or insert) to the cache (SRAM) , the lock on the cache set is released ( "Release lock on SRAM write" ) .

[0106] If a cache miss occurs and the target cache set is full (i.e., all ways are occupied by valid GATs) , an existing GAT must be evicted according to a policy like LRU / LFU. These evicted GATs are then directed towards the In-Memory Hash Table processing pipeline by being enqueued into an "In-Memory table Ready FIRR Queue" .

[0107] Requests for evicted items are taken from the In-Memory table Ready FIRR Queue. Similarly to the cache process, the group key of the evicted GAT is hashed to determine its target index (bucket) in the IMHT. A lock for this specific IMHT index is acquired. This can be a 1 bit lock per in-memory hash index.

[0108] In a request generation process, the current state of the target IMHT bucket is fetched. Read requests are placed into a "FIFR Read Queue" (First In First Ready) . The system then reads the hash table node (s) from the IMHT via the AXI interface. The group key of the evicted GAT is compared with the key (s) in the retrieved IMHT node (s) . If a matching key is found in the IMHT, the system proceeds to "Perform aggregation and issue store request" . That is, the aggregate value of the evicted GAT is combined with the aggregate value of the existing entry in the IMHT, and a request to write the updated entry back is generated. If the comparison indicates this is the last node in a collision chain it proceeds to "Issue store request" . This could be for storing a new GAT if it was not found, or updating the last found item. If the key is not found within the current node and it is not the end of a potential collision chain, the system will "Get next address and generate read request" to fetch the next node in the collision chain linked to the current IMHT bucket.

[0109] Store requests (resulting from aggregations or new insertions into the IMHT) are enqueued into a "FIFR Write Queue" . These requests are then processed to write the GAT data to the IMHT in main memory through the AXI interface. After the write operation to the IMHT is completed, the "Release lock on memory write" action occurs, freeing the IMHT index for other operations.

[0110] Figure 5 is a flowchart of a method, according to an example. In the example of figure 5, an aggregation process is divided into two main concurrent paths: processing input rows against the on-chip cache, and merging evicted GATs into the main memory IMHT.

[0111] Data from an Input Table (Columnar Format) is converted by C2R Module 321 into individual Input Row (Ri) 503 streams for processing. The system processes input rows one by one. A decision block 505 checks if the current row is the final one. If it is the last row, the process proceeds to "Flush Cache" 507, ensuring all remaining GATs in the cache are processed and potentially merged into the IMHT. If it is not the last row, the flow continues to the cache interaction logic.

[0112] For each input row Ri, the group key is hashed 509 in order to determine the specific set within the on-chip associative cache where the GAT should reside or be looked up. Following this, a lock for that cache set is acquired 511 that ensures exclusive access to the cache set during the subsequent operations, preventing data corruption from concurrent accesses.

[0113] With the cache set locked, the system performs a Compare tags in parallel operation 513. That is, the tags of all ways within the selected cache set are compared simultaneously against the tag of the input row Ri. The outcome of this parallel comparison can lead to different paths:

[0114] If there are many hits (implying multiple potential matches) , or if a more granular check is needed, the flow proceeds to "Compare Each Way" 515.

[0115] If there is "One Hit" , the flow directly proceeds to a "Match" decision 517 for that specific hit.

[0116] If there are no hits from the parallel comparison, the flow moves towards cache miss handling.

[0117] If a match is found (either directly from "One Hit" or after iterating through ways via "Compare Each Way" and finding a matching GAT) , the aggregate value in the existing GAT in the cache is updated 519 with the information from the input row Ri. Subsequently, the "Release Cache Set Lock" 521 is performed, making the cache set available for other operations.

[0118] If, after comparing all ways (reaching "End of Set" in the "Compare Each Way" 515 loop without a match) , no existing GAT for Ri is found in the cache set:

[0119] A decision "Empty Way? " checks if there is an unused way within the locked cache set. If an Empty Way exists: The new GAT (Ri_GAT) is inserted directly into this empty way 523. The "Release Cache Set Lock" follows, and the system can loop back for the next input row.

[0120] If No Empty Way exists (Cache Set is Full) , this triggers a cache eviction. An existing GAT is selected for eviction based on a policy like LRU / LFU. After eviction, the new Ri_GAT is inserted into the now-available way 523. The "Release Cache Set Lock" occurs. The evicted GAT is not discarded but is sent for processing via the "Merge Evicted GATs" path. The system can then loops back for the next input row.

[0121] When a GAT is evicted from the cache or when the cache is flushed after the last input row, a second pathway can be initiated. The system can check whether "All inputs and evictions processed? " 525. If yes, and the IMHT is not deemed full, the process can Stop 527. If there are still items to process or the system is ongoing, it checks whether the IMHT is almost full 529. If Yes, the system transitions to the Rehash phase 207. If No, the merge operation for the current evicted GAT proceeds.

[0122] To merge an evicted GAT, its target bucket in the IMHT must be accessed. This starts with "Lock IMHB#index" 531, acquiring an exclusive lock for the specific In-Memory Hash Bucket. Then, the current entry (if any) at that IMHB#is fetched: "Fetch IMHB#entry" 533.

[0123] A collision decision is made to check whether the fetched IMHB#entry is already occupied by a different GAT or if it is the start of a collision chain. For no collision (or direct write to Base Table -BT_IMHT) Write Evicted GAT to BT_IMHT occurs. If an entry for the same key already existed, "Aggregate and Write Back" is performed. The "Release IMHB Lock" follows, and the process can loop back to check if all inputs / evictions are processed. If a collision exists, the system can traverse or update a collision chain.

[0124] A "Match? " decision checks if the key of the evicted GAT matches the key of the current entry in the collision chain. If Match: The GATs are aggregated: "Aggregate and Write Back" . The "Release IMHB Lock" occurs, and the loop continues. If No Match: The system checks if it is at the "Last In Chain? " . If Last In Chain (and no match) : The evicted GAT is written as a new entry at the end of the chain: "Write Evicted GAT to new entry in ET_OCHT" . The "Release IMHB Lock" occurs, and the loop continues. If Not Last In Chain (and no match) : The system fetches the "Get next entry. " in the collision chain and loops back to the "Fetch IMHB#entry" .

[0125] The rehash phase 207 is triggered when the "IMHT almost full? " condition 529 is met. The Rehash process begins by iterating "For all valid IMHT_GATs" 535 from the current (old) IMHT. For each GAT from the old IMHT, its new position in the Rehashed IMHT (RIMHT) is determined. A lock for the target bucket in the RIMHT is acquired: "Lock RIMHB#index" . The current entry at that RIMHB#in the new table is fetched: "Fetch RIMHB#entry" .

[0126] RIMHT Collision Handling and Write Logic mirrors the IMHT collision handling. That is if there is no collision: "Write IMHT_GAT to BT_RIMHT" (Base Table of RIMHT) , then "Aggregate and Write Back" . The "Release RIMHB Lock" occurs 539. If a collision exists, and for a "Match? " in the RIMHT chain: if there is match: "Aggregate and Write Back" , then "Release RIMHB Lock" . If no natch: Check "Last In Chain? " in RIMHT. If Last In Chain: "Write IMHT_GAT to new entry in ET_RIMHT" (Extended Table of RIMHT) . "Release RIMHB Lock" . If not last in chain: "Get next entry. " and loop within RIMHT collision handling.

[0127] After processing each GAT from the old IMHT, a check is made: "All IMHT_GATs processed? " . If no, the loop continues via "For all valid IMHT_GATs" . If yes, the rehash is complete. The "IMHT=RIMHT" assignment makes the newly populated and larger RIMHT the active In-Memory Hash Table. The process then transitions back to the Hash and Merge phase, typically by re-evaluating the "IMHT almost full? " condition (now with a larger IMHT) or by checking "All inputs and evictions processed? " to continue normal operation.

[0128] Accordingly, aspects of the present disclosure describe that input data rows are fetched and converted from columnar to row format by a Column-to-Row (C2R) module. The "Hash" stages of the accelerator pipeline process these rows. For each input row, the group key field (s) are hashed to determine a target set in the on-chip cache. The accelerator then attempts to find a matching GAT in that cache set by comparing tags.

[0129] If a match is found (cache hit) , the aggregate value in the existing GAT is updated. If no match is found (cache miss) , a new GAT is inserted into an available way in the cache set. If the cache set is full, an existing GAT is evicted based on a replacement policy (e.g., Least Recently Used -LRU, or Least Frequently Used -LFU) .

[0130] Evicted GATs are handled by the "Merge" stages of the pipeline. These stages merge the evicted GATs into the IMHT. This involves hashing the group key of the evicted GAT to find the corresponding bucket in the IMHT. If an entry for the group key already exists in the IMHT, its aggregate value is updated; otherwise, a new entry is created. The Hash stages (interacting with the cache) and the Merge stages (interacting with the IMHT) operate in parallel, allowing for continuous processing.

[0131] In the Rehash Phase: Before processing new input rows in the Hash and Merge phase, the capacity of the IMHT is checked. If the IMHT (specifically, its extended table, IMHT_ET) is full, the process transitions to the Rehash phase. In this phase, a new, larger Rehashed In-Memory Hash Table (RIMHT) is allocated in main memory. Each valid GAT entry from the current IMHT is then read and merged into the corresponding location in the RIMHT. After all entries are transferred, the RIMHT becomes the active IMHT, and the process transitions back to the Hash and Merge phase to process further input rows or terminates if no more input rows exist.

[0132] The accelerator's architecture is structured as a pipeline of stages. Each stage is typically implemented as a Finite State Machine (FSM) . These stages are decoupled using hardware queues implemented in SRAM. Each queue has an associated scheduler (e.g., First-In-First-Ready -FIFR, or First-In-Round-Robin -FIRR) that selects the next ready item for processing by the subsequent stage. This decoupling allows stages to operate at their own pace, hiding latencies and improving overall throughput. Examples of such queues include:

[0133] ● Cache Ready Queue: Stores requests waiting to acquire a lock on a cache set to insert or update a GAT in the on-chip cache.

[0134] ● In-Memory Hash Table Ready Queue: Stores requests (typically for evicted GATs) waiting to acquire a lock on an IMHT index (bucket) for merging.

[0135] ● In-Memory Hash Node Read Queue: Stores requests for reading entries from the IMHT or RIMHT.

[0136] ● In-Memory Hash Node Write Queue: Stores requests for writing entries to the IMHT or RIMHT.

[0137] Multiple parallel instances of the processing pipeline can be implemented to further scale performance.

[0138] To ensure data consistency during concurrent operations, a hierarchical locking mechanism is employed. That is, for a First-Level Lock (Cache Lock) , an on-chip lock mechanism is used for the on-chip cache. This can be implemented as a 1-bit lock per cache set. Before a Hash FSM can access or modify a cache set, it must acquire the corresponding set lock. This allows multiple Hash FSMs to concurrently operate on different cache sets.

[0139] A Second-Level Lock (IMHT Lock) is a second-level on-chip lock mechanism used for concurrent access to the IMHT by the Merge FSMs. Given that the IMHT can have a large number of buckets, a simple 1-bit lock per bucket might consume excessive silicon area. Therefore, a bloom filter can be used as an approximate locking mechanism. When a Merge FSM needs to update an IMHT bucket, it inserts an identifier for that bucket into the bloom filter (effectively acquiring a lock) . When the update is complete, the identifier is removed (releasing the lock) . A bloom filter may produce false positives (i.e., indicate a bucket is locked when it is not) , which does not affect correctness but might slightly reduce optimal concurrency in such cases. It avoids false negatives, ensuring that if a bucket is truly locked, the bloom filter will indicate it. The bloom filter can be designed as an array of counters, where insertion increments a set of counters and removal decrements them.

[0140] This hierarchical locking allows the Hash and Merge operations to proceed in parallel with a high degree of concurrency, maximizing the utilization of both on-chip resources and memory bandwidth.

[0141] In an example, the accelerator can be managed via a software interface. This includes a user-space library for configuring accelerator resources (e.g., cache size, bloom filter parameters) and offloading hash aggregation jobs. A kernel-space device driver handles memory mapping (mmap) and job queue management. Jobs are typically submitted by writing to memory-mapped registers, which may trigger atomic store instructions.

[0142] 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.

[0143] 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.

[0144] 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.

[0145] 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.

[0146] 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.

[0147] [Rectified under Rule 91, 07.07.2025]Figure 6 is a schematic representation of a machine according to an example. The machine 600 can be, e.g., a system or apparatus, user equipment, or part thereof, or an accelerator. The machine 600 comprises a processor 603, and a memory 605 to store instructions 602, executable by the processor 603. The machine comprises a storage 609 that can be used to store data 811 as described above with reference to figures 1 to 5 for example.

[0148] [Rectified under Rule 91, 07.07.2025]The instructions 602, executable by the processor 603, can cause the machine 600 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.

[0149] [Rectified under Rule 91, 07.07.2025]Accordingly, the machine 600 can implement a method for accelerating hash aggregation operations.

[0150] 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.

[0151] 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.

[0152] 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.

[0153] 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.

[0154] 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 accelerator and configured to store aggregation records, wherein the first memory subsystem comprises a high-speed cache structure with parallel access capabilities that exploits temporal locality for frequently accessed aggregation records, wherein the high-speed cache structure is organized into multiple sets, wherein each set is a subdivision of the high-speed cache that can contain multiple entries and is addressable by a hash of group key fields;a second memory subsystem external to the hardware accelerator and accessible using a memory interface, wherein the second memory subsystem comprises 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;a hierarchical locking mechanism comprising:a first-level lock with one bit per set in the first memory subsystem; anda second-level lock implemented using a bloom filter for the persistent aggregation hash table in the second memory subsystem;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 pipeline of stages comprises:a lock cache index stage configured to hash group key fields of input data rows from an input table and acquire locks on cache indices and / or;an aggregate and write stage configured to compare tags, wherein tags are identifiers stored with each entry in a cache set that are derived from group key fields and used to determine whether a particular entry matches the requested data, and perform one of:aggregating and writing back on hit, when a matching tag is found,inserting on miss, when no matching tag is found, orevicting an entry if no invalid entry is present and / or;a lock hash table index stage configured to lock hash table indices for merging evictions and / or;a read hash node stage configured to generate read requests for hash nodes; and / oran aggregate and write to hash table stage configured to compare and perform one of:aggregating and writing back,searching next node, orinserting new aggregation records.3.The hardware accelerator of claim 1 or 2, wherein the bloom filter is configured to:increment counters when acquiring locks on hash table indices; anddecrement the same counters when releasing locks on hash table indices.4.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 aggregation records stored in the persistent aggregation hash table to columnar format.5.The hardware accelerator of any preceding claim, wherein the hardware queues comprise:at least one cache ready queue configured to store requests waiting on locking a set in the first memory subsystem;at least one hash table ready queue configured to store requests waiting on hash table index locks;at least one hash node read queue configured to store requests waiting on reading hash table entries; andat least one hash node write queue configured to store requests waiting on writing hash table entries.6.The hardware accelerator of any preceding claim, wherein the hardware queues provide a buffering mechanism that allows each pipeline stage to process entries respective predefined rates while maintaining sequential consistency through first-in-first-ready scheduling.7.The hardware accelerator of any preceding claim, wherein the FSMs are configured to execute a two-phase process comprising:a hash-and-merge phase wherein hashing input data rows from an input table and merging evicted records occur in parallel; anda rehash phase triggered when the persistent aggregation hash table extended table is full.8.The hardware accelerator of claim 7, wherein during the hash-and-merge phase, the FSMs are configured to:hash group key fields of input data rows to a set in the first memory subsystem;acquire a lock on the set;compare tags in parallel and, upon finding a match, perform aggregation and write back results, wherein tags are identifiers stored with each entry in a cache set that are derived from group key fields and used to determine whether a particular entry matches the requested data;upon finding no match, insert an aggregation record in an empty way, wherein a way is an individual storage location within a set that can hold one aggregation record, and release the lock;upon finding no empty way, evict an entry from the first memory subsystem, insert the aggregation record, and release the lock; andmerge aggregation records that are evicted or flushed in parallel to hashing input data rows.9.The hardware accelerator of claim 7 or 8, 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.10.A method for accelerating hash aggregation operations, the method comprising:receiving input data in columnar format from an input table;converting the input data from columnar format to row format to generate input data rows, wherein each input data row comprises one or more group key fields and one or more value fields to be aggregated;hashing group key fields of the input data rows to identify corresponding sets in a first memory subsystem integrated within a hardware accelerator, wherein each set is a subdivision of a cache memory that can contain multiple entries and is addressable by a hash of the group key fields, and wherein the first memory subsystem comprises a high-speed cache structure that exploits temporal locality for frequently accessed aggregation records;acquiring locks on the identified sets using a first-level locking mechanism;comparing tags, wherein tags are identifiers stored with each entry in a cache set that are derived from group key fields and used to determine whether a particular entry matches the requested data;performing operations on the first memory subsystem comprising one of:aggregating and writing back on hit,inserting on miss, orevicting an entry if no invalid entry is present,wherein inserting comprises storing an aggregation record in an empty way, wherein a way comprises an individual storage location within a set that can hold one aggregation record;acquiring locks on hash table indices in a persistent aggregation hash table in a second memory subsystem external to the hardware accelerator using a second-level locking mechanism implemented as a bloom filter, 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;merging evicted entries with the persistent aggregation hash table in the second memory subsystem; andexecuting the hashing and merging operations in parallel.11.The method of claim 10, wherein the bloom filter is configured to:increment counters when acquiring locks on hash table indices; anddecrement the same counters when releasing locks on hash table indices.12.The method of claim 10 or 11, further comprising:when the persistent aggregation hash table becomes full, 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.13.The method of any of claims 10 to 12, wherein the operations on the first memory subsystem and hash table operations 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.14.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 9.15.The system of claim 14, wherein the hardware accelerator is integrated into an input / output die of the at least one processor.16.The system of claim 13 or 14, 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.