Vector data processing method and apparatus for multicore processor
By using the hybrid instruction queue to confirm the priority and status judgment mechanism of vector operation codes in multi-core processors, the problem of low vector data processing efficiency is solved, and efficient vector data processing and calculation speed guarantee are achieved.
Patent Information
- Application Number
- PCT/CN2024/079094
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-21
- Filing Date
- 2024-02-28
- Publication Date
- 2024-09-26
AI Technical Summary
In vector data processing for multi-core processors, since the vector processing unit is limited by the area or bus speed of a single single-core processor, the processing speed and timeliness cannot be guaranteed, affecting the efficiency of vector data processing.
Confirm the priority of the vector operation code through the mixed instruction queue, and determine whether to send the operation code for calculation based on the status of the vector computing unit, ensuring that multiple core processors can share the vector computing unit and avoid being limited by the area and size of a single core processor bus speed.
It improves the efficiency and timeliness of vector data processing, ensures calculation speed, avoids conflicts between vector operation codes and bus dependence, and realizes efficient vector data processing of multi-core processors.
Smart Images

Figure CN2024079094_26092024_PF_FP
Abstract
Description
A method and device for processing vector data for multi-core processors
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the Patent Office of China on March 21, 2023, with application number 202310277393.X, entitled “A method and device for processing vector data for multi-core processors”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application relates to the field of data processing, and in particular to a method and device for processing vector data for a multi-core processor. Background Art
[0004] A vector processing unit can process vector data. A vector processing unit usually includes a vector register and multiple vector calculation units, such as a vector addition unit, a multiplication unit, a floating-point unit, etc.
[0005] In the field of vector data processing for multi-core processors, vector processing units generally only process data for a single processor or are directly connected to the bus and used by multiple core processors through bus commands. Due to the limitations of the utilization and scale of vector processing units, the processing of vector data for multi-core processors is limited by the area or bus speed of a single single-core processor, and the processing speed and timeliness cannot be guaranteed, which affects the efficiency of vector data processing.
[0006] Summary of the Invention
[0007] The present application proposes a method and device for processing vector data for a multi-core processor. The method for processing vector data for a multi-core processor proposed in the present application solves the problem in the related art that in the process of vector data processing for a multi-core processor, the processing speed and timeliness cannot be guaranteed due to the limitation of the area or bus speed of a single single-core processor, thereby affecting the efficiency of vector data processing.
[0008] According to the first aspect, an embodiment of the present application provides a method for processing vector data for a multi-core processor, including: a mixed instruction queue confirms the priority of processing the received vector opcode, and obtains the current status of the vector calculation unit that executes the vector opcode in sequence according to the processing priority; determines whether to send the vector opcode to the vector calculation unit that executes the vector opcode for calculation based on the current status, and determines whether to continue to send the vector opcode executed by the vector calculation unit to the mixed instruction queue.
[0009] In an exemplary embodiment, the step of the hybrid instruction queue confirming the priority of processing the received vector opcodes includes: the hybrid instruction queue confirming the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes.
[0010] In an exemplary embodiment, the step of the hybrid instruction queue confirming the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes includes: configuring a first-in-first-out cache area for the hybrid instruction queue, and confirming the priority of processing the received vector opcodes according to the first-in-first-out order based on the first-in-first-out cache area.
[0011] In an exemplary embodiment, the step of confirming the priority of processing the received vector opcodes by the hybrid instruction queue further includes: in response to receiving the same vector opcodes from multiple core processors, confirming the priority of processing the same vector opcodes according to the time sequence of receiving the same vector opcodes.
[0012] In an exemplary embodiment, the current state of the vector computing unit executing the vector opcode includes an idle state or a busy state.
[0013] In an exemplary embodiment, the step of determining whether to send the vector opcode to the vector computing unit that executes the vector opcode for calculation according to the current state includes: in response to the current state being an idle state, sending the vector opcode to the vector computing unit that executes the vector opcode for calculation.
[0014] In an exemplary embodiment, the step of determining whether to send the vector opcode to the vector computing unit that executes the vector opcode for computing according to the current state further includes: in response to the current state being a busy state, waiting for the vector computing unit that executes the vector opcode to transition to an idle state.
[0015] In an exemplary embodiment, the step of determining whether to continue sending the vector opcode executed by the vector computing unit to the mixed instruction queue includes: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in an idle state, the core processor to which the vector opcode belongs continues to send the vector opcode executed by the vector computing unit to the mixed instruction queue.
[0016] In an exemplary embodiment, the step of determining whether to continue sending the vector opcode executed by the vector computing unit to the mixed instruction queue also includes: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in a busy state and exceeds a threshold time, feeding back a full signal to the mixed instruction queue through the vector computing unit.
[0017] In an exemplary embodiment, the method further includes: acquiring the instruction to be executed through the instruction fetch unit of each core processor, and sending the instruction to the decoding unit via the instruction fetch unit for decoding and then outputting the corresponding vector operation code.
[0018] In an exemplary embodiment, the method further includes: receiving the vector opcode output by the decoding unit through the vector opcode issuing unit, and sending the vector opcode to the mixed instruction queue through the vector opcode issuing unit.
[0019] In an exemplary embodiment, the method further includes: feeding back a status of a vector computing unit executing the vector opcode to a vector opcode issuing unit of the core processor to which the vector opcode belongs, via an instruction submitting unit of the core processor to which the vector opcode belongs.
[0020] In an exemplary embodiment, the further step includes: when the feedback from the instruction submitting unit is empty, determining that the computing unit corresponding to the vector opcode is in an idle state.
[0021] In an exemplary embodiment, the method further includes: when the computing unit completes execution, submitting a completion flag to the instruction submit unit of the corresponding core, so as to feedback to the issuing unit through the instruction submit unit to start issuing the vector operation code.
[0022] In an exemplary embodiment, the method further includes: storing a vector register file corresponding to each processor core through an independent vector register corresponding to each processor core, wherein the vector register file is used to store 32 vectors.
[0023] In an exemplary embodiment, the invention further comprises: a vector processing unit shared by multiple processor cores, and a mixed instruction queue for multiple processor cores is provided at the input end of the vector processing unit.
[0024] In an exemplary embodiment, it also includes: multiple processor cores respectively have an instruction fetch unit, a decoding unit, a launch unit, a scalar processing unit and an instruction submission unit connected in sequence, the launch unit is connected to the input end of the vector processing unit, and the output end of the vector processing unit is connected to the instruction submission unit.
[0025] According to the second aspect, a vector data processing device for a multi-core processor is also provided, including: a first module, which is configured to be a mixed instruction queue to confirm the priority of processing the received vector opcode, and obtain the current status of the vector calculation unit that executes the vector opcode in sequence according to the processing priority; a second module, which is configured to determine whether to send the vector opcode to the vector calculation unit that executes the vector opcode for calculation based on the current status, and to determine whether to continue to send the vector opcode executed by the vector calculation unit to the mixed instruction queue.
[0026] In an exemplary embodiment, the first module is configured to: the mixed instruction queue confirms the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes.
[0027] In an exemplary embodiment, the first module is configured to configure a first-in-first-out buffer for the hybrid instruction queue, and determine the priority of processing the received vector opcodes in a first-in-first-out order based on the first-in-first-out buffer.
[0028] In an exemplary embodiment, the first module is configured to: in response to receiving the same vector opcode from a plurality of core processors, determine the priority of processing the same vector opcode according to the time sequence of receiving the same vector opcode.
[0029] In an exemplary embodiment, the current state of the vector computing unit executing the vector opcode includes an idle state or a busy state.
[0030] In an exemplary embodiment, the second module is configured to: in response to the current state being an idle state, send the vector operation code to a vector computing unit that executes the vector operation code for computing.
[0031] In an exemplary embodiment, the second module is configured to: in response to a current state being a busy state, cause a vector computing unit waiting to execute a vector opcode to transition to an idle state.
[0032] In an exemplary embodiment, the second module is configured to: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in an idle state, the core processor to which the vector opcode belongs continues to send the vector opcode executed by the vector computing unit to the mixed instruction queue.
[0033] In an exemplary embodiment, the second module is configured to: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is busy for a period exceeding a threshold, feed back a full signal to the mixed instruction queue via the vector computing unit.
[0034] In an exemplary embodiment, the apparatus further includes: a third module configured to obtain instructions to be executed through an instruction fetch unit of each core processor, and send the instructions to the decoding unit via the instruction fetch unit for decoding and then outputting a corresponding vector operation code.
[0035] In an exemplary embodiment, the apparatus further includes: a fourth module configured to receive the vector opcode output by the decoding unit through the vector opcode issuing unit, and send the fourth module to the mixed instruction queue via the vector opcode issuing unit.
[0036] In an exemplary embodiment, the apparatus further includes: a fifth module configured to feed back the status of the vector calculation unit executing the vector opcode to the vector opcode issuing unit of the core processor to which the vector opcode belongs via the instruction submitting unit of the core processor to which the vector opcode belongs.
[0037] In an exemplary embodiment, the apparatus further includes: a sixth module configured to determine that a computing unit corresponding to the vector opcode is in an idle state when feedback from the instruction submission unit is empty.
[0038] In an exemplary embodiment, the device further includes: a seventh module configured to submit a completion flag to the instruction submission unit of the corresponding core when the computing unit completes execution, so as to feedback to the emission unit through the instruction submission unit that it can start to emit vector opcodes.
[0039] In an exemplary embodiment, the apparatus further includes: an eighth module configured to store a vector register file corresponding to each processor core through an independent vector register corresponding to each processor core, wherein the vector register file is used to store 32 vectors.
[0040] In an exemplary embodiment, the apparatus further includes: a ninth module configured as a vector processing unit shared by multiple processor cores, wherein a mixed instruction queue for multiple processor cores is provided at an input end of the vector processing unit.
[0041] In an exemplary embodiment, the device also includes: a tenth module, which is configured to have multiple processor cores with instruction fetch units, decoding units, emission units, scalar processing units and instruction submission units connected in sequence, the emission unit is connected to the input end of the vector processing unit, and the output end of the vector processing unit is connected to the instruction submission unit.
[0042] According to a third aspect, a computer device is also provided, comprising at least one processor; and a memory, wherein the memory stores computer instructions that can be run on the processor, and when the instructions are executed by the processor, the steps of any of the above methods are implemented.
[0043] According to a fourth aspect, a non-volatile readable storage medium is further provided, wherein the non-volatile readable storage medium stores a computer program that implements any of the above method steps when executed by a processor.
[0044] In the process of vector data processing based on a multi-core processor, the vector calculation unit for vector data processing is limited by the area of a single core processor or is attached to a bus and is limited by the bus calculation speed. The present application proposes a vector data processing method for a multi-core processor, which provides a shared vector calculation unit for the multi-core processor, which is not limited by the area limitation of a single core processor or is attached to a bus to interact with the multi-core processor. Optionally, before sending the vector opcodes from multiple core processors to the corresponding calculation unit for calculation, the priority of processing them is determined by a mixed instruction queue, so that the data of multiple core processors can be processed in sequence and will not be limited by the area of a single core processor; at the same time, before sending it to the corresponding calculation unit, it will be determined whether to send it according to the status of the corresponding calculation unit, providing a complete set of processing procedures for processing vector data. For multiple core processors, the shared vector calculation units are all oriented to themselves, so it will not affect the calculation speed.
[0045] The present application has at least the following beneficial effects: the present application proposes a method, apparatus, device and medium for processing vector data for multi-core processors, wherein the present application proposes a vector data processing solution for multi-core processors that can enable multiple core processors to share a vector processing unit through a hybrid instruction queue, and each core processor can directly interact with the computing unit corresponding to the vector opcode through the vector opcode, thereby improving the efficiency of vector data processing while ensuring timeliness and computing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying any creative work.
[0047] FIG1 is a flowchart of a method for processing vector data for a multi-core processor provided in an embodiment of the present application;
[0048] FIG2 shows a flowchart of vector opcode scheduling for a multi-core processor provided in an embodiment of the present application;
[0049] FIG3 is a schematic diagram showing the structure of a vector data processing device for a multi-core processor provided by the present application;
[0050] FIG4 shows a schematic structural diagram of a computer device provided by the present application;
[0051] FIG5 shows a schematic structural diagram of a non-volatile readable storage medium provided by the present application. DETAILED DESCRIPTION
[0052] The following describes embodiments of the present application. However, it should be understood that the disclosed embodiments are merely examples and other embodiments may take various alternative forms.
[0053] Furthermore, it should be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but may also include elements not expressly listed or inherent to such processes, methods, articles, or apparatuses.
[0054] One or more embodiments of the present application will be described below with reference to the accompanying drawings.
[0055] Based on the above objectives, the first aspect of the embodiment of the present application proposes an embodiment of a method for processing vector data for a multi-core processor. FIG1 shows a flow chart of an embodiment of a method for processing vector data for a multi-core processor provided by an embodiment of the present application. As shown in FIG1 , the method for processing vector data for a multi-core processor according to an embodiment of the present application includes the following steps:
[0056] S1. The hybrid instruction queue confirms the priority of processing the received vector opcode and obtains the current state of the vector computing unit that executes the vector opcode in sequence according to the processing priority;
[0057] S2. Determine whether to send the vector opcode to the vector calculation unit that executes the vector opcode for calculation according to the current state, and determine whether to continue to send the vector opcode executed by the vector calculation unit to the mixed instruction queue.
[0058] In an exemplary embodiment, the step of the hybrid instruction queue confirming the priority of processing the received vector opcodes includes: the hybrid instruction queue confirming the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes.
[0059] In an exemplary embodiment, the step of the hybrid instruction queue confirming the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes includes: configuring a first-in-first-out cache area for the hybrid instruction queue, and confirming the priority of processing the received vector opcodes according to the first-in-first-out order based on the first-in-first-out cache area.
[0060] In an exemplary embodiment, the step of confirming the priority of processing the received vector opcodes by the hybrid instruction queue further includes: in response to receiving the same vector opcodes from multiple core processors, confirming the priority of processing the same vector opcodes according to the time sequence of receiving the same vector opcodes.
[0061] In an exemplary embodiment, the current state of the vector computing unit executing the vector opcode includes an idle state or a busy state.
[0062] In an exemplary embodiment, the step of determining whether to send the vector opcode to the vector computing unit that executes the vector opcode for calculation according to the current state includes: in response to the current state being an idle state, sending the vector opcode to the vector computing unit that executes the vector opcode for calculation.
[0063] In an exemplary embodiment, the step of determining whether to send the vector opcode to the vector computing unit that executes the vector opcode for computing according to the current state further includes: in response to the current state being a busy state, waiting for the vector computing unit that executes the vector opcode to transition to an idle state.
[0064] In an exemplary embodiment, the step of determining whether to continue sending the vector opcode executed by the vector computing unit to the mixed instruction queue includes: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in an idle state, the core processor to which the vector opcode belongs continues to send the vector opcode executed by the vector computing unit to the mixed instruction queue.
[0065] In an exemplary embodiment, the step of determining whether to continue sending the vector opcode executed by the vector computing unit to the mixed instruction queue also includes: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in a busy state and exceeds a threshold time, feeding back a full signal to the mixed instruction queue through the vector computing unit.
[0066] In an exemplary embodiment, the method further includes: acquiring the instruction to be executed through the instruction fetch unit of each core processor, and sending the instruction to the decoding unit via the instruction fetch unit for decoding and then outputting the corresponding vector operation code.
[0067] In an exemplary embodiment, the method further includes: receiving the vector opcode output by the decoding unit through the vector opcode issuing unit, and sending the vector opcode to the mixed instruction queue through the vector opcode issuing unit.
[0068] In an exemplary embodiment, the method further includes: feeding back a status of a vector computing unit executing the vector opcode to a vector opcode issuing unit of the core processor to which the vector opcode belongs, via an instruction submitting unit of the core processor to which the vector opcode belongs.
[0069] In an exemplary embodiment, the further step includes: when the feedback from the instruction submitting unit is empty, determining that the computing unit corresponding to the vector opcode is in an idle state.
[0070] In an exemplary embodiment, the method further includes: when the computing unit completes execution, submitting a completion flag to the instruction submit unit of the corresponding core, so as to feedback to the issuing unit through the instruction submit unit to start issuing the vector operation code.
[0071] In an exemplary embodiment, the method further includes: storing a vector register file corresponding to each processor core through an independent vector register corresponding to each processor core, wherein the vector register file is used to store 32 vectors.
[0072] In an exemplary embodiment, the invention further comprises: a vector processing unit shared by multiple processor cores, and a mixed instruction queue for multiple processor cores is provided at the input end of the vector processing unit.
[0073] In an exemplary embodiment, it also includes: multiple processor cores respectively have an instruction fetch unit, a decoding unit, a launch unit, a scalar processing unit and an instruction submission unit connected in sequence, the launch unit is connected to the input end of the vector processing unit, and the output end of the vector processing unit is connected to the instruction submission unit.
[0074] The following is another embodiment of a method for processing vector data for a multi-core processor provided by this application.
[0075] Figure 2 shows a vector opcode scheduling flow chart for a multi-core processor provided in an embodiment of the present application. As shown in Figure 2, in this embodiment, two core processors share a vector processing unit. At the input end of the vector processing unit, there is a mixed instruction queue for core 1 and core 2. Core 1 and core 2 respectively have their own instruction fetch unit, decoding unit, emission unit, scalar processing unit and instruction submission unit. For each core processor, the vector processing unit is self-oriented, so the vector processing unit is not limited to the area of a single core processor, and there will be no duplicate vector processing units occupying the limited area of the system. Therefore, functional components for the corresponding core processor can be deployed in the registers inside the vector processing unit for use without occupying the limited area of the system.
[0076] In the process of processing vector data, the instruction fetch unit receives the instruction to be executed and sends it to the decoding unit for decoding to obtain the vector opcode, and then sends the vector opcode to the emission unit of the core processor to wait for it to be sent to the mixed instruction queue. When there is a vector opcode in the emission queue, the instruction submission unit feedback is empty, that is, the computing unit corresponding to the vector opcode is in an idle state, then the vector opcode is sent from the emission unit to the mixed instruction queue. After the mixed instruction queue receives the vector opcode, the vector opcodes from different cores are judged in the corresponding instruction queue according to the time sequence of reception. Only when the computing unit corresponding to the vector opcode is idle, the mixed instruction queue sends it to the corresponding computing unit to execute the instruction of the vector opcode. When the computing unit completes the execution, the completion flag is submitted to the instruction submission unit of the corresponding core, so that the transmission unit can start to transmit the vector opcode through the instruction submission unit. If two core vector execution units issue the same vector opcode, such as addition, but the vector computation unit only has one addition computation unit, the hybrid instruction queue is configured with a first-in-first-out buffer. When a vector opcode arrives, the first vector opcode that enters the instruction queue corresponding to the source processor is sent first. When the vector execution unit determines that the execution unit corresponding to the vector opcode is idle, it will then issue the instruction. This ensures that the vector opcode from the processor is not lost and avoids conflicts. In other words, before executing the vector opcode sent to the vector processing unit by each core processor, the priority of its processing will be determined according to the time order in which it was received by the hybrid instruction queue. Only when the vector computation unit corresponding to the current vector opcode is idle will the current vector opcode be sent to the vector computation unit for calculation. Otherwise, the current vector opcode will wait in the hybrid instruction queue until the corresponding computation unit becomes idle before being sent to the computation unit. According to the above processing method for vector opcodes of multi-core processors, conflicts between the same opcodes from multi-core processors can be avoided. At the same time, this processing method does not rely on the bus to interact with multiple core processors, which can greatly improve the processing speed of vector data.
[0077] At the same time, corresponding independent vector registers are configured for each processor core. For each core processor, there is an independent vector register file, and each vector register file stores 32 vectors. That is to say, each core processor can have 32 vectors, which can solve the register conflict problem existing in multi-core processors. For example, a vector register file for the corresponding core processor is configured in the vector processing unit. In the process of processing vector opcodes, the conflict problem caused by the vector opcodes from multiple core processors using the same register at the same time can be avoided.
[0078] The second aspect of the embodiment of the present application proposes a vector data processing device for a multi-core processor. FIG3 shows a structural diagram of a vector data processing device for a multi-core processor provided by the present application. As shown in FIG3 , the vector data processing device for a multi-core processor provided by the present application includes: a first module 11, which is configured to confirm the priority of processing the received vector opcode by a mixed instruction queue, and obtain the current state of the vector calculation unit that executes the vector opcode in sequence according to the processing priority; a second module 12, which is configured to determine whether to send the vector opcode to the vector calculation unit that executes the vector opcode for calculation according to the current state, and determine whether to continue to send the vector opcode executed by the vector calculation unit to the mixed instruction queue.
[0079] In an exemplary embodiment, the first module is configured to: the mixed instruction queue confirms the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes.
[0080] In an exemplary embodiment, the first module is configured to configure a first-in-first-out buffer for the hybrid instruction queue, and determine the priority of processing the received vector opcodes in a first-in-first-out order based on the first-in-first-out buffer.
[0081] In an exemplary embodiment, the first module is configured to: in response to receiving the same vector opcode from a plurality of core processors, determine the priority of processing the same vector opcode according to the time sequence of receiving the same vector opcode.
[0082] In an exemplary embodiment, the current state of the vector computing unit executing the vector opcode includes an idle state or a busy state.
[0083] In an exemplary embodiment, the second module is configured to: in response to the current state being an idle state, send the vector operation code to a vector computing unit that executes the vector operation code for computing.
[0084] In an exemplary embodiment, the second module is configured to: in response to a current state being a busy state, cause a vector computing unit waiting to execute a vector opcode to transition to an idle state.
[0085] In an exemplary embodiment, the second module is configured to: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in an idle state, the core processor to which the vector opcode belongs continues to send the vector opcode executed by the vector computing unit to the mixed instruction queue.
[0086] In an exemplary embodiment, the second module is configured to: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is busy for a period exceeding a threshold, feed back a full signal to the mixed instruction queue via the vector computing unit.
[0087] In an exemplary embodiment, the apparatus further includes: a third module configured to obtain instructions to be executed through an instruction fetch unit of each core processor, and send the instructions to the decoding unit via the instruction fetch unit for decoding and then outputting a corresponding vector operation code.
[0088] In an exemplary embodiment, the apparatus further includes: a fourth module configured to receive the vector opcode output by the decoding unit through the vector opcode issuing unit, and send the fourth module to the mixed instruction queue via the vector opcode issuing unit.
[0089] In an exemplary embodiment, the apparatus further includes: a fifth module configured to feed back the status of the vector calculation unit executing the vector opcode to the vector opcode issuing unit of the core processor to which the vector opcode belongs via the instruction submitting unit of the core processor to which the vector opcode belongs.
[0090] In an exemplary embodiment, the apparatus further includes: a sixth module configured to determine that a computing unit corresponding to the vector opcode is in an idle state when feedback from the instruction submission unit is empty.
[0091] In an exemplary embodiment, the device further includes: a seventh module configured to submit a completion flag to the instruction submission unit of the corresponding core when the computing unit completes execution, so as to feedback to the emission unit through the instruction submission unit that it can start to emit vector opcodes.
[0092] In an exemplary embodiment, the apparatus further includes: an eighth module configured to store a vector register file corresponding to each processor core through an independent vector register corresponding to each processor core, wherein the vector register file is used to store 32 vectors.
[0093] In an exemplary embodiment, the apparatus further includes: a ninth module configured as a vector processing unit shared by multiple processor cores, wherein a mixed instruction queue for multiple processor cores is provided at an input end of the vector processing unit.
[0094] In an exemplary embodiment, the device also includes: a tenth module, which is configured to have multiple processor cores with instruction fetch units, decoding units, emission units, scalar processing units and instruction submission units connected in sequence, the emission unit is connected to the input end of the vector processing unit, and the output end of the vector processing unit is connected to the instruction submission unit.
[0095] Based on the above purposes, the third aspect of the embodiment of the present application proposes a computer device, and FIG4 shows a structural schematic diagram of a computer device provided by the present application. As shown in FIG4, an embodiment of a computer device provided by the present application includes the following modules: at least one processor 21; and a memory 22, the memory 22 stores computer instructions 23 that can be run on the processor 21, and the computer instructions 23 are executed by the processor 21 to implement the steps of the above method, wherein the steps include: the mixed instruction queue confirms the priority of processing the received vector opcode, and obtains the current state of the vector calculation unit that executes the vector opcode in sequence according to the processing priority; determines whether to send the vector opcode to the vector calculation unit that executes the vector opcode for calculation according to the current state, and determines whether to continue to send the vector opcode executed by the vector calculation unit to the mixed instruction queue.
[0096] In an exemplary embodiment, the step of the hybrid instruction queue confirming the priority of processing the received vector opcodes includes: the hybrid instruction queue confirming the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes.
[0097] In an exemplary embodiment, the step of the hybrid instruction queue confirming the priority of processing the received vector opcodes according to the time sequence of receiving the vector opcodes includes: configuring a first-in-first-out cache area for the hybrid instruction queue, and confirming the priority of processing the received vector opcodes according to the first-in-first-out order based on the first-in-first-out cache area.
[0098] In an exemplary embodiment, the step of confirming the priority of processing the received vector opcodes by the hybrid instruction queue further includes: in response to receiving the same vector opcodes from multiple core processors, confirming the priority of processing the same vector opcodes according to the time sequence of receiving the same vector opcodes.
[0099] In an exemplary embodiment, the current state of the vector computing unit executing the vector opcode includes an idle state or a busy state.
[0100] In an exemplary embodiment, the step of determining whether to send the vector opcode to the vector computing unit that executes the vector opcode for calculation according to the current state includes: in response to the current state being an idle state, sending the vector opcode to the vector computing unit that executes the vector opcode for calculation.
[0101] In an exemplary embodiment, the step of determining whether to send the vector opcode to the vector computing unit that executes the vector opcode for computing according to the current state further includes: in response to the current state being a busy state, waiting for the vector computing unit that executes the vector opcode to transition to an idle state.
[0102] In an exemplary embodiment, the step of determining whether to continue sending the vector opcode executed by the vector computing unit to the mixed instruction queue includes: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in an idle state, the core processor to which the vector opcode belongs continues to send the vector opcode executed by the vector computing unit to the mixed instruction queue.
[0103] In an exemplary embodiment, the step of determining whether to continue sending the vector opcode executed by the vector computing unit to the mixed instruction queue also includes: in response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in a busy state and exceeds a threshold time, feeding back a full signal to the mixed instruction queue through the vector computing unit.
[0104] In an exemplary embodiment, the method further includes: acquiring the instruction to be executed through the instruction fetch unit of each core processor, and sending the instruction to the decoding unit via the instruction fetch unit for decoding and then outputting the corresponding vector operation code.
[0105] In an exemplary embodiment, the method further includes: receiving the vector opcode output by the decoding unit through the vector opcode issuing unit, and sending the vector opcode to the mixed instruction queue through the vector opcode issuing unit.
[0106] In an exemplary embodiment, the method further includes: feeding back a status of a vector computing unit executing the vector opcode to a vector opcode issuing unit of the core processor to which the vector opcode belongs, via an instruction submitting unit of the core processor to which the vector opcode belongs.
[0107] In an exemplary embodiment, the further step includes: when the feedback from the instruction submitting unit is empty, determining that the computing unit corresponding to the vector opcode is in an idle state.
[0108] In an exemplary embodiment, the method further includes: when the computing unit completes execution, submitting a completion flag to the instruction submit unit of the corresponding core, so as to feedback to the issuing unit through the instruction submit unit to start issuing the vector operation code.
[0109] In an exemplary embodiment, the method further includes: storing a vector register file corresponding to each processor core through an independent vector register corresponding to each processor core, wherein the vector register file is used to store 32 vectors.
[0110] In an exemplary embodiment, the invention further comprises: a vector processing unit shared by multiple processor cores, and a mixed instruction queue for multiple processor cores is provided at the input end of the vector processing unit.
[0111] In an exemplary embodiment, it also includes: multiple processor cores respectively have an instruction fetch unit, a decoding unit, a launch unit, a scalar processing unit and an instruction submission unit connected in sequence, the launch unit is connected to the input end of the vector processing unit, and the output end of the vector processing unit is connected to the instruction submission unit.
[0112] The present application also provides a non-volatile readable storage medium. FIG5 shows a schematic diagram of the structure of a non-volatile readable storage medium provided by the present application. As shown in FIG5 , the non-volatile readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the steps of the above method.
[0113] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program for setting the system parameters can be stored in a non-volatile readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the non-volatile readable storage medium of the program can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). The above-mentioned computer program embodiment can achieve the same or similar effects as any of the corresponding aforementioned method embodiments.
[0114] In addition, the method disclosed in the embodiments of the present application may also be implemented as a computer program executed by a processor, which may be stored in a non-volatile readable storage medium. When the computer program is executed by the processor, the above-mentioned functions defined in the method disclosed in the embodiments of the present application are performed.
[0115] In addition, the above method steps and system units can also be implemented using a controller and a non-volatile readable storage medium configured to store a computer program that enables the controller to implement the above steps or unit functions.
[0116] Those skilled in the art will also appreciate that the various exemplary logic blocks, modules, circuits and algorithmic steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination thereof. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given of the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or as hardware depends on the application and the design constraints imposed on the entire system. Those skilled in the art can implement the function in a variety of ways for every application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the present application's embodiments.
[0117] In one or more exemplary designs, the functions can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted via a computer-readable medium. Computer-readable media include non-volatile readable storage media and communication media, and the communication media include any media that helps to transfer a computer program from one location to another. The non-volatile readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. As an example and not limitation, the computer-readable medium can include RAM, ROM, EEPROM (Electrically Erasable Programmable read only memory), CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be configured to carry or store the required program code in the form of instructions or data structures and can be accessed by a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves are used to transmit software from a website, server, or other remote source, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included within the definition of medium. As used herein, disk and optical disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically, while optical discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0118] The above are exemplary embodiments disclosed in the present application, but it should be noted that various changes and modifications may be made without departing from the scope of the present application as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present application may be described or required in individual form, they may also be understood as multiple unless expressly limited to the singular.
[0119] It should be understood that, as used herein, the singular forms "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" is intended to include any and all possible combinations of one or more of the associated listed items.
[0120] The serial numbers of the embodiments disclosed in the above embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0121] Those skilled in the art will understand that all or part of the steps for implementing the above embodiments may be accomplished by hardware, or may be accomplished by programs instructing related hardware, and the programs may be stored in a non-volatile readable storage medium, and the above-mentioned non-volatile readable storage medium may be a read-only memory, a disk, or an optical disk, etc.
[0122] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the disclosure of the embodiments of the present application (including the claims) is limited to these examples. Based on the concepts of the embodiments of the present application, the technical features of the above embodiments or different embodiments may be combined, and there are many other variations of different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included in the scope of protection of the embodiments of the present application.
Claims
1. A method for processing vector data for a multi-core processor, characterized in that: include: The hybrid instruction queue confirms the priority of processing the received vector opcode, and sequentially obtains the current state of the vector computing unit that executes the vector opcode according to the processing priority; It is determined according to the current state whether to send the vector operation code to the vector calculation unit that executes the vector operation code for calculation, and it is determined whether to continue to send the vector operation code executed by the vector calculation unit to the mixed instruction queue.
2. The method according to claim 1, characterized in that The step of the hybrid instruction queue confirming the priority of processing the received vector opcode comprises: The hybrid instruction queue determines the priority of processing the received vector operation codes according to the time sequence of receiving the vector operation codes.
3. The method according to claim 2, characterized in that The step of the hybrid instruction queue confirming the priority of processing the received vector opcode according to the time sequence of receiving the vector opcode comprises: A first-in-first-out buffer is configured for the hybrid instruction queue, and based on the first-in-first-out buffer, a priority of processing the received vector opcode is confirmed in a first-in-first-out order.
4. The method according to claim 3, characterized in that The step of the hybrid instruction queue confirming the priority of processing the received vector opcode also includes: In response to receiving the same vector operation code from a plurality of core processors, a priority of processing the same vector operation code is confirmed according to a time sequence of receiving the same vector operation code.
5. The method according to claim 1, characterized in that The current state of the vector computing unit executing the vector operation code includes: an idle state or a busy state.
6. The method according to claim 5, characterized in that The step of determining whether to send the vector operation code to a vector calculation unit that executes the vector operation code for calculation according to the current state comprises: In response to the current state being an idle state, the vector operation code is sent to a vector computing unit that executes the vector operation code for computing.
7. The method according to claim 5, characterized in that The step of determining whether to send the vector operation code to a vector computing unit that executes the vector operation code for computing according to the current state further includes: In response to the current state being a busy state, the vector computing unit waiting to execute the vector operation code changes to an idle state.
8. The method according to claim 5, characterized in that The step of determining whether to continue to send the vector operation code executed by the vector computing unit to the mixed instruction queue comprises: In response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in an idle state, the core processor to which the vector opcode belongs continues to send the vector opcode executed by the vector computing unit to the hybrid instruction queue.
9. The method according to claim 5, characterized in that The step of determining whether to continue to send the vector operation code executed by the vector computing unit to the mixed instruction queue also includes: In response to the core processor to which the vector opcode belongs detecting that the vector computing unit executing the vector opcode is in a busy state and the busy state exceeds a threshold time, a full signal is fed back to the hybrid instruction queue through the vector computing unit.
10. The method according to any one of claims 1 to 9, characterized in that: Also includes: The instruction to be executed is obtained by the instruction fetch unit of each core processor, and is sent to the decoding unit through the instruction fetch unit for decoding, and then the corresponding vector operation code is output.
11. The method according to claim 10, characterized in that Also includes: The vector operation code output by the decoding unit is received through the vector operation code issuing unit, and is sent to the mixed instruction queue through the vector operation code issuing unit.
12. The method according to claim 11, characterized in that Also includes: The state of the vector calculation unit executing the vector opcode is fed back to the vector opcode issuing unit of the core processor to which the vector opcode belongs through the instruction submitting unit of the core processor to which the vector opcode belongs.
13. The method according to claim 12, characterized in that Also includes: In a case where feedback from the instruction submitting unit is empty, it is determined that the computing unit corresponding to the vector opcode is in an idle state.
14. The method according to claim 12, characterized in that Also includes: When the computing unit completes the execution, a completion flag is submitted to the instruction submit unit of the corresponding core, so as to be fed back to the issuing unit through the instruction submit unit to start issuing the vector operation code.
15. The method according to any one of claims 1 to 9, characterized in that: Also includes: The vector register file corresponding to each processor core is stored through an independent vector register corresponding to each processor core, wherein the vector register file is used to store 32 vectors.
16. The method according to any one of claims 1 to 9, characterized in that: Also includes: A plurality of processor cores share a vector processing unit, and at the input end of the vector processing unit there is the mixed instruction queue facing the plurality of processor cores.
17. The method according to any one of claims 1 to 9, characterized in that: Also includes: The plurality of processor cores respectively have an instruction fetch unit, a decoding unit, a firing unit, a scalar processing unit and an instruction submitting unit connected in sequence, wherein the firing unit is connected to an input end of the vector processing unit, and the vector processing unit The output end of the processing unit is connected to the instruction issuing unit.
18. A vector data processing device for a multi-core processor, characterized in that: include: A first module is configured to confirm the priority of processing a received vector opcode as a hybrid instruction queue, and sequentially obtain the current state of a vector computing unit that executes the vector opcode according to the processing priority; The second module is configured to determine whether to send the vector operation code to the vector calculation unit that executes the vector operation code for calculation according to the current state, and to determine whether to continue to send the vector operation code executed by the vector calculation unit to the mixed instruction queue.
19. A computer device, characterized in that: include: at least one processor; as well as A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 17.
20. A non-volatile readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 17 are implemented.
Citation Information
Patent Citations
Multi-core multi-queue task cross processing method and device, system and storage medium
CN113934530A
Device and method for multi-core CPU atomic operation memory
CN115756767A
Vector data processing method and device for multi-core processor
CN115993949A
Operation processing apparatus and method
US20160188531A1
Dynamic allocation of arithmetic logic units for vectorized operations
US20220197858A1
