Register resource dynamic scheduling system

By designing a register resource dynamic scheduling system in GPGPU and using active thread register group expansion and first-level cache expansion strategies, the problem of register resource waste when branch instructions are executed is solved, and register resource utilization and computing performance are improved.

CN118377536BActive Publication Date: 2024-10-01SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410814044.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-01
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

During the working process of the GPGPU, when executing branch instructions, not all threads in the thread warp are in an active state, resulting in a waste of register resources. Existing technologies are difficult to effectively schedule and reallocate, resulting in low utilization of register resources and affecting computing performance.

Method used

Design a register resource dynamic scheduling system, through the user application layer, compilation optimization layer and device driver layer, combined with the thread block scheduling module, register file module and storage resource scheduling module, to achieve the overall scheduling of register resources based on the execution of branch instructions. For reallocation, the active thread register group expansion and first-level cache expansion strategies are adopted to improve the utilization of register resources.

Benefits of technology

Through the dynamic scheduling and reallocation of register resources, the utilization of register resources is improved, the memory access delay is reduced, the computing performance is improved, and the probability of thread pipeline blocking caused by register overflow is reduced, and the prefetching and Caching capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377536B_ABST
    Figure CN118377536B_ABST
Patent Text Reader

Abstract

The present invention discloses a register resource dynamic scheduling system, which belongs to the technical field of GPGPU register resource management. The technical problem to be solved by the present invention is how to perform overall scheduling and reallocation of register resources according to the execution status of branch instructions, so as to improve the utilization rate of register resources and further improve the computing performance. The technical scheme adopted is as follows: the system comprises a user application layer, a compilation optimization layer and a device driver layer algorithm acceleration layer, wherein the user application layer, the compilation optimization layer and the device driver layer are located on a host Host; the user application layer provides a development platform and an application environment for users and developers, and users use a high-level language to write an acceleration function kernel on the development platform; the algorithm acceleration layer is GPGPU, and GPGPU, as a coprocessor, uses an acceleration unit inside the GPGPU to execute the acceleration function kernel in a highly parallel manner, so as to realize algorithm acceleration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of GPGPU register resource management, in particular to a register resource dynamic scheduling system. Background Art

[0002] The storage structure of GPGPU (General-Purpose computing on Graphics Processing Units) usually includes global memory, system memory, shared memory, L1 Cache (first-level cache), L2 Cache (second-level cache) and register files. The register file is the most important part of the storage structure, providing data access speed that matches the computing kernel. GPGPU has a large number of register resources, which can ensure zero-overhead warp switching and effectively hide long-latency operations.

[0003] Usually, GPGPU will statically allocate registers to each thread so that each thread can have a certain number of registers to prevent performance degradation caused by register overflow. However, during the operation of GPGPU, it cannot be guaranteed that the SP inside the SM is always in a working state, especially when executing branch instructions, only a part of the threads in the thread warp are executed. Although with the continuous iteration of technology at this stage, strategies such as cooperative groups have emerged that can effectively avoid idle thread warps, it is still impossible to guarantee saturated operation of all threads. At this time, the register resources bound to the idle threads will be idle, resulting in a waste of resources.

[0004] Therefore, how to perform overall scheduling and reallocation of register resources according to the execution status of branch instructions, improve the utilization rate of register resources, and further improve computing performance is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The technical task of the present invention is to provide a register resource dynamic scheduling system to solve the problem of how to perform overall scheduling and reallocation of register resources according to the execution status of branch instructions, improve the utilization rate of register resources, and further improve computing performance.

[0006] The technical task of the present invention is achieved in the following manner: a register resource dynamic scheduling system, the system includes a user application layer, a compilation optimization layer, and a device driver level algorithm acceleration layer, the user application layer, the compilation optimization layer, and the device driver layer are located on a host Host, the host Host includes a CPU and a memory, and the CPU is used as a main processor to complete the establishment, allocation, scheduling, and release of tasks;

[0007] The user application layer provides users and developers with a development platform and application environment. Users use high-level languages ​​(opencl, cuda c, etc.) to write acceleration function kernels on the development platform.

[0008] The algorithm acceleration layer is GPGPU. GPGPU acts as a coprocessor to accelerate the algorithm by executing the acceleration function kernel in a highly parallel manner using a large number of acceleration units inside GPGPU for computationally intensive computing tasks that the CPU is not good at.

[0009] The compilation optimization layer compiles the acceleration function kernel and optimizes it according to GPGPU to generate a binary executable file that can be used by the hardware;

[0010] The device driver layer provides environment and support for GPGPU task scheduling, file execution and data communication;

[0011] Among them, GPGPU includes AXI interface, thread block scheduling module, L2 Cache module, GPGPU memory, GPGPU configuration module and at least one streaming multiprocessor (SM). The AXI interface serves as an internal interconnection bus to establish a connection between the GPGPU memory and the host memory to achieve data communication; the thread block scheduling module is used to implement the execution scheduling of thread blocks; the GPGPU configuration module is used to configure the control parameters of GPGPU; the L2 cache module is used to implement prefetching of data and instructions, reduce the memory access pressure of SM, and improve data exchange efficiency; the streaming multiprocessor serves as the computing unit of GPGPU.

[0012] Preferably, the stream multiprocessor includes a warp scheduling module, a register file module, a level 1 cache (L1Cache) module, a shared memory module, a storage resource scheduling module and a pipeline module;

[0013] Among them, the thread warp scheduling module is used to implement the scheduling and maintenance of thread warps;

[0014] The register file module and shared memory module are used to cache data and intermediate calculation results during the operation process;

[0015] The first-level cache module is used to implement pre-fetching, storage and refreshing of data and instructions, improve the memory access efficiency of the streaming multiprocessor, and reduce the memory access latency;

[0016] The storage resource scheduling module is used to implement the overall scheduling and reallocation of register resources when GPGPU executes branch instructions according to different register reallocation strategies. By reallocating the register groups of idle threads, the register groups of active threads or the L1 cache can be expanded to improve the utilization of register resources, reduce memory access latency, and improve computing performance.

[0017] The pipeline module is used to complete instruction fetching, decoding, data reading, execution and result writing back; among them, the execution stage of the pipeline module distributes several threads in a thread bundle to each streaming multiprocessor for execution; the streaming multiprocessor is the smallest computing unit of GPGPU, completing the arithmetic logic unit (ALU), flow control (Flow) and floating-point unit (FPU).

[0018] More preferably, the register reallocation strategy includes an active thread register expansion strategy and a first-level cache expansion strategy;

[0019] When executing the active thread register group expansion strategy, the idle register groups are scattered and reorganized, and the register resources are evenly distributed to each active register group according to the number of active register groups to achieve register group expansion; the active thread register expansion strategy increases the register group capacity of the active thread, reduces the probability of pipeline blocking caused by register overflow, and a larger number of registers can store more original data or intermediate results, improving computing performance;

[0020] When executing the first-level cache expansion strategy, the idle register groups are broken up and the register space is integrated into the first-level cache, logically expanding the capacity of the first-level cache; the first-level cache expansion strategy increases the capacity of the L1 Cache, improves the prefetching and caching capabilities of the GPGPU, reduces the memory access pressure in the pipeline read stage, reduces the probability of accessing the global memory or constant parameter memory, indirectly reduces the memory access delay, and improves the pipeline efficiency and computing power.

[0021] Preferably, when executing general algorithm instructions, the storage resource scheduling module only manages the communication between the first-level cache module and the register file module. When the GPGPU executes branch instructions, the register resources are uniformly scheduled and reallocated according to the register reallocation strategy.

[0022] Preferably, the storage resource scheduling module includes a communication arbitration submodule, a policy scheduling submodule, a first-level cache control submodule, a resource scheduling submodule, a resource calculation submodule and a register file control submodule;

[0023] Among them, the communication arbitration submodule is used to realize the communication management of the pipeline module to the first-level cache module and the register file module. The pipeline module no longer directly communicates with the first-level cache module and the register file module, and the communication arbitration submodule forwards it to realize the expansion and control of the register file module and the first-level cache module; when the pipeline module initiates a read and write request to the first-level cache module, the communication arbitration submodule forwards the read and write request to the first-level cache control submodule; when the pipeline module initiates a read and write request to the register file module, the communication arbitration submodule forwards the read and write request to the register file control submodule;

[0024] The policy scheduling submodule configures the calculation parameters according to the set register reallocation policy. When the register reallocation policy is to expand the capacity of the active thread register group, it calculates and returns the number of registers and address boundaries of each register group; when the register reallocation policy is to expand the capacity of the first-level cache, it returns the number of registers of each register group and the address boundary of the first-level cache;

[0025] The resource calculation submodule performs address allocation according to the set register reallocation strategy;

[0026] There is a RAM inside the resource scheduling submodule as a resource mapping table;

[0027] The first-level cache control submodule controls the reading and writing of the first-level cache;

[0028] The register file control submodule controls the reading and writing of the register file module.

[0029] Preferably, the resource calculation submodule performs address allocation according to the set register reallocation strategy as follows:

[0030] The resource calculation submodule reads the predicate register and obtains the thread activity mask by looking up the table according to the predicate condition; determines the number of active thread register groups and idle thread register groups, and calculates the number of currently idle registers according to the number of registers in each register group and the number of idle register groups;

[0031] When the register reallocation strategy is register group expansion, the resource calculation submodule evenly distributes the free registers to each active thread group according to the number of active thread groups;

[0032] When the register reallocation strategy is to expand the capacity of the first-level cache, the resource calculation submodule uses the free registers as a whole storage space as a logical extension of the first-level cache.

[0033] Preferably, when the first-level cache submodule receives a read or write request, it determines whether the read or write address exceeds the address boundary of the first-level cache:

[0034] If the address does not exceed the boundary, the read and write operations are performed in the first-level cache, and a response signal is returned;

[0035] If the address boundary is exceeded, the read / write address is forwarded to the resource scheduling module to find the mapping address. After the data is read / written at the mapping address, a response signal is returned.

[0036] Preferably, when the register file control submodule receives a read or write request, it determines whether the read or write address exceeds the address boundary of the current register group:

[0037] If the address boundary is not exceeded, the corresponding register group is read and written, and a response signal is returned;

[0038] If the address boundary is exceeded, the read / write address will be forwarded to the resource scheduling submodule to find the mapping address, and then the data will be read / written in the register of the corresponding address and a response signal will be returned.

[0039] Preferably, the resource scheduling submodule stores the resource mapping table according to different register reallocation strategies as follows:

[0040] When the register reallocation strategy is register group expansion, the resource scheduling submodule expands the address of the active register group, maps the address exceeding the address boundary with the free register address, and stores it in the resource mapping table;

[0041] When the register reallocation strategy is to expand the first-level cache, the resource scheduling submodule will map the storage space composed of free registers with the first-level cache address, and map the address exceeding the first-level cache address boundary with the storage space address, and store them in the resource mapping table; when the first-level cache control submodule or the register file subcontrol module inputs an address exceeding the address boundary, the resource scheduling submodule will search the corresponding mapping address, that is, the free register address, from the resource mapping table according to the corresponding address.

[0042] Preferably, the working process of the storage resource scheduling module is as follows:

[0043] (i) When the GPGPU executes a branch operation instruction, the decoding stage of the pipeline module parses the instruction, determines that it is a branch instruction, and sends the predicate condition and scheduling enable to the storage resource scheduling module;

[0044] (ii) After the storage resource scheduling module detects that the scheduling is enabled, the policy scheduling submodule configures the calculation parameters according to the register reallocation strategy and sends them to the resource calculation submodule;

[0045] (III) The resource calculation submodule reads the predicate register, obtains the thread activity mask by looking up the table according to the predicate condition, and determines the number of active thread register groups and idle thread register groups; the situation is as follows:

[0046] ① If the register reallocation strategy is to expand the register group of active threads, the register resources of the idle register group are scattered and evenly distributed according to the number of active register groups;

[0047] ② If the register reallocation strategy is to expand the capacity of the first-level cache, the register resources of the idle register groups are unified and integrated, and the addresses of all idle register groups are mapped and spliced ​​into a register space with continuous addresses as a logical extension of the first-level cache;

[0048] (IV) The resource scheduling submodule logically integrates and schedules the idle register group resources according to the register reallocation strategy; the situation is as follows:

[0049] ① If the register reallocation strategy is to expand the capacity of the active thread register group, the resource scheduling submodule maps the register resources of the idle register group with the address of the active register group according to the result of the resource calculation submodule, and stores it in the resource mapping table;

[0050] ② If the reallocation strategy is to expand the capacity of the first-level cache, the resource scheduling submodule maps and links the register space integrated by the resource calculation submodule with the first-level cache address, and stores the mapping in the resource mapping table;

[0051] (V) When the pipeline module initiates a read or write request, the communication arbitration submodule determines the request type:

[0052] ① If the request type is register read or write, the request is forwarded to the register file control submodule and the process jumps to step (six) to step (eight);

[0053] ② If the request type is first-level cache read and write, the request is forwarded to the first-level cache control submodule and jumps to step (9) to step (12);

[0054] (VI) If the communication request type is register read / write, the register file control submodule determines whether the request address exceeds the address boundary of the active register group:

[0055] ① If the address boundary is not exceeded, the module communicates with the register file module according to the communication address to read and write data;

[0056] ② If the address boundary is exceeded, the request address will be forwarded to the resource scheduling submodule;

[0057] (VII) The resource scheduling submodule searches the resource mapping table according to the request address and returns the found address to the register file control submodule;

[0058] (VIII) The register file control submodule reads and writes data in the corresponding address according to the returned address, and then returns a response signal to the communication arbitration submodule, which returns the response signal to the pipeline module to complete the reading and writing of the register file module;

[0059] (IX) When the communication request type is L1 cache read / write, the L1 cache control submodule determines whether the request address exceeds the address boundary of the L1 cache:

[0060] ① If the address boundary is not exceeded, the first-level cache module is communicated with according to the communication address to read and write data;

[0061] ② If the address boundary is exceeded, the request address will be forwarded to the resource scheduling submodule;

[0062] (10) The resource scheduling submodule searches the resource mapping table according to the request address, and sends the communication request to the register file control submodule based on the found address;

[0063] (XI) The register file control submodule reads and writes data from the corresponding address according to the request, and returns a response signal to the resource scheduling submodule;

[0064] (XII) The resource scheduling submodule returns the response signal to the first-level cache control submodule, the first-level cache control submodule returns the response signal to the communication arbitration submodule, and finally returns the response signal to the pipeline module to complete the reading and writing of the first-level cache.

[0065] The register resource dynamic scheduling system of the present invention has the following advantages:

[0066] (I) The present invention performs overall scheduling and reallocation of register resources according to the execution of branch instructions, and uniformly schedules and reallocates the idle thread register group resources in a thread bundle through register reorganization, that is, by reallocating the register groups of idle threads, the active thread register group capacity expansion or L1 Cache capacity expansion is achieved, thereby improving the utilization rate of register resources, reducing memory access latency as a whole, and improving computing performance;

[0067] (ii) The present invention can increase the register group capacity of active threads by expanding the register group of active threads. It can not only expand the register group of active threads, reduce the probability of pipeline blocking caused by register overflow, reduce the memory access pressure of active threads, and improve computing efficiency, but also expand the L1 Cache, improve the pre-fetching and caching capabilities of GPGPU, reduce data memory access overhead, and improve pipeline efficiency and computing power; and a larger number of registers can store more original data or intermediate results, thereby improving the computing performance of GPGPU;

[0068] (III) The L1 Cache expansion of the present invention can increase the capacity of the L1 Cache, improve the pre-fetching and caching capabilities of the GPGPU, reduce the memory access pressure in the pipeline read stage, reduce the access probability to the global memory or constant parameter memory, indirectly reduce the memory access delay, and improve the pipeline efficiency and computing power. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] The present invention is further described below in conjunction with the accompanying drawings.

[0070] Attached Figure 1 It is a schematic diagram of the structure of the register resource dynamic scheduling system;

[0071] Attached Figure 2 It is a schematic diagram of hierarchical thread organization structure;

[0072] Attached Figure 3 A schematic diagram of the correspondence between thread instruction execution and register resources;

[0073] Attached Figure 4 For attachment Figure 1 Schematic diagram of the structure of the midstream multiprocessor;

[0074] Attached Figure 5 Schematic diagram of the working process of the register resource dynamic scheduling system. DETAILED DESCRIPTION

[0075] The register resource dynamic scheduling system of the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0076] Example: As shown in the attached Figure 1 As shown, this embodiment provides a register resource dynamic scheduling system, which includes a user application layer, a compilation optimization layer, and a device driver level algorithm acceleration layer. The user application layer, the compilation optimization layer, and the device driver layer are located on a host Host. The host Host includes a CPU and a memory. The CPU is used as a main processor to complete the establishment, allocation, scheduling, and release of tasks.

[0077] The user application layer provides users and developers with a development platform and application environment. Users use high-level languages ​​(opencl, cuda c, etc.) to write acceleration function kernels on the development platform.

[0078] The algorithm acceleration layer is GPGPU. GPGPU acts as a coprocessor to accelerate the algorithm by executing the acceleration function kernel in a highly parallel manner using a large number of acceleration units inside GPGPU for computationally intensive computing tasks that the CPU is not good at.

[0079] The compilation optimization layer compiles the acceleration function kernel and optimizes it according to GPGPU to generate a binary executable file that can be used by the hardware;

[0080] The device driver layer provides environment and support for GPGPU task scheduling, file execution and data communication;

[0081] Among them, GPGPU includes AXI interface, thread block scheduling module, L2 Cache module, GPGPU memory, GPGPU configuration module and at least one streaming multiprocessor (SM). The AXI interface serves as an internal interconnection bus to establish a connection between the GPGPU memory and the host memory to achieve data communication; the thread block scheduling module is used to implement the execution scheduling of thread blocks; the GPGPU configuration module is used to configure the control parameters of GPGPU; the L2 cache module is used to implement prefetching of data and instructions, reduce the memory access pressure of SM, and improve data exchange efficiency; the streaming multiprocessor serves as the computing unit of GPGPU.

[0082] The stream multiprocessor in this embodiment includes a warp scheduling module, a register file module, a level 1 cache (L1Cache) module, a shared memory module, a storage resource scheduling module and a pipeline module;

[0083] Among them, the thread warp scheduling module is used to implement the scheduling and maintenance of thread warps;

[0084] The register file module and shared memory module are used to cache data and intermediate calculation results during the operation process;

[0085] The first-level cache module is used to implement pre-fetching, storage and refreshing of data and instructions, improve the memory access efficiency of the streaming multiprocessor, and reduce the memory access latency;

[0086] The storage resource scheduling module is used to implement the overall scheduling and reallocation of register resources when GPGPU executes branch instructions according to different register reallocation strategies. By reallocating the register groups of idle threads, the register groups of active threads or the L1 cache can be expanded to improve the utilization of register resources, reduce memory access latency, and improve computing performance.

[0087] The pipeline module is used to complete instruction fetching, decoding, data reading, execution and result writing back; among them, the execution stage of the pipeline module distributes several threads in a thread bundle to each streaming multiprocessor for execution; the streaming multiprocessor is the smallest computing unit of GPGPU, completing the arithmetic logic unit (ALU), flow control (Flow) and floating-point unit (FPU).

[0088] Resource waste of branch instructions

[0089] Large-scale hardware multithreading is the foundation of GPGPU parallel computing. The entire GPGPU computing is organized based on threads, and all threads execute the same accelerated kernel function. Currently, GPGPU widely adopts a hierarchical thread organization structure, which divides the thread model into three layers: thread grid, thread block, and thread bundle. Figure 2 For example, the thread grid consists of four thread blocks, each of which consists of 64 threads. In GPGPU, the thread block scheduling module assigns each thread block to different SMs for execution. The thread warp scheduling module inside the SM divides the thread block into multiple thread warps. The number of threads in each thread warp is fixed. Figure 2 The number of threads in a thread warp is 32, and a thread block is divided into 2 thread warps. Thread warps are the basic unit of GPGPU computing scheduling.

[0090] GPGPU will allocate a certain size of registers to each thread in the thread bundle to store data and intermediate calculation results, to ensure that the thread will not cause pipeline blockage and performance degradation due to register overflow. However, the allocation of register resources is generally static and fixed before the task starts. In static allocation mode, the balance and stability of all thread operations can be guaranteed when executing general operation instructions. However, when GPGPU executes branch instructions (if-else), not all threads in the thread bundle are in an active state. At this time, the register resources corresponding to the idle threads will inevitably be wasted, as shown in the attached figure. Figure 3 As shown, when a branch operation instruction is executed, four threads are idle, and half of the register resources are idle, resulting in a huge waste of resources.

[0091] This embodiment performs overall scheduling and reallocation of register resources based on the execution of branch instructions. By reallocating the register groups of idle threads, the register groups of active threads or the L1 Cache are expanded, thereby improving the utilization of register resources, reducing memory access latency as a whole, and improving computing performance.

[0092] In this embodiment, the register reallocation strategy includes an active thread register expansion strategy and a first-level cache expansion strategy;

[0093] When executing the active thread register group expansion strategy, the idle register groups are scattered and reorganized, and the register resources are evenly distributed to each active register group according to the number of active register groups to achieve register group expansion; the active thread register expansion strategy increases the register group capacity of the active thread, reduces the probability of pipeline blocking caused by register overflow, and a larger number of registers can store more original data or intermediate results, improving computing performance;

[0094] When executing the first-level cache expansion strategy, the idle register groups are broken up and the register space is integrated into the first-level cache, logically expanding the capacity of the first-level cache; the first-level cache expansion strategy increases the capacity of the L1 Cache, improves the prefetching and caching capabilities of the GPGPU, reduces the memory access pressure in the pipeline read stage, reduces the probability of accessing the global memory or constant parameter memory, indirectly reduces the memory access delay, and improves the pipeline efficiency and computing power.

[0095] As attached Figure 4 As shown, this embodiment adjusts the scheduling mode of storage resources. During the pipeline execution process, it does not communicate directly with the L1 Cache and the register file, but manages communication through the storage resource scheduling module. The internal communication arbitration module will arbitrate and judge the read and write requests of the pipeline and forward them to the L1 Cache or the register file for reading and writing data.

[0096] The storage resource scheduling module in this embodiment only manages the communication between the first-level cache module and the register file module when executing general algorithm instructions. When GPGPU executes branch instructions, it will uniformly schedule and reallocate register resources according to the register reallocation strategy.

[0097] The storage resource scheduling module in this embodiment includes a communication arbitration submodule, a policy scheduling submodule, a first-level cache control submodule, a resource scheduling submodule, a resource calculation submodule and a register file control submodule;

[0098] Among them, the communication arbitration submodule is used to realize the communication management of the pipeline module to the first-level cache module and the register file module. The pipeline module no longer directly communicates with the first-level cache module and the register file module, and the communication arbitration submodule forwards it to realize the expansion and control of the register file module and the first-level cache module; when the pipeline module initiates a read and write request to the first-level cache module, the communication arbitration submodule forwards the read and write request to the first-level cache control submodule; when the pipeline module initiates a read and write request to the register file module, the communication arbitration submodule forwards the read and write request to the register file control submodule;

[0099] The policy scheduling submodule configures the calculation parameters according to the set register reallocation policy. When the register reallocation policy is to expand the capacity of the active thread register group, it calculates and returns the number of registers and address boundaries of each register group; when the register reallocation policy is to expand the capacity of the first-level cache, it returns the number of registers of each register group and the address boundary of the first-level cache;

[0100] The resource calculation submodule performs address allocation according to the set register reallocation strategy; the details are as follows:

[0101] The resource calculation submodule reads the predicate register and obtains the thread activity mask by looking up the table according to the predicate condition; determines the number of active thread register groups and idle thread register groups, and calculates the number of currently idle registers according to the number of registers in each register group and the number of idle register groups;

[0102] When the register reallocation strategy is register group expansion, the resource calculation submodule evenly distributes the free registers to each active thread group according to the number of active thread groups;

[0103] When the register reallocation strategy is to expand the capacity of the first-level cache, the resource calculation submodule uses the free registers as a whole block of storage space as a logical extension of the first-level cache;

[0104] The resource scheduling submodule has a RAM inside as a resource mapping table; the resource scheduling submodule stores the resource mapping table according to different register reallocation strategies as follows:

[0105] When the register reallocation strategy is register group expansion, the resource scheduling submodule expands the address of the active register group, maps the address exceeding the address boundary with the free register address, and stores it in the resource mapping table;

[0106] When the register reallocation strategy is to expand the capacity of the first-level cache, the resource scheduling submodule maps the storage space composed of free registers with the first-level cache address, maps the address exceeding the boundary of the first-level cache address with the storage space address, and stores it in the resource mapping table; when the first-level cache control submodule or the register file subcontrol module inputs an address exceeding the address boundary, the resource scheduling submodule finds the corresponding mapping address, i.e., the free register address, from the resource mapping table according to the corresponding address;

[0107] The first-level cache control submodule controls the reading and writing of the first-level cache; when the first-level cache submodule receives a read or write request, it determines whether the read or write address exceeds the address boundary of the first-level cache:

[0108] If the address does not exceed the boundary, the read and write operations are performed in the first-level cache, and a response signal is returned;

[0109] If the address boundary is exceeded, the read / write address is forwarded to the resource scheduling module to find the mapping address. After the data is read / written at the mapping address, a response signal is returned.

[0110] The register file control submodule controls the reading and writing of the register file module; wherein, when the register file control submodule receives a read or write request, it determines whether the read or write address exceeds the address boundary of the current register group:

[0111] If the address boundary is not exceeded, the corresponding register group is read and written, and a response signal is returned;

[0112] If the address boundary is exceeded, the read / write address will be forwarded to the resource scheduling submodule to find the mapping address, and then the data will be read / written in the register of the corresponding address and a response signal will be returned.

[0113] As attached Figure 5 As shown in the figure, the working process of the storage resource scheduling module is as follows:

[0114] (i) When the GPGPU executes a branch operation instruction, the decoding stage of the pipeline module parses the instruction, determines that it is a branch instruction, and sends the predicate condition and scheduling enable to the storage resource scheduling module;

[0115] (ii) After the storage resource scheduling module detects that the scheduling is enabled, the policy scheduling submodule configures the calculation parameters according to the register reallocation strategy and sends them to the resource calculation submodule;

[0116] (III) The resource calculation submodule reads the predicate register, obtains the thread activity mask by looking up the table according to the predicate condition, and determines the number of active thread register groups and idle thread register groups; the situation is as follows:

[0117] ① If the register reallocation strategy is to expand the register group of active threads, the register resources of the idle register group are scattered and evenly distributed according to the number of active register groups;

[0118] ② If the register reallocation strategy is to expand the capacity of the first-level cache, the register resources of the idle register groups are unified and integrated, and the addresses of all idle register groups are mapped and spliced ​​into a register space with continuous addresses as a logical extension of the first-level cache;

[0119] (IV) The resource scheduling submodule logically integrates and schedules the idle register group resources according to the register reallocation strategy; the situation is as follows:

[0120] ① If the register reallocation strategy is to expand the capacity of the active thread register group, the resource scheduling submodule maps the register resources of the idle register group with the address of the active register group according to the result of the resource calculation submodule, and stores it in the resource mapping table;

[0121] ② If the reallocation strategy is to expand the capacity of the first-level cache, the resource scheduling submodule maps and links the register space integrated by the resource calculation submodule with the first-level cache address, and stores the mapping in the resource mapping table;

[0122] (V) When the pipeline module initiates a read or write request, the communication arbitration submodule determines the request type:

[0123] ① If the request type is register read or write, the request is forwarded to the register file control submodule and the process jumps to step (six) to step (eight);

[0124] ② If the request type is first-level cache read and write, the request is forwarded to the first-level cache control submodule and jumps to step (9) to step (12);

[0125] (VI) If the communication request type is register read / write, the register file control submodule determines whether the request address exceeds the address boundary of the active register group:

[0126] ① If the address boundary is not exceeded, the module communicates with the register file module according to the communication address to read and write data;

[0127] ② If the address boundary is exceeded, the request address will be forwarded to the resource scheduling submodule;

[0128] (VII) The resource scheduling submodule searches the resource mapping table according to the request address and returns the found address to the register file control submodule;

[0129] (VIII) The register file control submodule reads and writes data in the corresponding address according to the returned address, and then returns a response signal to the communication arbitration submodule, which returns the response signal to the pipeline module to complete the reading and writing of the register file module;

[0130] (IX) When the communication request type is L1 cache read / write, the L1 cache control submodule determines whether the request address exceeds the address boundary of the L1 cache:

[0131] ① If the address boundary is not exceeded, the first-level cache module is communicated with according to the communication address to read and write data;

[0132] ② If the address boundary is exceeded, the request address will be forwarded to the resource scheduling submodule;

[0133] (10) The resource scheduling submodule searches the resource mapping table according to the request address, and sends the communication request to the register file control submodule based on the found address;

[0134] (XI) The register file control submodule reads and writes data from the corresponding address according to the request, and returns a response signal to the resource scheduling submodule;

[0135] (XII) The resource scheduling submodule returns the response signal to the first-level cache control submodule, the first-level cache control submodule returns the response signal to the communication arbitration submodule, and finally returns the response signal to the pipeline module to complete the reading and writing of the first-level cache.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A register resource dynamic scheduling system, characterized in that: The system includes a user application layer, a compilation optimization layer, and a device driver level algorithm acceleration layer. The user application layer, the compilation optimization layer, and the device driver layer are located on a host Host. The host Host includes a CPU and a memory. The CPU is used as a main processor to complete the establishment, allocation, scheduling, and release of tasks. The user application layer provides users and developers with a development platform and application environment. Users use high-level languages ​​to write acceleration function kernels on the development platform. The algorithm acceleration layer is GPGPU. GPGPU acts as a coprocessor and uses the acceleration unit inside GPGPU to execute the acceleration function kernel in a highly parallel manner to achieve algorithm acceleration. The compilation optimization layer compiles the acceleration function kernel and optimizes it according to GPGPU to generate a binary executable file that can be used by the hardware; The device driver layer provides environment and support for GPGPU task scheduling, file execution and data communication; Among them, GPGPU includes AXI interface, thread block scheduling module, L2 cache module, GPGPU memory, GPGPU configuration module and at least one stream multiprocessor. AXI interface is used as an internal interconnect bus to establish a connection between GPGPU memory and host memory to achieve data communication; thread block scheduling module is used to implement thread block execution scheduling; GPGPU configuration module is used to configure GPGPU control parameters; L2 cache module is used to implement data and instruction pre-fetching; stream multiprocessor is used as GPGPU computing unit; The stream multiprocessor includes a storage resource scheduling module, which is used to implement the overall scheduling and reallocation of register resources when the GPGPU executes branch instructions according to different register reallocation strategies, and to expand the register group of active threads or the first-level cache by reallocating the register group of idle threads.

2. The register resource dynamic scheduling system according to claim 1, characterized in that: The streaming multiprocessor also includes a warp scheduling module, a register file module, a first-level cache module, a shared memory module and a pipeline module; Among them, the thread warp scheduling module is used to implement the scheduling and maintenance of thread warps; The register file module and shared memory module are used to cache data and intermediate calculation results during the operation process; The first-level cache module is used to implement pre-fetching, storage and refreshing of data and instructions, improve the memory access efficiency of the streaming multiprocessor, and reduce the memory access latency; The pipeline module is used to complete instruction fetching, decoding, data reading, execution and result writing back; among them, the execution stage of the pipeline module distributes several threads in a thread bundle to each streaming multiprocessor for execution; the streaming multiprocessor is the smallest operation unit of GPGPU, completing the arithmetic logic operation unit, flow control and floating-point operation unit.

3. The register resource dynamic scheduling system according to claim 2, characterized in that: The register reallocation strategy includes active thread register expansion strategy and L1 cache expansion strategy; When executing the active thread register group expansion strategy, the idle register groups are scattered and reorganized, and the register resources are evenly distributed to each active register group according to the number of active register groups to achieve register group expansion; When executing the first-level cache expansion strategy, the idle register groups are broken up and the register space is integrated into the first-level cache, thereby logically expanding the capacity of the first-level cache.

4. The register resource dynamic scheduling system according to claim 1, characterized in that: When executing general algorithm instructions, the storage resource scheduling module only manages the communication between the first-level cache module and the register file module. When the GPGPU executes branch instructions, it will uniformly schedule and reallocate register resources according to the register reallocation strategy.

5. The register resource dynamic scheduling system according to claim 1, characterized in that: The storage resource scheduling module includes a communication arbitration submodule, a policy scheduling submodule, a first-level cache control submodule, a resource scheduling submodule, a resource calculation submodule and a register file control submodule; Among them, the communication arbitration submodule is used to realize the communication management of the pipeline module to the first-level cache module and the register file module. The pipeline module no longer directly communicates with the first-level cache module and the register file module, and the communication arbitration submodule forwards it to realize the expansion and control of the register file module and the first-level cache module; when the pipeline module initiates a read and write request to the first-level cache module, the communication arbitration submodule forwards the read and write request to the first-level cache control submodule; when the pipeline module initiates a read and write request to the register file module, the communication arbitration submodule forwards the read and write request to the register file control submodule; The policy scheduling submodule configures the calculation parameters according to the set register reallocation policy. When the register reallocation policy is to expand the capacity of the active thread register group, it calculates and returns the number of registers and address boundaries of each register group; when the register reallocation policy is to expand the capacity of the first-level cache, it returns the number of registers of each register group and the address boundary of the first-level cache; The resource calculation submodule performs address allocation according to the set register reallocation strategy; There is a RAM inside the resource scheduling submodule as a resource mapping table; The first-level cache control submodule controls the reading and writing of the first-level cache; The register file control submodule controls the reading and writing of the register file module.

6. The register resource dynamic scheduling system according to claim 5, characterized in that: The resource calculation submodule performs address allocation according to the set register reallocation strategy as follows: The resource calculation submodule reads the predicate register and obtains the thread activity mask by looking up the table according to the predicate condition; determines the number of active thread register groups and idle thread register groups, and calculates the number of currently idle registers according to the number of registers in each register group and the number of idle register groups; When the register reallocation strategy is register group expansion, the resource calculation submodule evenly distributes the free registers to each active thread group according to the number of active thread groups; When the register reallocation strategy is to expand the capacity of the first-level cache, the resource calculation submodule uses the free registers as a whole storage space as a logical extension of the first-level cache.

7. The register resource dynamic scheduling system according to claim 5, characterized in that: When the first-level cache submodule receives a read or write request, it determines whether the read or write address exceeds the address boundary of the first-level cache: If the address does not exceed the boundary, the read and write operations are performed in the first-level cache, and a response signal is returned; If the address boundary is exceeded, the read / write address is forwarded to the resource scheduling module to find the mapping address. After the data is read / written at the mapping address, a response signal is returned.

8. The register resource dynamic scheduling system according to claim 5, characterized in that: When the register file control submodule receives a read or write request, it determines whether the read or write address exceeds the address boundary of the current register group: If the address boundary is not exceeded, the corresponding register group is read and written, and a response signal is returned; If the address boundary is exceeded, the read / write address will be forwarded to the resource scheduling submodule to find the mapping address, and then the data will be read / written in the register of the corresponding address and a response signal will be returned.

9. The register resource dynamic scheduling system according to claim 5, characterized in that: The resource scheduling submodule stores the resource mapping table according to different register reallocation strategies as follows: When the register reallocation strategy is register group expansion, the resource scheduling submodule expands the address of the active register group, maps the address exceeding the address boundary with the free register address, and stores it in the resource mapping table; When the register reallocation strategy is to expand the first-level cache, the resource scheduling submodule will map the storage space composed of free registers with the first-level cache address, and map the address exceeding the first-level cache address boundary with the storage space address, and store them in the resource mapping table; when the first-level cache control submodule or the register file subcontrol module inputs an address exceeding the address boundary, the resource scheduling submodule will search the corresponding mapping address, that is, the free register address, from the resource mapping table according to the corresponding address.

10. The register resource dynamic scheduling system according to claim 5, characterized in that: The working process of the storage resource scheduling module is as follows: (i) When the GPGPU executes a branch operation instruction, the decoding stage of the pipeline module parses the instruction, determines that it is a branch instruction, and sends the predicate condition and scheduling enable to the storage resource scheduling module; (ii) After the storage resource scheduling module detects that scheduling is enabled, the policy scheduling submodule configures the calculation parameters according to the register reallocation strategy and sends them to the resource calculation submodule; (III) The resource calculation submodule reads the predicate register, obtains the thread activity mask by looking up the table according to the predicate condition, and determines the number of active thread register groups and idle thread register groups; the situation is as follows: ① If the register reallocation strategy is to expand the register group of active threads, the register resources of the idle register group are scattered and evenly distributed according to the number of active register groups; ② If the register reallocation strategy is to expand the capacity of the first-level cache, the register resources of the idle register groups are unified and integrated, and the addresses of all idle register groups are mapped and spliced ​​into a register space with continuous addresses as a logical extension of the first-level cache; (IV) The resource scheduling submodule logically integrates and schedules the idle register group resources according to the register reallocation strategy; the situation is as follows: ① If the register reallocation strategy is to expand the capacity of the active thread register group, the resource scheduling submodule maps the register resources of the idle register group with the address of the active register group according to the result of the resource calculation submodule, and stores it in the resource mapping table; ② If the reallocation strategy is to expand the capacity of the first-level cache, the resource scheduling submodule maps and links the register space integrated by the resource calculation submodule with the first-level cache address, and stores the mapping in the resource mapping table; (V) When the pipeline module initiates a read or write request, the communication arbitration submodule determines the request type: ① If the request type is register read or write, the request is forwarded to the register file control submodule and the process jumps to step (six) to step (eight); ② If the request type is first-level cache read and write, the request is forwarded to the first-level cache control submodule and jumps to step (9) to step (12); (VI) If the communication request type is register read / write, the register file control submodule determines whether the request address exceeds the address boundary of the active register group: ① If the address boundary is not exceeded, the module communicates with the register file module according to the communication address to read and write data; ② If the address boundary is exceeded, the request address will be forwarded to the resource scheduling submodule; (VII) The resource scheduling submodule searches the resource mapping table according to the request address and returns the found address to the register file control submodule; (VIII) The register file control submodule reads and writes data in the corresponding address according to the returned address, and then returns a response signal to the communication arbitration submodule, which returns the response signal to the pipeline module to complete the reading and writing of the register file module; (IX) When the communication request type is L1 cache read / write, the L1 cache control submodule determines whether the request address exceeds the address boundary of the L1 cache: ① If the address boundary is not exceeded, the first-level cache module is communicated with according to the communication address to read and write data; ② If the address boundary is exceeded, the request address will be forwarded to the resource scheduling submodule; (10) The resource scheduling submodule searches the resource mapping table according to the request address, and sends the communication request to the register file control submodule based on the found address; (XI) The register file control submodule reads and writes data from the corresponding address according to the request, and returns a response signal to the resource scheduling submodule; (XII) The resource scheduling submodule returns the response signal to the first-level cache control submodule, the first-level cache control submodule returns the response signal to the communication arbitration submodule, and finally returns the response signal to the pipeline module to complete the reading and writing of the first-level cache.