Processor operation method and device and related products
By dividing the storage area into fine-grained areas and determining the overlap between the operation areas, the efficiency problem of the processor when multiple operations are executed simultaneously is solved, parallel execution of operations is realized, and the processing efficiency of the processor is improved.
Patent Information
- Application Number
- CN201910341003.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-25
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-05-01
AI Technical Summary
In the processor, when multiple operations are operated for the same storage area, it is necessary to wait for the previous operation to be completed, resulting in a decrease in processing efficiency of the processor.
By dividing the target storage area into multiple fine-grained areas, and determining whether there is overlap between these areas during operation, if not overlap, operations are allowed to be performed in parallel to avoid conflicts.
The processing efficiency of the processor is improved, so that multiple operations can operate on the target storage area at the same time, reducing the waiting time and enhancing the parallelism of the operations.
Smart Images

Figure CN111857829B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a processor operation method and device and related products. Background Art
[0002] With the continuous development of artificial intelligence technology, the amount of data and data dimensions that need to be processed are increasing. In related technologies, when multiple operations are performed on the same storage area, the next operation can only be executed after the previous operation is completed, which reduces the processing efficiency of the processor. Summary of the invention
[0003] In view of this, the present disclosure proposes a processor operation technical solution.
[0004] According to one aspect of the present disclosure, a processor operation method is provided, the method comprising: when a first operation is an operation on a target storage area, determining whether there is an ongoing second operation on the target storage area, the target storage area including at least one fine-grained area; when the second operation exists, determining whether there is an overlap between a first fine-grained area currently targeted by the first operation and a second fine-grained area currently targeted by the second operation; and when there is no overlap between the first fine-grained area and the second fine-grained area, executing the first operation.
[0005] According to another aspect of the present disclosure, a processor operation device is provided, the device comprising: an operation judgment module, used to judge whether there is an ongoing second operation on a target storage area when a first operation is an operation on the target storage area, the target storage area comprising at least one fine-grained area; an overlap judgment module, used to judge whether there is an overlap between a first fine-grained area currently targeted by the first operation and a second fine-grained area currently targeted by the second operation when the second operation exists; and an execution module, used to execute the first operation when there is no overlap between the first fine-grained area and the second fine-grained area.
[0006] According to another aspect of the present disclosure, an artificial intelligence chip is provided, wherein the artificial intelligence chip includes the processor operating device as described above.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising the artificial intelligence chip as described above.
[0008] According to another aspect of the present disclosure, a board is provided, which includes: a storage device, an interface device and a control device, and the artificial intelligence chip as described above; wherein the artificial intelligence chip is connected to the storage device, the control device and the interface device respectively; the storage device is used to store data; the interface device is used to realize data transmission between the artificial intelligence chip and an external device; the control device is used to monitor the status of the artificial intelligence chip.
[0009] According to an embodiment of the present disclosure, when the target storage area targeted by the first operation includes at least one fine-grained area and there is an ongoing second operation targeted at the target storage area, it is possible to determine whether there is an overlap between the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation, and when there is no overlap between the two, the first operation is executed. In this way, the fine-grained areas currently operated by the first operation and the second operation can be executed without overlapping, so that the first operation and the second operation can operate on the target storage area at the same time, thereby improving the processing efficiency of the processor.
[0010] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0012] Figure 1 A schematic diagram showing an application scenario of a processor operation method according to an embodiment of the present disclosure.
[0013] Figure 2 A flowchart of a processor operating method according to an embodiment of the present disclosure is shown.
[0014] Figure 3a and Figure 3b A schematic diagram showing an application scenario of a processor operation method according to an embodiment of the present disclosure.
[0015] Figure 4a and Figure 4b A schematic diagram showing an application scenario of a processor operation method according to an embodiment of the present disclosure.
[0016] Figure 5a and Figure 5b A schematic diagram showing an application scenario of a processor operation method according to an embodiment of the present disclosure.
[0017] Figure 6 A schematic diagram showing a circular buffer storage area of a processor operating method according to an embodiment of the present disclosure.
[0018] Figure 7 A block diagram showing a processor operating device according to an embodiment of the present disclosure.
[0019] Figure 8 A structural block diagram of a board according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0020] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0021] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0022] The terms “first”, “second” and the like used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components.
[0023] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.
[0024] See also Figure 1 , Figure 1A schematic diagram of an application scenario of a processor operation method according to an embodiment of the present disclosure is shown. Among them, the processor 100 can be a general-purpose processor (such as a central processing unit CPU, a graphics processing unit GPU), or a special-purpose processor (such as an artificial intelligence processor, a scientific computing processor or a digital signal processor, etc.), and the present disclosure does not limit the type of processor. The storage device 200 includes at least one target storage area 210. It can be understood that the processor can access a certain target storage area 210 by performing a read operation or a write operation. The processor performs a read operation for a certain target storage area 210, which can refer to the processor obtaining data in the target storage area 210. And the processor performs a write operation for a certain target storage area 210, which can refer to the processor writing data to the target storage area 210. In the related art, since the processor can perform multiple operations in parallel, in order to avoid conflicts, when the multiple operations performed in parallel by the processor are all operations for a certain target storage area 210, the processor will only perform one of the multiple operations, while blocking other operations, which will cause the efficiency of the processor to be reduced. The processor operation method provided in the present disclosure further divides the target storage area 210 into multiple fine-grained areas 211. When multiple operations executed in parallel by the processor are all operations for a certain target storage area 210, the processor can determine whether the fine-grained areas 211 targeted by the multiple operations overlap. If the fine-grained areas 211 targeted by each operation do not overlap, the multiple operations can be executed in parallel, thereby greatly improving the efficiency of the processor. It should be noted that the storage device 200 can be set inside the processor (such as an on-chip cache or register, etc.), or it can be set outside the processor and can communicate data with the processor (such as an off-chip memory, etc.). The present disclosure does not limit the type of storage device. The operations involved in the present disclosure can be basic operations supported by the processor hardware, or microinstructions (such as request signals, etc.) after the basic operations are parsed. The present disclosure does not limit the specific type of operation. The processor of the present disclosure can execute two operations in parallel, or more than two operations in parallel, and the present disclosure does not limit the number of operations executed in parallel.
[0025] Figure 2 A flowchart of a processor operating method according to an embodiment of the present disclosure is shown. The processor operating method can be applied to a processor.
[0026] like Figure 2 As shown, the processor operation method includes:
[0027] Step S11, when the first operation is an operation on a target storage area, determining whether there is an ongoing second operation on the target storage area, the target storage area including at least one fine-grained area.
[0028] Among them, the first operation can be a read operation or a write operation, and similarly, the second operation can also be a read operation or a write operation. The present disclosure does not limit the specific types of the first operation and the second operation. An operation may include one or more operands. The target storage area may be the storage area corresponding to one or more operands of the first operation and the second operation. The overall storage area where the target storage area is located can be the internal memory of the processor (such as an on-chip cache or register, etc.), or it can be an external memory connected to the processor (such as an off-chip memory, etc.).
[0029] In a possible implementation, the first operation and / or the second operation may include one or more operands, and the target storage area may be a storage area corresponding to any operand in the first operation and the second operation. The target storage area is a storage area corresponding to at least one operand in the first operation and at least one operand in the second operation. For example, for the first operand in the first operation and the second operand in the second operation, the first operand may be any operand in the first operation, and the second operand may be any operand in the second operation. When the first operand and the second operand are the same operands, the target storage area may be the storage area of the first operand or the storage area of the second operation. When the storage area of the first operand and the storage area of the second operand have overlapping areas, the target storage area is the overlapping area.
[0030] In a possible implementation, the target storage area includes at least one fine-grained area. Wherein, the determination method of the size and / or number of the fine-grained area may include one or any combination of the method determined according to the hardware design, the method determined according to the relevant operation of the target operand, and the method defined according to the relevant parameters in the operation. Wherein, the method determined according to the hardware design is to determine the size of the fine-grained area during the hardware design, such as determining that one row or more rows of the storage area is a fine-grained area. The method determined according to the relevant operation of the target operand includes a method determined according to the processing requirements, storage method, or transmission method of the target operand, for example, the target operand is a two-dimensional matrix data, and its scale is M*N (M, N are both positive integers), indicating the number of bytes occupied by the storage, that is, one row of M bytes, and a total of N rows. It can be determined that M bytes are a fine-grained area, and the target storage area corresponding to the target operand includes N fine-grained areas. The method defined according to the relevant parameters in the operation includes dividing the target storage area into multiple fine-grained areas according to the size and / or number of the fine-grained carried in the operation. When the first operand in the first operation and the second operand in the second operation both correspond to the target storage area, the first operation and the second operation may adopt the method in the embodiment of the present disclosure according to the multiple fine-grained areas divided in the target storage area.
[0031] It should be noted that the sizes of multiple fine-grained areas can be the same or different. For example, the first operation can carry the size of the first fine-grained area (the number of data bits in each fine-grained area), and the size of the first fine-grained area can be set to 64 bits, while the second operation can carry the second fine-grained area (for example, the number of data bits in each fine-grained area), and the size of the second fine-grained area can be set to 256 bits. That is, when the first operation is performed, every 64 bits are used as a fine-grained area, and when the second operation is performed, every 256 bits are used as a fine-grained area. For another example, the fine-grained size (for example, the number of data bits in each fine-grained area) carried by the first operation and the second operation is 512 bits. Similarly, the first operation can also carry the number of the first fine-grained area (for example, set to 4), and the second operation carries the number of the second fine-grained area (for example, set to 8). That is, when the first operation is performed, the target storage area is divided into 4 fine-grained areas, and when the second operation is performed, the target storage area is divided into 8 fine-grained areas. It can be understood that the two parameters of the size and number of fine-grains can also be carried simultaneously in the operation. The size and / or number of each fine-grained area can be determined according to requirements, and the present disclosure does not limit this.
[0032] In a possible implementation, it can be determined whether there is an ongoing second operation on the target storage area by looking up the occupancy status of the target storage area. For example, the processor can determine whether the target storage area is occupied by querying an occupancy status list. If it is occupied, the determination result is that there is an ongoing second operation on the target storage area. The occupancy status list can be pre-set and stored in the memory, or it can be generated before the processor starts to execute a task and deregistered after the task is completed. When the occupancy status of each storage area changes, the processor updates the content of the occupancy status list to record the occupancy status of each storage area.
[0033] In a possible implementation, it is possible to determine whether there is an ongoing second operation for the target storage area by querying the execution status of each operation. For example, the storage area corresponding to the operand of each operation can be recorded, and the execution status of each operation can be recorded. If the execution status of the operation for the target storage area is not completed, the judgment result is that there is an ongoing second operation for the target operation area. It is also possible to determine whether the target storage area corresponding to the operand is occupied by judging the occupation status of the operand, thereby determining whether there is an ongoing second operation for the target operation area. The present disclosure does not limit the basis for judging whether there is an ongoing second operation for the target operation area.
[0034] In a possible implementation, before a first operation is performed on a target storage area, it may be determined whether a second operation is being performed on the target storage area.
[0035] In a possible implementation, during the execution of the first operation on the target storage area, it may also be determined whether there is an ongoing second operation on the target storage area.
[0036] Step S12: when the second operation exists, determining whether a first fine-grained area currently targeted by the first operation overlaps with a second fine-grained area currently targeted by the second operation.
[0037] The first fine-grained area and the second fine-grained area can be any fine-grained area in the target storage area. It can be understood that the operation on the target storage area is the operation on each fine-grained area in the target storage area. For example, the target storage area A is the 1st to 10th row, each row is a fine-grained area, and the target storage area A includes 10 fine-grained areas. The write operation on the target storage area A can be regarded as a write operation on these 10 fine-grained areas. Its execution process can be to write the first fine-grained area (1st row), write the second fine-grained area (2nd row) after the first fine-grained area is written, write the third fine-grained area (3rd row) after the second fine-grained area is written, and so on, until the 10th fine-grained area (10th row) is written, and the write operation of the target storage area A is completed.
[0038] When there is an operation on the target storage area, as the operation is executed, the state of the fine-grained area in the target storage area may include the state of completed operation, the state of ongoing operation and the state of non-operation. The state of the fine-grained area currently targeted by the operation is the state of ongoing operation. Therefore, when there is an operation on the target storage area, it can be considered that there is an operation on a fine-grained area in the target storage area, and the fine-grained area being operated is the fine-grained area currently targeted by the operation.
[0039] In a possible implementation, the first fine-grained area currently targeted by the first operation may include the fine-grained area targeted by the first operation to be performed, which is usually the first fine-grained area. It may also include the fine-grained area currently targeted by the first operation being performed, which may be any fine-grained area. The second fine-grained area currently targeted by the second operation may be the fine-grained area currently targeted by the second operation being performed, which may be any fine-grained area.
[0040] In a possible implementation, when determining whether there is an ongoing second operation on the target storage area before the first operation performs an operation on the target storage area, the first fine-grained area currently targeted by the first operation is the fine-grained area to be performed by the first operation. For example, before the first operation performs an operation on the target storage area, the first fine-grained area currently targeted by the first operation is usually the first fine-grained area of the target storage area. At this time, the first operation has not yet performed an operation on the first fine-grained area. The second fine-grained area currently targeted by the ongoing second operation may be related to the execution process of the second operation. If the second operation has also just started to be executed, the second fine-grained area may also be the first fine-grained area of the target storage area. At this time, the first fine-grained area overlaps with the second fine-grained area. If the second operation has completed the operation of the first fine-grained area, and the second fine-grained area currently targeted is the Pth fine-grained area (P is an integer greater than 1), then the first fine-grained area does not overlap with the second fine-grained area.
[0041] In one possible implementation, when determining whether a second operation is in progress on a target storage area during a first operation on a target storage area, a first fine-grained area can be determined based on the execution process of the first operation, and a second fine-grained area can be determined based on the execution process of the second operation, and then it can be determined whether the first fine-grained area overlaps with the second fine-grained area.
[0042] In a possible implementation, if the execution rhythm of each operation is consistent, it is possible to determine whether there is an ongoing second operation on the target storage area and whether the first fine-grained area overlaps with the second fine-grained area only before the first operation is performed on the target storage area. The consistent rhythm means that when the sizes of the fine-grained areas are the same, the operation duration of the two operations on one fine-grained area is the same.
[0043] In one possible implementation, if the rhythm of the execution processes of various operations is inconsistent or cannot be determined to be consistent, during the operation of the first operation on the target storage area, after each operation on the first fine-grained area currently being targeted is completed, it is possible to continue to determine whether there is an ongoing second operation on the target operation area, and continue to determine whether the first fine-grained area overlaps with the second fine-grained area, so as to determine whether the first operation can continue to be executed.
[0044] In a possible implementation, it is possible to determine whether the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation overlap based on the physical address, the pointer position, the fine-grained area identifier, etc. For example, the current physical address of each operation can be recorded, and the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation can be determined according to the current physical address of the first operation and the current physical address of the second operation, as well as the correspondence between the physical address and the fine-grained area, so as to determine whether the first fine-grained area overlaps with the second fine-grained area. The physical address can include one or any combination of the starting address, the end address, the address of the set position, or the real-time operation address of the fine-grained area. For another example, a pointer can be set for each operation, and the pointer points to the fine-grained area currently targeted by the operation. According to the pointer position of the first operation and the pointer position of the second operation, the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation are determined respectively, so as to determine whether the first fine-grained area overlaps with the second fine-grained area. For another example, an identifier may be set for each fine-grained area, and whether the first fine-grained area overlaps with the second fine-grained area may be determined by recording the identifier of the fine-grained area currently targeted by the operation. The identifier may include any combination of letters, numbers, or symbols. Whether the first fine-grained area overlaps with the second fine-grained area may also be determined by other means, and the present disclosure does not limit the basis for determining whether the first fine-grained area overlaps with the second fine-grained area.
[0045] Step S13: When the first fine-grained area and the second fine-grained area do not overlap, perform the first operation.
[0046] In one possible implementation, if the first fine-grained area currently targeted by the first operation does not overlap with the second fine-grained area currently targeted by the second operation, the first fine-grained area may be a fine-grained area where the second operation has already been performed, or may be a fine-grained area where the second operation does not need to be performed. In this case, executing the first operation will not affect the operation process and operation results of the second operation, and the first operation can be performed.
[0047] According to this embodiment, when the target storage area targeted by the first operation includes at least one fine-grained area and there is an ongoing second operation targeted at the target storage area, it is possible to determine whether there is an overlap between the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation, and when there is no overlap between the two, the first operation is executed. In this way, the fine-grained areas currently operated by the first operation and the second operation can be executed without overlapping, so that the first operation and the second operation can operate on the target storage area at the same time, thereby improving the processing efficiency of the processor.
[0048] In a possible implementation manner, the method may further include: when the first fine-grained area overlaps with the second fine-grained area, blocking the first operation.
[0049] In one possible implementation, the first fine-grained area overlaps with the second fine-grained area, including the first fine-grained area completely overlapping or partially overlapping with the second fine-grained area. When the first fine-grained area overlaps with the second fine-grained area, if the first operation is performed, the operation of the first operation on the overlapping area may affect the execution of the second operation, resulting in an inaccurate operation result of the second operation, or may affect the execution of the first operation, resulting in an inaccurate operation result of the first operation. At this time, the first operation may be blocked, that is, the execution of the first operation may be suspended, and the first operation may be performed after the second operation completes the operation on the second fine-grained area currently being targeted. That is, the first operation is performed when the first fine-grained area does not overlap with the second fine-grained area.
[0050] In this embodiment, when the first fine-grained area overlaps with the second fine-grained area, the first operation is blocked, which can avoid operation errors and inaccurate operation results caused by the overlap of fine-grained areas of each operation, and ensure the correctness of each operation.
[0051] Figure 3a and Figure 3b A schematic diagram showing an application scenario of the processor operation method according to an embodiment of the present disclosure. Figure 3a and Figure 3b As shown, the overall storage area 20 includes a target storage area 21, wherein the target storage area 21 is divided into four fine-grained areas, namely a fine-grained area 22, a fine-grained area 23, a fine-grained area 24 and a fine-grained area 25.
[0052] like Figure 3a As shown, currently only write operations are included, and the write pointer wp is used to represent the fine-grained area currently targeted by the write operation. At the beginning of the write operation, the write pointer wp points to the fine-grained area 22. It can first be determined whether there is a second operation in progress for the target storage area 21. If the result of the determination is that there is no second operation, the write operation to the fine-grained area 22 is started; after the write operation to the fine-grained area 22 is completed, the write pointer wp increases, that is, wp++, and points to the next fine-grained area 23. After the same determination is made, the write operation to the fine-grained area 23 is started; after the write operation to the fine-grained area 23 is completed, the write pointer wp increases and points to the next fine-grained area 24. After the same determination is made, the write operation to the fine-grained area 24 is started.
[0053] Another example Figure 3bAs shown, currently there are two operations, a read operation and a write operation, where the read operation is the first operation and the write operation is the second operation. And the write pointer wp of the write operation and the read pointer rp of the read operation are used to represent the fine-grained regions currently targeted by the write operation and the read operation respectively.
[0054] When performing the read operation (the first operation), it is judged whether there is a second operation on the target storage area 21 that is in progress. After judgment, it is currently found that there is a second operation, the write operation. Further, it is judged whether the first fine-grained region ( Figure 3b the fine-grained region 22 therein) targeted by the read operation (the first operation) overlaps with the second fine-grained region ( Figure 3b the fine-grained region 24 therein) targeted by the write operation (the second operation). For example, it can be determined that the first fine-grained region and the second fine-grained region do not overlap according to the numbers of the fine-grained regions (22 and 24), or according to the relationship between rp and wp (rp = 0, wp = 2, rp < wp). Then, the read operation (the first operation) can be executed.
[0055] After the read operation on the fine-grained region 22 is completed, rp is incremented, i.e., rp++, and points to the next fine-grained region 23. After the same judgment, the first operation starts to operate on the fine-grained region 23; after the read operation on the fine-grained region 23 is completed, rp is incremented and points to the next fine-grained region 24. In this case, it is continuously judged whether the first fine-grained region and the second fine-grained region overlap. If the numbers of the fine-grained regions are the same or the pointer rp = wp, it can be judged that the first fine-grained region targeted by the first operation overlaps with the second fine-grained region targeted by the second operation, then the first operation cannot be executed and the first operation is blocked. When the second operation completes the operation on the fine-grained region 24 and wp is incremented and points to the next fine-grained region 25, and rp < wp, the first operation can be executed.
[0056] In a possible implementation manner, at least one of the first operation and the second operation can be a write operation. That is, when the operation on the target data is read after write (the second operation is a write operation and the first operation is a read operation), write after read (the second operation is a read operation and the first operation is a write operation), or write after write (both the second operation and the first operation are write operations), the method in the embodiments of the present disclosure can be adopted.
[0057] For example, if the first operation is a read operation and the second operation is a write operation, the target operand that the first operation needs to read needs to be the data after the write operation of the second operation. If the number of the second fine-grained region targeted by the second operation is 8, then the first operation can only read the data of the fine-grained regions numbered before 8. That is to say, if the first fine-grained region currently targeted by the first operation is any one of the fine-grained regions numbered 1 to 7, the first operation can be executed.
[0058] In one possible implementation, if the first operation and the second operation are both read operations, the relationship between the fine-grained areas of the first operation and the second operation will not affect the operation results. The method in the embodiment of the present disclosure can be used, or the first operation can be directly executed without making a judgment on the fine-grained area.
[0059] In this embodiment, when at least one of the first operation and the second operation is a write operation, by using the method in the embodiment of the present disclosure, by dividing the target storage area into one or more fine-grained areas, and performing operations in units of fine-grained areas, operations such as read-after-write, write-after-read, and write-after-write can be correctly executed to obtain accurate execution results, and the waiting time between operations can be reduced, thereby improving the execution efficiency of the processor.
[0060] In a possible implementation, the size and / or number of the fine-grained regions may be determined based on at least one of a region where data of a set length is located and a region where data of a set dimension is located.
[0061] It can be understood that the size and / or number of the fine-grained area can be determined in advance before the operation is generated, or it can be determined in real time when each operation is generated. Among them, the size and / or number of the fine-grained area can be determined in advance before the operation, and it can include determining the size and / or number of the fine-grained area according to at least one of the areas where the data of the preset length is located and the areas where the data of the preset dimension is located. The pre-set data of the set length and the pre-set data of the preset dimension can be independent of the operands of each operation, or can be determined in advance based on the operands of each operation, and can be determined according to demand. The size and / or number of the fine-grained area can be determined in real time when each operation is generated, and it can include determining the data of the set length or the data of the set dimension according to the operands of each operation, that is, according to the different operands of each operation, at least one of the areas where the data of the set length is located and the areas where the data of the set dimension is located can be determined in real time to determine the size and / or number of the fine-grained area.
[0062] For example, the size and / or quantity of the fine-grained area can be determined according to the size of the area where the data of the set length is located. For example, the size of the fine-grained area can be set according to the size of the storage area where the data of the set length is located in the target operand, and the area can be a fixed bit width. For example, the target operand B is a three-dimensional data of 20*10*5, and its storage method in the target storage area is 40*25 (i.e., 40 bits of data per row, a total of 25 rows), then the set length can be set to 40 bits, and each row of the target storage area can be set as a fine-grained area, and the storage area of the target operand B can be divided into 25 fine-grained areas; it is also possible to set each 5 rows of the storage area as a fine-grained area, and the storage area of the target operand B can be divided into 5 fine-grained areas. The present disclosure is not limited to this.
[0063] It is understandable that the size and / or number of fine-grained areas can be determined in the target storage area according to at least one of the areas where data of a set length is located and the areas where data of a set dimension is located, or the size and / or number of fine-grained areas can be determined in the overall storage area where the target storage area is located, and the size and / or number of fine-grained areas can be determined in other areas of the overall storage area. The above example only gives one of the cases, and the present disclosure does not limit the applicable division range for determining the size and / or number of fine-grained areas according to at least one of the areas where data of a set length is located and the areas where data of a set dimension is located.
[0064] In a possible implementation, the size and / or number of the fine-grained regions may be determined according to the size of the region where the data of the set dimension is located. For example, if the target operand C is 20*10 two-dimensional data, the storage region of the target operand C may be divided into 10 fine-grained regions according to the data with the set dimension of 1 dimension and length of 20.
[0065] In addition, the size and / or number of the fine-grained regions can also be determined based on the size of the region where the data of the set length and the size of the region where the data of the set dimension are located in the storage region of the target operand. For example, for the target operand C, the fine-grained regions can be divided according to the data of the set dimension of 2 dimensions and the size of 4*2, so that the storage region of the target operand C is divided into 25 fine-grained regions.
[0066] It should be understood that those skilled in the art may set the size and / or number of the divided fine-grained regions according to actual conditions, and the present disclosure does not limit this.
[0067] In this embodiment, by determining the size and / or number of the fine-grained areas according to the size of the area where data of a set length is located and / or the size of the area where data of a set dimension is located, the division of fine-grained areas can be completed according to data characteristics, which can improve the flexibility of fine-grained area division, thereby improving the efficiency of executing multiple operations, and can also make the division results of fine-grained areas more in line with the characteristics of different operands, thereby adapting to the processing requirements of different types of operands, and further improving the overall execution efficiency of multiple operations.
[0068] In a possible implementation, the size and / or number of the fine-grained regions may be determined according to at least one of hardware computing capability and hardware bandwidth.
[0069] The hardware computing capability may be the amount of data processed in parallel by the hardware in one computing cycle, and the hardware bandwidth may be the data transmission capability, such as the amount of data transmitted per unit time.
[0070] For example, a processor that applies the processor operation method has a hardware computing capability of processing 100 bits of data in parallel within one computing cycle and a hardware bandwidth of transmitting 200 bits of data per unit time. For a target storage area with a size of 1000 bits, the target storage area can be divided into 10 fine-grained areas according to the hardware computing capability, where each fine-grained area includes 100 bits of data; the target storage area can also be divided into 5 fine-grained areas according to the hardware bandwidth, where each fine-grained area includes 200 bits of data.
[0071] It should be understood that the hardware computing capability and hardware bandwidth may vary according to the processor hardware, and the present disclosure does not limit the hardware computing capability and hardware bandwidth.
[0072] It is understandable that the size and / or number of the fine-grained area can be determined in the target storage area according to at least one of the hardware computing capability and the hardware bandwidth, or the size and / or number of the fine-grained area can be determined in the overall storage area where the target storage area is located, and the size and / or number of the fine-grained area can be determined in other areas of the overall storage area. The above example only gives one of the cases, and the present disclosure does not limit the applicable division range for determining the size and / or number of the fine-grained area according to at least one of the hardware computing capability and the hardware bandwidth.
[0073] In this way, the size and / or number of the fine-grained areas can be determined according to the processing power of the processor (hardware computing power and / or hardware bandwidth), so that the division results of the fine-grained areas are more in line with the needs of different hardware usage environments, and the operations performed according to the fine-grained areas are synchronized with the processing power of the processor, which can maximize the execution efficiency of the hardware and thus improve the processing efficiency of the processor.
[0074] In a possible implementation, the first operation may be an operation in a first processing instruction, the second operation may be an operation in a second processing instruction, and the second processing instruction is a processing instruction before the first processing instruction in the instruction queue.
[0075] The first processing instruction and the second processing instruction may include one or more of a data access instruction, a computing instruction, a synchronization instruction and a communication instruction, for example, the instruction is a read and compute instruction. The present disclosure does not limit the specific types of the first processing instruction and the second processing instruction.
[0076] In a possible implementation, the first instruction may have a dependency relationship with the second instruction, for example, the first instruction needs to use the calculation result of the second instruction. The first instruction may also have no dependency relationship with the second instruction. When the first instruction has a dependency relationship with the second instruction, the first instruction and the second instruction can be executed in parallel through the method in the embodiment of the present disclosure.
[0077] In this embodiment, the first operation and the second operation may be operations in different instructions. By using the method in the embodiment of the present disclosure, the efficiency of instruction execution may be improved.
[0078] In a possible implementation, the first operation and the second operation may also be two operations in the same processing instruction, and the second operation may be independent of the first operation, or the second operation may be based on the result of the first operation. The processing instruction may include one or more of a data access instruction, an operation instruction, a synchronization instruction, and a communication instruction. For example, if the instruction is a "read and add" operation instruction, the first operation is a read operation, and the second operation is an addition operation. The present disclosure does not limit the specific type of the processing instruction.
[0079] In a possible implementation, the method may further include: recording first position information of a first fine-grained area currently operated by the first operation and second position information of a second fine-grained area currently operated by the second operation,
[0080] Step S13 may include: when the first location information is inconsistent with the second location information, performing the first operation.
[0081] In a possible implementation, the location information may include identification information of the fine-grained area. The identification information may include any combination of numbers and letters. This disclosure does not limit this.
[0082] For example, the location information can be represented by the number information of the fine-grained area, and the target storage area can be divided into 6 fine-grained areas, which are numbered 0 to 5. When the first operation and the second operation are performed on the target storage area, the first location information (for example, numbered 2) of the first fine-grained area currently operated by the first operation and the second location information (for example, numbered 5) of the second fine-grained area currently operated by the second operation can be recorded respectively; then, according to the relationship between the number information (2<5), it can be known that the first location information is inconsistent with the second location information; at this time, the first operation is performed.
[0083] In a possible implementation, the location information may include address information of the fine-grained area. The address information may include at least one of the start address information, the end address information, the address information of the preset position in the fine-grained area, and the address offset information of the fine-grained area. For example, the location information of the fine-grained area is ADDR15-ADDR31.
[0084] In this way, the position information can be used to directly and efficiently determine whether the first fine-grained area overlaps with the second fine-grained area, and determine whether to execute the first operation, which can improve the execution efficiency of the processor.
[0085] In a possible implementation, the first location information may include a first number of fine-grained regions where the first operation has been completed, and the second location information may include a second number of fine-grained regions where the second operation has been completed.
[0086] When the first location information is inconsistent with the second location information, performing the first operation may include: when the first operation is an operation after the second operation and the first number is less than the second number, performing the first operation.
[0087] For example, the first operation is an operation after the second operation, and its target storage area is divided into 6 fine-grained areas, and its location information can be represented by the number of fine-grained areas that have been operated. When executing the first operation and the second operation on the target storage area, the first number of fine-grained areas that have been operated by the first operation (for example, the first number is 3) and the second number of fine-grained areas that have been operated by the second operation (for example, the second number is 5) can be recorded respectively; then, according to the execution order of the first operation and the second operation, and the relationship between the first number and the second number, it can be known that the first operation is an operation after the second operation, and the first number 3 is less than the second number 5, at this time, the first operation is executed.
[0088] In this way, it is possible to intuitively determine whether the first fine-grained area overlaps with the second fine-grained area based on the number of fine-grained areas on which the operation has been completed, and then determine whether to execute the first operation, which can simplify the judgment process and improve the execution efficiency of the processor.
[0089] In one possible implementation, the target storage area may include an operable area and a non-operable area, and step S12 may include: when the second operation exists and the first fine-grained area currently targeted by the first operation is located in the operable area, determining whether there is an overlap between the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation.
[0090] In a possible implementation, the target storage area may include one or more non-operable areas, and may also include continuous or discontinuous non-operable areas.
[0091] In a possible implementation, the target storage area may include one or more operable areas, and may also include continuous or discontinuous operable areas, which is not limited in the present disclosure.
[0092] In one possible implementation, when the first operation is an operation on the target storage area, it can be first determined whether there is an ongoing second operation on the target storage area; when there is a second operation, it is determined whether the first fine-grained area targeted by the first operation is located in the operable area; when there is a second operation and the first fine-grained area targeted by the first operation is located in the operable area, it is then determined whether there is an overlap between the first fine-grained area targeted by the first operation and the second fine-grained area targeted by the second operation; when there is no overlap between the first fine-grained area and the second fine-grained area, the first operation is executed.
[0093] In a possible implementation, the non-operational area may include a prohibited operation area and a non-prohibited operation area. If the first operation is a write operation, when part of the data of the target operand cannot be modified, the storage area where the part of the data is located can be set as a prohibited operation area to avoid accidental modification of the part of the data; if the ongoing second operation is a read operation (read-after-write) of the data before the first operation, one or more fine-grained areas where the second operation is located can be set as non-prohibited operation areas, and when the second operation completes the reading of the non-prohibited operation area, the non-prohibited operation area can be changed to an operable area. The present disclosure does not limit the classification and division method of the non-operational area.
[0094] In this embodiment, it is possible to first determine whether the fine-grained area of the first operation is operable, and then determine the relationship between the fine-grained areas of different operations. On the one hand, the efficiency of the judgment is improved, and on the other hand, the specified data can be protected to prevent erroneous operations from occurring. Reading and writing of the specified space can also be prohibited, thereby reserving the space for executing other operations, further improving the flexibility of the processor in performing fine-grained synchronization.
[0095] In one possible implementation, the non-operable area may be a plurality of fine-grained areas including the second fine-grained area, and the position of the second fine-grained area within the non-operable area is updated along with the operation position of the second operation. The method may further include: when the second fine-grained area targeted by the second operation moves out of the non-operable area, updating the position of the non-operable area.
[0096] That is to say, the non-operable area including the second fine-grained area may not be updated with the update of the second fine-grained area targeted by the second operation. When the second fine-grained area targeted by the second operation moves out of the non-operable area, the position of the non-operable area is updated. For example, the non-operable area may be Q fine-grained areas (Q is an integer greater than 1) including the second fine-grained area, and the current non-operable area includes the 2nd to 2+Q-1th fine-grained areas. When the second operation is performed in the non-operable area after Q fine-grained areas are moved out of the non-operable area, the position of the non-operable area is updated with the position of the fine-grained area targeted by the second operation, and the updated non-operable area includes the 2nd+Q to 2+Q+Q-1th fine-grained areas. Among them, the size of Q can be arbitrarily determined according to demand.
[0097] Figure 4a and Figure 4b A schematic diagram showing an application scenario of the processor operation method according to an embodiment of the present disclosure. Figure 4a As shown, the target storage area 30 includes 8 fine-grained areas, wherein the operable area includes 5 fine-grained areas (fine-grained area 31, fine-grained area 35, fine-grained area 36, fine-grained area 37 and fine-grained area 38), and the non-operable area M0 includes 3 fine-grained areas (fine-grained area 32, fine-grained area 33 and fine-grained area 34). Among them, the second fine-grained area currently targeted by the second operation is the fine-grained area 32.
[0098] After the second operation completes the operation on the fine-grained area 32, the second fine-grained area currently targeted by the second operation is the fine-grained area 33. At this time, the second fine-grained area currently targeted by the second operation (fine-grained area 33) has not moved out of the non-operable area, and the position of the non-operable area is not updated; after the second operation completes the operation on the fine-grained area 33, the second fine-grained area currently targeted by the second operation is the fine-grained area 34. At this time, the second fine-grained area currently targeted by the second operation (fine-grained area 34) has not moved out of the non-operable area, and the position of the non-operable area is not updated; after the second operation completes the operation on the fine-grained area 34, the second fine-grained area currently targeted by the second operation is the fine-grained area 35. At this time, the second fine-grained area currently targeted by the second operation (fine-grained area 35) has moved out of the non-operable area, and the position of the non-operable area is updated to the fine-grained areas 35, 36 and 37). It should be noted that the present disclosure does not limit the size of the non-operable area.
[0099] like Figure 4b As shown, after the position of the non-operable area is updated, the operable area in the target storage area 30 includes 5 fine-grained areas (fine-grained area 31, fine-grained area 32, fine-grained area 33, fine-grained area 34 and fine-grained area 38), and the non-operable area M0 includes 3 fine-grained areas (fine-grained area 35, fine-grained area 36 and fine-grained area 37).
[0100] In this way, there is no need to update the position of the non-operable area in real time, which can reduce the overhead generated by updating the non-operable area.
[0101] In a possible implementation, the non-operable area may be a plurality of fine-grained areas including the second fine-grained area, and the second fine-grained area is located at a set position in the non-operable area, and the position of the non-operable area is updated with the operation position of the second operation.
[0102] That is to say, when the non-operable area is a plurality of fine-grained areas including the second fine-grained area, the position of the second fine-grained area in the non-operable area can be set (for example, the middle position, the last position, etc.), and the position of the non-operable area is updated with the operation position of the second operation. For example, the non-operable area can be Q fine-grained areas including the second fine-grained area, the current non-operable area includes the 2nd to 2+Q-1th fine-grained areas, and the set position of the second fine-grained area in the non-operable area is the Rth (where R≤Q). When the second operation completes the operation on the currently targeted fine-grained area, the second operation begins to perform the operation on the next fine-grained area. At this time, the position of the non-operable area is updated with the operation position of the second operation, and the updated non-operable area includes the 2nd+1st to 2nd+Qth fine-grained areas. Among them, the size of Q and the value of R can be determined according to demand. The present disclosure does not limit the number of fine-grained areas included in the non-operable area and the position of the second fine-grained area in the non-operable area.
[0103] Figure 5a and Figure 5b A schematic diagram showing an application scenario of the processor operation method according to an embodiment of the present disclosure. Figure 5a As shown, the target storage area 40 includes 8 fine-grained areas, wherein the operable area includes 5 fine-grained areas (fine-grained area 41, fine-grained area 45, fine-grained area 46, fine-grained area 47 and fine-grained area 48), and the non-operable area M1 includes 3 fine-grained areas (fine-grained area 42, fine-grained area 43 and fine-grained area 44). The second fine-grained area currently targeted by the second operation is set to the second fine-grained area located in the non-operable area M1, namely, the fine-grained area 43.
[0104] After the second operation completes the operation on the fine-grained area 43, the second fine-grained area currently targeted by the second operation is the fine-grained area 44. At this time, the position of the non-operable area is updated with the operation position of the second operation, so that the second fine-grained area currently targeted by the second operation is located in the second fine-grained area of the non-operable area M1.
[0105] like Figure 5b As shown, in the target storage area 40 after the position of the non-operable area is updated, the operable area includes 5 fine-grained areas (fine-grained area 41, fine-grained area 42, fine-grained area 46, fine-grained area 47 and fine-grained area 48), and the non-operable area M1 includes 3 fine-grained areas (fine-grained area 43, fine-grained area 44 and fine-grained area 45).
[0106] In this way, the position of the non-operable area can be updated in real time, the synchronization degree of fine-grained processing can be improved, and the efficiency of data synchronization processing can be further improved.
[0107] In a possible implementation, the target storage area may include: a circular buffer storage area. The circular buffer storage area may be used to store data in a circular manner.
[0108] Figure 6 A schematic diagram showing a circular buffer storage area of a processor operation method according to an embodiment of the present disclosure. Figure 6 As shown, the target storage area 50 includes a circular buffer storage area 51, whose addresses are start_addr to end_addr.
[0109] For example, the second operation is a write operation, and the target operand can be written into the circular buffer storage area 51. Its address pointer point starts from start_addr and stores data downward in sequence until end_addr, that is, the storage space of the circular buffer storage area 51 is filled. At this time, the address pointer point jumps back to start_addr to determine whether the address has been used up by the first operation to be synchronized. If it has been used up, the data is stored in the address, overwriting the original data. After that, the address pointer point moves downward in sequence until end_addr. At this time, the data can be overwritten again and the above process is repeated.
[0110] In this embodiment, a circular buffer storage area is used to store data, which can save data storage space and improve the efficiency of storage space use.
[0111] In a possible implementation, the circular buffer storage area may be divided into a plurality of fine-grained areas. For each fine-grained area, whether the data in the fine-grained area can be overwritten may be managed by a list or a flag or other means. For example, an overwrite flag may be set to indicate whether the data in the fine-grained area can be overwritten.
[0112] For example, the first operation is a read operation, and the second operation is a write operation, that is, writing first and reading later, and the write pointer wp and the read pointer rp can be used to represent the fine-grained areas currently targeted by the second operation and the first operation, respectively. When the overwrite flag of the second fine-grained area currently targeted by the second operation is overwritable, the second operation can be executed to write data. After the data is written, the overwrite flag of the second fine-grained area is set to non-overwritable, wp++. The second fine-grained area currently targeted by the second operation is the next fine-grained area. If wp>end_addr, then wp=start_addr. When the first fine-grained area currently targeted by the first operation does not overlap with the second fine-grained area, and the overwrite flag of the first fine-grained area is non-overwritable, the first operation can be executed to read data. After the data is read, the overwrite flag of the first fine-grained area is set to overwritable, rp++. The first fine-grained area currently targeted by the first operation is the next fine-grained area. If rp>end_addr, then rp=start_addr. When the first fine-grained area overlaps with the second fine-grained area, that is, rp=wp, the first operation cannot be executed. The first operation can be executed after the second operation completes the operation on the second fine-grained area currently targeted.
[0113] In this embodiment, the circular buffer access area is divided into a plurality of fine-grained areas, so that a plurality of operations can be performed on the circular buffer storage area at the same time, thereby improving the processing efficiency of the processor.
[0114] In a possible implementation, the fine-grained area may include a state identifier, and the state identifier may include a completed state or an incomplete state of operating the fine-grained area.
[0115] Step S13 may include: when the first fine-grained area does not overlap with the second fine-grained area, determining whether the state flag of the first fine-grained area is an operation completed state; if so, executing the first operation.
[0116] In a possible implementation, the fine-grained area may include a state identifier, and the state identifier may include an operation completed state or an operation incomplete state of the fine-grained area. For example, the state identifier may be represented by 0 and 1, wherein 0 represents an operation incomplete state of the fine-grained area, and 1 represents an operation completed state of the fine-grained area, or 0 represents an operation completed state of the fine-grained area, and 1 represents an operation incomplete state of the fine-grained area. The present disclosure does not limit the representation method of the state identifier.
[0117] In a possible implementation, the second operation may set the status identifier of the fine-grained area in the target storage area that has been operated on to the operation completed state, and set the status identifier of the fine-grained area that has not been operated on or is being operated on to the operation incomplete state. The status identifiers of some fine-grained areas in the fine-grained areas that have been operated on may also be set to the operation completed state, and the other fine-grained areas may be set to the operation incomplete state. For example, if the second operation has completed the operation on 5 fine-grained areas, the status identifiers of the first 3 fine-grained areas may be set to the operation completed state, and the other fine-grained areas may be set to the operation incomplete state.
[0118] In one possible implementation, when there is an ongoing second operation on the target storage area, for the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation, after determining that there is no overlap between the first fine-grained area and the second fine-grained area, it can be determined whether the status identifier of the first fine-grained area is the operation completed state; if the status identifier of the first fine-grained area is the operation completed state, the first operation can be executed.
[0119] In this embodiment, the fine-grained area includes a status identifier. When the first fine-grained area and the second fine-grained area do not overlap, whether the first operation is executable is determined based on the status identifier of the first fine-grained area, which can improve the accuracy of data processing while improving the processing efficiency of the processor.
[0120] In one possible implementation, the fine-grained area includes a status identifier, and the status identifier includes an operation completed state or an operation incomplete state of operating the fine-grained area. Step S13 may include: determining whether the status identifier of the first fine-grained area is an operation completed state; if so, executing the first operation when there is no overlap between the first fine-grained area and the second fine-grained area.
[0121] That is, when there is an ongoing second operation for the target storage area, for the first fine-grained area currently targeted by the first operation and the second fine-grained area currently targeted by the second operation, after determining that the state of the first fine-grained area is marked as the operation completed state, it is determined whether the first operation is executable according to the overlapping relationship between the first fine-grained area and the second fine-grained area. When there is no overlap between the first fine-grained area and the second fine-grained area, the first operation can be executed.
[0122] In this embodiment, the fine-grained area includes a status identifier. After determining that the status identifier of the first fine-grained area is the operation completed state, it can be determined whether the first operation is executable based on the overlapping relationship between the first fine-grained area and the second fine-grained area. This can improve the correctness of data processing and the processing efficiency of the processor.
[0123] In a possible implementation, the target operands of the first operation and the second operation are consistent, and the target storage area is a storage area of the target operand.
[0124] In a possible implementation, when the target operand of the first operation is consistent with the target operand of the second operation, the target storage area may be a storage area of the target operand. The storage area of the target operand is the target storage area. After the target storage area is divided into a plurality of fine-grained areas, according to the method in the embodiment of the present disclosure, two operations operating the same target operand can be executed in parallel without affecting the execution results of each operation.
[0125] In this embodiment, the method in the embodiment of the present disclosure can be used to implement parallel execution of two operations on the same operands, thereby improving the execution efficiency of the processor.
[0126] In a possible implementation, the target storage area is an overlapping area between a first storage area of a first operand in the first operation and a second storage area of a second operand in the second operation.
[0127] In a possible implementation, when there is an overlapping area in the storage areas of two operands, the target storage area is the overlapping area. The overlapping area in the storage areas of the two operations can be divided into multiple fine-grained areas. According to the method in the embodiment of the present disclosure, two operations with overlapping areas in the storage areas of the operands can be executed in parallel without affecting the execution results of each operation.
[0128] In this embodiment, when the storage areas of the operands of two operations overlap, the method in the embodiment of the present disclosure can be used to implement parallel execution of the two operations, thereby improving the execution efficiency of the processor.
[0129] In a possible implementation manner, the method may further include: dividing the entire storage area where the target storage area is located into a plurality of fine-grained areas.
[0130] In a possible implementation, the target storage area may be a partial storage area or the entire storage area of the overall storage area of the storage device, where the overall storage area includes a plurality of preset fine-grained areas.
[0131] For example, the overall storage area where the target storage area is located is RAM1, and RAM1 may include m pre-set fine-grained areas (m is a positive integer). The target storage area in RAM1 can occupy n fine-grained areas in RAM1 (n is a positive integer, and n<=m). It should be noted that the target storage area may also include a partial area in a fine-grained area. In the RAM1 shown in the above example, it is assumed that each fine-grained area is a row in the overall storage area RAM1, and each row is 100 bits. The target storage area may include the first (n-1) complete fine-grained areas, and also include a partial area of the last fine-grained area, for example, the first 80 bits in the nth row (nth fine-grained area) in RAM1.
[0132] In a possible implementation, when the overall storage area of the storage device is divided into a plurality of fine-grained areas, for any operation of any target storage area in the overall storage area, and whether the target storage area is a storage area of the same target operand of the first operation and the second operation, or the target storage area is an overlapping area of the storage area of the first operand in the first operation and the storage area of the second operand in the second operation, the fine-grained area in the target storage area can be determined according to the fine-grained division result of the overall storage area. The storage area of any operand of any operation in the overall storage area has a fine-grained area of the same size.
[0133] In one possible implementation, the size and / or number of the fine-grained areas of the overall storage area may be determined based on the hardware characteristics of the storage device, that is, the size and / or number of the fine-grained areas of the overall storage area may be determined based on at least one of the hardware computing capability and the hardware bandwidth of the storage device.
[0134] In this embodiment, the overall storage area where the target storage area is located is divided into multiple fine-grained areas. Any operation on any target storage area in the overall storage area can be executed according to the same fine-grained size. When different operations are performed in parallel according to the method in the embodiment of the present disclosure, they can be synchronized more conveniently, thereby improving the parallelism of operations and thereby improving the processing efficiency of the processor.
[0135] In a possible implementation, the method may further include:
[0136] According to the first fine-grained division information carried in the first operation, a first storage area of the first operand in the first operation is divided into a plurality of fine-grained areas, and
[0137] According to the second fine-grained division information carried in the second operation, the second storage area of the second operand in the second operation is divided into a plurality of fine-grained areas.
[0138] In a possible implementation, fine-grained partitioning information may be carried in an operation, and the fine-grained partitioning information may include the size and / or quantity of the fine-grained partitioning. Different operations may carry different fine-grained partitioning information. Operations of the same type may carry the same fine-grained partitioning information. The fine-grained partitioning information may be carried in the set position of the operand in the operation, and identification information of whether fine-grained partitioning is to be performed may also be carried in the operation code or the operand. The present disclosure does not limit the content and expression of the fine-grained partitioning information.
[0139] In a possible implementation, the first storage area of the first operand is divided into a plurality of first fine-grained areas according to the first fine-grained division information carried in the first operation. Other areas in the overall storage area where the first operand is located may not be fine-grained, or may be fine-grained according to the fine-grained division information carried by other operations. This disclosure does not limit this.
[0140] It is understandable that when the second operand of the second operation is consistent with the first operand of the first operation, the first storage area completely overlaps with the second storage area. The first fine-grained division information and the second fine-grained division information may be consistent or inconsistent. When the first fine-grained division information and the second fine-grained division information are inconsistent, the first storage area may be fine-grained according to the second fine-grained division information at the same time. That is, for the same storage area, different operations may divide it into multiple fine-grained areas of different sizes or numbers. At this time, it is possible to determine whether the first fine-grained area overlaps with the second fine-grained area based on the physical address of the first fine-grained area currently targeted by the first operation and the physical address of the second fine-grained area currently targeted by the second operation, and perform the first operation and the second operation in parallel based on the judgment result.
[0141] In one possible implementation, the fine-grained division information carried in each operation may include the size and / or number of the fine-grained area determined based on at least one of an area where operation data of a set length is located and an area where operands of a set dimension are located, so that the fine-grained division result is more consistent with the type or attribute of the operands in the operation.
[0142] In this embodiment, according to the first fine-grained division information carried in the first operation, the first storage area of the first operand in the first operation is divided into a plurality of fine-grained areas, and according to the second fine-grained division information carried in the second operation, the second storage area of the second operand in the second operation is divided into a plurality of fine-grained areas. Fine-grained division is performed according to the fine-grained division information carried in the operation, so that the fine-grained division result can better meet the processing requirements of each operation, and the operation parallelization is more flexible.
[0143] It should be understood that those skilled in the art may divide and set the target storage area into fine-grained areas according to actual conditions, and the present disclosure does not limit this.
[0144] It should be noted that although the processor operation method is described above by taking the above embodiment as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each step according to personal preferences and / or actual application scenarios, as long as it complies with the technical solution of the present disclosure.
[0145] Figure 7 FIG. 1 is a block diagram showing a processor operation device according to an embodiment of the present disclosure. Figure 7 As shown, the processor operating device includes:
[0146] An operation determination module 71, configured to determine whether there is an ongoing second operation on a target storage area when the first operation is an operation on the target storage area, the target storage area including at least one fine-grained area;
[0147] An overlap determination module 72, configured to determine, when the second operation exists, whether there is an overlap between a first fine-grained area currently targeted by the first operation and a second fine-grained area currently targeted by the second operation;
[0148] The execution module 73 is configured to execute the first operation when the first fine-grained area does not overlap with the second fine-grained area.
[0149] In a possible implementation manner, the device further includes: an execution control module, configured to block the first operation when the first fine-grained area overlaps with the second fine-grained area.
[0150] In a possible implementation manner, at least one of the first operation and the second operation is a write operation.
[0151] In a possible implementation, the size and / or number of the fine-grained regions are determined based on at least one of a region where data of a set length is located and a region where data of a set dimension is located.
[0152] In a possible implementation manner, the size and / or number of the fine-grained regions are determined according to at least one of hardware computing capability and hardware bandwidth.
[0153] In a possible implementation, the first operation is an operation in a first processing instruction, the second operation is an operation in a second processing instruction, and the second processing instruction is a processing instruction before the first processing instruction in the instruction queue.
[0154] In a possible implementation, the device also includes: a location recording module, used to record the first location information of the first fine-grained area of the current operation of the first operation and the second location information of the second fine-grained area of the current operation of the second operation, and the execution module 73 includes: a first execution sub-module, used to execute the first operation when the first location information is inconsistent with the second location information.
[0155] In one possible implementation, the first location information includes a first number of fine-grained areas where the first operation has been completed, the second location information includes a second number of fine-grained areas where the second operation has been completed, and the first execution submodule is further used to: when the first operation is an operation after the second operation and the first number is less than the second number, execute the first operation.
[0156] In one possible implementation, the target storage area includes an operable area and a non-operable area, and the overlap judgment module 72 includes: a judgment submodule, used to judge whether the first fine-grained area currently targeted by the first operation overlaps with the second fine-grained area currently targeted by the second operation when the second operation exists and the first fine-grained area currently targeted by the first operation is located in the operable area.
[0157] In a possible implementation manner, the non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the position of the second fine-grained area in the non-operable area is updated with the operation position of the second operation, and the device further includes:
[0158] An updating module is used to update the position of the non-operable area after the second fine-grained area targeted by the second operation moves out of the non-operable area.
[0159] In a possible implementation, the non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the second fine-grained area is located at a set position in the non-operable area, and the position of the non-operable area is updated with the operation position of the second operation.
[0160] In a possible implementation, the target storage area includes: a circular buffer storage area.
[0161] In a possible implementation, the fine-grained area includes a state identifier, and the state identifier includes a completed state or an incomplete state of operating the fine-grained area.
[0162] The execution module 73 includes: a first state judgment submodule, used to judge whether the state identifier of the first fine-grained area is an operation completed state when the first fine-grained area does not overlap with the second fine-grained area; and a second execution submodule, used to execute the first operation when the state identifier of the first fine-grained area is an operation completed state.
[0163] In a possible implementation, the fine-grained area includes a state identifier, and the state identifier includes a completed state or an incomplete state of operating the fine-grained area.
[0164] The execution module 73 includes: a second state judgment submodule, used to judge whether the state identifier of the first fine-grained area is an operation completed state; and a third execution submodule, used to execute the first operation when the state identifier of the first fine-grained area is an operation completed state and the first fine-grained area does not overlap with the second fine-grained area.
[0165] In a possible implementation, the target operands of the first operation and the second operation are consistent, and the target storage area is a storage area of the target operand.
[0166] In a possible implementation, the target storage area is an overlapping area between a first storage area of a first operand in the first operation and a second storage area of a second operand in the second operation.
[0167] In a possible implementation, the device further includes: a first setting module, configured to divide the overall storage area where the target storage area is located into a plurality of fine-grained areas.
[0168] In a possible implementation manner, the device further includes:
[0169] a second setting module, configured to divide a first storage area of a first operand in the first operation into a plurality of fine-grained areas according to first fine-grained division information carried in the first operation, and
[0170] The third setting module is used to divide the second storage area of the second operand in the second operation into a plurality of fine-grained areas according to the second fine-grained division information carried in the second operation.
[0171] In a possible implementation, an artificial intelligence chip is also disclosed, which includes the above-mentioned processor operating device.
[0172] In a possible implementation, a board is also disclosed, which includes a storage device, an interface device, a control device and the above-mentioned artificial intelligence chip; wherein the artificial intelligence chip is connected to the storage device, the control device and the interface device respectively; the storage device is used to store data; the interface device is used to realize data transmission between the artificial intelligence chip and an external device; the control device is used to monitor the status of the artificial intelligence chip.
[0173] In one possible implementation, the storage device includes: multiple groups of storage units, each group of storage units is connected to the artificial intelligence chip through a bus, and the storage units are: DDR SDRAM; the artificial intelligence chip includes: a DDR controller for controlling data storage and data storage of each storage unit; the interface device is: a standard PCIE interface.
[0174] Figure 8 A structural block diagram of a board according to an embodiment of the present disclosure is shown. Figure 8 In addition to the artificial intelligence chip 389, the board may also include other supporting components, including but not limited to: a storage device 390, an interface device 391 and a control device 392;
[0175] The storage device 390 is connected to the artificial intelligence chip via a bus for storing data. The storage device may include multiple groups of storage units 393. Each group of storage units is connected to the artificial intelligence chip via a bus. It is understood that each group of storage units may be DDR SDRAM (English: Double Data Rate SDRAM, double rate synchronous dynamic random access memory).
[0176] DDR can double the speed of SDRAM without increasing the clock frequency. DDR allows data to be read out on the rising and falling edges of the clock pulse. The speed of DDR is twice that of standard SDRAM. In one embodiment, the storage device may include 4 groups of storage units. Each group of storage units may include multiple DDR4 particles (chips). In one embodiment, the artificial intelligence chip may include 4 72-bit DDR4 controllers, 64 bits of the above 72-bit DDR4 controllers are used to transmit data, and 8 bits are used for ECC verification. It can be understood that when DDR4-3200 particles are used in each group of storage units, the theoretical bandwidth of data transmission can reach 25600MB / s.
[0177] In one embodiment, each group of the storage units includes a plurality of double data rate synchronous dynamic random access memories arranged in parallel. DDR can transmit data twice in one clock cycle. A controller for controlling DDR is provided in the artificial intelligence chip to control the data transmission and data storage of each of the storage units.
[0178] The interface device is electrically connected to the artificial intelligence chip. The interface device is used to realize data transmission between the artificial intelligence chip and an external device (such as a server or a computer). For example, in one embodiment, the interface device may be a standard PCIE interface. For example, the data to be processed is transmitted from the server to the artificial intelligence chip through the standard PCIE interface to realize data transfer. Preferably, when the PCIE 3.0X 16 interface is used for transmission, the theoretical bandwidth can reach 16000MB / s. In another embodiment, the interface device may also be other interfaces. The present disclosure does not limit the specific forms of expression of the above-mentioned other interfaces, and the interface unit can realize the switching function. In addition, the calculation results of the chip are still transmitted back to the external device (such as a server) by the interface device.
[0179] The control device is electrically connected to the artificial intelligence chip. The control device is used to monitor the state of the artificial intelligence chip. Specifically, the artificial intelligence chip and the control device can be electrically connected through an SPI interface. The control device may include a single-chip microcomputer (Micro Controller Unit, MCU). For example, the artificial intelligence chip may include multiple processing chips, multiple processing cores or multiple processing circuits, which can drive multiple loads. Therefore, the artificial intelligence chip can be in different working states such as multi-load and light load. The control device can realize the regulation of the working states of multiple processing chips, multiple processing and / or multiple processing circuits in the artificial intelligence chip.
[0180] In a possible implementation, an electronic device is disclosed, which includes the above-mentioned artificial intelligence chip. The electronic device includes a data processing device, a robot, a computer, a printer, a scanner, a tablet computer, a smart terminal, a mobile phone, a driving recorder, a navigator, a sensor, a camera, a server, a cloud server, a camera, a video camera, a projector, a watch, a headset, a mobile storage, a wearable device, a vehicle, a household appliance, and / or a medical device.
[0181] The transportation means include airplanes, ships and / or vehicles; the household appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, electric lights, gas stoves, and range hoods; the medical equipment includes magnetic resonance imaging, ultrasound machines and / or electrocardiographs.
[0182] A1. A processor operation method, the method comprising:
[0183] When the first operation is an operation on a target storage area, determining whether there is an ongoing second operation on the target storage area, the target storage area including at least one fine-grained area;
[0184] When the second operation exists, determining whether a first fine-grained area currently targeted by the first operation overlaps with a second fine-grained area currently targeted by the second operation;
[0185] When there is no overlap between the first fine-grained area and the second fine-grained area, the first operation is performed.
[0186] A2. The method according to claim A1, further comprising:
[0187] When the first fine-grained area overlaps with the second fine-grained area, the first operation is blocked.
[0188] A3. According to the method of claim A1, at least one of the first operation and the second operation is a write operation.
[0189] A4. According to the method described in claim A1, the size and / or number of the fine-grained regions are determined based on at least one of a region where data of a set length is located and a region where data of a set dimension is located.
[0190] A5. According to the method according to claim A1, the size and / or number of the fine-grained areas are determined based on at least one of hardware computing power and hardware bandwidth.
[0191] A6. According to the method of claim A1, the first operation is an operation in a first processing instruction, the second operation is an operation in a second processing instruction, and the second processing instruction is a processing instruction before the first processing instruction in the instruction queue.
[0192] A7. The method according to any one of claims A1 to A6, further comprising:
[0193] Recording first position information of a first fine-grained area currently operated by the first operation and second position information of a second fine-grained area currently operated by the second operation,
[0194] When the first fine-grained area and the second fine-grained area do not overlap, performing the first operation includes:
[0195] When the first location information is inconsistent with the second location information, the first operation is performed.
[0196] A8. The method according to claim A7, wherein the first location information includes a first number of fine-grained areas where the first operation has been completed, and the second location information includes a second number of fine-grained areas where the second operation has been completed,
[0197] When the first location information is inconsistent with the second location information, performing the first operation includes:
[0198] When the first operation is an operation subsequent to the second operation and the first number is less than the second number, the first operation is performed.
[0199] A9. According to the method of claim A1, the target storage area includes an operable area and a non-operable area, and when the second operation exists, determining whether a first fine-grained area currently targeted by the first operation overlaps with a second fine-grained area currently targeted by the second operation, comprising:
[0200] When the second operation exists and the first fine-grained area currently targeted by the first operation is within the operable area, it is determined whether the first fine-grained area currently targeted by the first operation overlaps with the second fine-grained area currently targeted by the second operation.
[0201] A10. According to the method of claim A9, the non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the position of the second fine-grained area in the non-operable area is updated with the operation position of the second operation, and the method further comprises:
[0202] When the second fine-grained area targeted by the second operation moves out of the non-operable area, the position of the non-operable area is updated.
[0203] A11. According to the method of claim A9, the non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the second fine-grained area is located at a set position in the non-operable area,
[0204] The position of the non-operable area is updated along with the operation position of the second operation.
[0205] A12. According to the method of claim A1, the target storage area comprises: a circular buffer storage area.
[0206] A13. According to the method of claim A1, the fine-grained area includes a state identifier, and the state identifier includes an operation completion state or an operation incomplete state of operating the fine-grained area.
[0207] When the first fine-grained area and the second fine-grained area do not overlap, performing the first operation includes:
[0208] When the first fine-grained area and the second fine-grained area do not overlap, determining whether the state identifier of the first fine-grained area is an operation completed state;
[0209] If yes, the first operation is performed.
[0210] A14. According to the method of claim A1, the fine-grained area includes a state identifier, and the state identifier includes an operation completed state or an operation incomplete state of operating the fine-grained area;
[0211] When the first fine-grained area and the second fine-grained area do not overlap, performing the first operation includes:
[0212] Determine whether the state flag of the first fine-grained area is an operation completed state;
[0213] If so, when the first fine-grained area does not overlap with the second fine-grained area, the first operation is performed.
[0214] A15. According to the method of claim A1, the target operands of the first operation and the second operation are consistent, and the target storage area is the storage area of the target operand.
[0215] A16. According to the method of claim A1, the target storage area is an overlapping area between a first storage area of a first operand in a first operation and a second storage area of a second operand in a second operation.
[0216] A17. The method according to any one of claims A1 to A16, further comprising:
[0217] The overall storage area where the target storage area is located is divided into multiple fine-grained areas.
[0218] A18. The method according to any one of claims A1 to A17, further comprising:
[0219] According to the first fine-grained division information carried in the first operation, a first storage area of the first operand in the first operation is divided into a plurality of fine-grained areas, and
[0220] According to the second fine-grained division information carried in the second operation, the second storage area of the second operand in the second operation is divided into a plurality of fine-grained areas.
[0221] A19. A processor operating device, the device comprising:
[0222] an operation determination module, configured to determine, when the first operation is an operation on a target storage area, whether there is an ongoing second operation on the target storage area, the target storage area including at least one fine-grained area;
[0223] an overlap determination module, configured to determine, when the second operation exists, whether there is an overlap between a first fine-grained area currently targeted by the first operation and a second fine-grained area currently targeted by the second operation;
[0224] An execution module is used to execute the first operation when the first fine-grained area does not overlap with the second fine-grained area.
[0225] A20. The device according to claim A19, further comprising:
[0226] The execution control module is used to block the first operation when the first fine-grained area overlaps with the second fine-grained area.
[0227] A21. The apparatus according to claim A19, wherein at least one of the first operation and the second operation is a write operation.
[0228] A22. According to the device described in claim A19, the size and / or number of the fine-grained areas are determined based on at least one of the areas where data of a set length is located and the areas where data of a set dimension is located.
[0229] A23. According to the device according to claim A19, the size and / or number of the fine-grained areas are determined based on at least one of hardware computing power and hardware bandwidth.
[0230] A24. According to the device according to claim A19, the first operation is an operation in a first processing instruction, the second operation is an operation in a second processing instruction, and the second processing instruction is a processing instruction before the first processing instruction in the instruction queue.
[0231] A25. The device according to any one of claims A19 to A24, further comprising:
[0232] a position recording module, configured to record first position information of a first fine-grained area currently operated by the first operation and second position information of a second fine-grained area currently operated by the second operation,
[0233] The execution module comprises:
[0234] The first execution submodule is used to execute the first operation when the first location information is inconsistent with the second location information.
[0235] A26. The apparatus according to claim A25, wherein the first location information comprises a first number of fine-grained regions where the first operation has been completed, and the second location information comprises a second number of fine-grained regions where the second operation has been completed,
[0236] The first execution submodule is further used for:
[0237] When the first operation is an operation subsequent to the second operation and the first number is less than the second number, the first operation is performed.
[0238] A27. The device according to claim A19, wherein the target storage area includes an operable area and a non-operable area, and the overlap determination module includes:
[0239] The judging submodule is used to judge whether the first fine-grained area currently targeted by the first operation overlaps with the second fine-grained area currently targeted by the second operation when the second operation exists and the first fine-grained area currently targeted by the first operation is within the operable area.
[0240] A28. The device according to claim A27, wherein the non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the position of the second fine-grained area in the non-operable area is updated with the operation position of the second operation, and the device further comprises:
[0241] An updating module is used to update the position of the non-operable area after the second fine-grained area targeted by the second operation moves out of the non-operable area.
[0242] A29. The device according to claim A27, wherein the non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the second fine-grained area is located at a set position within the non-operable area,
[0243] The position of the non-operable area is updated along with the operation position of the second operation.
[0244] A30. According to the device according to claim A19, the target storage area includes: a circular buffer storage area.
[0245] A31. The apparatus according to claim A19, wherein the fine-grained area includes a state identifier, wherein the state identifier includes an operation completed state or an operation incomplete state of operating the fine-grained area.
[0246] The execution module comprises:
[0247] A first state judgment submodule, configured to judge whether the state flag of the first fine-grained area is an operation completed state when the first fine-grained area does not overlap with the second fine-grained area;
[0248] The second execution submodule is configured to execute the first operation when the state of the first fine-grained area is identified as an operation completed state.
[0249] A32. The apparatus according to claim A19, wherein the fine-grained area includes a state identifier, wherein the state identifier includes an operation completed state or an operation incomplete state of operating the fine-grained area.
[0250] The execution module comprises:
[0251] A second state judgment submodule is used to judge whether the state flag of the first fine-grained area is an operation completed state;
[0252] The third execution submodule is configured to execute the first operation when the state of the first fine-grained area is identified as an operation completed state and the first fine-grained area does not overlap with the second fine-grained area.
[0253] A33. The apparatus according to claim A19, wherein the target operands of the first operation and the second operation are consistent, and the target storage area is the storage area of the target operand.
[0254] A34. The apparatus according to claim A19, wherein the target storage area is an overlapping area between a first storage area of a first operand in a first operation and a second storage area of a second operand in a second operation.
[0255] A35. The device according to any one of claims A19 to A34, further comprising:
[0256] The first setting module is used to divide the overall storage area where the target storage area is located into a plurality of fine-grained areas.
[0257] A36. The device according to any one of claims A19 to A35, further comprising:
[0258] a second setting module, configured to divide a first storage area of a first operand in the first operation into a plurality of fine-grained areas according to first fine-grained division information carried in the first operation, and
[0259] The third setting module is used to divide the second storage area of the second operand in the second operation into a plurality of fine-grained areas according to the second fine-grained division information carried in the second operation.
[0260] A37. An artificial intelligence chip, comprising a processor operating device as described in any one of claims A19-A36.
[0261] A38. An electronic device, comprising the artificial intelligence chip as described in claim A37.
[0262] A39. A board comprising: a storage device, an interface device, a control device, and an artificial intelligence chip as claimed in claim A37;
[0263] Wherein, the artificial intelligence chip is connected to the storage device, the control device and the interface device respectively;
[0264] The storage device is used to store data;
[0265] The interface device is used to realize data transmission between the artificial intelligence chip and external equipment;
[0266] The control device is used to monitor the status of the artificial intelligence chip.
[0267] A40. The board according to claim A39, wherein the storage device comprises: a plurality of groups of storage units, each group of the storage units is connected to the artificial intelligence chip via a bus, and the storage units are: DDR SDRAM;
[0268] The artificial intelligence chip includes: a DDR controller for controlling data transmission and data storage of each storage unit;
[0269] The interface device is: a standard PCIE interface.
[0270] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A processor operation method, characterized in that: The method comprises: When the first operation is an operation on a target storage area, determining whether there is an ongoing second operation on the target storage area, the target storage area including at least one fine-grained area; When the second operation exists, determining whether a first fine-grained area currently targeted by the first operation overlaps with a second fine-grained area currently targeted by the second operation; When the first fine-grained area does not overlap with the second fine-grained area, the first operation is performed, and both the first operation and the second operation are performed on any fine-grained area in the target storage area; The first operation is an operation in a first processing instruction, the second operation is an operation in a second processing instruction, and the second processing instruction is a processing instruction before the first processing instruction in the instruction queue; the method further includes: Recording first position information of a first fine-grained area currently operated by the first operation and second position information of a second fine-grained area currently operated by the second operation, When the first fine-grained area and the second fine-grained area do not overlap, performing the first operation includes: When the first location information is inconsistent with the second location information, the first operation is performed.
2. The method according to claim 1, characterized in that The method further comprises: When the first fine-grained area overlaps with the second fine-grained area, the first operation is blocked.
3. The method according to claim 1, characterized in that At least one of the first operation and the second operation is a write operation.
4. The method according to claim 1, characterized in that: The size and / or number of the fine-grained regions are determined based on at least one of a region where data of a set length is located and a region where data of a set dimension is located.
5. The method according to claim 1, characterized in that The size and / or number of the fine-grained regions are determined according to at least one of hardware computing capability and hardware bandwidth.
6. The method according to claim 1, characterized in that The first position information includes a first number of fine-grained regions where the first operation has been completed, and the second position information includes a second number of fine-grained regions where the second operation has been completed. When the first location information is inconsistent with the second location information, performing the first operation includes: When the first operation is an operation subsequent to the second operation and the first number is less than the second number, the first operation is performed.
7. The method according to claim 1, characterized in that The target storage area includes an operable area and a non-operable area. When the second operation exists, determining whether a first fine-grained area currently targeted by the first operation overlaps with a second fine-grained area currently targeted by the second operation includes: When the second operation exists and the first fine-grained area currently targeted by the first operation is within the operable area, it is determined whether the first fine-grained area currently targeted by the first operation overlaps with the second fine-grained area currently targeted by the second operation.
8. The method according to claim 7, characterized in that The non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the position of the second fine-grained area in the non-operable area is updated with the operation position of the second operation, and the method further includes: When the second fine-grained area targeted by the second operation moves out of the non-operable area, the position of the non-operable area is updated.
9. The method according to claim 7, characterized in that: The non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the second fine-grained area is located at a set position in the non-operable area, The position of the non-operable area is updated along with the operation position of the second operation.
10. The method according to claim 1, characterized in that The target storage area includes: a circular buffer storage area.
11. The method according to claim 1, characterized in that: The fine-grained area includes a state identifier, and the state identifier includes an operation completion state or an operation incomplete state of operating the fine-grained area. When the first fine-grained area and the second fine-grained area do not overlap, performing the first operation includes: When the first fine-grained area and the second fine-grained area do not overlap, determining whether the state identifier of the first fine-grained area is an operation completed state; If yes, the first operation is performed.
12. The method according to claim 1, characterized in that The fine-grained area includes a state identifier, and the state identifier includes an operation completion state or an operation incomplete state of operating the fine-grained area. When the first fine-grained area and the second fine-grained area do not overlap, performing the first operation includes: Determine whether the state flag of the first fine-grained area is an operation completed state; If so, when the first fine-grained area does not overlap with the second fine-grained area, the first operation is performed.
13. The method according to claim 1, characterized in that The target operands of the first operation and the second operation are consistent, and the target storage area is the storage area of the target operand.
14. The method according to claim 1, characterized in that The target storage area is an overlapping area between a first storage area of a first operand in a first operation and a second storage area of a second operand in a second operation.
15. The method according to claim 1, characterized in that The method further comprises: The overall storage area where the target storage area is located is divided into multiple fine-grained areas.
16. The method according to claim 1, characterized in that The method further comprises: According to the first fine-grained division information carried in the first operation, a first storage area of the first operand in the first operation is divided into a plurality of fine-grained areas, and According to the second fine-grained division information carried in the second operation, the second storage area of the second operand in the second operation is divided into a plurality of fine-grained areas.
17. A processor operating device, characterized in that: The device comprises: an operation determination module, configured to determine, when the first operation is an operation on a target storage area, whether there is an ongoing second operation on the target storage area, the target storage area including at least one fine-grained area; an overlap determination module, configured to determine, when the second operation exists, whether there is an overlap between a first fine-grained area currently targeted by the first operation and a second fine-grained area currently targeted by the second operation; an execution module, configured to execute the first operation when the first fine-grained area does not overlap with the second fine-grained area, wherein the first operation and the second operation are both executed for any fine-grained area in the target storage area; The first operation is an operation in a first processing instruction, the second operation is an operation in a second processing instruction, and the second processing instruction is a processing instruction before the first processing instruction in the instruction queue; the device further includes: a position recording module, configured to record first position information of a first fine-grained area currently operated by the first operation and second position information of a second fine-grained area currently operated by the second operation, The execution module comprises: The first execution submodule is used to execute the first operation when the first location information is inconsistent with the second location information.
18. The device according to claim 17, characterized in that The device also includes: The execution control module is used to block the first operation when the first fine-grained area overlaps with the second fine-grained area.
19. The device according to claim 17, characterized in that At least one of the first operation and the second operation is a write operation.
20. The device according to claim 17, characterized in that The size and / or number of the fine-grained regions are determined based on at least one of a region where data of a set length is located and a region where data of a set dimension is located.
21. The device according to claim 17, characterized in that The size and / or number of the fine-grained regions are determined according to at least one of hardware computing capability and hardware bandwidth.
22. The device according to claim 17, characterized in that The first position information includes a first number of fine-grained regions where the first operation has been completed, and the second position information includes a second number of fine-grained regions where the second operation has been completed. The first execution submodule is further used for: When the first operation is an operation subsequent to the second operation and the first number is less than the second number, the first operation is performed.
23. The device according to claim 17, characterized in that The target storage area includes an operable area and a non-operable area, and the overlap determination module includes: The judging submodule is used to judge whether the first fine-grained area currently targeted by the first operation overlaps with the second fine-grained area currently targeted by the second operation when the second operation exists and the first fine-grained area currently targeted by the first operation is within the operable area.
24. The device according to claim 23, characterized in that The non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the position of the second fine-grained area in the non-operable area is updated with the operation position of the second operation, and the device further includes: An updating module is used to update the position of the non-operable area after the second fine-grained area targeted by the second operation moves out of the non-operable area.
25. The device according to claim 23, characterized in that The non-operable area is a plurality of fine-grained areas including the second fine-grained area, and the second fine-grained area is located at a set position in the non-operable area, The position of the non-operable area is updated along with the operation position of the second operation.
26. The device according to claim 17, characterized in that The target storage area includes: a circular buffer storage area.
27. The device according to claim 17, characterized in that The fine-grained area includes a state identifier, and the state identifier includes an operation completion state or an operation incomplete state of operating the fine-grained area. The execution module comprises: A first state judgment submodule, configured to judge whether the state flag of the first fine-grained area is an operation completed state when the first fine-grained area does not overlap with the second fine-grained area; The second execution submodule is configured to execute the first operation when the state of the first fine-grained area is identified as an operation completed state.
28. The device according to claim 17, characterized in that The fine-grained area includes a state identifier, and the state identifier includes an operation completion state or an operation incomplete state of operating the fine-grained area. The execution module comprises: A second state judgment submodule is used to judge whether the state flag of the first fine-grained area is an operation completed state; The third execution submodule is configured to execute the first operation when the state of the first fine-grained area is marked as an operation completed state and the first fine-grained area does not overlap with the second fine-grained area.
29. The device according to claim 17, characterized in that The target operands of the first operation and the second operation are consistent, and the target storage area is the storage area of the target operand.
30. The device according to claim 17, characterized in that The target storage area is an overlapping area between a first storage area of a first operand in a first operation and a second storage area of a second operand in a second operation.
31. The device according to claim 17, characterized in that The device also includes: The first setting module is used to divide the overall storage area where the target storage area is located into a plurality of fine-grained areas.
32. The device according to claim 17, characterized in that The device also includes: a second setting module, configured to divide a first storage area of a first operand in the first operation into a plurality of fine-grained areas according to first fine-grained division information carried in the first operation, and The third setting module is used to divide the second storage area of the second operand in the second operation into a plurality of fine-grained areas according to the second fine-grained division information carried in the second operation.
33. An artificial intelligence chip, characterized in that: The artificial intelligence chip includes a processor operating device as described in any one of claims 17-32.
34. An electronic device, characterized in that: The electronic device includes the artificial intelligence chip as described in claim 33.
35. A board, characterized in that: The board includes: a storage device, an interface device and a control device and an artificial intelligence chip as claimed in claim 33; Wherein, the artificial intelligence chip is connected to the storage device, the control device and the interface device respectively; The storage device is used to store data; The interface device is used to realize data transmission between the artificial intelligence chip and external equipment; The control device is used to monitor the status of the artificial intelligence chip.
36. The board according to claim 35, characterized in that: The storage device comprises: a plurality of groups of storage units, each group of the storage units is connected to the artificial intelligence chip via a bus, and the storage units are: DDR SDRAM; The artificial intelligence chip includes: a DDR controller for controlling data transmission and data storage of each storage unit; The interface device is: a standard PCIE interface.
Citation Information
Patent Citations
Hardware instruction generation unit for specialized processors
CN107347253A
A computing device and a board card
CN109543832A
Operation method and device and related product
CN109657782A
Device and relative method for hardware array appositive operation
CN1588300A
Handling of address conflicts during asynchronous memory move operations
US20090198938A1
