A semantic hardware branch predictor and computing processing chip
By integrating a semantic hardware branch predictor into the computing chip, the word stream of a large language model is matched in real time, and hardware warm-up and resource scheduling are performed. This solves the problems of latency and resource waste in the process of calling large language model tools, and improves the execution speed and resource utilization.
Patent Information
- Application Number
- CN202611134194.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-11-20
AI Technical Summary
Large language models suffer from problems such as high inference latency due to serial execution, waste of idle hardware resources, and the inability of traditional hardware predictors to adapt to semantic-level tool call prediction acceleration during tool invocation.
A semantic hardware branch predictor is adopted and integrated into the computing chip. The semantic monitoring unit matches the word stream of the large language model in real time, extracts task context feature data, and combines it with the hardware operation unit to generate table index address and confidence count value. The prediction trigger unit issues a preheating scheduling signal in advance based on the confidence threshold. The underlying hardware completes the resource preheating and pre-occupancy, and the consistency of the real tool number is verified by the comparison unit to dynamically adjust the resource usage.
It effectively avoids the high latency problem of traditional large model tool calls waiting for complete instruction generation before configuring hardware resources, improves the execution response speed of tool calls, and enhances the utilization rate of hardware resources and the stability of inference operation.
Smart Images

Figure CN123138367A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of large language models and artificial intelligence technology, and in particular to a semantic hardware branch predictor and computing chip. Background Technology
[0002] In the tool invocation workflow of AI (Artificial Intelligence) agents driven by Large Language Model (LLM), the agent generally relies on the large language model to generate word streams one by one to execute a single tool invocation task. After the tool invocation instruction is completely parsed, the corresponding tool environment loading, network interaction and operator operation resource invocation are triggered. The overall tool invocation execution process depends on the complete instruction generation result of the large language model, which is the mainstream operating architecture for end-to-end agent inference execution.
[0003] The existing conventional intelligent agent tool invocation execution logic adopts a completely serial execution mechanism, which is strictly divided into three serial stages: large language model word stream inference generation, complete tool instruction recognition and parsing, and hardware resource loading and tool execution. Only after the large language model outputs the complete tool instruction text will the system start the underlying execution resource configuration, network handshake interaction, operator and model weight loading and other warm-up preparation operations. Moreover, the traditional hardware branch prediction architecture only performs prediction operations on the program counter and binary instruction stream.
[0004] However, this serial execution mode causes the underlying hardware execution resources to always lag behind the instruction generation process, which easily leads to high latency issues in tool invocation and causes users to experience lag. At the same time, during the cycle of large language models generating inference content word by word, the underlying execution hardware is idle for a long time, resulting in low hardware resource utilization. Furthermore, traditional hardware predictors cannot recognize the semantic intent carried by the word stream of large models, cannot achieve advance prediction of tool invocation behavior and hardware warm-up, and cannot adapt to the acceleration requirements of semantic-level inference execution of intelligent agents. Summary of the Invention
[0005] This invention provides a semantic hardware branch predictor and computing chip to solve the technical problems of high inference latency, waste of idle hardware resources, and inability of traditional hardware predictors to adapt to semantic-level tool call prediction acceleration caused by serial execution of tool calls in large model intelligent agents.
[0006] According to one aspect of the present invention, a semantic hardware branch predictor is provided, the semantic hardware branch predictor being integrated into a computing processing chip, the semantic hardware branch predictor including a semantic monitoring unit, a hardware operation unit, a speculation triggering unit, and a comparison unit, wherein:
[0007] The semantic monitoring unit is used to compare each word in the target large language model loaded on the computing chip with the preset prefix rules during the real-time output of the word stream for the target task. When a match is successful with the target prefix, the task context feature data matching the target prefix is obtained and sent to the hardware computing unit.
[0008] The hardware processing unit is used to calculate the target table index address corresponding to the target prefix based on the received task context feature data; and to obtain the target tool number and confidence count value that match the target table index address and send them to the speculation triggering unit.
[0009] The speculative triggering unit, when it determines that the received confidence count value is greater than or equal to the preset confidence threshold, generates a preheating scheduling signal based on the target tool number and sends it to the underlying hardware, so that the underlying hardware responds to the preheating scheduling signal and performs a matching preheating operation to pre-occupy hardware resources.
[0010] The comparison unit is used to obtain the real tool number obtained after the target large language model has completed the generation of all word streams for the target task, and compare the real tool number with the target tool number. If the comparison is inconsistent, the confidence count value that matches the target table index address is reduced, and a resource flushing control signal is generated and sent to the underlying hardware to make the underlying hardware release the pre-occupied hardware resources.
[0011] Specifically, when the actual tool number matches the target tool number, the agent matching the target large language model can directly use the pre-occupied hardware resources to execute the matching tool invocation task.
[0012] According to another aspect of the present invention, a computing processing chip is provided, including a semantic hardware branch predictor as described in any embodiment of the present invention.
[0013] The semantic hardware branch predictor of this invention, integrated within a computing chip, uses a semantic monitoring unit to perform prefix matching on the word stream output by a large language model in real time and extract corresponding task context feature data. A hardware computing unit then uses this context feature data to generate a table index address, retrieves the target tool number and confidence count, and triggers a preheating scheduling signal based on the confidence threshold. This preheating signal drives the underlying hardware to preheat and pre-occupy the hardware resources corresponding to the tool. A comparison unit verifies the consistency between the actual tool number and the predicted target tool number after the word stream of the large language model is generated. If they match, the pre-occupied hardware resources can be reused to execute the tool call task. If they do not match, the corresponding confidence count is promptly lowered and the preheated hardware resources are flushed and released. This collaborative mechanism of real-time semantic prediction, hardware preheating, and dynamic resource flushing and error correction effectively avoids the high latency problem caused by traditional large model tool calls waiting for complete instruction generation before configuring hardware resources, improving the execution response speed of tool calls. Furthermore, the iterative update of the confidence count and the error resource recycling mechanism avoid invalid resource occupation and waste, ensuring the utilization rate of chip hardware resources and the stability of inference operation.
[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of a semantic hardware branch predictor provided in Embodiment 1 of the present invention;
[0017] Figure 2 This is a schematic diagram of another semantic hardware branch predictor provided according to Embodiment 2 of the present invention;
[0018] Figure 3 This is a schematic diagram of another semantic hardware branch predictor provided in Embodiment 3 of the present invention;
[0019] Figure 4 This is a schematic diagram of a computing processing chip according to Embodiment 4 of the present invention;
[0020] Figure 5 This is an organizational structure diagram of a semantic monitoring unit applicable to an embodiment of the present invention;
[0021] Figure 6 This is an organizational structure diagram of a semantic pattern history table applicable to an embodiment of the present invention. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] Example 1
[0025] Figure 1 This is a schematic diagram of a semantic hardware branch predictor provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where tools are invoked through large model agents. The semantic hardware branch predictor 110 can generally be configured in a computing processing chip. Figure 1 As shown, the semantic hardware branch predictor 110 is integrated into a computing chip. The semantic hardware branch predictor 110 includes a semantic monitoring unit 120, a hardware operation unit 130, a speculation triggering unit 140, and a comparison unit 150, wherein:
[0026] The semantic monitoring unit 120 is used to compare each word in the target large language model loaded on the computing chip with the preset prefix rules during the real-time output of the word stream for the target task. When the target prefix is successfully matched, the task context feature data matching the target prefix is obtained and sent to the hardware computing unit 130.
[0027] The hardware processing unit 130 is used to calculate the target table index address corresponding to the target prefix based on the received task context feature data; and to obtain the target tool number and confidence count value that match the target table index address and send them to the speculation triggering unit 140.
[0028] The speculative triggering unit 140, when it determines that the received confidence count value is greater than or equal to the preset confidence threshold, generates a preheating scheduling signal according to the target tool number and sends it to the underlying hardware, so that the underlying hardware responds to the preheating scheduling signal and performs a matching preheating operation to pre-occupy hardware resources.
[0029] The comparison unit 150 is used to obtain the real tool number obtained after the target large language model has completed the generation of all word streams for the target task, and compare the real tool number with the target tool number: if the comparison is inconsistent, the confidence count value matching the target table index address is reduced, and a resource flushing control signal is generated and sent to the underlying hardware to make the underlying hardware release the pre-occupied hardware resources.
[0030] Specifically, when the actual tool number matches the target tool number, the agent matching the target large language model can directly use the pre-occupied hardware resources to execute the matching tool invocation task.
[0031] In this embodiment of the invention, the semantic hardware branch predictor can be specifically understood as: an independent hardware prediction circuit integrated within a computing chip, specifically designed for hardware-level inference prediction and resource scheduling of tool invocation behavior based on the semantic features of large language model lexical units. The semantic monitoring unit can be specifically understood as: a hardware detection unit used to monitor and match the prefix features of the large model's output lexical stream in real time, used to capture semantic features triggered by tool invocations. The hardware computation unit can be specifically understood as: a dedicated hardware computation circuit, a hardware computation unit that performs context feature computation, index address generation, and table lookup.
[0032] The inference triggering unit can be understood as a hardware threshold judgment and preheating scheduling output unit, which determines whether to start the underlying hardware resource preheating in advance based on the confidence count. The comparison unit can be understood as a hardware unit for prediction result verification and feedback error correction, used for comparing with real instructions, updating confidence, and flushing and recycling resources. The confidence count value can be understood as a hardware count value used to characterize the prediction credibility of the tool call corresponding to the current semantic prefix, used to quantify prediction reliability.
[0033] The underlying hardware can be understood as the chip-level execution hardware that is connected to and scheduled by the semantic hardware branch predictor hardware bus. It may include memory controllers, network cards, DMA (Direct Memory Access) controllers, etc., and provides the physical execution carrier for hardware warm-up and resource reclamation for the predictor. The two are subordinate and linked to each other in the predictive control layer and the hardware execution layer.
[0034] The actual tool ID can be understood as: after the large language model outputs all the word streams and generates the complete tool call instruction text, the unique identifier code corresponding to the tool that the agent actually needs to call is parsed and extracted from the instruction text. This code serves as the standard reference data for judging whether the target tool ID predicted in the early stage is accurate, and is used to verify the consistency of the prediction results completed by the comparison unit.
[0035] Specifically, the semantic hardware branch predictor 110, integrated within the computing chip, serves as an independent hardware prediction control layer circuit, establishing a hardware bus communication and control linkage relationship with the underlying hardware, which acts as the hardware execution layer. The computing chip can be an AI accelerator or a general-purpose processor, among other things.
[0036] The semantic monitoring unit 120 monitors the word stream output by the large language model in real time and performs word stream prefix matching with preset prefix rule prefixes. After matching the target prefix, it extracts the corresponding task context feature data and sends it to the hardware computing unit 130.
[0037] For example, the semantic monitoring unit 120 continuously caches and samples the word stream output by the large language model in real time, relying on the built-in cache. Using the preset tool call trigger prefix rule as the matching benchmark, it performs sequence-level semantic prefix matching on the continuously updated complete word sequence within the window. When the word sequence is detected to match any target trigger prefix, it retrieves the task context feature data uniquely bound to the target prefix by looking up the table and transmits the feature data to the hardware computing unit 130 in real time, completing the pre-semantic perception and feature extraction and transmission process.
[0038] Among them, the task context feature data is exclusive hardware feature data obtained by pre-encoding the semantic features of trigger prefixes for various tool calls. It is extracted, normalized and encoded offline according to the prefix semantic rules corresponding to different tool call business scenarios, forming an exclusive context feature dataset that corresponds one-to-one with each preset trigger prefix. The overall data is batch configured and solidified during the chip power-on initialization stage.
[0039] The hardware processing unit 130 calculates and generates the target table index address based on the received task context feature data. For example, it calculates the target table index address by XORing the hash value of the context feature data and the target trigger prefix. Alternatively, it first splits the task context feature data into multiple independent segments according to a preset fixed bit width. After each segment is hash-compressed, it performs a hierarchical superposition operation by combining the intermediate calculation result of the previous segment with the hash-compressed feature value of the next segment in the order of segment splitting. Each time two segments are superimposed, a feature merging operation is performed simultaneously (e.g., using loop truncation). The modulo mapping process compresses and converges the high-order feature information that exceeds the effective addressing width after superposition, while retaining the low-order effective feature information suitable for storage addressing. This ensures that the overall feature value after fusion falls stably within the bit width range required for semantic pattern historical storage unit lookup, thus constraining the data bit width to prevent overflow. This process is repeated iteratively until all segmented compressed features are fused, thereby continuously converging and compressing the originally dimensionally dispersed and bit-width-exceeding-addressing original context feature data into the standard effective bit width range suitable for semantic pattern historical storage unit addressing and reading. Finally, the target table index address is generated through mapping.
[0040] The target tool number and confidence count value are obtained by retrieving the pre-stored table entry through the target table index address and then transmitted to the speculation trigger unit 140.
[0041] When the confidence count value meets the preset threshold condition, the inference triggering unit 140 generates a preheating scheduling signal and sends it to the underlying hardware, driving the underlying hardware to complete the hardware resource preheating and pre-occupancy operations in advance. For example, the preheating scheduling signal is only sent to the underlying hardware through the system hardware bus when the count value reaches the preset high confidence threshold corresponding to the highest confidence level of the two-digit saturated counter, driving the underlying hardware to perform resource preheating and pre-occupancy operations in parallel. Alternatively, a transition threshold range corresponding to the medium confidence level is added. When the count value falls into this range, full hardware resource preheating will not be started immediately. Only a lightweight pre-read cache operation is triggered to load basic feature data in advance. When it is in the lowest confidence level range, no scheduling output is generated at all. This hierarchical triggering method can allocate hardware preheating resources differently according to the historical prediction reliability. It can avoid the invalid resource occupation caused by low confidence prediction and reserve lightweight pre-preparation in medium confidence scenarios, balancing the acceleration effect of tool calls and the consumption of chip hardware resources.
[0042] Generally, the complete tool instruction text output by a single large language model (i.e., the text after generating all word streams) only carries a fixed set of tool invocation logic and can only parse out a single set of real tool numbers as the standard verification basis. Correspondingly, when the semantic hardware branch predictor performs semantic prediction on a continuous word stream, it will only infer a set of corresponding target tool numbers based on the single target prefix currently matched. Subsequent comparison units only need to complete the one-to-one comparison of the two unique numbers to complete the prediction result verification. There is no need to handle the complex judgment logic of cross-matching multiple numbers, which simplifies the computational overhead of the hardware comparison circuit.
[0043] If multiple target trigger prefixes are identified simultaneously during a single word stream matching stage, multiple different target tool numbers will be generated, forming a multi-number cross-matching scenario. This scenario often occurs when multiple semantic prefixes that can trigger tool calls appear consecutively in the word stream of a large language model, or when the feature prefixes of different tools overlap and become confused. Accordingly, the hardware can add a prefix priority sorting mechanism to sort multiple matched target prefixes according to preset business priority rules. Only the target tool numbers corresponding to the highest priority or a preset number of higher priority prefixes are selected as the numbers to be verified this time and sent to the inference triggering unit for preheating judgment. The numbers corresponding to the remaining matching prefixes are temporarily stored in the on-chip cache and do not participate in this resource scheduling. After the current complete tool instruction is generated and this round of verification is completed, the confidence count value corresponding to the remaining numbers in the cache is slightly corrected and updated. This avoids the multi-path resource contention conflict caused by multiple number synchronous triggering and completely retains the historical prediction statistics corresponding to multiple semantic prefixes.
[0044] After the large language model outputs all word streams and generates real tool IDs, the comparison unit 150 performs a consistency comparison between the real tool IDs and the predicted target tool IDs. If the comparison is inconsistent, the confidence count value of the corresponding table index address is lowered to avoid continuous invalid warm-up, and a resource flushing control signal is issued to release the pre-occupied hardware resources. If the comparison is consistent, the agent directly reuses the pre-occupied hardware resources to complete the tool invocation task. For example, when the LLM completes the generation of the entire sentence and officially issues the instruction, the hardware compares the real tool IDs with the predicted target tool IDs. If the comparison is consistent, the agent directly uses the pre-warmed environment to achieve a zero-latency response.
[0045] It should be emphasized that the semantic hardware branch predictor proposed in this embodiment of the invention, in addition to lowering the confidence count value of the corresponding table index address with inconsistent matching based on the prediction result, can also trigger a global semantic pattern learning process at fixed chip cycles. Based on the statistical situation of various prefix matching and tool call execution within a long window, the corresponding confidence count value can be uniformly increased. Alternatively, confidence level reset processing can be initiated during idle periods when the computing chip is not running any tasks, and the confidence count value that has been maintained at a low level for a long time can be appropriately increased and repaired. With the help of two types of supplementary hardware mechanisms, the confidence level corresponding to each semantic prefix can be continuously and dynamically adjusted, preventing the confidence count value from being continuously suppressed due to a single prediction error and remaining at a low level that cannot trigger hardware warm-up for a long time. This ensures that the semantic hardware branch predictor can carry out resource pre-scheduling work stably for a long time.
[0046] In a specific example, the Semantic Monitoring Unit (SMU) 120, through its integrated configurable trigger pattern matcher, abandons the inefficient processing method of traditional full-text parsing. It eliminates the need for semantic parsing of the complete model output text, only requiring predefined semantic prefixes for tool calls, such as "{"action":", "call tool:", etc. <tool>The feature fields, such as "", perform high-speed and accurate pattern matching, which greatly simplifies the hardware processing logic and improves the real-time performance and efficiency of the tool's call to the pre-feature recognition.
[0047] By scanning and monitoring the token sequences of the streaming output of the large language model in real time, we continuously capture the semantic feature changes during the model generation process, providing real-time data input for pre-prediction and judgment.
[0048] Among them, "{"action":", "call tool:", " <tool>"" is a pre-defined feature text prefix that represents the upcoming tool invocation behavior. It is a distinctive character fragment that distinguishes ordinary text generation from the tool invocation process. The semantic monitoring unit only needs to identify any segment of this type of prefix appearing in the streaming word sequence to determine that a tool invocation operation will occur later, which serves as the basis for initiating the subsequent index calculation and prediction process.
[0049] The configurable trigger pattern matcher is a dedicated hardware matching circuit integrated within the semantic monitoring unit. It supports the flexible addition, deletion, and modification of feature prefixes used for identifying tool calls according to different business scenarios without changing the underlying hardware operation logic. It can adapt to multiple large model output formats and tool call identifier texts of different styles, and has universal adaptability.
[0050] In a specific example, the Speculative Trigger Unit (STU) 140 receives the confidence value output from the Semantic Pattern History Table (S-PHT) and only sends a prefetch scheduling signal through the system hardware bus when the confidence value reaches a preset high confidence threshold (such as two binary identifiers 11 representing a strong prediction level), thus initiating the pre-allocation operation of underlying hardware resources.
[0051] The semantic pattern history table is a hardware storage structure dedicated to storing historical semantic matching prediction information. This table uses the task context combined with the prefix hash operation result as an independent retrieval index. Each storage entry is associated with the target tool number obtained from the match and the confidence status represented by a two-digit saturation counter. The hardware computing unit can quickly access the table through the calculated index to retrieve the prediction records corresponding to the same semantic prefix in the past, providing a basis for confidence judgment for the inference triggering unit. At the same time, the comparison unit will synchronously update the confidence value at the corresponding position in the table after the verification is completed, and continuously iterate and optimize the subsequent prediction accuracy.
[0052] For example, the Semantic Pattern History Table (S-PHT) data structure uses a combination of context and prefix hash values as the retrieval index. Each stored entry synchronously records the corresponding prediction result, including the target tool number and the confidence level represented by a two-digit saturation counter. An example entry is as follows:
[0053] Index 0x0A2F corresponds to the code writing task, with the prefix "{"action":", matching target tool number 0x05 (Python executor), confidence level 11, which is a strong prediction level;
[0054] Index 0x0B1C corresponds to the search task, with the prefix "{"action":", matching target tool number 0x09 (web search interface), confidence level 10, which is a weak prediction level.
[0055] The semantic hardware branch predictor of this invention, integrated within a computing chip, uses a semantic monitoring unit to perform prefix matching on the word stream output by a large language model in real time and extract corresponding task context feature data. A hardware computing unit then uses this context feature data to generate a table index address, retrieves the target tool number and confidence count, and triggers a preheating scheduling signal based on the confidence threshold. This preheating signal drives the underlying hardware to preheat and pre-occupy the hardware resources corresponding to the tool. A comparison unit verifies the consistency between the actual tool number and the predicted target tool number after the word stream of the large language model is generated. If they match, the pre-occupied hardware resources can be reused to execute the tool call task. If they do not match, the corresponding confidence count is promptly lowered and the preheated hardware resources are flushed and released. This collaborative mechanism of real-time semantic prediction, hardware preheating, and dynamic resource flushing and error correction effectively avoids the high latency problem caused by traditional large model tool calls waiting for complete instruction generation before configuring hardware resources, improving the execution response speed of tool calls. Furthermore, the iterative update of the confidence count and the error resource recycling mechanism avoid invalid resource occupation and waste, ensuring the utilization rate of chip hardware resources and the stability of inference operation.
[0056] Example 2
[0057] Figure 2 This is a schematic diagram of another semantic hardware branch predictor provided in Embodiment 2 of the present invention. This embodiment is a refinement of the semantic monitoring unit in the above embodiments. Figure 2 As shown, the semantic hardware branch predictor 210 is integrated into a computing chip. The semantic hardware branch predictor 210 includes a semantic monitoring unit 220, a hardware operation unit 230, a speculation triggering unit 240, and a comparison unit 250, wherein:
[0058] The semantic monitoring unit 220 is used to compare each word in the target large language model loaded on the computing chip with the preset prefix rules during the real-time output of the word stream for the target task. When the target prefix is successfully matched, the task context feature data matching the target prefix is obtained and sent to the hardware computing unit 230.
[0059] The hardware processing unit 230 is used to calculate the target table index address corresponding to the target prefix based on the received task context feature data; and to obtain the target tool number and confidence count value matching the target table index address and send them to the speculation triggering unit 240.
[0060] The inference triggering unit 240, when it determines that the received confidence count value is greater than or equal to the preset confidence threshold, generates a preheating scheduling signal according to the target tool number and sends it to the underlying hardware, so that the underlying hardware responds to the preheating scheduling signal and performs a matching preheating operation to pre-occupy hardware resources.
[0061] The comparison unit is used to obtain the real tool number obtained after the target large language model has completed the generation of all word streams for the target task, and compare the real tool number with the target tool number. If the comparison is inconsistent, the confidence count value that matches the target table index address is reduced, and a resource flushing control signal is generated and sent to the underlying hardware to make the underlying hardware release the pre-occupied hardware resources.
[0062] Specifically, when the actual tool number matches the target tool number, the agent matching the target large language model can directly use the pre-occupied hardware resources to execute the matching tool invocation task.
[0063] Specifically, the semantic monitoring unit 220 includes a sliding window cache 260;
[0064] Correspondingly, the semantic monitoring unit 220 is specifically used to push each word in the word stream to the sliding window cache 260 for storage in real time, and then compare all the words stored in the sliding window cache 260 with the preset prefix rules.
[0065] In this embodiment of the invention, the sliding window cache can be specifically understood as: a time-series circular cache hardware module set inside the semantic monitoring unit, which continuously holds a sequence of lexical terms in a continuous time sequence, automatically eliminating the earliest stored lexical terms as new lexical terms flow in, and maintaining a fixed-length lexical observation window. The preset prefix rule can be specifically understood as: a pre-configured feature character sequence judgment standard, used to identify the indicative segments in the lexical stream that indicate the upcoming execution of a tool call.
[0066] Specifically, the semantic monitoring unit 220 has a built-in sliding window cache 260. It continuously receives the lexical stream output by the large language model and stores each newly generated lexical in real time into the sliding window cache 260. It continuously updates the continuous lexical sequence stored in the window and continuously reads the existing lexical data in the sliding window cache 260 to perform matching and comparison with preset prefix rules. When the lexical sequence in the window matches the preset prefix rule, the semantic monitoring unit 220 extracts the corresponding context identifier. The backend hardware circuit combines the context identifier and the trigger word hash value to retrieve the semantic pattern history table and perform tool call result prediction.
[0067] The preset prefix rule is a preset tool call trigger prefix, which can include action identifier prefixes, tool call text prefixes, or tool label prefixes, such as "{"action":", "call tool:", etc. <tool>".
[0068] Furthermore, based on the above embodiments, the semantic hardware branch predictor also includes a semantic context register, wherein:
[0069] The semantic context register is used to store task context feature data that matches each prefix in the preset prefix rules;
[0070] Correspondingly, the semantic monitoring unit is further used to obtain the task context feature data that matches the target prefix from the semantic context register when a successful match is found, and send it to the hardware computing unit.
[0071] In this embodiment of the invention, the semantic context register can be specifically understood as a dedicated hardware register group used to store task context feature data representing the attributes of the current inference task. The target prefix can be specifically understood as a tool call trigger prefix successfully matched by the lexical sequence. The task context feature data can be specifically understood as identification information that can distinguish different inference tasks, which can take the form of task numbers or cue word embedding vectors, and is used to eliminate prediction ambiguity caused by the same trigger prefix.
[0072] Specifically, the semantic hardware branch predictor is configured with a semantic context register (SCR). The semantic context register stores task context feature data that corresponds to each preset prefix rule, such as the task ID or the simplified embedding vector of the prompt word. As part of the lookup table index, it resolves the ambiguity of the same trigger prefix corresponding to different tools in different task scenarios.
[0073] For example, the trigger prefix "{"action":" corresponds to a code execution tool in a code writing task scenario, but to a web search tool in an information retrieval task scenario. This prefix alone cannot distinguish the target tool. By combining the task context features to generate an index, the two scenarios can be distinguished and the correct tool number can be matched for each scenario.
[0074] Task context feature data is generated synchronously and loaded into the semantic context register at the beginning of a single inference task initiated by the large language model. When a new inference task is initialized, the system extracts the context feature data representing the attributes of this task, writes it into the semantic context register and keeps it there. It is effectively stored throughout the entire task inference cycle. After the semantic monitoring unit matches the target prefix in the word stream, it directly reads the set of real-time effective task context feature data corresponding to the current task in the register and forwards it to the hardware computing unit to participate in index calculation. The task context feature data stored in the register will only be updated and replaced when the current inference task ends and a new task is switched.
[0075] For example, if the trigger prefix is "{"action":", a unified prefix hash Hash_A is generated. When the semantic monitoring unit matches the target prefix Hash_A, it reads the code writing task context feature CTX_Code from the semantic context register, combines CTX_Code with Hash_A to form a retrieval index 0x0A2F to access the semantic pattern history table, and matches the target tool number 0x05 (Python executor), corresponding to the code execution tool. When switching inference tasks, the semantic context register updates the stored information retrieval task context feature CTX_Search. When the same trigger prefix "{"action":" is matched again, CTX_Search is combined with Hash_A to form a new retrieval index 0x0B1C to access the semantic pattern history table, and matches the target tool number 0x09 (web search interface), corresponding to the web search tool. The same trigger prefix forms independent retrieval indexes based on different real-time task context features, locating non-interfering stored entries in the table and eliminating prediction ambiguity caused by a single prefix.
[0076] Correspondingly, after the semantic monitoring unit completes the word sequence comparison and determines that it has successfully matched the target prefix, it reads the task context feature data corresponding to the target prefix from the semantic context register and transmits the set of feature data to the back-end hardware computing unit to provide basic input data for the operation of the target table index address.
[0077] It is understood that the embodiments of the present invention can limit the applicable scenarios to the prediction and execution process of tool calls within a single agent. Only the characteristic feature words and fixed trigger prefixes representing tool call actions in the model streaming output of a single agent are monitored. This is different from the open prompt word interaction scenario with no fixed format and arbitrary free text. It avoids the prediction failure, false triggering or missed triggering problems caused by the lack of fixed feature identifiers and the inability to stably match trigger prefixes in the open prompt of general agents.
[0078] For ordinary text generation scenarios that do not belong to a single intelligent agent tool call, free dialogue Prompt scenarios without a standardized trigger prefix, and lexical stream output scenarios that cannot match the preset tool call prefix, the preheating and prediction processes such as semantic matching, context index calculation, and S-PHT table lookup prediction can be omitted. The semantic monitoring unit only performs regular lexical stream listening and caching operations, does not output any prefetching scheduling and resource preheating signals, and does not occupy hardware prediction and scheduling resources. This ensures that the system only enables speculative preheating functions in compliant tool call scenarios, while other general text generation scenarios run silently throughout, avoiding unnecessary hardware overhead and misscheduling problems.
[0079] By adding a semantic context register to the semantic hardware branch predictor, and pre-storing the task context feature data corresponding to each preset tool call trigger prefix, the semantic monitoring unit can retrieve the corresponding dedicated task context feature data in real time after successfully matching the target trigger prefix in the word stream and send it to the hardware computing unit for index calculation. This breaks through the limitations of traditional tool call prediction that relies solely on a single trigger prefix. It can distinguish different task scenarios and target tools corresponding to the same prefix through the dual coupling constraint of prefix and task context features, eliminating the tool identification ambiguity and prediction errors caused by single prefix matching, improving the accuracy and adaptability of tool call hardware prediction, and ensuring the real-time performance and efficiency of the overall prediction and scheduling process by relying on the fast reading characteristics of the hardware register.
[0080] The semantic hardware branch predictor of this invention, by utilizing the sliding window cache built into the semantic monitoring unit, can perform hardware-level real-time caching and ordered temporary storage of the continuous word stream output by the large language model. By first caching each word in the database and then performing prefix matching comparison based on the complete continuous word sequence in the cache, the hardware processing method avoids the recognition omissions and judgment errors caused by single discrete word matching. It can accurately capture the tool call triggering prefix features hidden in the word stream, ensuring the continuity, completeness and real-time performance of semantic prefix matching, providing accurate and reliable pre-judgment basis for subsequent hardware prediction and resource preheating operations, and effectively improving the accuracy and stability of overall tool call semantic prediction.
[0081] Example 3
[0082] Figure 3 This is a schematic diagram of another semantic hardware branch predictor provided in Embodiment 3 of the present invention. This embodiment is a refinement of the semantic hardware branch predictor in the above embodiments. Figure 3 As shown, the semantic hardware branch predictor 310 is integrated into a computing chip. The semantic hardware branch predictor 310 includes a semantic monitoring unit 320, a hardware operation unit 330, a speculation triggering unit 340, and a comparison unit 350, wherein:
[0083] The semantic monitoring unit 320 is used to compare each word in the target large language model loaded on the computing chip with the preset prefix rules during the real-time output of the word stream for the target task. When the target prefix is successfully matched, the task context feature data matching the target prefix is obtained and sent to the hardware computing unit 330.
[0084] The hardware processing unit 330 is used to calculate the target table index address corresponding to the target prefix based on the received task context feature data; and to obtain the target tool number and confidence count value that match the target table index address and send them to the speculation triggering unit 340.
[0085] The speculative triggering unit 340, when it determines that the received confidence count value is greater than or equal to the preset confidence threshold, generates a preheating scheduling signal based on the target tool number and sends it to the underlying hardware, so that the underlying hardware responds to the preheating scheduling signal and performs a matching preheating operation to pre-occupy hardware resources.
[0086] The comparison unit is used to obtain the real tool number obtained after the target large language model has completed the generation of all word streams for the target task, and compare the real tool number with the target tool number. If the comparison is inconsistent, the confidence count value that matches the target table index address is reduced, and a resource flushing control signal is generated and sent to the underlying hardware to make the underlying hardware release the pre-occupied hardware resources.
[0087] Specifically, when the actual tool number matches the target tool number, the agent matching the target large language model can directly use the pre-occupied hardware resources to execute the matching tool invocation task.
[0088] The semantic hardware branch predictor 310 also includes a semantic pattern history storage unit 360;
[0089] The semantic pattern history storage unit 360 has multiple storage entries inside. Each storage entry is used to store a set of binding data, which includes the table index address, the target tool number, and the confidence count value.
[0090] Accordingly, the hardware processing unit 330 is further used to retrieve the semantic pattern history storage unit 360 according to the target table index address, obtain the target tool number and confidence count value that match the target table index address, and send them to the speculation trigger unit 340.
[0091] In this embodiment of the invention, the semantic pattern history storage unit can be specifically understood as a hardware storage module that stores the semantic pattern history table. The stored table entry can be specifically understood as an independent data entry within the semantic pattern history storage unit, serving as the smallest access unit. The bound data can be specifically understood as a set of prediction information that associates and stores information such as the index address, target tool number, and confidence count value. The target table index address can be specifically understood as the retrieval address obtained by the hardware processing unit combining contextual features with prefix hashing.
[0092] Specifically, the semantic hardware branch predictor 310 is configured with a semantic pattern history storage unit 360, which maintains multiple independent storage entries. Each storage entry stores a set of bound data, such as the table index address, the target tool number, and the confidence count value.
[0093] After the hardware computing unit 330 obtains the target table index address, it accesses the semantic pattern history storage unit 360 based on the address to perform a retrieval, reads the target tool number and confidence count value corresponding to the target table index address, and transmits both types of data to the speculation triggering unit 340 for subsequent judgment.
[0094] Optionally, based on the above embodiments, the hardware processing unit is specifically used for:
[0095] Perform an XOR operation between the received task context feature data and the hash value corresponding to the target prefix to obtain the target table index address corresponding to the target prefix.
[0096] Specifically, the hardware processing unit receives task context feature data and the hash value corresponding to the target prefix, and calculates the target table index address as the retrieval index of the semantic pattern history table by XORing the context data and the trigger prefix hash.
[0097] In addition, other fusion algorithms such as concatenated hashing and multinomial hashing can be used to construct table index addresses. By fusing task scenario information and prefix feature information to form a composite index, prediction entries with the same prefix under different tasks can be distinguished, providing addressing basis for quickly reading target tool number and confidence count value.
[0098] By using a hardware processing unit, the target table index address is generated by XORing the task context feature data with the hash value corresponding to the target prefix. Compared with the method of addressing using only a single prefix hash, this method can integrate task scenario information and trigger prefix feature information to achieve composite addressing. This distinguishes different storage table entries corresponding to the same trigger prefix in different task contexts, reducing prediction ambiguity. At the same time, the XOR operation is a basic bit operation that is easy to implement at high speed in hardware, with low computation latency. It does not require the additional hardware overhead and processing delay caused by complex hash operations, ensuring the real-time performance of the semantic pattern historical storage unit addressing process. This, in turn, ensures that the tool can advance the speculative prediction process with low latency, improving the overall execution efficiency of speculative scheduling.
[0099] Optionally, based on the above embodiments, the semantic pattern history storage unit adopts a static random access memory hardware architecture; the confidence count value is a two-digit saturated confidence count.
[0100] In this embodiment of the invention, the static random access memory (SRAM) can be specifically understood as: an on-chip storage hardware architecture that requires no refresh and has high-speed read / write capabilities, suitable for hardware real-time table lookup scenarios. The two-bit saturated confidence counter can be specifically understood as: a saturated counter implemented using two bits, with upper and lower limits, used to quantify the confidence level of historical prediction results recorded under the corresponding index.
[0101] Specifically, the semantic pattern history storage unit is built using a static random access memory (SRAM) hardware architecture. Each storage entry stores the target tool number and a two-digit saturation counter. The two-digit saturation confidence count is used to characterize the prediction confidence level under the corresponding index. The complete entry content includes the index address obtained by XORing the task context feature data and the target prefix hash value, the target tool number corresponding to the index, and the two-digit saturation confidence count that records the prediction confidence. The hardware computing unit relies on dedicated hardware circuits to support parallel index addressing operations and entry data reading operations.
[0102] By employing a static random access memory (SRAM) hardware architecture for the semantic pattern historical storage unit, low-latency random read / write access can be achieved, adapting to the data throughput requirements of real-time table lookup in LLM streaming generation scenarios. Simultaneously, a two-bit saturated confidence count is used to characterize the prediction confidence level, requiring only a small amount of storage bits to divide multiple confidence levels. The count value can be continuously updated iteratively based on the correctness of each prediction, saving storage overhead compared to longer-width counting schemes. Compared to schemes without quantized confidence markers, it provides a clear quantitative basis for the inference trigger unit. These two approaches work together to ensure high-speed access and dynamic evaluation of prediction confidence in the semantic pattern historical storage unit while controlling hardware storage resource consumption, improving the real-time performance and resource utilization efficiency of the tool's hardware prediction process.
[0103] Optionally, based on the above embodiments, the speculative triggering unit includes a hardware signal output interface, which is electrically connected to the memory controller of the underlying hardware.
[0104] Accordingly, based on the above embodiments, the inference triggering unit is further configured to: when it is determined that the received confidence count value is greater than or equal to a preset confidence threshold, generate a preheating scheduling signal according to the target tool number, and send it to the memory controller via the hardware signal output interface, so that the memory controller receives the preheating scheduling signal, queries the preset tool resource mapping table according to the target tool number carried by the signal to obtain the physical memory base address and memory allocation space, divides and locks the pre-allocated physical memory range, and switches the isolated running environment corresponding to the target tool number to the ready state;
[0105] Accordingly, based on the above embodiments, the comparison unit includes a hardware flushing signal path, which is electrically connected to the memory controller of the underlying hardware.
[0106] Accordingly, based on the above embodiments, the comparison unit is further configured to: if the actual tool number does not match the target tool number, generate a resource flushing control signal and send it to the memory controller so that the memory controller can reclaim the pre-allocated physical memory area and switch the isolated running environment corresponding to the target tool number to the initial state.
[0107] In this embodiment of the invention, the hardware signal output interface can be specifically understood as: the hardware interaction port through which the prediction trigger unit outputs scheduling instructions. The preset threshold can be specifically understood as: a criterion used to determine the reliability of the prediction result and decide whether to initiate resource preheating. The tool resource mapping table can be specifically understood as: a mapping data table storing the correspondence between target tool numbers and physical memory resources and operating environments. The hardware flushing signal path can be specifically understood as: the hardware channel through which the comparison unit sends resource reclamation instructions to the memory controller. The isolated operating environment can be specifically understood as: a software and hardware operating platform that allows a single tool to run independently and is mutually isolated.
[0108] Specifically, the speculation trigger unit is configured with a hardware signal output interface and establishes an electrical connection with the memory controller of the underlying hardware. After receiving the confidence count value, the speculation trigger unit compares the confidence count value with a preset confidence threshold.
[0109] When the confidence count value is greater than or equal to the preset confidence threshold, a tool warm-up scheduling signal is generated based on the target tool number and encapsulated using the hardware instruction encoding method built into the module. This warm-up scheduling signal carries the tool resource identification information corresponding to the target tool number. The hardware signal output interface of the speculative trigger unit completes the signal encapsulation and transmission according to the hardware bus preset transmission protocol. It is transmitted to the memory controller of the underlying hardware via the dedicated hardware signal channel of the system hardware bus. The entire process uses a hardware direct connection transmission method to bypass the system kernel scheduling link, realizing low-latency hardware-based transmission of the warm-up scheduling signal.
[0110] After receiving the warm-up scheduling signal, the memory controller extracts the target tool number carried in the signal as a search keyword, traverses and queries the hardware-pre-stored tool resource mapping table, matches and retrieves the physical memory base address and adaptive memory allocation space parameters corresponding to the target tool number, independently divides a dedicated memory range in the physical memory space based on the obtained memory parameters, and performs hardware locking operations to prevent the memory range from being occupied by other processes. At the same time, it synchronously retrieves the isolation runtime environment configuration parameters corresponding to the target tool, and switches the originally idle and suspended isolation runtime environment to a ready-to-run state that can respond to calls at any time.
[0111] Among them, the hardware preheating behavior can be flexibly adapted to various hardware preheating methods such as physical memory pre-binding allocation, tool runtime image preloading, and dedicated communication link pre-establishment.
[0112] The comparison unit establishes an independent hardware flushing signal path and establishes a hardware electrical connection with the memory controller. When the actual tool number is output by the model inference, the comparison unit performs a consistency check between the actual tool number and the previously predicted target tool number. When it is determined that the two sets of numbers do not match, a resource flushing control signal is constructed and sent directly to the memory controller through the hardware flushing signal path. After the memory controller recognizes the flushing control signal, it releases the locking state of the previously pre-allocated physical memory area and reclaims the memory resources. At the same time, it retrieves the environment control configuration instruction and reverts the isolated running environment bound to the target tool number from the ready state to the initial idle state, waiting for the next scheduling instruction.
[0113] In a specific example, when the prefix match is successful and the prediction confidence meets the high confidence judgment condition (such as the confidence count value being greater than or equal to the preset confidence threshold), the speculation triggering unit sends a hardware scheduling instruction to the memory controller or the system external bus to actively trigger the preheating operation of the tool's runtime environment.
[0114] The tool environment warm-up supports a variety of typical execution methods, including pre-allocating physical memory resources for the container image corresponding to the tool, establishing secure communication connections in advance, and preloading the required model sub-weight data from disk.
[0115] The embodiments of the present invention only complete the preheating trigger and resource pre-configuration logic at the hardware level, and are not limited to specific tool preheating execution actions. They can be flexibly adapted to the pre-resource preheating requirements of various tools.
[0116] In a specific example, for lightweight tools such as Docker (container virtualization engine) and WASM (WebAssembly) that isolate the runtime environment, this embodiment of the invention supports a pre-binding and pre-allocation warm-up mechanism for physical memory.
[0117] The inference triggering unit uses internal address generation logic to retrieve the target tool number obtained from the semantic pattern historical storage unit, queries the tool resource mapping table in hardware storage, and reads the physical memory base address and memory space size parameters corresponding to the tool.
[0118] Meanwhile, it is speculated that the triggering unit can bypass the operating system kernel and directly send the highest priority hardware pre-allocation request signal to the system memory controller. After receiving the request, the memory controller activates the shortcut shadow page table of the on-chip hardware memory management unit and directly completes the locking and pre-allocation operation of the corresponding memory page frame in physical memory. This quickly switches the running state of the tool isolation environment from the suspended state to the ready state, and finally completes the hardware-level memory warm-up process.
[0119] The quick shadow page table is a dedicated page table structure within the hardware memory management unit used for speculative resource allocation. It records the physical memory mapping temporarily locked during the prediction phase. Independent of the regular page table maintained by the operating system, it does not require kernel page table traversal and can quickly establish the mapping relationship between virtual addresses and physical addresses based on the pre-allocation request. This shortens the address mapping establishment latency in speculative warm-up scenarios. It can be quickly cleared and reclaimed when prediction failure triggers resource flushing, without interfering with the standard page table system on which normal business operations depend.
[0120] A memory page frame is a basic physical storage unit obtained by dividing physical memory at a fixed granularity. It belongs to the management unit at the physical memory level. The operating system and hardware memory management unit carry out memory allocation, locking and reclamation operations in units of page frames. In the speculative warm-up process of this embodiment of the invention, the memory controller completes resource locking in units of page frames, reserves continuous or discrete physical storage carriers for the tool's isolated running environment, and can unlock and return to the physical memory free resource pool in batches in units of page frames after prediction failure.
[0121] By using a hardware signal output interface directly connected to the memory controller, the speculative triggering unit sends a preheating scheduling signal carrying the target tool number after the confidence count reaches a preset threshold. This allows the memory controller to lock the physical memory region in advance and switch the corresponding isolated runtime environment to a ready state. By relying on the direct hardware connection, the delay caused by the operating system kernel scheduling is avoided, enabling speculative pre-preparation of tool resources and shortening the startup time when the tool is officially called. At the same time, the comparison unit sends a resource flushing control signal in a timely manner when the predicted target tool number does not match the actual tool number through an independent hardware flushing signal path. This causes the memory controller to reclaim the pre-occupied physical memory and reset the isolated runtime environment, avoiding the long-term occupation of invalid resources. While fully leveraging the latency optimization benefits of speculative execution, a closed-loop resource reclamation mechanism is built for prediction error scenarios, balancing inference response speed and system memory resource utilization, and preventing memory resource leakage and resource contention caused by erroneous preheating.
[0122] Optionally, based on the above embodiments, the hardware signal output interface is also electrically connected to the network card of the underlying hardware;
[0123] Accordingly, based on the above embodiments, the inference triggering unit is further configured to: when it is determined that the received confidence count value is greater than or equal to a preset confidence threshold, generate a preheating scheduling signal according to the target tool number, and send it to the network card via the hardware signal output interface so that the network card receives the preheating scheduling signal, obtains matching network configuration parameters according to the target tool number carried by the signal to generate a synchronization data packet, establishes a low-level network link with the external service and completes the transport layer handshake and encryption key negotiation, and binds the obtained pre-established network connection with the target tool number and stores it in the hardware connection register pool;
[0124] Accordingly, based on the above embodiments, the hardware flushing signal path is electrically connected to the network card of the underlying hardware.
[0125] Accordingly, based on the above embodiments, the comparison unit is further configured to: if the actual tool number does not match the target tool number, generate a resource flushing control signal and send it to the network card, so that the network card disconnects the pre-established network connection bound to the corresponding target tool number and releases the hardware connection register pool storage space.
[0126] In this embodiment of the invention, network configuration parameters can be specifically understood as: network communication parameters such as gateway address, port, and encryption suite specific to each external API (Application Programming Interface) tool. The hardware connection register pool can be specifically understood as: on-chip dedicated storage units used to cache pre-established network connection information.
[0127] Specifically, the hardware signal output interface is electrically connected to the underlying hardware network card. When the speculative triggering unit determines that the confidence count value has reached the preset confidence threshold, it generates a preheating scheduling signal based on the target tool number and transmits it to the network card through the hardware signal output interface.
[0128] The network card extracts the target tool number carried in the signal, retrieves the matching network configuration parameters, generates a synchronization data packet, actively establishes a low-level network link with the external service, completes the transport layer handshake and encryption key negotiation operations in sequence, and then binds and stores the pre-established network connection and the corresponding target tool number to the hardware connection register pool.
[0129] The hardware flushing signal path is also electrically connected to the underlying network card. The comparison unit compares the real tool number with the predicted target tool number. When the two are inconsistent, a resource flushing control signal is generated and sent to the network card. After the network card recognizes the signal, it disconnects the pre-established network connection bound to the target tool number and clears the corresponding storage resources in the hardware connection register pool.
[0130] In a specific example, the hardware signal output interface can not only connect to the memory controller, but also establish an electrical connection with the underlying hardware network card. For external cloud API tools, it can realize the pre-warming of the network link. It is speculated that when the confidence count value is greater than or equal to the preset confidence threshold, the trigger unit generates a pre-warming scheduling signal carrying the target tool number based on the internal state machine. This signal is then sent to the network card MAC (Media Access Control) or PHY (Physical Layer) chip in the form of a pre-connection control primitive via the hardware signal output interface.
[0131] The network card retrieves the network configuration parameters of the corresponding external API tool built in, and encapsulates and generates network synchronization data packets (such as TCP SYN, i.e., TCP synchronization messages) based on its own independent hardware circuit. The assembly and sending of data packets are carried out independently by the network card hardware circuit, without the need to schedule the CPU (Central Processing Unit) to participate in calculation and forwarding.
[0132] The network interface card (NIC) autonomously completes the physical layer signal connectivity verification and transport layer three-way handshake interaction process with the remote external service. Simultaneously, it performs TLS (Transport Layer Security) encryption suite matching and session key negotiation operations. The entire network warm-up process runs in parallel with the central processing unit's inference and computation tasks, without competing for hardware computing resources. The generated pre-established network connection is bound to the target tool number and stored in the hardware connection register pool.
[0133] This network warm-up process can be executed in parallel during the synchronous phase of the large model's continuous output tool calling text parameters. That is, while the LLM is still generating JSON (JavaScript Object Notation) string parameters, the hardware-level TLS session key negotiation and network connection have already been established and maintained in the hardware connection register pool.
[0134] The hardware flushing signal path of the comparison unit is synchronously connected to the network card. When the actual tool number and the predicted target tool number do not match, the comparison unit sends a resource flushing control signal to the network card. The network card locates and disconnects the corresponding pre-established network connection according to the tool number carried by the signal, and simultaneously releases the storage resources occupied in the hardware connection register pool, completing the recycling and reset of network preheating resources.
[0135] The internal state machine is a hardware logic circuit integrated inside the speculative triggering unit. It has multiple preset operating states and state transition rules. It can automatically switch working modes based on different triggering conditions such as confidence verification results, network preheating execution progress, and flushing and recycling instructions. It autonomously completes a series of orderly hardware operations such as generating preheating signals, issuing pre-connection control primitives, recording preheating process status, and receiving prediction error responses. It does not require an external processor to continuously issue step-by-step instructions. It achieves fully automated control of the network preheating process by relying on the hardware-fixed transition logic.
[0136] Pre-connection control primitives are low-level dedicated hardware instructions defined by the speculative triggering unit for the network card hardware. They belong to the hardware-level independent communication instruction format, which is different from the standard network call instructions issued by the operating system. They can directly reach the network card's MAC and PHY chips through the hardware signal output interface. They are used to trigger the network handshake warm-up process before the network card starts external API tools. The primitives contain a target tool number identifier. The network card can match the corresponding network parameters based on the identifier and independently initiate hardware warm-up actions such as synchronous data packet sending and key negotiation.
[0137] Through a hardware signal output interface directly connected to the underlying network card, when the confidence count reaches a preset threshold, the inference triggering unit directly sends a preheating scheduling signal carrying the target tool number to the network card. This allows the network card to pre-establish the underlying network link, transport layer handshake, and encryption key negotiation, and cache the pre-established network connection. The entire network preheating operation can be carried out synchronously with the process of generating call parameters for the large model, saving the time spent on connection establishment and key exchange during the actual tool call. At the same time, no CPU intervention is required throughout the process, so it does not occupy the model inference computing power. The comparison unit is connected to the network card through an independent hardware flushing signal path. When the predicted number does not match the actual number, it quickly sends a flushing control signal, causing the network card to disconnect the erroneous pre-established network connection in time and release the space occupied by the hardware connection register pool. This avoids invalid long connections from continuously occupying network card hardware resources and register storage resources. While reducing the latency of external API calls by using hardware pre-connection, the accompanying hardware flushing mechanism promptly reclaims idle network resources, balancing the inference call response speed and the efficient utilization of underlying network hardware resources.
[0138] Optionally, based on the above embodiments, the hardware signal output interface is also electrically connected to the direct memory access controller of the underlying hardware.
[0139] Accordingly, based on the above embodiments, the speculation triggering unit is further configured to: when it is determined that the received confidence count value is greater than or equal to a preset confidence threshold, generate a preheating scheduling signal according to the target tool number, and send it to the direct memory access controller via the hardware signal output interface, so that the direct memory access controller receives the preheating scheduling signal, reads the matching exclusive operator and / or local model weight according to the target tool number carried by the signal, and stores it in the on-chip reserved storage area;
[0140] Accordingly, based on the above embodiments, the hardware flushing signal path is electrically connected to the direct memory access controller of the underlying hardware.
[0141] Accordingly, based on the above embodiments, the comparison unit is further configured to: if the actual tool number does not match the target tool number, generate a resource flushing control signal and send it to the direct memory access controller so that the direct memory access controller clears the dedicated operators and / or local model weight cache preloaded in the on-chip reserved storage area.
[0142] In this embodiment of the invention, the direct memory access controller can be specifically understood as a hardware control module that can autonomously complete data transfer between storage devices without the involvement of the CPU.
[0143] Specifically, the hardware signal output interface is electrically connected to the underlying direct memory access controller. The inference trigger unit generates a preheating scheduling signal based on the target tool number when the confidence count value reaches the preset confidence threshold, and transmits it to the direct memory access controller through the hardware signal output interface.
[0144] The direct memory access controller extracts the target tool number from the signal, retrieves the matching dedicated operator and local model weights, and stores them in the on-chip reserved storage area.
[0145] The hardware flushing signal path of the comparison unit is synchronously and electrically connected to the direct memory access controller. After the comparison unit completes the comparison of the real tool number and the predicted target tool number, if there is a discrepancy between the two, it will generate a resource flushing control signal and send it to the direct memory access controller. The direct memory access controller will then clear the dedicated operators and local model weights that have been cached in advance in the reserved storage area on the chip.
[0146] In a specific example, the hardware signal output interface can connect to the memory controller and network card, as well as establish an electrical connection with the underlying direct memory access controller.
[0147] For tools equipped with local hardware accelerators, running small local models or dedicated computing kernels, hardware-level data preloading and warm-up can be achieved, such as preloading local model sub-weights or dedicated operators.
[0148] When the inference trigger unit determines that the confidence count value is greater than or equal to the preset confidence threshold, it generates a preheating scheduling signal (such as a channel configuration signal) carrying the target tool number and sends it to the direct memory access controller.
[0149] In response to the preheating scheduling signal, the direct memory access controller switches to blind prefetch mode, bypassing the CPU core throughout the process. It reads the corresponding tool-specific edge operator files and model local sub-weight data from non-volatile storage media such as flash memory, NVMe (Non-Volatile Memory Express) solid-state drives, etc. via a high-speed hardware bus, and moves the data to the on-chip static random access memory or the on-chip reserved storage area partitioned by high-bandwidth memory.
[0150] The hardware flushing signal path of the comparison unit is synchronously connected to the direct memory access controller. When the actual tool number is inconsistent with the predicted target tool number, the comparison unit sends a resource flushing control signal to the direct memory access controller. After receiving the instruction, the controller clears the preloaded operator and weight cache data in the reserved storage area on the chip and releases the high-speed storage resources on the chip. The entire data preloading process runs independently and does not occupy CPU computing power. At the same time, a complete cache reclamation mechanism is provided to handle prediction failure scenarios.
[0151] Among them, the blind prefetch working mode is a speculative hardware preloading working mechanism exclusive to the DMA controller. This mode does not need to wait for the upper-layer task to confirm the scheduling instruction, nor does it need to rely on the CPU to participate in the data transfer process. It can actively trigger the data prefetch operation based solely on the preheating scheduling signal issued by the speculative trigger unit. It can move the computing resources required by the tool from the persistent storage medium to the cache area in advance, thus masking the storage read latency by predictive loading. At the same time, it supports quickly clearing the prefetch cache when the prediction fails, achieving seamless and low-overhead hardware-level predictive loading.
[0152] Edge operator files are lightweight computing instruction files specific to tools in hardware-accelerated scenarios. They contain dedicated computing operators, operational logic, and hardware scheduling parameters required for model inference. Model local sub-weights are partial weight parameter data required for a single tool's inference task after the large model is split. Both are essential core computing resources during tool invocation. They are smaller in size, more targeted, and can be independently preloaded into on-chip high-speed storage to meet the fast inference execution needs of lightweight edge tools.
[0153] The on-chip reserved storage area of high-bandwidth memory is a dedicated high-speed cache area that is statically partitioned and independently isolated in the high-bandwidth memory hardware space of the system in advance. This area is not occupied by the regular memory scheduling of the operating system and is specifically used to store the operator files and model sub-weight data preloaded in the speculative preheating process. It has the characteristics of low read and write latency, high bandwidth, and high hardware access priority. It can provide an independent hardware cache space for prediction preloaded data and avoid the mutual crowding of resources between preloaded data and regular business data.
[0154] The channel configuration signal is a dedicated low-level hardware instruction signal issued by the speculative triggering unit to the direct memory access controller. The signal carries the storage channel addressing identifier corresponding to the target tool number, data transmission priority, data read and write start and end addresses, and other supporting configuration information. It is used to trigger the direct memory access controller to switch to blind prefetch mode, complete the initialization configuration of the dedicated data transmission channel, and guide the controller to read the corresponding operator and model weight data from the specified storage medium. The entire process relies on hardware direct connection path transmission, without the need for the CPU to issue step-by-step configuration instructions to complete the DMA transmission channel parameter configuration.
[0155] A hardware direct connection is established with the direct memory access controller via a hardware signal output interface. When the confidence count reaches a preset confidence threshold, the inference triggering unit sends a preheating scheduling signal carrying the target tool number, driving the direct memory access controller to pre-read the corresponding dedicated operator and local model weights and cache them in the on-chip reserved storage area. The entire data pre-movement operation does not require CPU computing power and can complete data preheating in parallel during the gaps in the large model generation tool call text, eliminating the long wait caused by reading computing resources from low-speed storage when the tool starts. At the same time, the comparison unit connects to the direct memory access controller through an independent hardware flushing signal path. When the predicted target tool number does not match the actual tool number, it sends a resource flushing control signal in a timely manner, causing the controller to clear the pre-cache data in the on-chip reserved storage area and release high-speed on-chip storage resources. This not only shortens the inference startup delay of local models and dedicated operator-type tools through inference prefetching, but also avoids long-term invalid occupation of high-speed storage resources due to prediction errors through a hardware-level cache reclamation mechanism, balancing inference acceleration performance and hardware storage resource utilization.
[0156] Optionally, based on the above embodiments, the semantic hardware branch predictor is configured with an independent logic operation circuit, which is decoupled from the inference engine hardware circuit corresponding to the target large language model loaded on the computing processing chip.
[0157] In this embodiment of the invention, the independent logic operation circuit can be specifically understood as a hardware operation path dedicated to the semantic hardware branch predictor, not shared with other hardware, and possessing dedicated computing resources. The inference engine hardware circuit can be specifically understood as a hardware computing unit on the chip specifically responsible for forward inference of the large language model and word generation operations. The two types of hardware circuits are completely isolated at the levels of computing resources, runtime sequence, and control path, and there is no resource sharing or operation blocking.
[0158] Specifically, the semantic hardware branch predictor is equipped with a dedicated independent logic operation circuit. This circuit is completely decoupled from the hardware resources of the LLM inference engine inside the chip. The predictor relies entirely on its own independent hardware computing power to complete the entire hardware processing flow, including lexical matching, semantic pattern history table indexing, memory or direct memory access controller or network card, and other multi-dimensional hardware preheating scheduling.
[0159] Unlike conventional coupled architectures that share the computing power of the inference engine for prediction, this architecture can also add a bus bypass sniffing hardware path as an additional data acquisition path. It can bypass the bus-transmitted word data stream without sending interaction requests to the inference engine. Even if the inference engine is fully loaded with model generation operations and hardware resources are fully occupied, the semantic hardware branch predictor can still independently and in parallel complete the entire set of speculation warm-up operations, such as confidence calculation, target tool number retrieval, and sending warm-up scheduling signals to the memory controller, DMA controller, network card, etc., without being limited by the load status of the inference engine. At the same time, with the help of an independent hardware flushing signal path, various pre-allocated hardware resources can be recovered when prediction fails, realizing a hardware layered architecture in which prediction operations and model inference are completely parallel.
[0160] By equipping the semantic hardware branch predictor with an independent logic operation circuit decoupled from the hardware circuit of the large language model inference engine, the hardware computing resources of the two are completely isolated and their runtime sequences do not block each other. All operations related to branch prediction, such as semantic matching, confidence calculation, and warm-up signal issuance, do not need to compete for the computing resources of the inference engine. This will not slow down core inference tasks such as large model lexical generation and feature calculation. It can perform tool call prediction and hardware warm-up operations in parallel while the inference engine is running under continuous high load. This avoids the increase in overall inference latency caused by the competition for computing power between the prediction logic and model inference, fully releases the parallel processing capability of the chip hardware, and simultaneously improves the throughput of large model inference and the efficiency of speculation warm-up.
[0161] The semantic hardware branch predictor of this invention adds a semantic pattern history storage unit with multiple independent storage entries to achieve the binding and solidification of table index address, target tool number and confidence count value. Relying on the hardware computing unit to complete fast hardware table lookup retrieval based on the target table index address obtained by calculation, it can accurately and efficiently retrieve historical semantic prediction statistics and push them to the speculation triggering unit. Compared with the traditional single prediction mechanism without historical memory, it can realize statistical prediction of semantic tool calling behavior based on historical prediction confidence patterns, improve the reliability and accuracy of prediction results. At the same time, the hardware-level table lookup reading method has extremely low latency and does not introduce additional inference overhead, providing stable and reliable data support for hardware pre-warm-up scheduling, and effectively optimizing the overall performance of large language model tool call speculation execution.
[0162] Example 4
[0163] Figure 4 This is a schematic diagram of a computing processing chip according to Embodiment 4 of the present invention, as shown below. Figure 4 As shown, the computing processing chip 410 includes a semantic hardware branch predictor 420 as described in any embodiment of the present invention.
[0164] In this embodiment of the invention, the computing chip can be specifically understood as an integrated AI processing chip carrier that integrates large language model inference, hardware branch prediction, memory and peripheral scheduling hardware circuits.
[0165] Optionally, based on the above embodiments, the computing chip is an AI accelerator or a general-purpose processor.
[0166] In this embodiment of the invention, the AI accelerator can be specifically understood as a dedicated computing chip designed specifically for large language models and neural network inference operations, integrating dedicated acceleration hardware such as an NPU (Neural Processing Unit), DMA, high-speed on-chip storage, and hardware scheduling circuits. The general-purpose processor can be specifically understood as a standard processing chip with general-purpose serial computing capabilities, capable of carrying various software drivers and peripheral control units, and adaptable to the scheduling and execution of multiple types of programs.
[0167] By offering two optional hardware carriers—AI accelerators or general-purpose processors—this solution can adapt to different deployment scenarios. When targeting large-scale cloud-based inference services with large models, an AI accelerator can be chosen as the carrier, leveraging the dedicated parallel hardware circuitry built into the chip to maximize the parallel warm-up acceleration capabilities of the semantic hardware branch predictor. In lightweight terminal deployment scenarios, a general-purpose processor can be used to integrate the semantic hardware branch predictor to complete basic prediction and scheduling functions, without being limited to a single chip type. This lowers the hardware adaptation threshold of the solution, broadens the applicability of the entire semantic branch prediction and hardware preloading warm-up architecture, and improves the cross-hardware platform compatibility and reusability of the solution.
[0168] In a specific example, the semantic hardware branch prediction process applicable to an embodiment of the present invention may include: performing a streaming monitoring step, where the semantic monitoring unit pushes a new lexical into a sliding window buffer each time the large language model generates a new lexical; then proceeding to a semantic triggering step, where if the content in the sliding window matches a preset trigger prefix, the semantic monitoring unit checks the context identifier ID in the semantic context register; then performing a table lookup prediction step, where the hardware circuit combines the context identifier with the trigger word hash to retrieve the semantic pattern history table; after the retrieval is complete, proceeding to a speculation execution judgment step, determining whether a match has been found and whether the confidence level is high; if the judgment result is negative, no preheating is performed; if the speculation execution judgment result is negative, no preheating is performed. If the result is yes, the inference trigger unit sends an instruction to the memory controller or external bus to initiate environment warm-up, and then enters the result verification and feedback step. After the large language model completes the generation of a complete sentence and officially issues the instruction, the hardware compares the real target with the inferred target. After the comparison is completed, it enters the secondary judgment step of whether it hits or not. If the secondary judgment result is yes, the agent directly calls the warmed-up environment to achieve zero-latency response, and then the process moves to the end node. If the secondary judgment result is no, the hardware initiates a flush signal to release various hardware resources that were mistakenly prefetched and updates the internal counter of the semantic pattern history table. After the resource release and counter update operations are completed, the process moves to the end node.
[0169] Figure 5 This is an organizational structure diagram of a semantic monitoring unit applicable to an embodiment of the present invention. As shown in the figure, externally input streaming term data is transmitted to the semantic monitoring unit (SMU). The streaming term data is stored in a sliding window buffer within the semantic monitoring unit. The sliding window buffer stores an ordered sequence of terms, such as Token_N-2, Token_N-1, Token_N (representing the Nth term). The sliding window buffer sends all term data in the buffer to the trigger pattern matcher to perform a content comparison operation. The trigger pattern matcher retrieves a preset trigger prefix from within the semantic monitoring unit. The preset trigger prefix may include "{"action":", "call tool:", etc. <tool>"For three types of text matching, the trigger pattern matcher compares the word sequence output by the sliding window cache with the preset trigger prefix to complete the content comparison. If the two match successfully, it outputs a successful match and obtains the task context feature data in the semantic context register (SCR).
[0170] Figure 6 This is an organizational structure diagram of a semantic pattern history table applicable to an embodiment of the present invention. As shown in the figure, the task context feature data stored in the SCR and the target prefix Trigger_Prefix_Hash hash data when a match is successful are respectively input into the XOR operation unit to complete the operation. The result of the operation is transmitted to the S-PHT semantic pattern history table as an index address. The S-PHT semantic pattern history table is divided into three storage areas: index (Context + Prefix Hash), target tool (Target ToolID), and confidence (2-bit Counter). The first row of the table stores the index value 0x0A2F, the corresponding target tool identifier 0x05 (i.e., Python executor), and the two-bit counter confidence 11 (representing strong prediction). The second row of the table stores the index value 0x0B1C, the corresponding target tool identifier 0x09 (i.e., web page retrieval interface), and the two-bit counter confidence 10 (representing weak prediction). The index address generated by the XOR operation can be matched and retrieved from the corresponding row of the S-PHT with the target tool number and confidence count value.
[0171] By employing a non-PC (Program Counter) addressing mechanism, unlike traditional predictors that rely on instruction memory addresses for judgment, the technical solution of this invention uses the semantic sequence of lexical units as the basis for branch jumps, achieving hardware-level resource preheating. This sinks the traditional software-layer tool call processing flow to the hardware bus layer, utilizing the time gap generated by the large language model to generate a complete JSON string to complete the underlying physical hardware resource scheduling. Adopting a decoupled state machine architecture, the semantic hardware branch predictor and the large language model inference engine are independent of each other. Even when the inference engine is under high load, the predictor can still perform calculations independently by bypassing the bus data stream. This hides the physical time consumption caused by the startup of various hardware environments, achieving zero-latency sensory interaction and optimizing the smoothness of interaction. Simultaneously, it achieves accurate prediction based on the semantic pattern history table. Compared to the method of pre-starting all tools, it reduces unnecessary hardware resource occupation and power consumption, resulting in better hardware energy efficiency. Furthermore, the storage space specifications of the semantic pattern history table can be flexibly adjusted according to hardware costs, enabling deployment across all scenarios from lightweight edge chips to high-performance cloud servers, and possessing good hardware compatibility and scalability.
[0172] The computing chip in this embodiment of the invention integrates a semantic hardware branch predictor. Relying on the chip's built-in semantic hardware branch predictor's full hardware semantic recognition and prediction scheduling capabilities, it can perform real-time prefix matching and extract task context feature data through a semantic monitoring unit during the output of the lexical stream from a large language model. The hardware computing unit then generates an index address through high-speed computation and retrieves the corresponding target tool number and confidence count value from a table. The inference triggering unit then pre-triggers the underlying hardware to complete the pre-warming and pre-configuration of tool resources such as memory, network, and operator weights based on a confidence threshold. This breaks through the limitation of traditional computing chips that require waiting for the large model to fully generate tool instructions before configuring resources, significantly shortening the response latency of intelligent agent tool calls. At the same time, the chip can verify the consistency between the prediction results and the actual tool call instructions in real time through a comparison unit. For prediction error scenarios, redundant hardware resources are flushed and recycled in a timely manner, and the confidence count value is updated iteratively, realizing dynamic error correction and optimization of the prediction mechanism. This effectively avoids idle and invalid occupation of chip hardware resources, significantly improving the hardware resource utilization, inference efficiency, and overall operational stability of the computing chip in intelligent agent tool call scenarios.
[0173] To provide interaction with the user, the systems and techniques described herein can be implemented on a computing processing chip having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computing processing chip. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0174] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0175] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0176] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0177] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.< / tool> < / tool> < / tool> < / tool>
Claims
1. A semantic hardware branch predictor, characterized in that, The semantic hardware branch predictor is integrated into a computing chip. The semantic hardware branch predictor includes a semantic monitoring unit, a hardware operation unit, a prediction triggering unit, and a comparison unit, wherein: The semantic monitoring unit is used to compare each word in the target large language model loaded on the computing chip with the preset prefix rules during the real-time output of the word stream for the target task. When a match is successful with the target prefix, the task context feature data matching the target prefix is obtained and sent to the hardware computing unit. The hardware processing unit is used to calculate the target table index address corresponding to the target prefix based on the received task context feature data; and to obtain the target tool number and confidence count value that match the target table index address and send them to the speculation triggering unit. The speculative triggering unit, when it determines that the received confidence count value is greater than or equal to the preset confidence threshold, generates a preheating scheduling signal based on the target tool number and sends it to the underlying hardware, so that the underlying hardware responds to the preheating scheduling signal and performs a matching preheating operation to pre-occupy hardware resources. The comparison unit is used to obtain the real tool number obtained after the target large language model has completed the generation of all word streams for the target task, and compare the real tool number with the target tool number. If the comparison is inconsistent, the confidence count value that matches the target table index address is reduced, and a resource flushing control signal is generated and sent to the underlying hardware to make the underlying hardware release the pre-occupied hardware resources. Specifically, when the actual tool number matches the target tool number, the agent matching the target large language model can directly use the pre-occupied hardware resources to execute the matching tool invocation task.
2. The semantic hardware branch predictor according to claim 1, characterized in that, The semantic monitoring unit specifically includes a sliding window cache; Correspondingly, the semantic monitoring unit is specifically used to push each word in the word stream to the sliding window cache for storage in real time, and then compare all the words stored in the sliding window cache with the preset prefix rules.
3. The semantic hardware branch predictor according to claim 1, characterized in that, The semantic hardware branch predictor also includes a semantic context register, wherein: The semantic context register is used to store task context feature data that matches each prefix in the preset prefix rules; Correspondingly, the semantic monitoring unit is further used to obtain the task context feature data that matches the target prefix from the semantic context register when a successful match is found, and send it to the hardware computing unit.
4. The semantic hardware branch predictor according to claim 1, characterized in that, The semantic hardware branch predictor also includes a semantic pattern history storage unit; The semantic pattern history storage unit has multiple storage entries inside. Each storage entry is used to store a set of binding data, which includes the table index address, the target tool number, and the confidence count value. Correspondingly, the hardware processing unit is further used to retrieve the semantic pattern history storage unit based on the target table index address, obtain the target tool number and confidence count value that match the target table index address, and send them to the speculation trigger unit.
5. The semantic hardware branch predictor according to any one of claims 1-4, characterized in that, The hardware processing unit is specifically used for: Perform an XOR operation between the received task context feature data and the hash value corresponding to the target prefix to obtain the target table index address corresponding to the target prefix.
6. The semantic hardware branch predictor according to claim 4, characterized in that, The semantic pattern history storage unit adopts a static random access memory hardware architecture; the confidence count value is a two-digit saturated confidence count.
7. The semantic hardware branch predictor according to claim 1, characterized in that, The speculative triggering unit includes a hardware signal output interface, which is electrically connected to the memory controller of the underlying hardware. Correspondingly, the speculation triggering unit is further used to: when it is determined that the received confidence count value is greater than or equal to the preset confidence threshold, generate a preheating scheduling signal according to the target tool number, and send it to the memory controller through the hardware signal output interface, so that the memory controller receives the preheating scheduling signal, queries the preset tool resource mapping table according to the target tool number carried by the signal to obtain the physical memory base address and memory allocation space, divides and locks the pre-allocated physical memory range, and switches the isolated running environment corresponding to the target tool number to the ready state; Accordingly, the comparison unit includes a hardware flushing signal path, which is electrically connected to the memory controller of the underlying hardware. Correspondingly, the comparison unit is further used to: if the actual tool number does not match the target tool number, generate a resource flushing control signal and send it to the memory controller so that the memory controller can reclaim the pre-allocated physical memory area and switch the isolated running environment corresponding to the target tool number to the initial state.
8. The semantic hardware branch predictor according to claim 7, characterized in that, The hardware signal output interface is also electrically connected to the network card of the underlying hardware. Accordingly, the speculation triggering unit is further used to: when it is determined that the received confidence count value is greater than or equal to the preset confidence threshold, generate a preheating scheduling signal according to the target tool number, and send it to the network card through the hardware signal output interface so that the network card receives the preheating scheduling signal, obtains the matching network configuration parameters according to the target tool number carried by the signal to generate a synchronization data packet, establishes a low-level network link with the external service and completes the transport layer handshake and encryption key negotiation, and binds the obtained pre-established network connection with the target tool number and stores it in the hardware connection register pool; Correspondingly, the hardware flushing signal path is electrically connected to the network card of the underlying hardware; Correspondingly, the comparison unit is further used to: if the actual tool number does not match the target tool number, generate a resource flushing control signal and send it to the network card, so that the network card disconnects the pre-established network connection bound to the corresponding target tool number and releases the hardware connection register pool storage space.
9. The semantic hardware branch predictor according to claim 7, characterized in that, The hardware signal output interface is also electrically connected to the direct memory access controller of the underlying hardware. Accordingly, the speculation triggering unit is further used to: when it is determined that the received confidence count value is greater than or equal to the preset confidence threshold, generate a preheating scheduling signal according to the target tool number, and send it to the direct memory access controller via the hardware signal output interface, so that the direct memory access controller receives the preheating scheduling signal, reads the matching exclusive operator and / or local model weight according to the target tool number carried by the signal, and stores it in the on-chip reserved storage area. Correspondingly, the hardware flushing signal path is electrically connected to the direct memory access controller of the underlying hardware. Correspondingly, the comparison unit is further used to: if the actual tool number does not match the target tool number, generate a resource flushing control signal and send it to the direct memory access controller so that the direct memory access controller clears the dedicated operators and / or local model weight cache preloaded in the on-chip reserved storage area.
10. The semantic hardware branch predictor according to claim 1, characterized in that, The semantic hardware branch predictor is configured with independent logic operation circuits, which are decoupled from the inference engine hardware circuits corresponding to the target large language model loaded on the computing processing chip.
11. A computing processing chip, characterized in that, Includes the semantic hardware branch predictor as described in any one of claims 1-10.
12. The computing processing chip according to claim 11, characterized in that, The computing chip is an AI accelerator or a general-purpose processor.
