Task execution method and device, equipment and storage medium

By adopting an independent first-level cache and a shared second-level cache hierarchical structure in the GPU, the problems of resource waste and cache consistency complexity in traditional GPU design are solved, and efficient data access and performance improvement are achieved.

CN118672941AActive Publication Date: 2024-09-20YUANQIXIN (SHANDONG) SEMICONDUCTOR TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411154887.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-09-20
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

In traditional GPU designs, independent L2 cache for each stream multi-processor leads to resource waste, data redundancy and complicated cache consistency maintenance, especially under highly parallel workloads, resulting in data transmission delays and performance impacts.

Method used

A hierarchical structure of independent first-level cache and shared second-level cache is adopted, and read requests are forwarded to the shared second-level cache through a preset cross matrix to centrally manage cache resources and reduce data duplication and delay.

Benefits of technology

It improves cache hit rate, reduces data transmission delay, optimizes computing performance, and has flexibility and adaptability to meet diverse application needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672941A
    Figure CN118672941A
Patent Text Reader

Abstract

The invention discloses a task execution method, device and equipment and a storage medium, relates to the technical field of caching, is applied to a streaming multiprocessor, and comprises the following steps: generating a read request for a first-level cache of the host computer based on a calculation task generated by the host computer; the calculation task corresponds to instruction data and operand data; if the read request does not hit the data, forwarding the read request to a preset cross matrix through a first-level cache so as to forward the read request to a second-level cache shared by a plurality of streaming multiprocessors; reading instruction data or operand data from the second-level cache through the first-level cache based on the read request; and executing a calculation task according to the read instruction data or operand data, and caching an operation result to a second-level cache, so that an upper computer processes the operation result corresponding to the calculation task. In this way, the data corresponding to the calculation task can be efficiently read through the hierarchical cache structure of the independent first-level cache and the shared second-level cache, cache resources are managed in a centralized mode, and delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of caching technology, and in particular to a task execution method, apparatus, device, and storage medium. Background Art

[0002] GPUs (Graphics Processing Units) typically contain multiple Stream Multiprocessors (SMPs). These SMPs significantly accelerate computation by executing different data streams simultaneously. However, with the increasing number of cores, efficiently managing the memory hierarchy, especially the L2 cache, becomes a significant challenge for improving overall system efficiency. In traditional GPU designs, each stream multiprocessor may have its own independent L2 cache. While this design ensures the independence of each core and fast data access, it suffers from resource waste, data redundancy, and complex cache consistency maintenance. Especially under highly parallel workloads, where data is frequently transferred between cores, independent caches lead to a large amount of data migration and invalid cache line flushing, severely impacting system performance and energy efficiency.

[0003] Therefore, reducing data transmission latency and improving cache hit rate are problems that need to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a task execution method, apparatus, device, and storage medium that, through a hierarchical caching structure of independent first-level cache and shared second-level cache, can efficiently read data corresponding to computing tasks, centrally manage cache resources, and reduce latency. The specific solution is as follows:

[0005] In a first aspect, this application provides a task execution method applied to a streaming multiprocessor, comprising:

[0006] The computing task generated by the host computer generates a read request for its own L1 cache; each streaming multiprocessor has an independent L1 cache; each computing task has instruction data and operand data.

[0007] If the read request does not find data in the first-level cache, the read request is forwarded to a preset cross-matrix through the first-level cache, so that the read request can be forwarded to a second-level cache shared by several streaming multiprocessors through the preset cross-matrix; the preset cross-matrix integrates an arbitrator and a route, which is used to forward the read request to the second-level cache according to the arbitration mechanism and the address space corresponding to the read request;

[0008] Based on the read request, the instruction data or operand data corresponding to the computing task are read from the second-level cache via the first-level cache;

[0009] The computing task is executed according to the read instruction data or the operand data, and the corresponding computing result is cached in the secondary cache so that the host computer can process the computing result corresponding to the computing task.

[0010] Optionally, the step of generating read requests for its own first-level cache based on the computing task generated by the host computer includes:

[0011] The computing tasks generated by the host computer activate their own scheduling units to generate several thread bundles;

[0012] The initial instruction address corresponding to the computing task and the name of the thread bundle are passed to its own instruction fetch unit, so that the instruction fetch unit can parse the initial instruction address and the name of the thread bundle, and generate a read request for its own first-level cache based on the parsing result.

[0013] Optionally, the method further includes:

[0014] If the read request hits data in the first-level cache, the instruction data or operand data corresponding to the computing task is read from the first-level cache through the read request, so as to execute the computing task according to the read instruction data or operand data.

[0015] Optionally, reading instruction data or operand data corresponding to the computing task from the first-level cache via the read request includes:

[0016] After reading the corresponding instruction data or operand data locally from the first-level cache according to the read request, the instruction data or operand data read from the first-level cache is cached in a preset buffer corresponding to the streaming multiprocessor;

[0017] Read instruction data or operand data corresponding to the computing task from the preset buffer.

[0018] Optionally, forwarding the read request to a preset crossbar matrix through the first-level cache, so as to forward the read request to a second-level cache shared by a plurality of streaming multiprocessors through the preset crossbar matrix, includes:

[0019] The read request is forwarded to the first interface coupler of the preset cross matrix through its corresponding mainline interface of the first-level cache. The preset cross matrix then uses its internally integrated read arbitrator and routing to forward the read request to the second interface coupler. The second interface coupler then uses the slave interface corresponding to the second-level cache to pass the read request to the second-level cache, thus completing the process of forwarding the read request to the second-level cache shared by several streaming multiprocessors.

[0020] Optionally, executing the computation task based on the read instruction data or operand data includes:

[0021] The execution unit selects a target computing unit that matches the computing task; the target computing unit includes a logic computing unit, a floating-point computing unit, a memory access unit, and a function unit.

[0022] The target computing unit executes the computing task corresponding to the read instruction data or operand data to obtain the corresponding calculation result.

[0023] Optionally, caching the corresponding calculation result in the second-level cache includes:

[0024] The calculation result is forwarded to the third interface coupler of the preset cross matrix through the master line interface of the first-level cache, so that the preset cross matrix forwards the calculation result to the fourth interface coupler using the internally integrated write arbiter and routing, and caches the calculation result in the second-level cache through the fourth interface coupler using the slave line interface corresponding to the second-level cache.

[0025] Secondly, this application provides a task execution apparatus for use in a streaming multiprocessor, comprising:

[0026] A read request generation module is used to generate a read request for its own first-level cache based on a computing task generated by the host computer; the streaming multiprocessor corresponds to an independent first-level cache; the computing task corresponds to instruction data and operand data;

[0027] A forwarding module is used to forward the read request to a preset cross-matrix through the first-level cache when the read request does not find data in the first-level cache, so that the read request can be forwarded to a second-level cache shared by several streaming multiprocessors through the preset cross-matrix; the preset cross-matrix integrates an arbitrator and a route, which is used to forward the read request to the second-level cache according to the arbitration mechanism and the address space corresponding to the read request;

[0028] The data reading module is used to read instruction data or operand data corresponding to the computing task from the second-level cache through the first-level cache based on the read request;

[0029] The task execution module is used to execute the calculation task according to the read instruction data or operand data, and cache the corresponding calculation results in the secondary cache so that the host computer can process the calculation results corresponding to the calculation task.

[0030] Thirdly, this application provides an electronic device, comprising:

[0031] Memory, used to store computer programs;

[0032] A processor for executing the computer program to implement the task execution method as described above.

[0033] Fourthly, this application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the task execution method described above.

[0034] Therefore, the streaming multiprocessor in this application can generate read requests for its own L1 cache based on the computing tasks generated by the host computer; each streaming multiprocessor has an independent L1 cache; each computing task has instruction data and operand data; if the read request does not find data in the L1 cache, the read request is forwarded to a preset cross-matrix through the L1 cache, so that the read request is forwarded to a L2 cache shared by several streaming multiprocessors through the preset cross-matrix; the preset cross-matrix integrates an arbitrator and a route, used to forward the read request to the L2 cache according to the arbitration mechanism and the address space corresponding to the read request; then, based on the read request, the instruction data or operand data corresponding to the computing task is read from the L2 cache through the L1 cache; then, the computing task is executed according to the read instruction data or operand data, and the corresponding calculation result is cached in the L2 cache so that the host computer can process the calculation result corresponding to the computing task. In this way, this application constructs a level 1 cache within each streaming multiprocessor, and allocates appropriate cache space for each streaming multiprocessor within a level 2 cache according to the number of streaming multiprocessors and their address space. Through the hierarchical cache structure of independent level 1 cache and shared level 2 cache, the data corresponding to the computing task can be read efficiently. The shared level 2 cache allows for centralized management of cache resources, allowing all streaming multiprocessors to access the same cache pool, reducing data copying, lowering data transmission latency, and improving cache hit rate. Furthermore, this hierarchical cache structure has high flexibility and adaptability, and can meet diverse application requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0036] Figure 1 A flowchart of a task execution method disclosed in this application;

[0037] Figure 2 A flowchart of a specific task execution method disclosed in this application;

[0038] Figure 3 A schematic diagram of a cross matrix disclosed in this application;

[0039] Figure 4 This is a schematic diagram of a crosspoint-based M×S crossbar switch architecture disclosed in this application;

[0040] Figure 5 A schematic diagram of the connection relationship between a streaming multiprocessor and a secondary cache disclosed in this application;

[0041] Figure 6 This is a structural diagram of a task execution device disclosed in this application;

[0042] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0044] See also Figure 1 As shown, an embodiment of the present invention discloses a task execution method applied to a streaming multiprocessor, comprising:

[0045] Step S11: Generate a read request for its own first-level cache based on the computing task generated by the host computer; the streaming multiprocessor corresponds to an independent first-level cache; the computing task corresponds to instruction data and operand data.

[0046] Understandably, after the host computer generates a parallel computing task, it will cache the instruction data and operand data required for the computing task in the L1 or L2 cache of the corresponding streaming multiprocessor. The relevant streaming multiprocessor first generates a read request for its own L1 cache based on the computing task to be executed, in order to attempt to read the instruction data and operand data required for the computing task from the L1 cache.

[0047] In a specific embodiment, the process of generating a read request for its own L1 cache based on the computing task generated by the host computer may include: activating its own scheduling unit based on the computing task generated by the host computer to generate several thread bundles; passing the initial instruction address corresponding to the computing task and the name of the thread bundle to its own instruction fetch unit, so that the instruction fetch unit can parse the initial instruction address and the name of the thread bundle, and generate a read request for its own L1 cache based on the parsing result. Specifically, when the streaming multiprocessor needs to execute the computing task of the host computer, it first activates its internal scheduling unit to generate active thread bundles. If two active thread bundles are generated simultaneously, parameters such as the initial instruction address and the ID (Identity) of the active thread bundle are passed to the instruction fetch unit; after parsing the received instruction address and other parameter information, the instruction fetch unit generates a read request signal to read the instruction data and operand data required by the computing task from the L1 cache.

[0048] Step S12: If the read request does not find data in the first-level cache, the read request is forwarded to a preset cross-matrix through the first-level cache, so that the read request can be forwarded to a second-level cache shared by several streaming multiprocessors through the preset cross-matrix; the preset cross-matrix integrates an arbitrator and a route, which is used to forward the read request to the second-level cache according to the arbitration mechanism and the address space corresponding to the read request.

[0049] In this embodiment, if the Level 1 cache reads the corresponding cache based on the address information corresponding to the read request but fails to find the data, the read request can be forwarded to a preset cross-matrix, which then forwards the read request to the shared Level 2 cache. The preset cross-matrix integrates an arbitrator and address forwarding routing. The arbitrator includes a read arbitrator for read requests and a write arbitrator for write requests. The arbitration mechanism of the preset cross-matrix can forward the read request to the corresponding cache area of ​​the Level 2 cache based on the address space corresponding to the read request. In a specific embodiment, the cross-matrix (AXI-Crossbar, a cross-matrix based on the AXI (Advanced eXtensible Interface, a bus protocol) bus) can include a master-slave AXI interface coupling module and a Crossbar module. The master-slave interface coupling module is responsible for interconnecting multiple Master (main line, connected to the Level 1 cache) interfaces or Slave (slave line, connected to the Level 2 cache) interfaces with the Crossbar module to form a cross-matrix, supporting data caching and data bit width conversion. The Crossbar module integrates an arbitrator and routing functions, and is responsible for data routing and forwarding between the master and slave interfaces. If a 3x3 master-slave interconnection network is formed through an AXI-Crossbar crossbar matrix, then Master 0 (the main line connecting the first-level cache corresponding to the streaming multiprocessor with sequence number 0 and the crossbar matrix) is connected to the Crossbar module through the AXI interface coupling module and can realize data forwarding with any interface of Slave 0 to 3.

[0050] In one specific embodiment, forwarding the read request to a preset cross-matrix via the first-level cache, so that the read request can be forwarded to a second-level cache shared by several streaming multiprocessors via the preset cross-matrix, may include: forwarding the read request to a first interface coupler of the preset cross-matrix via the first-level cache through its corresponding mainline interface, so that the preset cross-matrix can forward the read request to a second interface coupler using its internally integrated read arbitrator and routing, and then passing the read request to the second-level cache through the second interface coupler using the slave interface corresponding to the second-level cache, thereby completing the process of forwarding the read request to a second-level cache shared by several streaming multiprocessors. Specifically, the L1 caches of different streaming multiprocessors are connected to the preset cross-matrix via separate mainline interfaces, while the preset cross-matrix is ​​connected to the L2 cache via several slaveline interfaces. The L1 cache can forward read requests to the first interface coupler of the preset cross-matrix through the mainline interface. The first interface coupler is used to receive read requests forwarded by the L1 cache. Then, the preset cross-matrix can use its internally integrated read arbitrator and corresponding routing to forward the read requests, and the second interface coupler forwards the read requests to the corresponding cache area of ​​the L2 cache.

[0051] Step S13: Based on the read request, read the instruction data or operand data corresponding to the computing task from the second-level cache via the first-level cache.

[0052] Furthermore, when a read request is forwarded to the L2 cache, the L2 cache returns the instruction data or operand data to the streaming multiprocessor via the L1 cache. It is understood that the streaming multiprocessor can cache the data read from the cache into its own corresponding preset buffer for task operations.

[0053] In one specific embodiment, the method may further include: if the read request hits data in the L1 cache, then the instruction data or operand data corresponding to the computing task is read from the L1 cache through the read request, so as to execute the computing task according to the read instruction data or operand data. Specifically, after the read request issued by the streaming multiprocessor to the L1 cache hits data in the L1 cache, it can directly read the instruction data or operand data corresponding to the computing task from the L1 cache. Further, the step of reading the instruction data or operand data corresponding to the computing task from the L1 cache through the read request may include: after reading the corresponding instruction data or operand data locally from the L1 cache according to the read request, caching the instruction data or operand data read from the L1 cache to a preset buffer corresponding to the streaming multiprocessor; and reading the instruction data or operand data corresponding to the computing task from the preset buffer. The L1 cache can cache the read instruction data or operand data to a preset buffer of the thread bundle corresponding to the streaming multiprocessor. Then, the streaming multiprocessor can read the corresponding instruction data or operand data from the preset buffer to perform the computing task.

[0054] Step S14: Execute the computing task according to the read instruction data or the operand data, and cache the corresponding computing result in the secondary cache so that the host computer can process the computing result corresponding to the computing task.

[0055] In an embodiment of the present application, when the streaming multiprocessor reads the instruction data and operand data corresponding to the computing task, it executes the computing task and can cache the corresponding calculation results to the secondary cache for processing by the host computer.

[0056] In one specific embodiment, executing the computation task based on the read instruction data or operand data may include: selecting a target computation unit matching the computation task through its own execution unit; the target computation unit includes a logic computation unit, a floating-point computation unit, a memory access unit, and a function unit; and using the target computation unit to execute the computation task corresponding to the read instruction data or operand data to obtain the corresponding computation result. The execution unit of the streaming multiprocessor will, based on the received operand data and related instruction data, select a target computation unit matching the computation task according to the type of the computation task, and use the selected target computation unit to complete the computation process of the computation task to obtain the corresponding computation result. Further, caching the corresponding computation result in the secondary cache may include: forwarding the computation result to the third interface coupler of the preset cross-matrix through the main interface of the primary cache, so that the preset cross-matrix uses its internally integrated write arbitrator and routing to forward the computation result to the fourth interface coupler, and then using the fourth interface coupler to cache the computation result in the secondary cache through the slave interface corresponding to the secondary cache. Specifically, after the streaming multiprocessor obtains the computation result corresponding to the computation task, it forwards the computation result to the third interface coupler of the preset cross matrix through the main interface of the first-level cache. The third interface coupler is used to receive data write requests. Then, the preset cross matrix forwards the computation result to the fourth interface coupler through the internally integrated write arbitrator and related routing. The fourth interface coupler caches the computation result to the second-level cache through the corresponding slave interface so that the host computer can process the computation result.

[0057] Therefore, this application constructs a level 1 cache within each stream multiprocessor, and allocates appropriate cache space for each stream multiprocessor within a level 2 cache according to the number of stream multiprocessors and their address spaces. Through the hierarchical cache structure of independent level 1 cache and shared level 2 cache, data corresponding to computing tasks can be read efficiently, and cache resources can be centrally managed through the shared level 2 cache. When different stream multiprocessors interact with each other, data interaction can be achieved simply by using the address spaces corresponding to the stream multiprocessors, thus optimizing data access efficiency, reducing conflicts, and improving overall computing performance.

[0058] like Figure 2 As shown, the embodiment of the present application discloses a task execution method applied to a streaming multiprocessor, including:

[0059] A streaming multiprocessor can include a scheduling unit, L1-Icache (Instruction Cache, the instruction cache of the first-level cache), an instruction fetch unit, a decoding unit, an operand collection unit, a register file, an L1-Dcache (Data Cache, the data cache of the first-level cache), an execution unit, and a write-back unit. The scheduling unit (which maintains the thread bundle PC host table) is responsible for activating the thread bundle and generating relevant parameter information to pass to the instruction fetch unit. The instruction fetch unit parses the relevant parameters passed by the previous level to generate a request signal for the L1-Icache. After receiving the request signal from the instruction fetch unit, the L1-Icache reads the instruction data according to the corresponding request information. If the read misses, the request information will continue to be passed to the L2-Cache (second-level cache) via the AXI-Crossbar cross matrix until the instruction data is read and then returned to the instruction fetch unit. The decoder receives instruction data from the instruction fetch unit and parses it, extracting information such as the source operand address and destination address based on the instruction type. The decoder then passes the operand and other information to the operand collection unit, which reads the register file or L1-D cache based on the operand type and address. When the operand is located in the L1-D cache, the read process is similar to the instruction data. If the data misses, a read request is sent to the L2-cache. Furthermore, after the instruction data and operand collection are complete, the operand is passed to the execution unit, which integrates a logic calculation unit, a floating-point calculation unit, a memory access unit, and a function unit. Based on the type of computational task, the execution unit selects the appropriate computation unit for computation. After execution, the computation result is written back to the corresponding cache based on the destination type and address, completing a complete pipeline operation. The L1-cache can include two types: L1-Icache and L1-Dcache. It integrates a request arbitration module, a response arbitration module, a response cache buffer, a bypass forwarding module, and cache RAM. When receiving data read requests from multiple warps at the same time, the request arbitration module prioritizes the warp IDs and performs round-robin processing. When the relevant data is read from the cache RAM, it is cached in the corresponding buffer according to the warp ID through the response arbitration module, and then processed in round-robin. If the data is not hit, the read request is forwarded to the L2-Cache through the bypass forwarding module via the AXI-Crossbar cross matrix to continue reading the data. Figure 3 The diagram shows an AXI-Crossbar cross-matrix. The Crossbar section includes a read arbitrator for handling read requests (AR / R) and a write arbitrator for handling write requests (AW / W), both of which forward data based on routing. Furthermore, as... Figure 4The figure shows an M×S crossbar switch architecture based on crosspoints. Each crosspoint has a switch controlled by a select signal, which controls the crosspoint's on / off state and determines the connection between input and output ports. The select signal is generated by the crossbar router. When multiple nodes simultaneously initiate communication requests to the same node, an arbiter using a round-robin strategy determines which port's interface coupling buffer the incoming data originates from. When data is removed from the interface buffer, the corresponding storage resources are released. If the buffer is full, the output port deasserts the buffer available signal, temporarily blocking subsequent communication requests. When a transmission task from port M to port S is urgently needed, it prepares the data to be sent and simultaneously sends a transmission request signal and transmission information, such as the destination port number, to the crossbar controller. If the data path is available, the crossbar controller asserts the select signal of the (M, S) switch and simultaneously sends a ready-to-send feedback signal to port M. After receiving the feedback signal, data enters the crossbar from port M and leaves the crossbar network along the data path at port S. When the (M, S) select signal is asserted, the crossbar controller sends a transmission request signal to port S. Once the data is correctly received and buffered by port S, port S sends a corresponding response signal to the crossbar controller. The controller then sends the response signal back to port M, signaling the completion of the communication task and freeing up storage space. The corresponding crosspoint switch is then closed.

[0060] like Figure 5 The figure shows the connection relationship between the streaming multiprocessor and the L2 cache. It can be seen that the L1-cache includes two types: L1-Icache and L1-Dcache. Each streaming multiprocessor corresponds to one L1-cache. The L1-cache is connected to the AXI-Crossbar matrix via a master line. The AXI-Crossbar matrix is ​​connected to the L2 cache via a slave line. The L2 cache corresponds to different cache areas based on the address space of the streaming multiprocessor. In a specific embodiment, the L1-cache can integrate a request arbitration module, a response arbitration module, a response buffer, a bypass forwarding module, and cache RAM. When multiple thread warps simultaneously receive read requests, the request arbitration module prioritizes them according to the thread warp IDs and performs round-robin processing. When the relevant data is read from the cache RAM, it is cached in the corresponding buffer according to the thread warp ID through the response arbitration module, and the round-robin processing is repeated. If the data does not hit, the read request is forwarded to the L2-cache via the bypass forwarding module through the AXI-Crossbar matrix to continue reading the data.

[0061] In a specific embodiment, after the host computer generates a parallel computing task, it first caches the instructions and operands required for this computing task into the L2-Cache, and allocates the necessary streaming multiprocessor and its corresponding L2-Cache space for this task. Correspondingly, the streaming multiprocessor SMP0 activates its internal scheduling unit to generate active thread bundles. If two active thread bundles W0 and W1 are generated simultaneously, parameters such as the initial instruction address and the ID of the active thread bundle are passed to the instruction fetch unit. After parsing the received instruction address and other parameter information, the instruction fetch unit generates read request signals Req.W0 and Req.W1 to read the instruction data from the L1-I cache. When the request arbitration module in the L1-I cache detects the read request signal, it sequentially reads the corresponding cache according to the address information. If the data hits, the instruction data is cached into response buffer.W0 and buffer.W1 respectively through the response arbitration module, and then retrieved sequentially by the instruction fetch unit. Conversely, if a data miss occurs, the L1-ICache bypass forwarding module forwards the request signals IReq.W0 and IReq.W1 sequentially to the AXI-Crossbar cross-connect matrix. The SMP0 read request is accessed from the Master0 side via the interconnection network, and after passing through the arbitrator and routing forwarding, it is passed from the Slave0 side to the L2-Cache, where data is read from the designated SMP0 cache area. The read data is then cached in the corresponding buffer by the L1-Icache's acknowledgment arbitration module. Finally, the instruction fetch unit reads the data and forwards it to the decoding unit. Upon receiving the instruction data from the instruction fetch unit, the decoding unit parses it, determining the location of the source operands, the location of the calculation results, and the required computation unit type based on the instruction type protocol. This information is then passed to the operand collection unit, which reads the register file or L1-Dcache according to the corresponding operand type and address. When the operand is located in the register file, it can be read directly from the register address. When the operand is located in the L1-D cache, read request signals DReq.W0 and DReq.W1 are generated. This process is the same as the instruction data request and response flow. If the data is hit, the operand is returned directly. If the data is not hit, the read request signal needs to be forwarded to the L2-Cache. Finally, after all the necessary operands are collected, they are passed to the execution unit. Further, after receiving the operand and related instruction information, the execution unit selects the appropriate computing unit to perform the operation according to the type of computation task, including the logic computing unit, floating-point computing unit, memory access unit, and function unit. After the execution is completed, the operation result is cached in the corresponding register file or L1-D cache through the write-back unit according to the destination type and address. At this point, a complete pipeline operation of SMP0 is completed.Understandably, when a computational task is assigned to multiple SMPs, each SMP will generate multiple active thread bundles to complete the relevant computations. By repeating the above steps, the computation results of all SMPs will eventually be cached in the L2-Cache and processed by the host computer.

[0062] This application constructs a Level 1 cache within each streaming multiprocessor, and allocates appropriate cache space for each streaming multiprocessor within a Level 2 cache based on the number of streaming multiprocessors and their address spaces. Through this hierarchical cache structure of independent Level 1 cache and shared Level 2 cache, data corresponding to computational tasks can be read efficiently. The shared Level 2 cache allows for centralized management of cache resources, enabling all streaming multiprocessors to access the same cache pool, reducing data copying, lowering data transfer latency, and improving cache hit rate. Furthermore, this hierarchical cache structure possesses high flexibility and adaptability, and can meet diverse application requirements.

[0063] Therefore, this application constructs a Level 1 cache within each streaming multiprocessor and allocates appropriate cache space for each streaming multiprocessor within a Level 2 cache based on the number of streaming multiprocessors and their address spaces. Through this hierarchical caching structure of independent Level 1 caches and shared Level 2 caches, data corresponding to computational tasks can be read efficiently. The shared Level 2 cache allows for centralized management of cache resources. Compared to the scheme of independent Level 2 caches for each streaming multiprocessor, while ensuring the independence of each core and data access speed, it suffers from resource waste, data redundancy, and complex cache consistency maintenance. Especially under highly parallel workloads, where data is frequently transferred between cores, independent caches lead to significant data migration and invalid cache line flushing, severely impacting system performance and energy efficiency. In contrast, the hierarchical caching structure of this application with a shared Level 2 cache allows all streaming multiprocessors to access the same cache pool, reducing data copying, lowering data transmission latency, and improving cache hit rate. Furthermore, this hierarchical caching structure possesses high flexibility and adaptability, meeting diverse application requirements.

[0064] like Figure 6 As shown in the figure, this application discloses a task execution device applied to a streaming multiprocessor, comprising:

[0065] The read request generation module 11 is used to generate read requests for its own L1 cache based on the computing tasks generated by the host computer; the streaming multiprocessor has an independent L1 cache; the computing task has instruction data and operand data.

[0066] In scenarios such as artificial intelligence, big data analysis, and high-end graphics rendering, the streaming multiprocessor in the GPU can execute computing tasks generated by the corresponding host computer. These computing tasks correspond to instruction data and operand data. A single streaming multiprocessor corresponds to an independent L1 cache. Furthermore, the process of a streaming multiprocessor executing a single computing task specifically involves generating a read request for its own L1 cache based on the computing task using its own read request generation model. This read request allows the streaming multiprocessor to read the instruction data and L1 operand data related to the current computing task from its corresponding independent L1 cache.

[0067] a forwarding module 12 configured to forward the read request to a preset crossbar matrix via the first-level cache when the read request does not hit data in the first-level cache, so as to forward the read request to a second-level cache shared by a plurality of streaming multiprocessors via the preset crossbar matrix; the preset crossbar matrix integrates an arbiter and a router, configured to forward the read request to the second-level cache based on an arbitration mechanism and an address space corresponding to the read request;

[0068] When a read request generated by a single streaming multiprocessor doesn't match data in its corresponding independent L1 cache, the forwarding module forwards the read request to a pre-set crossbar matrix. This crossbar matrix is ​​a crossbar switch connecting the L1 cache and the L2 cache (shared by several streaming multiprocessors). It integrates an arbiter and routing mechanism to facilitate data forwarding between the L1 and L2 caches. The crossbar matrix forwards the read request to the L2 cache, allowing the corresponding data to be read from the L2 cache.

[0069] Data reading module 13 is used to read instruction data or operand data corresponding to the computing task from the second-level cache through the first-level cache based on the read request;

[0070] Among them, in the streaming multiprocessor, the data reading module can be used to read the instruction data or operand data corresponding to the current computing task from the second level cache through the first level cache; the instruction data and operand data corresponding to the current computing task can be read from the first level cache and / or the second level cache through a read request.

[0071] The task execution module 14 is used to execute the computing task according to the read instruction data or the operand data, and cache the corresponding computing result in the secondary cache so that the host computer can process the computing result corresponding to the computing task.

[0072] In this process, after the streaming multiprocessor reads the instruction data and operand data corresponding to the current computing task, it can execute the computing task through the task execution module, and then cache the corresponding calculation results in the secondary cache so that the host computer can process the calculation results corresponding to the current computing task. It is understandable that the process of caching the calculation results in the secondary cache is also achieved through a preset cross-matrix data forwarding.

[0073] Therefore, this application constructs a level 1 cache within each streaming multiprocessor, and allocates appropriate cache space for each streaming multiprocessor within a level 2 cache according to the number of streaming multiprocessors and their address space. Through the hierarchical cache structure of independent level 1 cache and shared level 2 cache, the data corresponding to the computing task can be read efficiently. The shared level 2 cache allows for centralized management of cache resources, enabling all streaming multiprocessors to access the same cache pool, reducing data copying, lowering data transmission latency, and improving cache hit rate. Furthermore, this hierarchical cache structure has high flexibility and adaptability, and can meet diverse application requirements.

[0074] In one specific embodiment, the read request generation module 11 may include:

[0075] A thread bundle generation unit is used to activate its own scheduling unit based on the computing tasks generated by the host computer to generate a number of thread bundles;

[0076] The read request generation unit is used to pass the initial instruction address corresponding to the computing task and the name of the thread bundle to its own instruction fetching unit, so that the instruction fetching unit can parse the initial instruction address and the name of the thread bundle, and generate a read request for its own first-level cache based on the parsing result.

[0077] In a specific embodiment, the device may further include:

[0078] The first-level cache read module is used to read instruction data or operand data corresponding to the computing task from the first-level cache when the read request hits data in the first-level cache, so as to execute the computing task according to the read instruction data or operand data.

[0079] In another specific embodiment, the first-level cache read module may include:

[0080] The first data caching unit is used to read the corresponding instruction data or operand data from the first-level cache according to the read request, and then cache the instruction data or operand data read from the first-level cache to a preset buffer corresponding to the streaming multiprocessor.

[0081] The first data reading unit is configured to read instruction data or operand data corresponding to the computing task from the preset buffer.

[0082] In a specific embodiment, the forwarding module 12 may include:

[0083] A forwarding unit is configured to forward the read request to a first interface coupler of a preset cross matrix through the primary cache via its own corresponding master line interface, so that the preset cross matrix forwards the read request to a second interface coupler using an internally integrated read arbiter and routing, and transmits the read request to the secondary cache through the second interface coupler using a slave line interface corresponding to the secondary cache, thereby completing the process of forwarding the read request to the secondary cache shared by a plurality of streaming multiprocessors.

[0084] In one specific embodiment, the task execution module 14 may include:

[0085] A computation unit selection unit is used to select a target computation unit that matches the computation task through its own execution unit; the target computation unit includes a logic computation unit, a floating-point computation unit, a memory access unit, and a function unit.

[0086] The task execution unit is used to execute the computation task corresponding to the read instruction data or operand data using the target computing unit, and obtain the corresponding computation result.

[0087] In one specific embodiment, the task execution module 14 may include:

[0088] The second data cache unit is used to forward the calculation result to the third interface coupler of the preset cross matrix through the main line interface of the first-level cache, so that the preset cross matrix uses the internally integrated write arbiter and routing to forward the calculation result to the fourth interface coupler, and cache the calculation result to the second-level cache through the fourth interface coupler using the slave line interface corresponding to the second-level cache.

[0089] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0090] Figure 7This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the task execution method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0091] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0092] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0093] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including computer programs that can be used to complete the task execution method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0094] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned task execution method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0095] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0096] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0097] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0098] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0099] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A task execution method, It is characterized in that Applicable to streaming multiprocessors, including: Generate a read request for its own first-level cache based on the computing task generated by the host computer; the streaming multiprocessor corresponds to an independent first-level cache; the computing task corresponds to instruction data and operand data; If the read request does not hit data in the first-level cache, the read request is forwarded to a preset cross matrix through the first-level cache, so that the read request is forwarded to a second-level cache shared by a plurality of streaming multiprocessors through the preset cross matrix; an arbitrator and a router are integrated in the preset cross matrix, and are used to forward the read request to the second-level cache according to an arbitration mechanism and an address space corresponding to the read request; Reading instruction data or operand data corresponding to the computing task from the secondary cache via the primary cache based on the read request; The computing task is executed according to the read instruction data or the operand data, and the corresponding computing result is cached in the secondary cache so that the host computer can process the computing result corresponding to the computing task.

2. The task execution method according to claim 1, It is characterized in that The generating of a read request for its own first-level cache based on the computing task generated by the host computer includes: Activate its own scheduling unit based on the computing tasks generated by the host computer to generate several thread bundles; The initial instruction address corresponding to the computing task and the name of the thread warp are passed to its own instruction fetch unit, so that the instruction fetch unit parses the initial instruction address and the name of the thread warp, and generates a read request for its own first-level cache according to the parsing result.

3. The task execution method according to claim 1, It is characterized in that Also includes: If the read request hits data in the first-level cache, instruction data or operand data corresponding to the computing task is read from the first-level cache through the read request, so as to execute the computing task according to the read instruction data or operand data.

4. The task execution method according to claim 3, It is characterized in that The reading instruction data or operand data corresponding to the computing task from the first-level cache through the read request includes: After reading the corresponding instruction data or operand data locally from the first-level cache according to the read request, the instruction data or operand data read from the first-level cache is cached in a preset buffer corresponding to the streaming multiprocessor; The instruction data or operand data corresponding to the computing task is read from the preset buffer.

5. The task execution method according to claim 1, It is characterized in that The step of forwarding the read request to a preset cross matrix through the first-level cache, so as to forward the read request to a second-level cache shared by a plurality of streaming multiprocessors through the preset cross matrix, comprises: The read request is forwarded by the first-level cache via its own corresponding main line interface to the first interface coupler of a preset cross matrix, so that the preset cross matrix uses the internally integrated read arbiter and routing to forward the read request to the second interface coupler, and the read request is passed to the second-level cache via the second interface coupler using the slave line interface corresponding to the second-level cache, so as to complete the process of forwarding the read request to the second-level cache shared by several streaming multiprocessors.

6. The task execution method according to any one of claims 1 to 5, It is characterized in that The performing of the computing task according to the read instruction data or the operand data includes: Selecting a target computing unit that matches the computing task through its own execution unit; the target computing unit includes a logic computing unit, a floating-point computing unit, a memory access unit and a function unit; The target computing unit is used to execute the computing task corresponding to the read instruction data or operand data to obtain a corresponding computing result.

7. The task execution method according to claim 6, It is characterized in that The step of caching the corresponding operation result into the secondary cache comprises: The calculation result is forwarded to the third interface coupler of the preset cross matrix through the master line interface of the first-level cache, so that the preset cross matrix forwards the calculation result to the fourth interface coupler using the internally integrated write arbiter and routing, and caches the calculation result to the second-level cache through the fourth interface coupler using the slave line interface corresponding to the second-level cache.

8. A task execution device, It is characterized in that Applicable to streaming multiprocessors, including: A read request generation module, used to generate a read request for its own first-level cache based on a computing task generated by a host computer; the streaming multiprocessor corresponds to an independent first-level cache; the computing task corresponds to instruction data and operand data; A forwarding module, used for forwarding the read request to a preset cross matrix through the first-level cache when the read request does not hit data in the first-level cache, so as to forward the read request to the second-level cache shared by a plurality of streaming multiprocessors through the preset cross matrix; an arbitrator and a router are integrated in the preset cross matrix, and used for forwarding the read request to the second-level cache according to an arbitration mechanism and an address space corresponding to the read request; A data reading module, configured to read instruction data or operand data corresponding to the computing task from the secondary cache via the primary cache based on the read request; The task execution module is used to execute the computing task according to the read instruction data or the operand data, and cache the corresponding computing result to the secondary cache so that the host computer can process the computing result corresponding to the computing task.

9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the task execution method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that Used to store a computer program, which, when executed by a processor, implements the task execution method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-core memory system simulator on basis of network-on-chip interconnection

    CN103914333A

  • Matrix of on-chip routers interconnecting a plurality of processing engines and a method of routing using thereof

    CN104954254A

  • Apparatus and method for on-chip crossbar design in a network switch using benes network

    US20170024346A1

  • Methods for increasing instruction-level parallelism in microprocessors and digital system

    US6988183B1

Cited By

  • Data transmission system and method based on SoC bus

    CN119311623A

  • Data transmission system and method based on SoC bus

    CN119311623B

  • Arithmetic logic unit, instruction processing method and computer equipment

    CN121858068A

  • Task execution method and apparatus, device, and storage medium

    WO2026040515A1