Method and apparatus for configuring relay register module, and computing device and readable medium

By dynamically configuring the relay register module to allocate relay registers for tasks, the problem of general data register port congestion and waiting is solved, and processor performance and floating-point operation efficiency are improved.

WO2024245142A1PCT designated stage expired Publication Date: 2024-12-05MOORE THREADS TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/095218
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-26
Filing Date
2024-05-24
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

In chip technology, the high usage of general data registers causes congestion and waiting problems for each pipeline to access general data register ports at the same time, affecting processor performance.

Method used

By dynamically configuring the relay register module, each task is assigned a corresponding number of relay registers according to the task's startup allocation request, which is used to store the intermediate results obtained by task-based instruction operations and reduce dependence on general data registers.

Benefits of technology

It alleviates the problem of congestion and waiting for general data register ports, improves the performance of processors, especially the operating efficiency of floating-point computing units, and optimizes the performance of logical computing units pipelines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024095218_05122024_PF_FP_ABST
    Figure CN2024095218_05122024_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method for configuring a relay register module. The method comprises the following steps: receiving a start and allocation request for at least one task, which is sent by means of a task scheduler; on the basis of the start and allocation request, determining the number of relay registers to be allocated to each task among the at least one task; for each task, allocating a corresponding number of relay registers; and when the allocation is completed, sending a wake-up signal to the task scheduler, wherein the wake-up signal is used for the task scheduler to start the task for which the relay register has been allocated, and the relay register module is used for storing an intermediate result which is obtained by means of task-based instruction operations. The present disclosure further relates to an apparatus for configuring a relay register module.
Need to check novelty before this filing date? Find Prior Art

Description

Method and apparatus for configuring a relay register module, computing device, and readable medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application CN202310607003.0 filed on May 26, 2023, which is incorporated by reference in its entirety for all purposes. Technical Field

[0003] The present disclosure relates to the field of chip technology, and more particularly to a method and apparatus for configuring a relay register module. Furthermore, the present disclosure also relates to a corresponding computing device, a computer program product, and a computer-readable medium. Background Art

[0004] General data registers can be used by each pipeline of a central processing unit or graphics processing unit to store attributes, private data and other related information. They are generally used in large quantities. In related technologies, there is a problem of congestion and waiting when each pipeline accesses the general data register port at the same time.

[0005] Summary of the Invention

[0006] The present disclosure proposes a technical solution for configuring a relay register module. By dynamically configuring relay registers for tasks to store intermediate results obtained by task-based instruction operations, the problem of congestion and waiting caused by simultaneous access of general data register ports by various pipelines can be alleviated.

[0007] According to one aspect of the present disclosure, a method for configuring a relay register module is provided, which includes the following steps: - receiving a start allocation request for at least one task sent by a task scheduler, - determining the number of relay registers to be allocated to each task in the at least one task based on the start allocation request, - allocating a corresponding number of relay registers for each task, - when the allocation is completed, sending a wake-up signal to the task scheduler, the wake-up signal is used by the task scheduler to start the task to which the relay register has been allocated, wherein the relay register module is used to store intermediate results obtained based on task instruction operations.

[0008] According to some exemplary embodiments of the method, the start allocation request includes the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein determining the number of relay registers to be allocated to each task in the at least one task based on the start allocation request includes: determining the number of relay registers to be allocated to each task based on the granularity corresponding to the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein the granularity represents the maximum number of work item instances included in the corresponding task.

[0009] According to some exemplary embodiments of the method, the number of relay registers to be allocated to each work item instance in the task is determined based on a limited number of tasks started simultaneously.

[0010] According to some exemplary embodiments of the method, each work item instance in tasks of different working modes is allocated with a different number of relay registers, and each work item instance in tasks of the same working mode is allocated with the same or different number of relay registers.

[0011] According to some exemplary embodiments of the method, the number of relay registers to be allocated to each task is less than or equal to a reference value, wherein the reference value is determined based on the total number of relay registers, the working mode of the task, and the configured maximum relay register usage.

[0012] According to some exemplary embodiments of the method, the task includes at least one work item instance, and each work item instance is allocated at least one relay register. The method also includes: when the calculation result of the first instruction in the relay register has been used up, storing the calculation result of the second instruction in the relay register, wherein the first instruction and the second instruction are instructions of the same work item instance, and the second instruction is a subsequent instruction of the first instruction.

[0013] According to some exemplary embodiments of the method, allocating a corresponding number of relay registers for each task includes: determining, based on the number of relay registers to be allocated to the task, available rows in the relay register module for allocation to the task, the available rows being relay register rows available for allocation; allocating the relay registers in the available rows to the task, and marking the available rows as allocated relay register rows.

[0014] According to some exemplary embodiments of the method, the available row includes an index value, the task includes a number, and the method further includes: obtaining the number of the task and the index value of the available row assigned to the corresponding task and recording the number and the index value in a row address table, wherein the number is used to manage the row address table.

[0015] According to some exemplary embodiments of the method, the method further includes: in response to receiving an access request to the relay register module, generating a physical address of the relay register corresponding to the access request based on the task number included in the access request and the row address table, wherein the physical address is used to access the relay register module.

[0016] According to some exemplary embodiments of the method, the method further includes: in response to receiving a task end signal, reclaiming a relay register allocated to the task corresponding to the task end signal.

[0017] According to another aspect of the present disclosure, a device for configuring a relay register module is provided, which includes the following modules: - a relay register controller, which is used to receive a start allocation request of at least one task sent by a task scheduler; and based on the start allocation request, determines the number of relay registers to be allocated to each task in the at least one task; - an allocation unit, which allocates a corresponding number of relay registers for each task; - a notification unit, which sends a wake-up signal to the task scheduler when the allocation is completed, and the wake-up signal is used by the task scheduler to start the task to which the relay register has been allocated; - wherein the relay register module is used to store intermediate results obtained based on task instruction operations.

[0018] According to some exemplary embodiments of the device, the start allocation request includes the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, and the relay register controller is configured to determine the number of relay registers to be allocated to each task based on the granularity corresponding to the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein the granularity represents the maximum number of work item instances included in the corresponding task.

[0019] According to some exemplary embodiments of the apparatus, the number of relay registers to be allocated to each work item instance in the task is determined based on a limited number of tasks started simultaneously.

[0020] According to some exemplary embodiments of the apparatus, each work item instance in tasks of different working modes is allocated with a different number of relay registers, and each work item instance in tasks of the same working mode is allocated with the same or different number of relay registers.

[0021] According to some exemplary embodiments of the apparatus, the number of relay registers to be allocated to each task is less than or equal to a reference value, wherein the reference value is determined based on the total number of relay registers, the working mode of the task, and the configured maximum relay register usage.

[0022] According to some exemplary embodiments of the device, the task includes at least one work item instance, each work item instance is allocated at least one relay register, and the allocation unit is configured to store the calculation result of the second instruction in the relay register when the calculation result of the first instruction in the relay register has been used up, wherein the first instruction and the second instruction are instructions of the same work item instance, and the second instruction is a subsequent instruction of the first instruction.

[0023] According to some exemplary embodiments of the device, the allocation unit is configured to determine, based on the number of relay registers to be allocated to the task, available rows in the relay register module for allocation to the task, the available rows being relay register rows available for allocation; allocate the relay registers of the available rows to the task, and mark the available rows as allocated relay register rows.

[0024] According to some exemplary embodiments of the device, the available row includes an index value, the task includes a number, and the allocation unit is further configured to obtain the number of the task and the index value of the available row assigned to the corresponding task and record the number and the index value in a row address table, wherein the number is used to manage the row address table.

[0025] According to some exemplary embodiments of the device, the allocation unit is further configured to, in response to receiving an access request to the relay register module, generate a physical address of the relay register corresponding to the access request based on the task number included in the access request and the row address table, wherein the physical address is used to access the relay register module.

[0026] According to some exemplary embodiments of the device, the allocation unit is further configured to, in response to receiving a task end signal, reclaim the relay register allocated to the task corresponding to the task end signal.

[0027] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the method according to any one of the above embodiments.

[0028] According to another aspect of the present disclosure, a computer program product is provided, comprising instructions, which, when executed by a computing device, enable the computing device to perform the method according to any one of the above embodiments.

[0029] According to another aspect of the present disclosure, a computer-readable medium having instructions stored thereon is provided. When the instructions are executed, the computer-readable medium causes a computing device to perform the method according to any one of the above embodiments.

[0030] Through an embodiment of the present disclosure, since a corresponding number of relay registers can be allocated to each task based on the startup allocation request of each task, the problem of congestion and waiting caused by simultaneous access of each pipeline to the general data register port can be alleviated by dynamically configuring the relay registers used to store the intermediate results obtained by the task-based instruction operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Specific exemplary embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, the present disclosure may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the scope of the present disclosure to those skilled in the art. The terminology used in the detailed description of the specific exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the present disclosure. In the drawings, like numbers refer to like parts.

[0032] FIG1 shows a flowchart of a method 100 for configuring a relay register module according to an embodiment of the present disclosure.

[0033] FIG2 is a schematic diagram showing a fixed binding between a relay register and a task (wave).

[0034] FIG3 shows a block diagram of an apparatus 300 for configuring a relay register module according to an embodiment of the present disclosure.

[0035] FIG4 shows a block diagram of an apparatus 400 for configuring a relay register module according to another embodiment of the present disclosure.

[0036] FIG5 shows a block diagram of an apparatus 500 for configuring a relay register module according to another embodiment of the present disclosure.

[0037] FIG6 shows a schematic diagram of dynamically allocating relay registers according to an embodiment of the present disclosure.

[0038] FIG7 is a schematic diagram showing the interaction between a task scheduler and a relay register configuration device according to an embodiment of the present disclosure.

[0039] FIG8 is a schematic diagram showing the interaction between a task scheduler and a relay register configuration device according to another embodiment of the present disclosure.

[0040] FIG9 shows a block diagram of a computing device according to one embodiment of the present disclosure. DETAILED DESCRIPTION

[0041] To make the objectives, technical solutions, and advantages of the present disclosure more clearly understood, the technical solutions of the present disclosure are further described below with reference to the accompanying drawings and examples. It should be further understood that, as used in this specification, the term "comprising" means the presence of the stated features, steps, operations, parts, and / or components, but does not exclude the presence or addition of one or more other features, steps, operations, parts, components, and / or groups thereof.

[0042] In related technologies, general-purpose data registers are used in various CPU or GPU pipelines to store attributes, private data, addresses, and other related information. They are generally used in large quantities. For example, in general, any work item instance for each task can be allocated dozens to a maximum of more than two hundred. Furthermore, the number of such registers varies with the number of tasks. For example, if a single task uses a large number of general-purpose registers, the number of tasks that can be started will inevitably be small, or even impossible to use according to the set maximum number of tasks. At the same time, general-purpose data registers are used by all pipelines, including integer or floating-point ALU pipelines, special arithmetic function pipelines, texture sampling pipelines, and so on. This causes congestion and waiting when each pipeline accesses the general-purpose data register port simultaneously. The computational ALU processing unit in the kernel operates at the kernel's high frequency state, and it is precisely this high-speed operation that requires reducing general-purpose data register access congestion to enable kernel processing to achieve optimal performance.

[0043] The present disclosure provides a method for configuring a relay register module, wherein the relay register module can be used to store intermediate results obtained by task-based instruction operations, such as intermediate results of floating-point or fixed-point operations. In this way, intermediate results used between previous and subsequent instructions can be immediately read from the relay register and used by subsequent instructions, thereby reducing access pressure on general-purpose data registers, enabling core processing to achieve better performance, and also improving the operating efficiency of the floating-point unit.

[0044] By storing intermediate instruction results in relay registers, subsequent instructions in the pipeline can quickly access these intermediate results. The use of relay registers reduces the pressure on the floating-point and integer logic units (LOGUs) to access general-purpose data registers. They offer fast access speeds, short cycles, high bandwidth, and small capacity. Furthermore, during the compilation process, the compiler can optimize compiled instructions by combining general-purpose data registers with relay register resources, resulting in improved LOGU pipeline performance.

[0045] For ease of understanding, the following description will be given using an application to a GPU as an example. The method for configuring a relay register module provided in the embodiments of the present disclosure may be applicable to any application scenario.

[0046] Existing desktop GPU architectures typically use pure SIMD (Single Instruction Multiple Data) 32 or CUDA's pure SIMT (Single Instruction Multiple Thread) 32. This pure SIMD32 small core structure groups 32 work item instances together for execution, resulting in excellent parallelism. The SIMD32 structure is commonly used in parallel programming, where 32 work item instances simultaneously execute the same instruction behavior. In some mobile GPU architectures, to reduce core area and power consumption, a large core structure such as SIMD128 is often used, where 128 work item instances are grouped together for execution. However, the SIMD32 small core structure increases thread scheduling, instruction issuance, and instruction fetching for less complex computations, while the SIMD128 large core structure significantly wastes resources for smaller tasks. Therefore, it is appropriate to adopt different structures based on different usage scenarios.

[0047] In this application, wave is a custom SIMD Thread, wave32 represents a parallel thread bundle assembled from 32 work item instances, and wave128 represents a parallel thread bundle assembled from 128 work item instances.

[0048] FIG1 shows a flowchart of a method 100 for configuring a relay register module according to an embodiment of the present disclosure. Exemplarily, the method for configuring a relay register module of the present disclosure can be executed by a device for configuring a relay register module, for example, a device for configuring a relay register module in a GPU. As shown in FIG1 , the method 100 includes: step S100, receiving a start allocation request for at least one task sent by a task scheduler; step S200, determining the number of relay registers to be allocated to each task in the at least one task based on the start allocation request; step S300, allocating a corresponding number of relay registers for each task; step S400, sending a wake-up signal to the task scheduler when the allocation is completed, the wake-up signal being used by the task scheduler to start the task to which the relay register has been allocated; wherein the relay register module is used to store intermediate results obtained based on task-based instruction operations.

[0049] In this way, since each task can be allocated a corresponding number of relay registers based on its startup allocation request, the dynamic configuration of relay registers used to store intermediate results obtained by task-based instruction operations can alleviate the congestion and waiting problem caused by simultaneous access to general data register ports by various pipelines. Furthermore, even if individual tasks require a large number of general data register resources and the number of startup tasks is small, more relay register resources can be allocated to the tasks to be run based on the startup allocation request, thereby fully utilizing the relay register area that would otherwise be idle when fixed relay register allocation is used, thereby improving relay register utilization.

[0050] The start allocation request may be a start allocation request for one or more tasks, and the wake-up signal is sent to the task scheduler after the allocation is completed. This may be the case when all tasks corresponding to the start allocation request have been allocated, or the wake-up signal may be sent for any task that has been allocated. For a task, the allocation completion may be to determine that all relay registers allocated to the task have been allocated, or to determine that part of the relay registers allocated to the task have been allocated. For example, if the device for configuring the relay register module determines that the currently available relay register rows are only part of the relay register rows to be allocated to the task, partial configuration may also be performed. For example, if there are 4 rows of relay registers to be allocated to the task and there are currently 2 rows of available relay register rows, the allocation may be determined to be complete after the 2 rows are allocated, and a wake-up signal may be sent to the task scheduler. It should be noted that in the case of partial configuration, if it is determined that the parsed instructions require more relay registers after executing part of the code, the task may be blocked, and the task scheduler may re-initiate the start allocation request. The device for configuring the relay register module performs the relay register configuration operation based on the start allocation request, and the present disclosure does not limit this. Exemplarily, the task corresponding to the start allocation request sent by the task scheduler is a task determined by compilation to require configuration of a relay register.

[0051] In the present application, relay registers can be dynamically allocated to corresponding tasks, and the number of relay registers and relay register areas allocated to each task can change dynamically. For example, when individual tasks need to use a large number of general data register resources and the number of startup tasks is small, a larger number of relay registers can be allocated to the startup tasks to make full use of the relay register resources, thereby solving the problem that the relay registers are fixedly bound to the tasks, and when the number of startup tasks is small, the relay register areas of the idle task parts are still unusable, resulting in resource waste.

[0052] Exemplarily, tasks may include wave32 and wave128. Alternatively or additionally, tasks may include wave64, etc. Exemplarily, a wave32 launch allocation request may include the task's operating mode, i.e., wave32 mode, and the number of relay registers to be allocated to each work item instance in the task. This number may be set to 2, 4, 6, 8, etc., depending on the number of tasks launched simultaneously. Exemplarily, a wave128 launch allocation request may include the task's operating mode, i.e., wave128 mode, and the number of relay registers to be allocated to each work item instance in the task. This number may be set to 2, 4, etc., depending on the number of tasks launched simultaneously. In some optional embodiments, the number of relay registers allocated to each work item instance in a wave128 mode task is smaller than the number of relay registers allocated to each work item instance in a wave32 mode task. Furthermore, the number of relay registers allocated to each work item instance in different tasks with the same operating mode may also differ. For example, the number of relay registers allocated to each work item instance in one wave32 mode may be 2, while the number of relay registers allocated to each work item instance in another wave32 mode may be 4.

[0053] In this way, a different number of relay registers can be allocated to each task according to the startup allocation request of each task. It should be noted that in order to be compatible with multiple task working modes and to adopt the method of binding relay registers to tasks, it is necessary to design the relay registers corresponding to each task according to the maximum execution granularity. For example, in order to be compatible with wave32 mode and wave128 mode, it is necessary to design according to the execution strength of 128 work item instances, and the hardware implementation overhead is too large. In addition, if the amount of data used in the general data register is large, resulting in insufficient task startup, the method of binding relay registers to tasks will result in a fixed number of available resources for each task. At this time, a large number of relay register resources are idle and cannot be used.

[0054] The disclosed embodiments can dynamically allocate relay registers for each task, eliminating the need to design based on the maximum execution granularity in a multi-tasking mode, effectively reducing hardware overhead. When operating in different modes, relay register resources can be fully utilized without increasing overhead, improving efficiency.

[0055] Exemplarily, since the relay registers are not fixedly bound to each work item instance, after determining the number of relay registers allocated to each task, the corresponding number of relay registers can be allocated to the corresponding task. When the allocation is completed, a wake-up signal is sent to the task scheduler so that the task scheduler starts the task to which the relay registers have been allocated. Exemplarily, if a task in the task scheduler needs to configure the relay registers, the task scheduler can block the task until a wake-up signal is received indicating that the relay register configuration has been completed for the task. The task scheduler can then allow the task to participate in scheduling based on the received wake-up signal.

[0056] Among them, based on the start allocation request, determining the number of relay registers to be allocated to each task in the at least one task can be to determine the number of relay registers corresponding to each task based on the type of task. For example, for tasks in wave128 mode, the number of relay registers corresponding to the wave128 mode can be allocated. It can also be that the start allocation request includes the number of relay registers applied for by the task, and allocation is performed based on the number of relay registers applied for by the task. The present disclosure does not limit the method of determining the number of relay registers to be allocated to each task in the at least one task.

[0057] In one possible implementation, the start allocation request includes the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein determining the number of relay registers to be allocated to each task in the at least one task based on the start allocation request includes: determining the number of relay registers to be allocated to each task according to the granularity corresponding to the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein the granularity represents the maximum number of work item instances included in the corresponding task.

[0058] Exemplarily, the granularity corresponding to the wave32 mode is 32, and if the number of relay registers to be allocated to each work item instance in wave32 is 4, the number of relay registers allocated to the wave32 is 32*4=128. Exemplarily, the granularity corresponding to the wave128 mode is 128, and if the number of relay registers to be allocated to each work item instance in wave128 is 2, the number of relay registers allocated to the wave128 is 128*2=256. In addition, even if the number of work item instances included in wave32 is less than 32, 128 relay registers are allocated to the wave32. Similarly, even if the number of work item instances included in wave128 is less than 128, 256 relay registers are allocated to the wave128.

[0059] As mentioned above, when compatible with multiple working modes, such as when wave32 and wave128 are used simultaneously, if the binding mode is adopted, it is necessary to design according to the mode of maximum execution granularity. Here, it is necessary to design according to the execution granularity of 128 work item instances of wave128. In this way, when executing a wave32 task, the relay register space corresponding to 96 work item instances is idle, which leads to a huge waste of resources. Through the implementation method of the embodiment of the present disclosure, more relay register usage can be configured for each work item instance in the wave32 task, thereby making the reading and writing efficiency higher.

[0060] In a possible implementation, the number of relay registers to be allocated to each work item instance in the task is determined based on a limited number of tasks started simultaneously.

[0061] For example, during compilation, the number of relay registers allocated to each work item instance can be determined by limiting the number of tasks that can be started simultaneously based on the amount of general data register resources occupied by the task. For example, the number of relay registers to be allocated to each work item instance in the task is inversely correlated (or negatively correlated) with the limited number of tasks that can be started simultaneously. For example, the smaller the limited number of tasks that can be started simultaneously, the larger the number of relay registers to be allocated to each work item instance in the task. In this way, more efficient utilization of relay register resources can be achieved.

[0062] As mentioned above, the number of relay registers to be allocated to each work item instance in tasks of different working modes may be the same or different.

[0063] In a possible implementation, each work item instance in tasks of different working modes is to be allocated a different number of relay registers, and each work item instance in tasks of the same working mode is to be allocated the same or different number of relay registers.

[0064] For example, the number of relay registers allocated to each work item instance in a task operating in the wave128 mode can be equal to or less than the number of relay registers allocated to each work item instance in a task operating in the wave32 mode. For example, the number of relay registers allocated to each work item instance in a task operating in the wave128 mode is 2, while the number of relay registers allocated to each work item instance in a task operating in the wave32 mode is 4. Of course, a different number of relay registers can be allocated to each work item instance in each of the two modes, depending on the number of tasks launched simultaneously. Additionally, the number of relay registers allocated can also vary depending on the operating modes of the simultaneously launched tasks. Furthermore, the number of relay registers allocated to each work item instance in different tasks operating in the same mode can also vary. For example, the number of relay registers allocated to each work item instance in one wave32 mode is 2, while the number of relay registers allocated to each work item instance in another wave32 mode is 4. Of course, a different number of relay registers can also be allocated to each work item instance in the same mode, depending on the number of tasks launched simultaneously. Additionally, the number of relay registers allocated can also vary depending on the operating modes of the simultaneously launched tasks. In some optional embodiments, the number of relay registers allocated to each work item instance in different tasks of the same working mode may be the same.

[0065] In this way, more efficient utilization of relay register resources can be achieved.

[0066] The number of relay registers to be allocated to each task may be limited, for example, may be less than or equal to a reference value.

[0067] In one possible implementation, the number of relay registers to be allocated to each task is less than or equal to a reference value, where the reference value is determined based on the total number of relay registers, the working mode of the task, and the configured maximum relay register usage.

[0068] For example, assuming that the total number of relay registers K = M banks * N tasks * SIMD_Numb, each task is configured with a maximum relay register usage T of a single instance, aligned_size represents the number of DWs (DW is the abbreviation of Double-Word) contained in the aligned single instance relay register row, and aligned_line represents the number of relay register rows that need to be allocated. The number of tasks in pure wave128 mode that can be supported by the number of relay registers is Num_of_Wave128 = K / (SIMD_128*aligned_size*((T+aligned_size-1) / aligned_size)). Waves exceeding this number will enter a blocked state due to the inability to allocate relay registers; the number of tasks in pure wave32 mode that can be supported by the number of relay registers is Num_of_Wave32 = K / (SIMD_32*aligned_size*((T+aligned_size-1) / aligned_size)). Waves exceeding this number will enter a blocked state due to the inability to allocate relay registers.

[0069] In this way, when the maximum relay register usage is configured for each task, the number of relay registers allocated to each task can be flexibly selected within a range, which not only ensures more efficient utilization of relay registers, but also reduces the situation where too many relay registers are allocated to a task, thereby affecting the startup of new tasks.

[0070] In one possible implementation, the task includes at least one work item instance, and each work item instance is allocated at least one relay register. The method further includes: when the calculation result of the first instruction in the relay register has been used up, storing the calculation result of the second instruction in the relay register, wherein the first instruction and the second instruction are instructions of the same work item instance, and the second instruction is a subsequent instruction of the first instruction.

[0071] Exemplarily, wave32 may include greater than or equal to 1 work item instance and less than or equal to 32 work item instances, while wave128 may include greater than or equal to 1 work item instance and less than or equal to 128 work item instances. Alternatively, wave128 may also include greater than or equal to 33 work item instances and less than or equal to 128 work item instances. Exemplarily, each work item instance may be allocated at least one relay register, such as 2, 4, 6, etc. Each work item instance within the same task has its own relay register space. After the previous instruction of the same task is written back, it can be immediately provided to the next instruction for use after the delay is hidden through the task's internal instruction scheduling. When it is written back again, as long as the previous instruction is guaranteed to be used up, the previous result can be directly overwritten. For example, the same work item instance includes the first instruction and the second instruction, and the second instruction is the subsequent instruction of the first instruction. When the calculation result of the first instruction has been used up, the result of the second instruction can be written into the relay register storing the first instruction, that is, overwriting the intermediate result of the first instruction.

[0072] In this way, the cyclic utilization of relay registers can be guaranteed, and there is no need to allocate too many relay registers to each work item instance, thereby improving the utilization rate of relay registers.

[0073] In one possible implementation, allocating a corresponding number of relay registers to each task includes: determining, based on the number of relay registers to be allocated to the task, available rows in the relay register module for allocation to the task, the available rows being relay register rows available for allocation; allocating the relay registers in the available rows to the task, and marking the available rows as allocated relay register rows.

[0074] Exemplarily, the relay register rows of the relay register module are managed through an effective available row information table. When a relay register row in the relay register module is available for allocation, the flag corresponding to the available relay register row in the effective available row information table is 1; when a relay register row in the relay register module is not available for allocation, for example, it has been allocated or occupied, the flag corresponding to the unavailable relay register row in the effective available row information table is 0. Exemplarily, when the available relay register row is assigned to a task, the flag of the relay register row in the effective available row information table is changed to 0. Alternatively, when a relay register row in the relay register module is available for allocation, the flag corresponding to the available relay register row in the effective available row information table is 0; when a relay register row in the relay register module is not available for allocation, for example, it has been allocated or occupied, the flag corresponding to the unavailable relay register row in the effective available row information table is 1. Correspondingly, when the relay register row available for allocation is allocated to a certain task, the flag of the relay register row in the valid available row information table is changed to 1.

[0075] In this way, relay register rows can be dynamically assigned to each task.

[0076] In one possible implementation, the available row includes an index value, the task includes a number, and the method further includes: obtaining the number of the task and the index value of the available row assigned to the corresponding task and recording the number and the index value in a row address table, wherein the number is used to manage the row address table.

[0077] Exemplarily, each task is assigned a number waveid in the task scheduler, and the number of each task in the task scheduler is different from the numbers of other tasks, that is, the task can be identified by the number. Exemplarily, each available row corresponds to an index value bitid. In one example, the valid available row information table is set to a 48-bit valid mark table, and each 1 bit indicates that a relay register row is valid and available. Generally, 1 is used to indicate that it can be used, and 0 is used. In essence, it is to find the x-th bit that is valid, and then fill this x together with the task number waveid into the row address table. Exemplarily, the task number waveid can be used to manage the row address table, so that when the pipeline accesses the relay register, it only needs to send the task number to access the relay register. Exemplarily, according to the number of relay registers assigned to the task, the valid available row information table can be searched continuously, and multiple rows of relay registers can be configured for use by the task, and can be traversed once for filling.

[0078] In this way, the number of the task can be associated with the available relay register row in the relay register module, so that only the number of the task needs to be provided when the pipeline accesses the relay register.

[0079] In one possible implementation, the method further includes: in response to receiving an access request to the relay register module, generating a physical address of the relay register corresponding to the access request based on the task number included in the access request and the row address table, wherein the physical address is used to access the relay register module.

[0080] For example, since the row address table is managed by the task number, when an access request to the relay register module is received, the index value of the relay register row assigned to the task can be determined by the task number, and the physical address (LineID and BankID) of the relay register row assigned to the task can be determined by the index value, and the actual storage area of ​​the relay register can be accessed through the physical address.

[0081] In this way, simple and efficient access to the actual storage area of ​​the relay register can be achieved.

[0082] In a possible implementation, the method further includes: in response to receiving a task end signal, reclaiming a relay register allocated to the task corresponding to the task end signal.

[0083] Exemplarily, after receiving a signal indicating that the pipeline has completed execution of a corresponding task, the task scheduler releases the space occupied by the task in the task scheduler and sends a task completion signal containing the task number to the relay register controller. In response to receiving the task completion signal, the relay register controller notifies the allocation unit to reclaim the relay register row allocated to the task number. Exemplarily, the allocation unit changes the bit in the valid available row information table pointed to by the index value corresponding to the task number from 0 to 1, indicating that it is available for allocation.

[0084] In this way, the storage space of the relay register can be recycled.

[0085] FIG2 is a schematic diagram showing a fixed binding between a relay register and a task (wave).

[0086] As shown in Figure 2, relay registers are fixedly bound to waves and have a fixed configuration, requiring no allocation. The number of relay registers is also fixed according to the maximum number of waves supported by the kernel. The number of relay registers allocated to each wave cannot be adjusted based on the number of enabled waves. This results in a large number of general-purpose data registers being used by waves. Even when a small number of waves are enabled, the unused relay registers in these waves remain unused, resulting in wasted resources.

[0087] Figure 2 illustrates n waves, each bound to m relay registers. The total overhead is n*m*number of SIMD instances. This size is fixed; even if only one wave is enabled, only m relay registers are available. Due to the high overhead of relay registers, the number m of relay registers per instance is typically fixed at 2 or 4.

[0088] Figure 3 shows a block diagram of an apparatus 300 for configuring a relay register module according to an embodiment of the present disclosure. The principle of solving the problem by this apparatus is similar to the method of the above-mentioned embodiment, so its specific implementation can refer to the above-mentioned embodiment.

[0089] As shown in Figure 3, apparatus 300 may include a relay register controller 301, an allocation unit 302, and a notification unit 303. The relay register controller 301 may be configured to receive a start allocation request for at least one task sent by a task scheduler; and based on the start allocation request, determine the number of relay registers to be allocated to each of the at least one task. In one example, the task scheduler sends start allocation requests for multiple tasks, which may include wave32 and wave128. Alternatively or additionally, tasks may also include wave64, etc. Exemplarily, the start allocation request for wave32 may include the task's operating mode, i.e., wave32 mode, and the number of relay registers to be allocated to each work item instance in the task. This number may be set to 2, 4, 6, 8, etc., depending on the number of tasks to be started simultaneously. Furthermore, the relay register controller 301 may be configured to determine the number of relay registers to be allocated to each task based on the granularity corresponding to the task's operating mode and the number of relay registers to be allocated to each work item instance in the task, where the granularity represents the maximum number of work item instances included in the task. Exemplarily, the granularity corresponding to the wave32 mode is 32, and if the number of relay registers to be allocated to each work item instance in wave32 is 4, the number of relay registers allocated to the wave32 is 32*4=128. Exemplarily, the granularity corresponding to the wave128 mode is 128, and if the number of relay registers to be allocated to each work item instance in wave128 is 2, the number of relay registers allocated to the wave128 is 128*2=256. In addition, even if the number of work item instances included in wave32 is less than 32, 128 relay registers are allocated to the wave32. Similarly, even if the number of work item instances included in wave128 is less than 128, 256 relay registers are allocated to the wave128.

[0090] For example, the number of relay registers to be allocated to each work item instance within a task is determined based on the limited number of tasks that can be started simultaneously. For example, during compilation, the number of relay registers allocated to each work item instance is determined based on the number of general data register resources occupied by the tasks and the number of tasks that can be started simultaneously. This allows for more efficient utilization of relay register resources.

[0091] For example, each work item instance in tasks with different operating modes is allocated a different number of relay registers, while each work item instance in tasks with the same operating mode is allocated the same or different number of relay registers. For example, the number of relay registers allocated to each work item instance in a task in wave128 mode is less than the number of relay registers allocated to each work item instance in a task in wave32 mode. For example, the number of relay registers allocated to each work item instance in a task in wave128 mode is 2, while the number of relay registers allocated to each work item instance in a task in wave32 mode is 4. Of course, other numbers of relay registers can also be allocated to each work item instance in the two modes, depending on the number of tasks launched simultaneously. Additionally, the number of relay registers allocated can also be determined based on the operating modes of the tasks launched simultaneously. Furthermore, the number of relay registers allocated to each work item instance in different tasks with the same operating mode can also be different. For example, the number of relay registers allocated to each work item instance in one wave32 mode is 2, while the number of relay registers allocated to each work item instance in another wave32 mode is 4. Of course, other numbers of relay registers can also be allocated to each work item instance in the same mode, depending on the number of tasks started simultaneously. Additionally, the number of relay registers can also be determined based on the operating modes of the tasks started simultaneously. In some optional embodiments, the number of relay registers allocated to each work item instance in different tasks in the same operating mode can be the same. In this way, more efficient utilization of relay register resources can be achieved.

[0092] Exemplarily, the number of relay registers to be allocated to each task is less than or equal to a reference value, where the reference value is determined based on the total number of relay registers, the operating mode of the task, and the configured maximum relay register usage. For example, assuming the total number of relay registers K = M banks * N tasks * SIMD_Numb, each task is configured with a maximum relay register usage T, aligned_size represents the number of DWs contained in the relay register row corresponding to a single instance of alignment, and aligned_line represents the number of relay register rows allocated. The number of tasks in pure wave128 mode that can be supported by the number of relay registers is Num_of_Wave128 = K / (SIMD_128*aligned_size*((T+aligned_size-1) / aligned_size)). Waves exceeding this number will enter a blocked state due to the lack of relay registers allocated. The number of tasks in pure wave32 mode that can be supported by the number of relay registers is Num_of_Wave32 = K / (SIMD_32*aligned_size*((T+aligned_size-1) / aligned_size)). Waves exceeding this number will enter a blocked state due to the lack of relay registers allocated. In this way, when the maximum relay register usage is configured for each task, the number of relay registers allocated to each task can be flexibly selected within a range, which not only ensures more efficient use of relay registers, but also avoids allocating too many relay registers to a task, thereby affecting the startup of new tasks.

[0093] The allocation unit 302 can be configured to allocate a corresponding number of relay registers to each task. Exemplarily, the allocation unit 302 can determine available rows in the relay register module for allocation to the task based on the number of relay registers to be allocated to the task, the available rows being relay register rows available for allocation; allocate relay registers in the available rows to the task, and mark the available rows as allocated relay register rows. Exemplarily, the relay register rows of the relay register module are managed via an effective available row information table. When a relay register row in the relay register module is available for allocation, the flag corresponding to the available relay register row in the effective available row information table is 1; when a relay register row in the relay register module is not available for allocation, for example, if it has already been allocated or occupied, the flag corresponding to the unavailable relay register row in the effective available row information table is 0. Exemplarily, when the available relay register row is allocated to a task, the flag of the relay register row in the effective available row information table is changed to 0. Alternatively, when a relay register row in the relay register module is available for allocation, the flag corresponding to the available relay register row in the valid available row information table is 0; when a relay register row in the relay register module is not available for allocation, for example, it has already been allocated or occupied, the flag corresponding to the unavailable relay register row in the valid available row information table is 1. Correspondingly, when the available relay register row is assigned to a task, the flag of the relay register row in the valid available row information table is changed to 1. In this way, a relay register row can be dynamically allocated to each task.

[0094] The available row includes an index value, and the task includes a number. The allocation unit 302 can also be configured to obtain the number of the task and the index value of the available row assigned to the corresponding task and record the number and the index value in a row address table, wherein the number is used to manage the row address table.

[0095] Exemplarily, each task is assigned a waveid number in the task scheduler, and each task number in the task scheduler is distinct from other tasks, meaning that the task can be identified by this number. Exemplarily, each available row corresponds to an index value, bitid. In one example, the valid available row information table is configured as a 48-bit valid flag table, with each bit indicating whether a relay register row is valid and available. Generally, 1 indicates available, and 0 indicates used. Essentially, this involves searching for the x-th valid bit and then entering this x bit into the row address table along with the task's waveid number. Exemplarily, the task's waveid number can be used to manage the row address table, so that when accessing a relay register, the pipeline only needs to send the task's number. Exemplarily, based on the number of relay registers assigned to a task, the valid available row information table can be continuously searched, multiple relay register rows can be configured for use by the task, and the rows can be filled in one go. In this way, the task number can be associated with the available relay register rows in the relay register module, so that when the pipeline accesses a relay register, only the task number needs to be provided.

[0096] The allocation unit 302 may also be configured to, in response to receiving an access request to the relay register module, generate a physical address of the relay register corresponding to the access request based on the task number and the row address table included in the access request, wherein the physical address is used to access the relay register module. For example, since the row address table is managed by the task number, when receiving an access request to the relay register module, the index value of the relay register row assigned to the task can be determined by the task number, and the physical address (LineID and BankID) of the relay register row assigned to the task can be determined by the index value, and the actual storage area of ​​the relay register can be accessed by the physical address. In this way, simple and efficient access to the actual storage area of ​​the relay register can be achieved.

[0097] The allocation unit 302 can also be configured to, in response to receiving a task end signal, reclaim the relay register allocated to the task corresponding to the task end signal. Exemplarily, after receiving a signal indicating that the pipeline has finished executing the corresponding task, the task scheduler sends a task end signal containing the task number to the relay register controller. In response to receiving the task end signal, the relay register controller notifies the allocation unit to reclaim the relay register row allocated to the task number. The task scheduler releases the space occupied by the task in the task scheduler only after receiving a release and recovery completion signal from the relay register controller, completing the task end release operation. Exemplarily, the allocation unit changes the bit in the valid available row information table pointed to by the index value corresponding to the task number from 0 to 1, indicating that it is available for allocation. In this way, the recycling of the relay register storage space can be achieved.

[0098] Because the task includes at least one work item instance, each work item instance is allocated at least one relay register. The allocation unit 302 may also be configured to, when the computation result of the first instruction in the relay register has been fully used, store the computation result of the second instruction in the relay register, wherein the first and second instructions are instructions of the same work item instance, and the second instruction is a subsequent instruction of the first instruction. Exemplarily, wave32 may include greater than or equal to one work item instance and less than or equal to 32 work item instances, while wave128 may include greater than or equal to one work item instance and less than or equal to 128 work item instances. Alternatively, wave128 may include greater than or equal to 33 work item instances and less than or equal to 128 work item instances. Exemplarily, each work item instance is allocated at least one relay register, such as one, two, four, or six. Each work item instance within the same task has its own relay register space. After a previous instruction within the same task is written back, the relay register space can be immediately made available to the next instruction for use, after delays are hidden through internal instruction scheduling within the task. When written back again, the previous result can be directly overwritten as long as the previous instruction is fully used. In this way, the recycling of relay registers can be guaranteed, and the allocation of too many relay registers to each work item instance (if unnecessary) can be avoided.

[0099] The notification unit 303 can be configured to send a wake-up signal to the task scheduler when the allocation is completed, and the wake-up signal is used by the task scheduler to start the task to which the relay register has been allocated. For example, since the relay register is not fixedly bound to each work item instance, after determining the number of relay registers allocated to each task, the corresponding number of relay registers needs to be allocated to the corresponding task. When the allocation is completed, a wake-up signal is sent to the task scheduler so that the task scheduler starts the task to which the relay register has been allocated. For example, if a task in the task scheduler needs to configure a relay register, the task scheduler blocks the task until a wake-up signal is received indicating that the relay register configuration for the task has been completed. The task scheduler then allows the task to participate in scheduling.

[0100] FIG4 shows a block diagram of an apparatus 400 for configuring a relay register module according to another embodiment of the present disclosure.

[0101] The device 400 may include a relay register controller, a configuration manager, an address converter, and a read / write port. In an alternative embodiment, the device 400 may also only include a relay register controller, a configuration manager, and an address converter. The relay register controller may be configured to receive a start allocation request for at least one task sent by an upstream (e.g., a task scheduler) (such as a task number, a working mode, and the number of work item instances included in the task, as well as the number of relay registers to be allocated to each work item instance). The relay register controller may determine the number of relay register rows required to be allocated to each task based on the received task start allocation request, and send the number of relay register rows required to the configuration manager. The configuration manager may be configured to dynamically allocate the relay registers according to the number of relay register rows required. When the configuration manager completes the allocation response, the relay register controller will send a wake-up notification to inform the task scheduler that the relay registers required for the task have been allocated and that the task can be started to participate in the scheduling execution.

[0102] When determining the number of required relay register rows, the relay register controller dynamically allocates the required number of relay register rows to different tasks in a multi-mode mixed state based on the different numbers of relay register rows required by different tasks. In particular, the relay register controller can increase or decrease the number of relay register rows used by the corresponding tasks when the number of simultaneously activated tasks is reduced or increased due to specific usage scenarios.

[0103] The configuration manager maintains a valid available row information table, searches and manages the relevant information in the table, obtains the available valid and allocable information, and updates the content in the valid available row information table. In one example, the configuration manager searches the valid available row information table from beginning to end, and when the x-th bit is found to indicate that it can be used (such as being set to 1 to indicate that the row is available), the bit is set to indicate that it has been used (such as being set to 0 to indicate that the row has been used), and it cannot be occupied by other tasks. After allocating the available row to the task, the configuration manager sends the task number and the valid bit index value to the address converter. The address converter then records the task number and the valid bit index value in the row address table. At the same time, the configuration manager recycles the relay register of the releasable task, updates the relevant content in the valid available row information table, and recycles it for use by subsequent tasks. In one example, when the task execution is completed, the configuration manager sets the flag of the corresponding row in the available row information table to be available (such as being set to 1 to indicate that the row is available).

[0104] The address converter manages the row address table according to the task number. In one example, the address converter configures the maximum number of entries belonging to a task to limit the maximum number of tasks that can be started at a time in some application scenarios.

[0105] Additionally, when the pipeline accesses the relay register module, the address converter maps and generates the physical address of the relay register, such as the line number (Line ID) and the bank number (Bank ID), according to the access request and the row address table. For example, since the row address table is managed by the task number, when an access request to the relay register module is received, the index value of the relay register row assigned to the task can be determined by the task number, and the physical address (Line ID and Bank ID) of the relay register row assigned to the task can be determined by the index value, and the actual storage area of ​​the relay register can be accessed by the physical address. In this way, simple and efficient access to the actual storage area of ​​the relay register can be achieved.

[0106] Additionally, the read / write port may be configured to allow the ALU pipeline to access the relay register via the read / write port according to the physical address. In an alternative embodiment, the read / write port may also be provided on the relay register module.

[0107] FIG5 shows a block diagram of an apparatus 500 for configuring a relay register module according to another embodiment of the present disclosure.

[0108] As shown in Figure 5, device 500 may include a relay register controller, a configuration manager, an address converter, a row address table, and a read / write port. In an alternative embodiment, device 500 may also only include a relay register controller, a configuration manager, an address converter, and a row address table. In this case, the read / write port may be arranged on the relay register module. Device 500 may be implemented as device 400, with the difference that the row address table is separated from the configuration manager in Figure 5 and implemented separately.

[0109] In Figure 5, relay register allocation is performed exemplarily according to the wave32 and wave128 compatibility modes: the total number of relay registers, K, is equal to M banks * N tasks * SIMD_Numb. When the program starts, the maximum number of relay registers is first configured, such as T. aligned_size represents the number of DWs contained in a single instance of aligned relay register rows. When the relay register controller receives a task start allocation request from the task scheduler, it obtains the number of relay register rows from the start allocation request, indicating how many relay register rows to allocate. If relay register configuration is determined to be necessary, blocking information is determined for the task, including the need for relay register configuration. If relay register configuration is determined not to be necessary, the task is determined to be in a ready state. The wave128 mode can be configured to 1, indicating that each segment (Seg) can only be allocated one relay register row, and the four segments (Seg0, Seg1, Seg2, Seg3) correspond to four relay register rows. When in wave32 mode, it can be configured as ((T+aligned_size-1) / aligned_size) rows. Generally, the calculation result is 0, 1, 2, 3, or 4 relay register rows, and the corresponding relay register usage for each work item instance is 0, 2, 4, 6, or 8. For example, when a task is assigned a relay register row but is not completed, it can be understood that there are temporarily no idle relay register rows available for allocation. The task can wait until other tasks are completed and the relay register rows available for allocation are released, and then the relay register rows are allocated to the task. However, when the number of released relay register rows does not meet the number of relay register rows required by the start allocation request, the configuration manager will make the task allocation continue to wait until the number of released relay register rows meets the number of relay register rows required by the start allocation request.

[0110] In some optional embodiments, a partial relay register row allocation step may also be performed for a task. For example, when a task requires allocation of four relay register rows and two relay register rows are currently idle, the allocation step for two relay register rows may be performed. If relay register rows are released for allocation after the completion of other tasks, the allocation step for the remaining two relay register rows may be performed. If all relay register rows to be allocated to the task have been allocated, a wake-up signal is sent to the task scheduler.

[0111] For example, when Wave32 needs to configure two relay register rows, the configuration manager searches the valid row information table from beginning to end. If the x-th bit is marked as available (e.g., 1), it sets the bit to used (e.g., 0), making it unavailable for other tasks. At this point, the x-th bit is used as an index, along with the task number, into the corresponding entry in the row address table. In one example, the valid row information table is configured as a 48-bit valid flag table, with each bit indicating a valid relay register row. Typically, 1 indicates available, and 0 indicates used. Essentially, the configuration manager searches for the x-th bit and then enters this x bit into the row address table along with the task's waveid number. Exemplarily, the task's waveid number can be used to manage the row address table, allowing the pipeline to access relay registers by simply sending the task's number. Exemplarily, the valid row information table can be searched continuously based on the number of relay registers assigned to a task, configuring multiple rows of relay registers for that task, and then filling them in one pass. In this way, the task number can be associated with the available relay register row in the relay register module, so that when the pipeline accesses the relay register, only the task number needs to be provided. When the task completes and the allocated relay register row is released, the corresponding bit in the valid available row address table is set to available through the entry in the row address table.

[0112] FIG6 shows a schematic diagram of dynamically allocating relay registers according to an embodiment of the present disclosure.

[0113] As shown in Figure 6, after dynamic allocation is completed, wave32 allocates 2 relay register rows, and each segment of wave128 allocates one relay register row, and the mapping structure is shown in Figure 6. It is obvious that when there are relatively few tasks started at the same time, more relay register rows can be allocated to each task. For example, wave32 allocates 4 relay register rows (for special optimization), and each segment of wave128 allocates 2 relay register rows. Compared with the case of fixed binding, for applications where the number of tasks started at the same time is relatively small due to a large amount of general data register usage by tasks, more relay register resources can be dynamically allocated to each task or more relay register resources can be dynamically allocated for use as general data registers, which helps to reduce the pressure of multiple pipelines accessing general data registers at the same time, while improving the utilization of relay register resources.

[0114] As shown in Figure 6, each work item instance within the same task has its own relay register space. After the previous instruction of the same task is written back, the delay is hidden through the internal instruction scheduling of the task, and it can be immediately provided to the next instruction for use. When it is written back again, as long as the previous instruction is guaranteed to be used, the previous result can be directly overwritten.

[0115] FIG7 is a schematic diagram showing the interaction between a task scheduler and a relay register configuration device according to an embodiment of the present disclosure.

[0116] As shown in Figure 7, after the program is compiled by the compiler, the usage of the relay register is configured. After completion, the software or driver module will configure it into the command control flow, and then pass the usage of the intermediate register through the scheduling management of the intermediate modules. Until it is transmitted to the task scheduler to store the wave storage. At this time, the task scheduler will set different usages based on whether the usage of this relay register is 0. If it is 0, the relay register is not allocated, and the wave state is directly set to the ready state to enter the scheduling information queue for scheduling execution; when it is not 0, the wave needs to be configured through the relay register configuration device, and the blocking state of the unfinished configuration is set. When the wave configuration is completed, the monitor detects that the wave has completed the configuration, clears the blocking state, updates the wave entry to the ready state, and updates the wave state to the ready state to enter the scheduling information queue for scheduling execution.

[0117] FIG8 is a schematic diagram showing the interaction between a task scheduler and a relay register configuration device according to another embodiment of the present disclosure.

[0118] As shown in Figure 8, when a wave finishes executing, the wave end unit executes the end instruction and sends a termination signal for that wave number to the task scheduler. Upon receiving this termination signal, the task scheduler sends a release signal to the relay register configuration device. Once the relay register is released and recovered, a release and recovery completion signal for the wave number is returned, releasing the stored information for that wave and completing the wave's termination and release operation.

[0119] In various embodiments, the apparatus 300, 400, 500 may be used to perform the steps of any method as described above. Therefore, any features according to the method are applicable to the apparatus 300, 400, 500 and vice versa.

[0120] Additionally or alternatively, the above-mentioned method, universal docking module, service platform or third-party platform of the present application can be implemented on one or more computers or servers or similar devices using computer processors, memory units, storage devices, computer software and other components. A high-level block diagram of such a computer or server is shown in FIG9 . Here, computers, servers or other devices including processors are collectively referred to as computing devices. Computing device 902 includes a processor 904, which controls the operation of computer 902 by executing computer program instructions that define the overall operation. The computer program instructions can be stored in a storage device 912 (e.g., a disk) and loaded into memory 910 when the computer program instructions need to be executed. Therefore, the steps of the method with reference to FIG1 can be defined by computer program instructions stored in memory 910 and / or storage device 912, and controlled by the processor 904 that executes the computer program instructions. The computing device 902 also includes one or more network interfaces 906 for communicating with other devices via a network. The computing device 902 also includes other input / output devices 908 (e.g., a display, keyboard, mouse, speakers, buttons, etc.) that enable a user to interact with the computer 902. Those skilled in the art will recognize that embodiments of actual computers may also include other components, and that FIG9 is a high-level representation of some components of such a computer for illustrative purposes.

[0121] Each of the storage device 912 and the memory 910 includes a tangible, non-transitory computer-readable storage medium. Each of the storage device 912 and the memory 910 may include a high-speed random access memory, such as a dynamic random access memory (DRAM), a static random access memory (SRAM), a double data rate synchronous dynamic random access memory (DDR RAM), or other random access solid-state memory devices, and may include a non-volatile memory, such as one or more magnetic disk storage devices (such as an internal hard disk and a removable disk), a magneto-optical disk storage device, an optical disk storage device, a flash memory device, a semiconductor memory device (such as an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM)), a compact disk read-only memory (CD-ROM), a digital versatile disk read-only memory (DVD-ROM) disk, or other non-volatile solid-state storage devices.

[0122] In another embodiment, a computer program product is provided, which can be downloaded from the Internet or stored on a storage medium. The computer program product includes instructions, which, when executed by a computing device or similar apparatus, cause the computing device to perform the method according to any one of the above embodiments.

[0123] In another embodiment, the above method, universal docking module, service platform or third-party platform can be implemented in a network-based cloud computing system. In such a network-based cloud computing system, a server communicates with one or more client computers via a network. The client computer can communicate with the server via a web browser application resident on and running on the client computer, for example. The client computer can store data on the server and access the data via the network. The client computer can transmit data requests or online service requests to the server via the network. The server can implement the requested service and provide the data to (one or more) client computers. The server can also transmit data adapted to enable the client computer to implement a specified function (e.g., perform calculations, display specified data on a screen, etc.). Certain steps of the above method can be implemented by the server or by other computers / processors in the network-based cloud computing system. Certain steps of the above method can be implemented locally by a client computer in the network-based cloud computing system. The steps of the above method can be implemented by one or more devices in the network-based cloud computing system or by a local client computer in any combination.

[0124] It should be appreciated that certain features of the present application that are described in the context of separate embodiments for the sake of clarity may also be provided in combination in a single embodiment. Conversely, various features of the present application that are described in the context of a single embodiment for the sake of simplicity may also be provided individually or in any suitable subcombination or in any other described embodiment of the present application as appropriate. Certain features described in the context of various embodiments should not be considered essential features of those embodiments unless the embodiment is ineffective without those elements.

[0125] Although the present invention has been described in conjunction with the specific embodiments thereof, it is apparent that many substitutions, modifications and variations will be apparent to those skilled in the art. It is therefore intended to cover all such substitutions, modifications and variations that fall within the spirit and broad scope of the appended claims.

[0126] All publications, patents, and patent applications mentioned in this specification are incorporated herein by reference in their entirety to the same extent as if each individual publication, patent, or patent application was specifically and specifically indicated to be incorporated herein by reference. In addition, citation or identification of any reference in this application should not be construed as an admission that such reference is available as prior art to the present application. Where section headings are used, they should not be construed as necessarily limiting.

Claims

1. A method for configuring a relay register module, characterized in that: The method comprises: receiving a start allocation request for at least one task sent by a task scheduler; determining, based on the start allocation request, a number of relay registers to be allocated to each of the at least one task; For each task, a corresponding number of relay registers are allocated; When the allocation is completed, a wake-up signal is sent to the task scheduler, and the wake-up signal is used by the task scheduler to start the task to which the relay register has been allocated. The relay register module is used to store intermediate results obtained based on task instruction operations.

2. The method according to claim 1, characterized in that The start allocation request includes a working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein determining the number of relay registers to be allocated to each task in the at least one task based on the start allocation request includes: The number of relay registers to be allocated to each task is determined according to the granularity corresponding to the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein the granularity represents the maximum number of work item instances included in the corresponding task.

3. The method according to claim 2, characterized in that The number of relay registers to be allocated to each work item instance in the task is determined based on a limited number of tasks started simultaneously.

4. The method according to claim 2 or 3, characterized in that: Each work item instance in tasks of different working modes has a different number of relay registers to be allocated. Each work item instance in a task of the same working mode is to be allocated with the same or different number of relay registers.

5. The method according to claim 1, characterized in that The number of relay registers to be allocated to each task is less than or equal to a reference value, wherein the reference value is determined based on the total number of relay registers, the working mode of the task, and the configured maximum relay register usage.

6. The method according to claim 1, characterized in that The task includes at least one work item instance, each work item instance is allocated at least one relay register, and the method further includes: When the calculation result of the first instruction in the relay register has been used up, the calculation result of the second instruction is stored in the relay register, wherein the first instruction and the second instruction are instructions of the same work item instance, and the second instruction is a subsequent instruction of the first instruction.

7. The method according to claim 1, characterized in that For each task, a corresponding number of relay registers are allocated, including: Based on the number of relay registers to be allocated to the task, determining available rows in the relay register module for allocation to the task, the available rows being relay register rows available for allocation; The relay registers of the available row are allocated to the task, and the available row is marked as an allocated relay register row.

8. The method according to claim 7, characterized in that The available row includes an index value, the task includes a number, and the method further includes: The number of the task and the index value of the available row allocated to the corresponding task are obtained and the number and the index value are recorded in a row address table, wherein the number is used to manage the row address table.

9. The method according to claim 8, characterized in that The method further comprises: In response to receiving an access request to the relay register module, generating a physical address of the relay register corresponding to the access request according to the number of the task included in the access request and the row address table, The physical address is used to access the relay register module.

10. The method according to claim 1, characterized in that The method further comprises: In response to receiving a task end signal, reclaiming a relay register allocated to the task corresponding to the task end signal.

11. A device for configuring a relay register module, characterized in that: The device comprises: - a relay register controller, which is used to receive a start allocation request of at least one task sent by the task scheduler; and based on the start allocation request, determine the number of relay registers to be allocated to each task in the at least one task; - an allocation unit, which allocates a corresponding number of relay registers for each task; - a notification unit, which sends a wake-up signal to the task scheduler when the allocation is completed, and the wake-up signal is used by the task scheduler to start the task to which the relay register has been allocated; -Wherein, the relay register module is used to store intermediate results obtained based on task instruction operations.

12. The device according to claim 11, characterized in that The start allocation request includes the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein the relay register controller is configured to determine the number of relay registers to be allocated to each task based on the granularity corresponding to the working mode of the task and the number of relay registers to be allocated to each work item instance in the task, wherein the granularity represents the maximum number of work item instances included in the corresponding task.

13. The device according to claim 12, characterized in that The number of relay registers to be allocated to each work item instance in the task is determined based on a limited number of tasks started simultaneously.

14. The device according to claim 12 or 13, characterized in that Each work item instance in tasks of different working modes has a different number of relay registers to be allocated, and each work item instance in tasks of the same working mode has a same or different number of relay registers to be allocated.

15. The device according to claim 11, characterized in that The number of relay registers to be allocated to each task is less than or equal to a reference value, wherein the reference value is determined based on the total number of relay registers, the working mode of the task, and the configured maximum relay register usage.

16. The device according to claim 11, characterized in that The task includes at least one work item instance, each work item instance is allocated at least one relay register, wherein the allocation unit is configured to store the calculation result of the second instruction in the relay register when the calculation result of the first instruction in the relay register has been used up, wherein the first instruction and the second instruction are instructions of the same work item instance, and the second instruction is a subsequent instruction of the first instruction.

17. The device according to claim 11, characterized in that The allocation unit is configured to determine, based on the number of relay registers to be allocated to the task, available rows in the relay register module for allocation to the task, the available rows being relay register rows available for allocation; The relay registers of the available row are allocated to the task, and the available row is marked as an allocated relay register row.

18. The device according to claim 17, characterized in that The available row includes an index value, and the task includes a number, wherein the allocation unit is further configured to obtain the number of the task and the index value of the available row allocated to the corresponding task and record the number and the index value in a row address table, wherein the number is used to manage the row address table.

19. The device according to claim 18, characterized in that The allocation unit is also configured to, in response to receiving an access request to the relay register module, generate a physical address of the relay register corresponding to the access request according to the task number included in the access request and the row address table, wherein the physical address is used to access the relay register module.

20. The device according to claim 11, characterized in that The allocation unit is further configured to, in response to receiving a task end signal, reclaim the relay register allocated to the task corresponding to the task end signal.

21. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 10.

22. A computer program product comprising instructions which, when executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 10.

23. A computer readable medium having stored thereon instructions which, when executed, cause a computing device to perform the method of any one of claims 1 to 10.

Citation Information

Patent Citations

  • Multi-task operation method and device for SPI-NAND

    CN108052379A

  • Resource allocation method and device

    CN112559169A

  • Data processing method and data processing device

    CN114090081A

  • Method and device for configuring relay register module, computing equipment and readable medium

    CN116400982A

  • Method and apparatus for performing single instruction multiple data (SIMD) operation using pairing of registers

    US20150154144A1