Data access method, natural language reasoning method, processor and computing equipment

Through decoupling and decoding of split decoding, the address dependency and register dependency judgment, the target instructions are constructed and executed in advance, and the delay problem caused by dependencies in the existing technology is solved, and the performance and bandwidth of data memory access are improved.

CN119088453APending Publication Date: 2024-12-06DAMO (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410926122.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Existing data access methods are limited by memory address dependencies and register dependencies, resulting in latency and reduced access performance and bandwidth.

Method used

By separating address splitting and register splitting decoding, target instructions are constructed in advance and executed without dependencies, reducing latency, reducing latency and increasing bandwidth.

Benefits of technology

It realizes low latency, high performance and high bandwidth data memory access, improving the overall performance of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088453A_ABST
    Figure CN119088453A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data access method, a natural language reasoning method, a processor and computing equipment. The data access method comprises the following steps: acquiring a data access instruction; performing address splitting decoding on the data access instruction to obtain memory address information, judging whether address dependence occurs or not based on the memory address information, performing register splitting decoding on the data access instruction to obtain register information, and judging whether register dependence occurs or not based on the register information; under the condition that address dependence does not occur, constructing a target instruction based on the memory address information and the register information; and under the condition that register dependence does not occur, executing the target instruction to complete data access. Decoupling of split decoding is achieved, judgment of address dependence and judgment of register dependence are separated, response time is shortened, then delay of data memory access is shortened, and memory access performance and data memory access bandwidth are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the technical field of data processing, and in particular to a data access method, a natural language reasoning method, a processor, and a computing device. Background Art

[0002] With the development of data processing technology, the demand for memory access and memory access bandwidth is increasing.

[0003] At present, for the decoding process of data memory access, a single data memory access instruction needs to be split and decoded into multiple target instructions for execution. After the split decoding information is sent to the data memory access unit (Load-Store Unit, referred to as LSU), the data memory access unit sends a data read and write request to the data bus to execute data writing and reading.

[0004] However, due to the memory address dependency, the existing data access instructions are being executed, and the data is written out at the memory address. The current data access instructions need to be split to obtain the target instructions and wait for execution. The data access unit needs to wait for the existing data access instructions to complete the response before sending the data read and write request to the data bus. In addition, due to the register dependency, the existing data access instructions are being executed on limited registers and need to wait for the registers to be released, which increases the latency of data access and reduces the access performance and data access bandwidth. Therefore, a data access method with low latency, high access performance, and high data access bandwidth is urgently needed. Summary of the invention

[0005] In view of this, an embodiment of this specification provides a data access method. One or more embodiments of this specification also relate to a natural language reasoning method, a processor and a computing device to solve the technical defects existing in the prior art.

[0006] According to a first aspect of an embodiment of this specification, a data access method is provided, including:

[0007] Get data access instructions;

[0008] Performing address splitting and decoding on the data memory access instruction to obtain memory address information, and judging whether address dependency occurs based on the memory address information, and performing register splitting and decoding on the data memory access instruction to obtain register information, and judging whether register dependency occurs based on the register information;

[0009] Construct target instructions based on memory address information and register information without address dependency;

[0010] In the absence of register dependency, the target instruction is executed to complete data memory access.

[0011] According to a second aspect of an embodiment of this specification, a natural language reasoning method is provided, which is applied to a processor, including:

[0012] receiving an inference request for a natural language task sent by a front end, wherein the inference request includes a data access instruction;

[0013] Performing address splitting and decoding on the data memory access instruction to obtain memory address information, and judging whether address dependency occurs based on the memory address information, and performing register splitting and decoding on the data memory access instruction to obtain register information, and judging whether register dependency occurs based on the register information;

[0014] Construct target instructions based on memory address information and register information without address dependency;

[0015] In the absence of register dependency, the target instruction is executed to complete data access and obtain the inference result;

[0016] Send the inference results to the front end.

[0017] According to a third aspect of the embodiments of this specification, there is provided a processor, including an instruction interface, an address split decoder, a register split decoder, a register status table, and a data access unit;

[0018] Instruction interface, used to obtain data access instructions;

[0019] An address splitting decoder is used to perform address splitting decoding on data memory access instructions to obtain memory address information, and based on the memory address information, determine whether address dependency occurs;

[0020] A register split decoder is used to perform register split decoding on a data memory access instruction to obtain register information;

[0021] A register status table, used to determine whether register dependency occurs based on register information;

[0022] The data memory access unit is used to construct a target instruction based on memory address information and register information without address dependency, and execute the target instruction to complete data memory access without register dependency.

[0023] According to a fourth aspect of the embodiments of this specification, a computing device is provided, comprising the above-mentioned processor.

[0024] In one embodiment of the present specification, a data memory access instruction is obtained; the data memory access instruction is subjected to address split decoding to obtain memory address information, and based on the memory address information, it is determined whether address dependency occurs; the data memory access instruction is subjected to register split decoding to obtain register information, and based on the register information, it is determined whether register dependency occurs; in the case where address dependency does not occur, a target instruction is constructed based on the memory address information and register information; in the case where register dependency does not occur, the target instruction is executed to complete data memory access. The decoupling of split decoding is achieved, address dependency is separated from register dependency judgment, the target instruction is split out in advance when there is no address dependency, the response time is reduced, and in the case where register dependency does not occur, the target instruction is directly executed to complete data memory access, the delay of data memory access is reduced, and the memory access performance and data memory access bandwidth are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a timing diagram of a data access method;

[0026] Figure 2 It is a structural block diagram of a processor in a data access method;

[0027] Figure 3 is a timing diagram of a data access method provided by an embodiment of this specification;

[0028] Figure 4 is a structural block diagram of a processor in a data access method provided by an embodiment of this specification;

[0029] Figure 5 is a flow chart of a data access method provided by an embodiment of this specification;

[0030] Figure 6 is a schematic diagram of the structure of a processor in a data access method provided by an embodiment of this specification;

[0031] Figure 7 It is a structural diagram of a register split decoder in a data access method provided by an embodiment of this specification;

[0032] Figure 8 It is a structural diagram of an address splitting decoder in a data access method provided by an embodiment of this specification;

[0033] Fig. 9 It is a structural schematic diagram of a data access sequence table in a data access method provided by an embodiment of this specification;

[0034] Fig.10 It is a flowchart of a data access method provided by an embodiment of this specification;

[0035] Fig.11 is a flow chart of a natural language reasoning method provided by an embodiment of this specification;

[0036] Fig.12 is a schematic diagram of the structure of a processor provided by an embodiment of this specification;

[0037] Fig.13 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0038] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0039] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0040] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0041] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0042] First, the terms involved in one or more embodiments of this specification are explained.

[0043] Large Language Models (LLMs): A neural network model based on the Transformer architecture. Large language models learn to understand and generate human language by training on large amounts of text data. They are able to perform complex natural language processing tasks such as answering questions, generating text, translating, and summarizing.

[0044] Generative Pre-trained Transformer (GPT): A neural network model based on the Transformer architecture, which is pre-trained on a large amount of Internet text in an unsupervised manner and can then be fine-tuned to adapt to specific natural language processing tasks. The GPT predicts the next word word by word until a complete sentence or paragraph is generated.

[0045] Bidirectional Encoder Representations from Transformers (BERT): A pre-trained neural network model whose main feature is the use of a bidirectional Transformer encoder to understand the contextual relationship in the text. Unlike GPT, BERT uses a masked language model training strategy to randomly mask some words in the input sequence, and then train the model to predict these masked words. This design enables BERT to consider the contextual information before and after the word at the same time, thus performing well on many NLP tasks.

[0046] Natural Language Processing (NLP): A branch of computer science that deals with techniques that enable machines to understand, parse, generate, and manipulate human language. NLP combines linguistics, computer science, and mathematics to build intelligent systems that can interact with human language. Applications include speech recognition, machine translation, sentiment analysis, question-answering systems, etc.

[0047] Self-Attention Algorithm (Transform): A neural network architecture for processing sequence data that introduces an innovation called the "self-attention mechanism" that allows the model to compute in parallel when processing sequences, rather than processing element by element like traditional recurrent neural networks. The self-attention mechanism enables the model to establish connections between any two positions in a given sequence, which greatly improves training speed and model efficiency.

[0048] Load-Store Unit (LSU): A key component in the processor that handles all read and write operations to memory. The LSU ensures that data is correctly loaded from memory to registers, or stored from registers back to memory. This process is critical to ensuring the correctness and consistency of program state.

[0049] Load-Store Ordering Table (LSOT): An instruction data structure used to manage the execution of data access instructions in a processor. LSOT helps maintain the correct order of data access and ensures consistency even when the processor uses out-of-order execution. This is key to achieving high performance while maintaining data integrity.

[0050] Address dependency: When executing a series of instructions in a pipeline processor, the subsequent instructions depend on the memory address modified by the previous instruction. Specifically, if an instruction (such as a data storage instruction) changes the contents of a certain address in memory, and the subsequent instruction (such as a data access instruction) needs to read the data at this address, then an address dependency occurs between the two instructions. This dependency causes the processor to execute the instructions in the original order, because the result of the subsequent instruction depends on the completion of the previous instruction. In processors with out-of-order execution, this dependency limits the reordering of instructions because the order of memory access must be correct to avoid data inconsistency problems.

[0051] Register dependency: When executing a series of instructions in a pipelined processor, one instruction requires the result of another instruction as input, where the "result" is usually stored in a register. In other words, if the result of one instruction is stored in a register, and the subsequent instruction needs to use the data in this register, then a register dependency occurs between the two instructions. This dependency also restricts the order in which instructions can be executed, because the previous instruction must complete and write the result to the register before the subsequent instruction can use the data. In the processor pipeline, register dependencies can cause the pipeline to stall because the processor must wait for the required data to become available.

[0052] RunAhead Decoder (RADecoder): A technique used to improve processor performance. RAD decodes and executes portions of instructions ahead of time, especially those related to address generation, thereby reducing overall latency and speeding up the instruction execution process. This technique is particularly useful in multi-stage pipelined and super-pipelined processors.

[0053] Complex Instruction Set Computer (CISC): A design philosophy of computer architecture characterized by a large number of instructions in the instruction set, each of which can perform complex operations. Instructions under the CISC architecture tend to have a high degree of functional integration and can directly support the features of high-level languages, such as floating-point operations, string operations, and indirect addressing modes. This design reduces the workload of programmers because more complex operations can be completed with a single instruction, but on the other hand, the complexity of the CISC instruction set may make the processor's decoding and execution more complicated, affecting performance and efficiency. For example, the x86 architecture.

[0054] Reduced Instruction Set Computer (RISC): A design philosophy of computer architecture that, in contrast to CISC, pursues simplicity and efficiency. The RISC design principle is to use a small number of highly regular, easy-to-decode instructions. RISC architecture instructions are usually fixed length, each instruction only does simple things, and complex operations are completed by combining multiple simple instructions. This design simplifies the design of the processor and reduces the complexity of instruction decoding, thereby improving the execution speed and scalability of the processor. For example, the ARM architecture and the RISC-V architecture.

[0055] Vector instruction: A type of computer instruction that is primarily used to process vector data, which is a group of contiguous data elements. Unlike scalar instructions, which process a single data item at a time, vector instructions can perform the same operation, such as addition, multiplication, or comparison, on multiple data elements at the same time. This parallel processing capability makes vector instructions extremely efficient when processing large data sets, especially in areas such as scientific computing, image processing, signal processing, and machine learning. Vector instructions are often used in conjunction with vector registers and vector processing units (VPUs), which are specifically designed to execute vector instructions efficiently.

[0056] At present, the traditional data access process is as follows Figure 1 As shown, Figure 1 A timing diagram of a data access method is shown:

[0057] There is a propagation delay from decoding (address decoupling) to sending (register decoupling).

[0058] During the issuance (register decoupling) process, there is a data-dependent delay.

[0059] There is a propagation delay from sending down (register decoupling) to data access memory. There is a data processing delay during the data access memory process.

[0060] There is a request delay when data is accessed from memory to the bus.

[0061] During the bus transaction, there is an addressing delay.

[0062] There is a response delay when data is written back via the bus.

[0063] When writing data back to the register, there is a write-back delay.

[0064] There is a propagation delay after the data is written back to the commit.

[0065] During the submission process, there is a submission delay.

[0066] In summary, the total delay of traditional data memory access = propagation delay * 3 + data dependency delay + data processing delay + request delay + addressing delay + response delay + write-back delay + commit delay.

[0067] Correspondingly, the structure of the processor in the traditional data access method is as follows Figure 2 As shown, Figure 2 A structural block diagram of a processor in a data access method is shown:

[0068] After the decoder completes the decoding, it passes the split information into the instruction control queue, which passes through the data access unit in sequence to construct the target instruction execution data access unit.

[0069] In one embodiment of this specification, the data access process is as follows: Figure 3 As shown, Figure 3 A timing diagram of a data access method provided by an embodiment of this specification is shown:

[0070] There is a propagation delay from decoding (address decoupling) to sending (register decoupling), and there is a request delay from decoding (address decoupling) to the bus.

[0071] There is a data dependency delay during the sending (register decoupling) process. There is a propagation delay from sending (register decoupling) to data access. There is a data processing delay during data access. At the same time, there is a response delay when returning data write back through the bus.

[0072] When writing data back to the register, there is a write-back delay.

[0073] There is a propagation delay after the data is written back to the commit.

[0074] During the submission process, there is a submission delay.

[0075] In summary, the total delay for data access in the embodiments of this specification = the maximum value of two items [(propagation delay*2+data dependency delay+data processing delay), (request delay+addressing delay+response delay+write-back delay)]+propagation delay+commit delay.

[0076] Compared to Figure 1 The total delay is reduced, which saves the smaller delay among (propagation delay * 2 + data dependency delay + data processing delay) or (request delay + addressing delay + response delay + write-back delay), and the calculation of the split address is performed in advance, which reduces the pressure of address dependency judgment of memory access instructions, and at the same time fills the information in the instruction control queue as early as possible, further accelerating the execution speed of data memory access instructions.

[0077] Correspondingly, the structure of the processor in the data access method in the embodiment of this specification is as follows: Figure 4 As shown, Figure 4 A structural block diagram of a processor in a data access method is shown:

[0078] The traditional split decoding process is decoupled, and the decoder is split into two independent units: address split decoder and register split decoder, without signal connection.

[0079] After the address split decoder completes decoding, it directly sends a data read and write request to the bus based on the memory address information obtained by splitting through the data access unit. At the same time, after the register split decoder completes decoding, it passes the register information into the instruction control queue, and the instruction control queue sequentially passes through the data access unit to construct the target instruction execution data access.

[0080] like Figure 1-Figure 4 It can be seen that compared with the traditional data memory access method, the embodiment of this specification realizes the decoupling of split decoding, splits the target instruction in advance without address dependency, reduces the response time, reduces the delay of data memory access, and improves the memory access performance and data memory access bandwidth.

[0081] Specifically, this specification provides a data access method, and this specification also involves a natural language reasoning method, a processor, and a computing device, which are described in detail one by one in the following embodiments.

[0082] See also Figure 5 , Figure 5 A flowchart of a data access method provided by an embodiment of the present specification is shown, including the following specific steps:

[0083] Step 502: Obtain a data access instruction.

[0084] The embodiments of this specification are applied to a processor with a data access memory function, the processor includes a control unit, a register and a data processing component (for example, an arithmetic logic unit (ALU)), wherein the control unit includes a split decoder and a memory access control unit, and the data access memory is realized by completing the exchange with the data in the memory through the data access unit. Optionally, the split decoder includes an address split decoder, a register split decoder and a data access memory sequence table, see the subsequent Figure 6-Figure 9 The types of processors include, but are not limited to, central processing unit (CPU), graphics processing unit (GPU), vector processing unit (VPU), neural processing unit (NPU) and tensor processing unit (TPU).

[0085] The data access memory instruction is a computer macro instruction for data access memory. It is a macro instruction used to complete data exchange between memory and registers. It cannot be directly executed by the hardware components of the processor, and the macro instruction needs to be split into multiple microinstructions for execution. The data access memory instruction can be a vector instruction or a scalar instruction, which is not limited here. The data access memory instruction is written in assembly language, including at least one of a data access instruction and a data storage instruction, for example, the LOAD instruction and the STORE instruction in the ARM architecture, x86 architecture or RISC-V architecture. Specifically, the vector macro instruction "VLvd, rs1, rs2" represents loading data from the memory to the vector register vd, rs1 is the base address register, and rs2 is the index register, which is used to calculate the starting memory address of the load.

[0086] An optional way to obtain the data memory access instruction is to obtain the data memory access instruction from the instruction interface, and another optional way is to obtain the data memory access instruction from the instruction buffer (InstructionBuffer), which is not limited here.

[0087] Exemplarily, on a physical machine used for natural language reasoning tasks, multiple vector processors are deployed, and any vector processor includes a main processor and a coprocessor. The coprocessor and the main processor are connected through a coprocessor interface, and the coprocessor is connected to a bus. The coprocessor includes a control unit, a vector register, and an arithmetic logic unit. The control unit includes an address splitting decoder and a register splitting decoder. The assembly language of the data access instruction obtained by the large language model from the instruction interface is "VLv0, (s1)", which means loading data into the vector register v0 starting from the memory address indicated by the s1 register.

[0088] In step 502, the data access instruction is obtained, which provides a macro instruction basis for the subsequent splitting and decoding, determining the dependency and constructing the target instruction.

[0089] Step 504: Perform address splitting and decoding on the data memory access instruction to obtain memory address information, and determine whether address dependency occurs based on the memory address information; and perform register splitting and decoding on the data memory access instruction to obtain register information, and determine whether register dependency occurs based on the register information.

[0090] Address split decoding is to extract the memory address information in the data access instruction and process it separately. This process usually occurs in the instruction split decoding stage. Generally, the split decoding and execution of instructions are closely linked, but in the embodiments of this specification, in order to improve efficiency, address split decoding and data processing are decoupled. Address split decoding can start memory access in advance, even if the register information has not been split and decoded, which can reduce the overall delay. For example, there is an ARM architecture LOAD instruction: "LDR r0, [r1, #4]". This instruction tells the processor to read data from the address indicated by the r1 register plus 4 to the r0 register. The address split decoder will parse the base register r1 and the displacement 4, and calculate the actual memory address without waiting for the data in the r0 register.

[0091] Memory address information is the specific memory address specified in the data access instruction for reading or writing data. Memory address information includes but is not limited to: base address, index, displacement and other information used to calculate the final memory location. Memory address information is a key component of data access instructions, which instructs the processor how to locate data in memory. Through the address split decoder, this part of information is parsed and calculated in advance so that the data access unit can issue read and write requests as early as possible to reduce waiting time. For example, "LDR r0, [r1, #4]", the memory address information is [r1, #4], that is, the base register r1 and the displacement 4. The processor uses the memory address information to calculate the specific memory address, and then initiates a data read request to the memory.

[0092] Register split decoding is to extract register-related information from data access instructions for subsequent data processing. This process is carried out in parallel with address split decoding, but focuses on the register operation part of data access instructions.

[0093] Register information is the specific register specified in the data access instruction. Register information includes but is not limited to: the identifiers of the source register and the target register. Register information is the basis for completing data processing inside the processor. It tells the processor which registers should be read, which should be written, and how the data is read and written. Register information is used to guide the control logic of the data path to ensure that data is passed between the correct registers. For example, in "LDR r0, [r1, #4]", the register information includes r0 as the target register and r1 as the source register. When data is read from the memory, it is stored in r0, and the value of r1 is used to calculate the memory address.

[0094] Based on the memory address information, determine whether address dependency occurs. An optional method is: use the data access sequence table to determine whether address dependency occurs based on the memory address information, wherein the data access sequence table is used to determine whether the memory address information obtained by split decoding overlaps with the memory address information of any previous incomplete data access instruction.

[0095] Based on the register information, it is determined whether register dependency occurs. An optional method is: using the register status table, based on the register information, to determine whether register dependency occurs, wherein the register status table determines whether the register pointed to by the register information obtained by split decoding is in a high position, wherein register dependency includes but is not limited to: Write After Read (WAR): If a register is being written by another instruction that has not yet been completed, and the current instruction attempts to read the register, WAR dependency occurs. At this time, the register is in a "high" state, which means that it is being updated, but the update result is not yet stable, so it cannot be read; Read After Write (RAW): When a register read by an instruction is being written by another instruction that has not yet been completed, RAW dependency occurs. Here, the "high" state indicates that the register is undergoing a write process, and the current instruction attempts to read it before its write is completed; Write After Write (WAW): If two consecutive instructions attempt to write to the same register, and the previous write operation has not yet been completed, WAW dependency is generated. In this case, the "high" state indicates that the register is in a write operation, so the new write must wait.

[0096] Exemplarily, the data memory access instruction "VLv0, (s1)" is subjected to address splitting decoding, the current value of "s1" is 1000, and the displacement is 4, then the starting memory address of the memory access is 1000, and the memory address information is obtained: base address: s1 = 1000, displacement: 4, final address: 1000 + 4 = 1003; memory address information: 1000, #4. The data memory access sequence table records another unfinished data memory access instruction "VW v1, (r2)", where the value of "r2" is 999 and the access length is 4 bytes. Because the address 1000 of "VL v0, (s1)" overlaps with the address range [999, 1002] of "VW v1, (r2)", an address dependency occurs. The data memory access instruction "VLv0, (s1)" is subjected to register splitting decoding, and the register information is obtained: target register: v0, source register: s1. At this time, the status of registers v0 and s1 in the register status table is as follows: v0: low state (no write operation in progress); s1: high state (write operation in progress, updated by instruction "ADDs1, s1, 100"). Because "VLv0, (s1)" depends on the value of s1, and s1 is currently in a high state, register dependency occurs.

[0097] In step 504, the decoupling of split decoding is achieved, and the address dependency and register dependency judgment are separated, which lays an information foundation and judgment basis for the subsequent construction and execution of target instructions without address dependency.

[0098] Step 506: Construct the target instruction based on the memory address information and the register information without address dependency.

[0099] The target instruction is a computer macroinstruction obtained by decoding and used for data access. It is a microinstruction used to complete data exchange between memory and registers, and can be directly executed by the hardware components of the processor. The target instruction can be a vector instruction or a scalar instruction, which is not limited here. Specifically, the vector macroinstruction is "VLvd, rs1, rs2", and the target instruction is: data access instruction: read data starting from memory address 1004 (1000+4*1, assuming that each data element occupies 1 byte), and register operation instruction: write the read data into the vector register v0, the corresponding binary representation is 01010000000000010000000000000000, where 0101- is the operation code (opcode) of the data access instruction, indicating that this is A vector data access instruction, 00000000- is the function code (functioncode) of the data access instruction, which is used to determine the type of load (such as loading integers, floating-point numbers, vector length, etc.), 0001- is the binary field of rs1, indicating the source register s1, that is, the base address register, 0000- is the binary field of vdest, indicating the target vector register v0, 0000000000000- the remaining bits are used to indicate other control information such as immediate offset, load type, mask, etc.

[0100] Based on the memory address information and the register information, a target instruction is constructed. An optional method is to combine the memory address information and the register information to construct the target instruction.

[0101] Exemplarily, in the absence of address dependency, the memory address information (1000, #4) and register information (target register: v0, source register: s1) are merged to construct the target instruction: imm[11:5]=0000000 (the upper 7 bits of the immediate value are 0); rs1=10010 (the encoding of s1); funct3=010 (corresponding to VL32); imm[4:0]=0000100 (the lower 5 bits of the immediate value); rd=00000 (the encoding of v0), and the corresponding binary representation is: 000000010010010000010000000.

[0102] In step 506, the target instruction is split out in advance without address dependency, thereby reducing the response time.

[0103] Step 508: Execute the target instruction to complete data memory access without register dependency.

[0104] Execute the target instruction to complete the data memory access. An optional method is: execute the target instruction to exchange data with the data bus to complete the data memory access.

[0105] Exemplarily, in the absence of register dependency, the target instruction "000000010010010000010000000" is executed to exchange data with the data bus, complete data memory access, and use the large language model to complete the natural language reasoning task.

[0106] In the embodiments of this specification, decoupling of split decoding is achieved, address dependency and register dependency judgment are separated, target instructions are split out in advance without address dependency, response time is reduced, and target instructions are directly executed to complete data memory access without register dependency, thereby reducing data memory access latency and improving memory access performance and data memory access bandwidth.

[0107] In an optional embodiment of the present specification, before determining whether register dependency occurs based on register information in step 504, the following specific steps are also included:

[0108] Get register information of non-data memory access instructions;

[0109] Correspondingly, in step 504, judging whether register dependency occurs based on register information includes the following specific steps:

[0110] Based on the register information of the data memory access instruction and the non-data memory access instruction, it is determined whether register dependency occurs.

[0111] Non-data memory access instructions are computer macro instructions that are not used to complete data exchange between memory and registers. Non-data memory access instructions usually process data operations between registers (such as addition (ADD), subtraction (SUB), and operation (AND), or operation (OR)), conditional jump (JMP), unconditional jump (JE, JNE, etc.), movement (such as data movement (MOV), data exchange (XCHG), etc.) operations. Non-data memory access instructions include but are not limited to: arithmetic logic instructions, control transfer instructions, data movement instructions, etc. For example, arithmetic logic instruction: "ADD r1, r2": add the value of register r2 to register r1, and the result is saved in r1. For another example, control transfer instruction: "JMP label": unconditionally jump to the code location marked by label label to continue execution. Data movement instruction: "MOV r1, r2": copy the data in register r2 to register r1.

[0112] The register information of the non-data memory access instruction is the specific register specified in the non-data memory access instruction. The register information includes but is not limited to: the identifiers of the source register and the target register. The register information is the basis for completing data processing inside the processor. It tells the processor which registers should be read, which should be written, and how the data is read and written. The register information is used to guide the control logic of the data path to ensure that the data is transferred between the correct registers.

[0113] An optional method for determining whether register dependency occurs based on register information of data memory access instructions and non-data memory access instructions is to use a register status table to determine whether register dependency occurs based on register information of data memory access instructions and non-data memory access instructions.

[0114] Exemplarily, the register information of the data memory access instruction "VLv0, (s1)" is: target register: v0, source register: s1, and the register information of the non-data memory access instruction "ADD s1, s1, 100" is: target register: s1, source register 1: s1. The status of registers v0 and s1 in the register status table is as follows: v0: low state (no write operation is in progress); s1: high state (write operation is in progress, updated by the instruction "ADD s1, s1, 100"). Because "VLv0, (s1)" depends on the value of s1, and s1 is currently in a high state, register dependency occurs: read-after-write dependency.

[0115] In the embodiments of the present specification, the register dependency of non-memory access type instructions is determined in advance, which effectively reduces the latency of data memory access and improves memory access performance and data memory access bandwidth.

[0116] In an optional embodiment of the present specification, before step 506, the following specific steps are also included:

[0117] Based on the register information, the number of tokens issued for the target instruction is calculated;

[0118] Determine whether the instruction construction condition of the data access unit is met based on the number of issued tokens and the number of remaining tokens of the data access unit;

[0119] Correspondingly, step 506 includes the following specific steps:

[0120] If so, the target instruction is constructed using the data access unit based on the memory address information and the register information without address dependency.

[0121] The token issuance is a mechanism used by the processor to control and synchronize the execution of instructions in the data access process. The token issuance is used to track resource usage and ensure that instructions are executed in an orderly and efficient manner with limited hardware resources. The token issuance represents the ability or authority of the data access unit to execute instructions. When an instruction is ready to execute, it needs to obtain the corresponding token in order to build and execute the target instruction in the data access unit. The number of tokens limits the number of instructions that can be built and executed at the same time, thereby avoiding over-allocation of resources and conflicts.

[0122] The number of tokens issued is the number of tokens requested from the data access unit to construct the target instruction. The number of tokens issued depends on the complexity of the target instruction and the required resources.

[0123] The data access unit is a component in the processor that handles read and write operations to the memory.

[0124] The number of remaining tokens of the data access unit is the number of tokens that are currently not in use in the data access unit, indicating the remaining processing capacity of the data access unit. The number of remaining tokens changes dynamically, depending on how many instructions are currently using the tokens. When an instruction completes execution and releases the token, the number of remaining tokens increases, allowing more instructions to enter the execution queue of the data access unit. For example, if the data access unit is initially configured with 10 tokens and there are currently 3 instructions being executed, the number of remaining tokens is 7, indicating that 7 new instructions can be built and executed.

[0125] The instruction construction condition of the data access unit is a standard for determining whether to allow the target instruction to be constructed in the data access unit. The instruction construction condition ensures the correctness of instruction execution, the effective allocation of resources and the overall performance of the processor.

[0126] Based on the number of tokens issued and the number of remaining tokens of the data access unit, determine whether the instruction construction conditions of the data access unit are met. An optional method is: compare the number of tokens issued and the number of remaining tokens of the data access unit to determine whether the instruction construction conditions of the data access unit are met.

[0127] Exemplarily, based on the register information (target register: v0, source register: s1), the number of issued tokens of the target instruction is calculated: 3, the number of issued tokens and the number of remaining tokens of the data access unit are calculated: 4, the number of issued tokens and the number of remaining tokens of the data access unit are compared to determine whether the instruction construction conditions of the data access unit are met, and if so, in the absence of address dependency, the memory address information (1000, #4) and register information (target register: v0, source register: s1) are merged to construct the target instruction.

[0128] In the embodiments of the present specification, the normal operation of the data access unit is effectively controlled through token pool judgment, ensuring the correctness of instruction execution, effective allocation of resources and the overall performance of the processor.

[0129] In an optional embodiment of the present specification, judging whether address dependency occurs based on the memory address information in step 504 includes the following specific steps:

[0130] Based on the memory address information, construct a data access item of the target instruction in the data access sequence table;

[0131] Based on the memory address information of the data access items of the target instruction and other data access items in the data access sequence table, it is determined whether address dependency occurs.

[0132] The data access sequence table is a data structure used to manage the execution order of data access instructions. The data access sequence table records the data access items of multiple data access macroinstructions / microinstructions in a specific order. Fig. 9 Related instructions.

[0133] The data access item is a table item of each data access instruction recorded in the data access sequence table, including the data access item index, whether the dependency is valid, the type and address range, etc. For example, the following data access items are recorded in the data access sequence table: Index: 1, Whether the dependency is valid: Invalid, Type: Load, Address range: [1000, 1003], indicating that the first data access item is a data access instruction, reading 4 bytes of data from memory address 1000, and there is no unresolved dependency at present. For details, see the subsequent Fig. 9 Related instructions.

[0134] The data access item of the target instruction is the table item of the target instruction recorded in the data access sequence table. Other data access items are data access items of other data access instructions except the data access item of the target instruction recorded in the data access sequence table.

[0135] The memory address information of other data access items is the specific memory address for reading or writing data specified in the data access instruction corresponding to the other data access items. The memory address information of other data access items includes but is not limited to: base address, index, displacement and other information used to calculate the final memory location.

[0136] Based on the memory address information of the data access items and other data access items of the target instruction in the data access sequence table, determine whether address dependency occurs. An optional method is: based on the memory address information of the data access items and other data access items of the target instruction in the data access sequence table, determine whether there is address overlap. If so, determine that address dependency occurs; if not, determine that address dependency does not occur.

[0137] Exemplarily, based on the memory address information (1000, #4), the data access item of the target instruction is constructed in the data access sequence table: index: 1, whether the dependency is valid: invalid, type: Load, address range: [1000, 1003], based on the address range of the data access item of the target instruction in the data access sequence table ([1000, 1003]) and the memory address information of other data access items (address range: [999, 1002]), it is determined that there is address overlap and address dependency occurs.

[0138] In the embodiments of the present specification, the data access sequence table is used to perform address dependency judgment, effectively detecting address dependency, thereby optimizing the data access process, reducing delays, and improving processor efficiency.

[0139] In an optional embodiment of the present specification, after determining whether address dependency occurs based on the memory address information of the data access item of the target instruction and other data access items in the data access sequence table, the following specific steps are also included:

[0140] In the case of address dependency, determining that the data access item dependency of the target instruction is valid;

[0141] In response to a wake-up request, return to execute the memory address information of the data access items and other data access items of the target instruction in the data access sequence table, and determine whether address dependency occurs. If no address dependency occurs, updating the data access item dependency of the target instruction is invalid, wherein the wake-up request is generated when the data access item that has address dependency with the target instruction is executed.

[0142] A wake-up request is a request used in a processor to wake up a target instruction that has been suspended due to address dependency and to continue execution. The wake-up request is generated when the data memory access item that has address dependency with the target instruction is completed, and is generated and sent by the data memory access unit in the processor. The wake-up request is usually generated when the data memory access item that causes address dependency is completed, indicating that the target instruction can safely access the required memory and there is no longer an address conflict. For example, the instruction corresponding to the other data memory access item currently being executed is "STOREr1, [addr] / / Store the value of register r1 to memory address addr", and the data access instruction is "LOAD r2, [addr] / / Read data from memory address addr to register r2". Since these two instructions access the same memory address, the LOAD instruction must wait for the STORE instruction to complete. When the STORE instruction is completed, the data memory access unit will generate a wake-up request to allow the data memory access instruction to continue execution.

[0143] The data access item dependency is a dependency status mark of the data access item, including valid and invalid. When the data access item dependency is valid, the data access item is suspended. When the data access item dependency is invalid, the data access item continues to execute. The data access item dependency switches in response to the wake-up request, switching from valid to invalid.

[0144] It should be noted that the data access item dependency is invalid and no wake-up is performed when the address dependency is released.

[0145] Exemplarily, in the event of an address dependency, determine whether the data access item dependency of the target instruction is valid: index: 1, whether the dependency is valid: valid, type: Load, address range: [1000, 1003], the data access unit generates a wake-up request when the data access item that has an address dependency with the target instruction is executed, and in response to the wake-up request, return to execute the memory address information of the data access item of the target instruction and other data access items in the data access sequence table, and determine whether an address dependency occurs. If no address dependency occurs, update the data access item dependency of the target instruction to invalid: index: 1, whether the dependency is valid: invalid, type: Load, address range: [1000, 1003].

[0146] In the embodiments of the present specification, a data access sequence table is used to manage address dependencies and construct a dependency chain. A wake-up request is not generated when it is not necessary, and a wake-up request is generated only when necessary, thereby avoiding unnecessary wake-up overhead and reducing processor latency and power consumption.

[0147] In an optional embodiment of the present specification, the memory address information of the data access item of the target instruction includes a starting memory address and an ending memory address, and the memory address information of other data access items includes a starting memory address and an ending memory address;

[0148] Based on the memory address information of the data access item of the target instruction and other data access items in the data access sequence table, determining whether address dependency occurs includes at least one of the following:

[0149] When the starting memory address of the data access item of the target instruction is less than the ending memory address of other data access items, determining that an address dependency occurs;

[0150] When the end memory address of the data access item of the target instruction is greater than the start memory address of other data access items, it is determined that address dependency occurs.

[0151] The starting memory address of the data access item of the target instruction is the address where the target instruction starts to access the memory, and is the starting point of the access range recorded by the data access item of the target instruction in the data access sequence table. For example, if the target instruction is "VL v0, (s1)", where the value of s1 is 1000, and there is no displacement, then the starting memory address of the data access item of the target instruction is 1000.

[0152] The end memory address of the target instruction's data access item is the last address of the target instruction's memory access. This is the end point of the access range recorded by the target instruction's data access item in the data access sequence table. For example, if the target instruction wants to read 4 bytes of data and the starting memory address is 1000, the end memory address is 1003.

[0153] The starting memory address of other data access items is the address where other data access instructions other than the target instruction start to access the memory. This is the starting point of the access range recorded by other data access items in the data access sequence table. For example, for other data access instructions "VW v1, (r2)", where the value of r2 is 999 and the access length is 4 bytes, the starting memory address of other data access items is 999.

[0154] The end memory address of other data access items is the last address of the memory accessed by other data access instructions except the target instruction. This is the end point of the access range recorded by other data access items in the data access sequence table. For example, if other data access instructions access 4 bytes of data, the end memory address of other data access items is 1002.

[0155] For example, the target instruction is instruction A, and the other data access items in the data access sequence table are B[i], where i is the number of items in the table. For any positive integer i, if the following conditions are met, it is determined that instruction A has an address overlap: the starting memory address of instruction A is less than the ending memory address of instruction B[i]; the ending memory address of instruction A is greater than the starting memory address of instruction B[i].

[0156] In the embodiments of the present specification, whether address overlap occurs is determined based on the starting memory address and the ending memory address, thereby improving the accuracy of address dependency determination.

[0157] In an optional embodiment of the present specification, the target instruction includes a data access instruction and a data storage instruction, and the instructions corresponding to other data access items include a data access instruction and a storage instruction;

[0158] After determining whether address dependency occurs based on the data access item of the target instruction and the memory address information of other data access items in the data access sequence table, at least one of the following is further included:

[0159] In the case where the write target instruction is a data storage instruction and the instruction corresponding to the write other data access item is a data access instruction, recording the instruction corresponding to the write other data access item as a dependent instruction of the write target instruction;

[0160] In the case where the write target instruction is a data access instruction and the instruction corresponding to writing other data access items is a data storage instruction, recording the write target instruction as a dependent instruction of the instruction corresponding to writing other data access items;

[0161] When the write target instruction is a data storage instruction and the instruction corresponding to the write other data access item is a data storage instruction, the instruction corresponding to the write other data access item is recorded as a dependent instruction of the write target instruction.

[0162] A data access instruction is a computer instruction used for data access, and is an instruction used to write data from memory to registers.

[0163] The data storage instruction is a computer instruction used for data storage, and is an instruction used to complete the writing of data from a register to a memory.

[0164] In the data access sequence table, not only validity or invalidity needs to be recorded, but also dependent instructions with address dependency need to be recorded.

[0165] Specifically, for read-after-write dependency, when the target instruction is a data storage instruction and the instructions corresponding to other data access items are data access instructions, the target instruction is recorded as the dependent instruction of the instruction corresponding to the other data access item. For example, instruction Load3 attempts to read data from the address range [1002, 1005], but instruction Store2 is writing to [1001, 1002]. Although the write range of Store2 only partially overlaps with the read range of Load3, this is enough to trigger the read-after-write dependency. In the data access sequence table, the Store instruction of index 2 is recorded in the dependent instruction field of the Load instruction of index 3, indicating that Load3 must wait for Store2 to complete.

[0166] For read-after-write dependency, when the target instruction is a data access instruction and the instructions corresponding to other data access items are data storage instructions, record the dependent instructions of the target instruction that are the instructions corresponding to other data access items. For example, instruction Store5 is trying to write to address [1005, 1006], but instruction Load3 has read data from [1002, 1005]. Although the read range of Load3 does not completely overlap with the write range of Store5, since they are adjacent on the timeline, this is sufficient to trigger a read-after-write dependency. In the data access sequence table, the dependent instruction field of the Store instruction at index 5 should record the Load instruction at index 3, indicating that Store5 must wait for Load3 to complete.

[0167] For write-after-write dependency, when the target instruction is a data storage instruction and the instructions corresponding to other data access items are data storage instructions, the instructions corresponding to other data access items are recorded as dependent instructions of the target instruction. For example, instructions Store4 and Store5 both attempt to write to the address range containing

[1005] . Although their write ranges are not exactly the same, since the write range of Store5 includes the end of the write range of Store4, this constitutes a write-after-write dependency. In the data access sequence table, the dependent instruction field of the Store instruction at index 5 should record the Store instruction at index 4, indicating that Store5 must wait for Store4 to complete.

[0168] It should be noted that when there are multiple dependent instructions at the same time, the dependent instruction with a closer new and old relationship is selected for recording.

[0169] In the embodiments of the present specification, dependent instructions are recorded in a data access sequence table to effectively and accurately manage address dependencies, significantly reduce data access latency, and significantly improve memory access performance and data access bandwidth.

[0170] In an optional embodiment of the present specification, after determining whether address dependency occurs based on the memory address information in step 504, the following specific steps are further included:

[0171] Send data read and write requests to the data bus without address dependency;

[0172] Execute the target instruction to complete data access, including the following specific steps:

[0173] Write the initial data fed back by the data bus back to the register;

[0174] The target data is read from the register through the data bus and written to the target memory area.

[0175] Data read and write requests are data read and write requests sent by the processor to the memory, reading data from the memory and writing it back to the register or reading data from the register and writing it to the memory. Data read and write requests are the basis of data access operations, which contain the information required to access the memory, such as the address, data width, and operation type (read or write).

[0176] A data bus is a collection of physical lines used to transfer data between the processor and memory or other peripheral devices in a computer system. It is a channel for data transmission, responsible for carrying data signals so that data can flow between different system components.

[0177] Initial data is the original data stored in the memory before the data read and write operation begins. It is the data state before any modification is made.

[0178] The target data is the updated data stored in the register after the data read / write operation begins, and is the data to be written to the memory. The target data can come from a variety of sources, such as calculation results, external input data, or data read from other registers. In a data write operation, the target data will be written back to the specified target memory address, overwriting the original initial data.

[0179] Exemplarily, in the absence of address dependency, the data access unit sends a data read and write request to the data bus, writes the initial data fed back by the data bus back to register v0, reads the target data from register v0 through the data bus, and writes it to the target memory area 1000+4.

[0180] In the embodiments of the present specification, when no address dependency occurs, data read and write requests are sent to the data bus in advance, the initial data fed back by the data bus is written back to the register, and the target data is read from the register through the data bus and written to the target memory area, thereby reducing the time waiting for the data bus response and improving memory access performance.

[0181] In an optional embodiment of the present specification, after the target data is read from the register through the data bus and written into the target memory area, the following specific steps are also included:

[0182] After the write is completed, the target instruction is released and a wake-up request is generated.

[0183] In the embodiment of this specification, after writing to the memory is completed, the target instruction is released, a wake-up request is generated, and a dependency release request is sent to the data access sequence table. In response to the wake-up request, the suspended target instruction is awakened, enters the execution state, and sends a data read and write request to the bus.

[0184] In the embodiments of this specification, the instructions are released immediately and a wake-up request is generated, which effectively reduces the instruction waiting time, speeds up the instruction flow efficiency, and enhances the concurrent processing capability, thereby improving the memory access performance of the processor.

[0185] Figure 6 FIG. 1 shows a schematic diagram of the structure of a processor in a data access method provided by an embodiment of the present specification. Figure 6 As shown:

[0186] The processor includes a decoder part and a subsequent data access unit. The decoder is divided into an address split decoder and a register split decoder. The address split decoder and the register split decoder are completely decoupled from each other. The split decoding method is the same, and the number of split and sent information is the same, but the memory address information and register information obtained by the split decoding are different.

[0187] The address split decoder and the register split decoder each include a data access instruction interface and a data storage instruction interface.

[0188] The address split decoder is controlled by the data access sequence table and connected through the memory address information transmission interface. The address split decoder obtains the data access instruction through the data access instruction interface and obtains the data storage instruction through the data storage instruction interface. The data access instruction and the data storage instruction are input into the data access instruction address split decoder and the data storage instruction split decoder respectively under the control of the split pause controller, and finally sent to the instruction control queue through the memory address information sending channel of the data access instruction and the memory address information sending channel of the data storage instruction respectively.

[0189] The register split decoder obtains data access instructions through the data access instruction interface and obtains data storage instructions through the data storage instruction interface, and inputs them into the data access instruction register split decoder and the data storage instruction split decoder respectively, and completes the index register and mask index register information calculation at the same time, and finally sends them to the instruction control queue through the register information sending channel of the data access instruction and the register information sending channel of the data storage instruction respectively.

[0190] In the instruction control queue, the memory address information and register information are merged and can only be submitted after being merged.

[0191] When the subsequent pause signal is pulled high, the split pause controller pauses the split process.

[0192] Figure 7 FIG. 1 shows a schematic diagram of a structure of a register split decoder in a data access method provided by an embodiment of the present specification. Figure 7 As shown:

[0193] The register split decoder obtains data access instructions through the data access instruction interface and obtains data storage instructions through the data storage instruction interface, and inputs them into the data access instruction register split decoder and the data storage instruction split decoder respectively, and completes the index register and mask index register information calculation at the same time, and finally sends them to the instruction control queue through the register information sending channel of the data access instruction and the register information sending channel of the data storage instruction respectively.

[0194] The register split decoder supports the split decoding of data access instructions and data storage instructions at the same time, and the register split decoder does not need to rely on the new and old relationship. The split register information is sent according to the standard instruction execution process and finally sent to the data access unit to merge the memory address information and the register information.

[0195] Figure 8FIG. 1 shows a schematic diagram of the structure of an address split decoder in a data access method provided by an embodiment of the present specification. Figure 8 As shown:

[0196] The address split decoder is controlled by the data access sequence table and connected through the memory address information transmission interface. The address split decoder obtains the data access instruction through the data access instruction interface and obtains the data storage instruction through the data storage instruction interface. The data access instruction and the data storage instruction are input into the data access instruction address split decoder and the data storage instruction split decoder respectively under the control of the split pause controller, and finally sent to the instruction control queue through the memory address information sending channel of the data access instruction and the memory address information sending channel of the data storage instruction respectively.

[0197] The address split decoder includes a dependency information path and a split information path. The switching control indicates the new and old relationship to ensure the creation order of the data access items of the instructions in the data access sequence table. In the address split decoder, when the current instruction split decoding is not completed, no new instructions are accepted; after the data access sequence table completes the address dependency judgment, it gives the dependency information of the current data access instruction, which is combined with the split information and sent to the data access unit.

[0198] Fig. 9 FIG. 1 shows a schematic diagram of the structure of a data access sequence table in a data access method provided by an embodiment of the present specification. Fig. 9 As shown:

[0199] The data access sequence table records multiple data access items, and any data access item includes information such as index, valid mark, type, address range, etc.

[0200] The address split decoder transmits the data access sequence table through two channels: data access instruction transmission channel 0 and data access instruction transmission channel 1. A target instruction wake-up channel and a target instruction release channel are established between the data access sequence table and the data access unit. A memory address information delivery channel is established between the address split decoder and the data access unit.

[0201] The data access sequence table supports address overlap detection between two instructions and other data access items, and also supports address overlap detection between two instructions. When creating data access items, address dependency detection is performed: when addresses overlap, the indexes of other data access items that are closer in sequence to the instruction are recorded as dependency indexes. At the same time, the dependent instructions are marked as valid, and the dependents are awakened when the dependent instructions are executed and released.

[0202] Fig.10 A schematic diagram of a data access method provided by an embodiment of this specification is shown. Fig.10 As shown:

[0203] Data access instruction stream input;

[0204] -Splitting and decoding of data access instructions, issuing dependency judgment and dispatching process;

[0205] - Address splitting and decoding of data access memory instructions, constructing data access memory items of target instructions, judging address dependency, and issuing requests when there is no address dependency, while reading and writing data through the bus and writing back to registers;

[0206] -Determine address dependency;

[0207] --Merge and issue;

[0208] --Wake up, determine address dependency, and send a request if there is no address dependency;

[0209] Merge memory address information and register information;

[0210] Register write back;

[0211] Release target command;

[0212] The dependency is released and the execution judgment address dependency is returned.

[0213] At present, deep learning technology and applications have been deeply developed and widely promoted, and the demand for computing power and memory bandwidth has become increasingly strong. Natural language models such as the GPT series and BERT series have made significant progress in the field of natural language tasks. However, as the scale of the model continues to expand, in order to support the acceleration of computational reasoning of the Transform algorithm, its memory access performance bottleneck has become increasingly prominent.

[0214] At present, the decoding process for data memory access is limited by the memory address dependency. The existing data memory access instructions are being executed. After the data is written out at the memory address, the current data memory access instructions are split to obtain the target instructions which need to wait for execution. The data memory access unit needs to wait for the existing data memory access instructions to complete the response before sending data read and write requests to the data bus. In addition, due to the register dependency, the existing data memory access instructions are being executed on limited registers and need to wait for the registers to be released, which increases the latency of data memory access and reduces the memory access performance and data memory access bandwidth.

[0215] thus, Fig.11 A flowchart of a natural language reasoning method provided by an embodiment of this specification is shown. The method is applied to a processor and includes the following specific steps:

[0216] Step 1102: receiving a reasoning request for a natural language task sent by a front end, wherein the reasoning request includes a data access instruction;

[0217] Step 1104: performing address splitting and decoding on the data memory access instruction to obtain memory address information, and judging whether address dependency occurs based on the memory address information, and performing register splitting and decoding on the data memory access instruction to obtain register information, and judging whether register dependency occurs based on the register information;

[0218] Step 1106: constructing a target instruction based on the memory address information and the register information without address dependency;

[0219] Step 1108: Execute the target instruction to complete data access without register dependency and obtain the inference result;

[0220] Step 1110: Send the inference result to the front end.

[0221] This specification is applied to a processor with a natural language reasoning function, the processor including a control unit, a register and a data processing component (e.g., an arithmetic logic unit (ALU)), wherein the control unit includes a split decoder and a memory access control unit, and the data access control unit completes the exchange with the data in the memory to realize the data access. Optionally, the split decoder includes an address split decoder, a register split decoder and a data access sequence table, which can be referred to above Figure 6-Figure 9 Types of processors include, but are not limited to, central processing units, graphics processing units, vector processing units, neural processing units, and tensor processing units.

[0222] The front end is a user interface or application that initiates natural language task reasoning requests. It communicates with the processor (back end) to convert user needs into specific operation instructions.

[0223] Natural language tasks are reasoning tasks in natural language processing, including but not limited to: text question answering tasks, summary extraction tasks, machine translation tasks, and sentiment analysis tasks.

[0224] The inference request of a natural language task is a request generated and sent by the front end to perform a natural language task.

[0225] The inference result is the output of the processor after executing the natural language task. It is the conclusion or conversion result obtained after analyzing and processing the original input data. For example, the front end sends an inference request for a sentiment analysis task, and after the processor analyzes a piece of text, the inference result is a sentiment label of "positive", "negative" or "neutral". For another example, the front end sends an inference request for a machine translation task, and after the processor analyzes a piece of text, the inference result is the translated text.

[0226] The embodiments of this specification and the technical solution of the above-mentioned data access method belong to the same concept. For details not described in detail in the embodiments of this specification, please refer to the description of the technical solution of the above-mentioned data access method.

[0227] In the embodiments of this specification, for the reasoning request of the natural language task, the decoupling of split decoding is realized, the address dependency and register dependency judgment are separated, the target instruction is split out in advance without address dependency, the response time is reduced, and the target instruction is directly executed to complete data memory access and obtain the reasoning result without register dependency, which reduces the delay of data memory access, improves memory access performance and data memory access bandwidth, and improves the execution efficiency of natural language reasoning.

[0228] Corresponding to the above method embodiment, this specification also provides a processor embodiment, Fig.12 FIG. 1 shows a schematic diagram of a processor structure provided by an embodiment of the present specification. Fig.12 As shown, the processor 1200 includes an instruction interface 1210, an address split decoder 1220, a register split decoder 1230, a register state table 1240 and a data access unit 1250;

[0229] Instruction interface 1210, used to obtain data access instructions;

[0230] An address splitting decoder 1220 is used to perform address splitting decoding on the data memory access instruction to obtain memory address information, and determine whether address dependency occurs based on the memory address information;

[0231] A register split decoder 1230 is used to perform register split decoding on the data memory access instruction to obtain register information;

[0232] A register status table 1240, used to determine whether register dependency occurs based on register information;

[0233] The data access unit 1250 is used to construct a target instruction based on memory address information and register information without address dependency, and execute the target instruction to complete data access without register dependency.

[0234] Optionally, the data access instruction includes a data access instruction and a data storage instruction, and the address split decoder 1220 includes an access address split decoder, a storage address split decoder and a data access sequence table;

[0235] An access address split decoder is used to perform address split decoding on data access instructions to obtain memory address information;

[0236] A storage address split decoder is used to perform address split decoding on the data storage instruction to obtain memory address information;

[0237] The data access sequence table is used to determine whether address dependency occurs based on memory address information.

[0238] Optionally, the data access instruction includes a data access instruction and a data storage instruction, and the register split decoder 1230 includes an access register split decoder and a storage register split decoder;

[0239] An access register split decoder is used to perform register split decoding on a data access instruction to obtain register information;

[0240] The storage register split decoder is used to perform register split decoding on the data storage instruction to obtain register information.

[0241] Optionally, the address splitting decoder 1220 is also used to construct a data access item of the target instruction in the data access sequence table based on the memory address information, and to determine whether address dependency occurs based on the memory address information of the data access item of the target instruction and other data access items in the data access sequence table.

[0242] In the embodiments of this specification, the address decoding process in the processor is divided into an address split decoder and a register split decoder, thereby realizing the decoupling of split decoding, separating the address dependency from the register dependency judgment, splitting the target instruction in advance when there is no address dependency, reducing the response time, and directly executing the target instruction to complete data memory access when there is no register dependency, thereby reducing the delay of data memory access and improving the memory access performance and data memory access bandwidth of the processor.

[0243] The above is a schematic solution of a processor of this embodiment. It should be noted that the technical solution of the processor and the technical solution of the above data access method belong to the same concept, and the details of the processor technical solution not described in detail can be referred to the description of the technical solution of the above data access method.

[0244] Fig.13 13 shows a block diagram of a computing device provided by an embodiment of the present specification. The components of the computing device 1300 include but are not limited to a memory 1310 and a processor 1320. The processor 1320 is connected to the memory 1310 via a bus 1330, and the database 1350 is used to store data.

[0245] The computing device 1300 also includes an access device 1340, which enables the computing device 1300 to communicate via one or more networks 1360. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 1340 may include one or more of any type of network interface (e.g., a Network Interface Controller (NIC)) of wired or wireless, such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).

[0246] In one embodiment of the present specification, the above components of the computing device 1300 and Fig.13 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.13 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0247] The computing device 1300 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1300 may also be a mobile or stationary server.

[0248] The processor 1320 is used to execute the following computer program / instruction, which implements the steps of the above-mentioned data access method when executed by the processor.

[0249] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data access method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data access method.

[0250] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0251] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0252] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0253] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0254] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A data access method, comprising: Get data access instructions; Performing address splitting and decoding on the data memory access instruction to obtain memory address information, and judging whether address dependency occurs based on the memory address information, and performing register splitting and decoding on the data memory access instruction to obtain register information, and judging whether register dependency occurs based on the register information; Constructing a target instruction based on the memory address information and the register information without address dependency; In the absence of register dependency, the target instruction is executed to complete data memory access.

2. The method according to claim 1, before determining whether register dependency occurs based on the register information, further comprising: Get register information of non-data memory access instructions; The determining whether register dependency occurs based on the register information includes: Based on the register information of the data memory access instruction and the non-data memory access instruction, it is determined whether register dependency occurs.

3. The method according to claim 1, before constructing the target instruction based on the memory address information and the register information without address dependency, further comprising: Based on the register information, the number of tokens issued for the target instruction is calculated; Based on the number of issued tokens and the number of remaining tokens of the data access memory unit, determining whether an instruction construction condition of the data access memory unit is met; The step of constructing a target instruction based on the memory address information and the register information without address dependency includes: If so, in the case where no address dependency occurs, the target instruction is constructed using the data access unit based on the memory address information and the register information.

4. The method according to any one of claims 1 to 3, wherein judging whether address dependency occurs based on the memory address information comprises: Based on the memory address information, constructing a data access item of the target instruction in a data access sequence table; Based on the memory address information of the data access items of the target instruction and other data access items in the data access sequence table, it is determined whether address dependency occurs.

5. The method according to claim 4, after determining whether address dependency occurs based on the memory address information of the data access item of the target instruction and other data access items in the data access sequence table, further comprises: In the case where address dependency occurs, determining that the data access item dependency of the target instruction is valid; In response to a wake-up request, the memory address information of the data access items and other data access items of the target instruction in the data access sequence table is returned to determine whether an address dependency occurs. If no address dependency occurs, updating the data access item dependency of the target instruction is invalid, wherein the wake-up request is generated when the execution of the data access item that has an address dependency on the target instruction is completed.

6. The method according to claim 4, wherein the memory address information of the data memory access item of the target instruction includes a starting memory address and an ending memory address, and the memory address information of the other data memory access items includes a starting memory address and an ending memory address; The determining whether address dependency occurs based on the memory address information of the data access item of the target instruction and other data access items in the data access sequence table includes at least one of the following: When the starting memory address of the data access item of the target instruction is smaller than the ending memory address of other data access items, determining that an address dependency occurs; When the end memory address of the data access item of the target instruction is greater than the start memory address of other data access items, it is determined that address dependency occurs.

7. The method according to claim 4, wherein the target instructions include data access instructions and data storage instructions, and the instructions corresponding to the other data access items include data access instructions and data storage instructions; After determining whether address dependency occurs based on the memory address information of the data access item of the target instruction and other data access items in the data access sequence table, at least one of the following is further included: In a case where the target instruction is a data storage instruction and the instruction corresponding to the other data access item is a data access instruction, recording the instruction corresponding to the other data access item as a dependent instruction of the target instruction; In the case where the target instruction is a data access instruction and the instruction corresponding to the other data access item is a data storage instruction, recording that the target instruction is a dependent instruction of the instruction corresponding to the other data access item; In the case that the target instruction is a data storage instruction and the instruction corresponding to the other data access item is a data storage instruction, the instruction corresponding to the other data access item is recorded as a dependent instruction of the target instruction.

8. The method according to claim 1, after determining whether address dependency occurs based on the memory address information, further comprises: Sending data read and write requests to the data bus without address dependency; The executing the target instruction to complete data access includes: Writing the initial data fed back by the data bus back to the register; The target data is read from the register through the data bus and written into the target memory area.

9. The method according to claim 8, after reading the target data from the register and writing the target data into the target memory area through the data bus, further comprises: After the writing is completed, the target instruction is released and a wake-up request is generated.

10. A natural language reasoning method, applied to a processor, comprising: Receiving a reasoning request for a natural language task sent by a front end, wherein the reasoning request includes a data access instruction; Performing address splitting and decoding on the data memory access instruction to obtain memory address information, and judging whether address dependency occurs based on the memory address information, and performing register splitting and decoding on the data memory access instruction to obtain register information, and judging whether register dependency occurs based on the register information; Constructing a target instruction based on the memory address information and the register information without address dependency; In the case where no register dependency occurs, executing the target instruction completes data access and obtains an inference result; The inference result is sent to the front end.

11. A processor comprising an instruction interface, an address split decoder, a register split decoder, a register status table and a data access unit; The instruction interface is used to obtain data access instructions; The address splitting decoder is used to perform address splitting decoding on the data memory access instruction to obtain memory address information, and determine whether address dependency occurs based on the memory address information; The register splitting decoder is used to perform register splitting decoding on the data memory access instruction to obtain register information; The register status table is used to determine whether register dependency occurs based on the register information; The data access unit is used to construct a target instruction based on the memory address information and the register information without address dependency, and execute the target instruction to complete data access without register dependency.

12. The processor according to claim 11, wherein the data memory access instruction comprises a data access instruction and a data storage instruction, and the address split decoder comprises an access address split decoder, a storage address split decoder and a data memory access sequence table; The access address splitting decoder is used to perform address splitting decoding on the data access instruction to obtain memory address information; The storage address splitting decoder is used to perform address splitting decoding on the data storage instruction to obtain memory address information; The data access sequence table is used to determine whether address dependency occurs based on the memory address information.

13. The processor according to claim 11, wherein the data memory access instruction comprises a data access instruction and a data storage instruction, and the register split decoder comprises an access register split decoder and a storage register split decoder; The access register split decoder is used to perform register split decoding on the data access instruction to obtain register information; The storage register split decoder is used to perform register split decoding on the data storage instruction to obtain register information.

14. According to the processor of claim 11, the address splitting decoder is also used to construct a data access item of the target instruction in the data access sequence table based on the memory address information, and determine whether address dependency occurs based on the memory address information of the data access item of the target instruction and other data access items in the data access sequence table.

15. A computing device comprising the processor according to any one of claims 11 to 14.

Citation Information

Cited By

  • Binary translation method and device, electronic equipment and readable storage medium

    CN119336392A

  • Programmable instruction distribution system

    CN119847610A

  • Programmable Instruction Distribution System

    CN119847610B