CN117573210A - Synchronous control method, device and equipment - Google Patents

Synchronous control method, device and equipment Download PDF

Info

Publication number
CN117573210A
CN117573210A CN202311546136.8A CN202311546136A CN117573210A CN 117573210 A CN117573210 A CN 117573210A CN 202311546136 A CN202311546136 A CN 202311546136A CN 117573210 A CN117573210 A CN 117573210A
Authority
CN
China
Prior art keywords
signal
units
target
unit
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311546136.8A
Other languages
Chinese (zh)
Inventor
巩冬梅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202311546136.8A priority Critical patent/CN117573210A/en
Publication of CN117573210A publication Critical patent/CN117573210A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3885Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units
    • G06F9/3887Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units controlled by a single instruction for multiple data lanes [SIMD]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Neurology (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Multi Processors (AREA)

Abstract

The embodiment of the application provides a synchronous control method, a synchronous control device and synchronous control equipment, wherein the method comprises the following steps: the method comprises the steps that corresponding configuration instructions are sent to N target units, the N target units are operation units for executing a current calculation task in a plurality of operation units, the configuration instructions instruct the target units to execute configuration operation before the current calculation task, and N is an integer greater than or equal to 1; receiving a starting signal sent by a target unit according to a configuration instruction, wherein the starting signal indicates the target unit to execute configuration operation; and generating a first synchronization signal according to the starting signal sent by each target unit, and sending the first synchronization signal to N target units, wherein the first synchronization signal indicates the N target units to synchronously execute the current calculation task. The synchronous control method, the synchronous control device and the synchronous control equipment are used for improving the data consistency of N target units after executing the current calculation task.

Description

Synchronous control method, device and equipment
Technical Field
The embodiment of the application relates to the field of neural network processors, in particular to a synchronous control method, a synchronous control device and synchronous control equipment.
Background
A Neural Network Processing Unit (NPU) is a processor for performing Neural network computing tasks. The NPU comprises a plurality of operation units which are commonly used for executing the neural network calculation task.
In the related art, the process of performing a computing task once includes: and sequentially issuing corresponding instructions to each operation unit, and executing calculation tasks by each operation unit according to the corresponding instructions. In practical applications, multiple computing units are often required to perform computing tasks synchronously to meet data consistency requirements. The data consistency means that the plurality of operation units synchronously start to execute the current calculation task, so that each operation unit can output all calculation results obtained after the current calculation task is executed before the next calculation task is executed.
In the related art described above, the times at which the respective arithmetic units receive the corresponding instructions may be different, and thus the start times at which the respective arithmetic units execute the calculation tasks may also be different, resulting in poor data consistency after the respective arithmetic units execute the calculation tasks.
Disclosure of Invention
The embodiment of the application provides a synchronous control method, a synchronous control device and synchronous control equipment, which are used for improving data consistency after an operation unit executes a calculation task.
In a first aspect, an embodiment of the present application provides a synchronization control method, including:
the method comprises the steps that corresponding configuration instructions are sent to N target units, the N target units are operation units for executing a current calculation task in a plurality of operation units, the configuration instructions instruct the target units to execute configuration operation before the current calculation task, and N is an integer greater than or equal to 1;
Receiving a starting signal sent by a target unit according to a configuration instruction, wherein the starting signal indicates the target unit to execute configuration operation;
and generating a first synchronization signal according to the starting signal sent by each target unit, and sending the first synchronization signal to N target units, wherein the first synchronization signal indicates the N target units to synchronously execute the current calculation task.
In one possible implementation manner, the generating the first synchronization signal according to the start signal sent by each target unit includes:
for each target unit, performing level adjustment on a first preset signal of the target unit according to a starting signal sent by the target unit to obtain a first state signal of the target unit;
and generating a first synchronous signal according to the first state signal of each target unit, a first preset signal of the residual units and the preset task identification information, wherein the residual units are operation units except N target units in the plurality of operation units.
In one possible implementation manner, the generating the first synchronization signal according to the first status signal of each target unit, the first preset signal of the remaining units and the pre-configured task identification information includes:
determining first state identification information according to the first state signals of each target unit and the first preset signals of the remaining units;
And generating a first synchronous signal according to the first state identification information and the task identification information.
In one possible embodiment, determining the first state identification information according to the first state signal of each target unit and the first preset signal of the remaining units includes:
for each target unit, determining the level corresponding to the first state signal of the target unit as a first state identifier of the target unit;
determining the level corresponding to the first preset signal of the residual unit as a second state identifier of the residual unit;
and sequencing the first state identifiers of the target units and the second state identifiers of the rest units according to a first preset sequence to obtain first state identifier information.
In one possible implementation manner, the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged according to a first preset sequence; generating a first synchronization signal according to the first state identification information and the task identification information, including:
judging whether the first state identification information is matched with the task identification information;
if so, a first synchronization signal is generated.
In one possible embodiment, the method further comprises:
Receiving an ending signal sent by each target unit, wherein the ending signal indicates the target unit to finish executing the current calculation task;
and generating a second synchronizing signal according to the ending signals sent by the target units, wherein the second synchronizing signal indicates N target units to synchronously execute the current computing task to end.
In one possible implementation manner, the generating the second synchronization signal according to the end signal sent by each target unit includes:
for each target unit, performing level adjustment on a second preset signal of the target unit according to an end signal sent by the target unit to obtain a second state signal of the target unit;
and generating a second synchronous signal according to the second state signal of each target unit, a second preset signal of the residual units and the preset task identification information, wherein the residual units are operation units except N target units in the plurality of operation units.
In one possible implementation manner, the generating the second synchronization signal according to the second status signal of each target unit, the second preset signal of the remaining units and the pre-configured task identification information includes:
determining second state identification information according to the second state signals of the target units and second preset signals of the residual units;
And generating a second synchronous signal according to the second state identification information and the task identification information.
In one possible embodiment, determining the second state identification information according to the second state signal of each target unit and the second preset signal of the remaining units includes:
for each target unit, determining the level corresponding to the second state signal of the target unit as a third state identifier of the target unit;
determining the level corresponding to the second preset signal of the residual unit as a fourth state identifier of the residual unit;
and sequencing the third state identifiers of all the target units and the fourth state identifiers of the rest units according to the first preset sequence to obtain second state identifier information.
In one possible implementation manner, the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged according to a first preset sequence; generating a second synchronization signal according to the second state identification information and the task identification information, including:
judging whether the second state identification information is matched with the task identification information;
if so, a second synchronization signal is generated.
In one possible implementation, sending corresponding configuration instructions to N target units includes:
Acquiring a control instruction;
analyzing the control instruction to obtain configuration instructions corresponding to N target units;
and sending corresponding configuration instructions to the N target units.
In one possible embodiment, the plurality of arithmetic units are arithmetic units in a neural network processing unit.
In one possible embodiment, the plurality of arithmetic units are identical in structure.
In one possible embodiment, the arithmetic unit is a matrix arithmetic unit or a vector arithmetic unit.
In a second aspect, an embodiment of the present application provides a synchronization control apparatus, including:
the sending module is used for sending corresponding configuration instructions to N target units, wherein the N target units are operation units for executing a current calculation task in a plurality of operation units, the configuration instructions instruct the target units to execute configuration operation before the current calculation task, and N is an integer greater than or equal to 1;
the receiving module is used for receiving a starting signal sent by the target unit according to the configuration instruction, and the starting signal indicates the target unit to execute the configuration operation to finish;
the generating module is used for generating a first synchronous signal according to the starting signal sent by each target unit, and the first synchronous signal indicates N target units to synchronously execute the current calculation task;
And the sending module is also used for sending the first synchronous signals to the N target units.
In one possible implementation, the generating module is specifically configured to:
for each target unit, performing level adjustment on a first preset signal of the target unit according to a starting signal sent by the target unit to obtain a first state signal of the target unit;
and generating a first synchronous signal according to the first state signal of each target unit, a first preset signal of the residual units and the preset task identification information, wherein the residual units are operation units except N target units in the plurality of operation units.
In one possible implementation, the generating module is specifically configured to:
determining first state identification information according to the first state signals of each target unit and the first preset signals of the remaining units;
and generating a first synchronous signal according to the first state identification information and the task identification information.
In one possible implementation, the generating module is specifically configured to:
for each target unit, determining the level corresponding to the first state signal of the target unit as a first state identifier of the target unit;
determining the level corresponding to the first preset signal of the residual unit as a second state identifier of the residual unit;
And sequencing the first state identifiers of the target units and the second state identifiers of the rest units according to a first preset sequence to obtain first state identifier information.
In one possible implementation manner, the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged according to a first preset sequence; the generating module is specifically used for:
judging whether the first state identification information is matched with the task identification information;
if so, a first synchronization signal is generated.
In one possible implementation of the method according to the invention,
the receiving module is also used for receiving an ending signal sent by each target unit, and the ending signal indicates the target unit to finish executing the current calculation task;
the generating module is further configured to generate a second synchronization signal according to the end signal sent by each target unit, where the second synchronization signal indicates that the N target units synchronously execute the current computing task to end.
In one possible implementation manner, the generating module is further specifically configured to:
for each target unit, performing level adjustment on a second preset signal of the target unit according to an end signal sent by the target unit to obtain a second state signal of the target unit;
And generating a second synchronous signal according to the second state signal of each target unit, a second preset signal of the residual units and the preset task identification information, wherein the residual units are operation units except N target units in the plurality of operation units.
In one possible implementation manner, the generating module is further specifically configured to:
determining second state identification information according to the second state signals of the target units and second preset signals of the residual units;
and generating a second synchronous signal according to the second state identification information and the task identification information.
In one possible implementation manner, the generating module is further specifically configured to:
for each target unit, determining the level corresponding to the second state signal of the target unit as a third state identifier of the target unit;
determining the level corresponding to the second preset signal of the residual unit as a fourth state identifier of the residual unit;
and sequencing the third state identifiers of all the target units and the fourth state identifiers of the rest units according to the first preset sequence to obtain second state identifier information.
In one possible implementation manner, the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged according to a first preset sequence; the generating module is also specifically used for:
Judging whether the second state identification information is matched with the task identification information;
if so, a second synchronization signal is generated.
In one possible implementation, the sending module is specifically configured to:
acquiring a control instruction;
analyzing the control instruction to obtain configuration instructions corresponding to N target units;
and sending corresponding configuration instructions to the N target units.
In one possible embodiment, the plurality of arithmetic units are arithmetic units in a neural network processing unit.
In one possible embodiment, the plurality of arithmetic units are identical in structure.
In one possible embodiment, the arithmetic unit is a matrix arithmetic unit or a vector arithmetic unit.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory causes the processor to perform the method of any of the first aspects.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions for performing the method of any one of the first aspects when the computer-executable instructions are executed by a processor.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the method of any of the first aspects.
In a sixth aspect, embodiments of the present application provide a chip on which a computer program is stored, which when executed by the chip, implements the method of any one of the first aspects.
In a seventh aspect, embodiments of the present application provide a chip module, where a computer program is stored on the chip module, and when the computer program is executed by the chip module, the method according to any one of the first aspect is implemented.
The embodiment of the application provides a synchronous control method, a synchronous control device and synchronous control equipment, wherein the method comprises the following steps: the method comprises the steps that corresponding configuration instructions are sent to N target units, the N target units are operation units for executing a current calculation task in a plurality of operation units, the configuration instructions instruct the target units to execute configuration operation before the current calculation task, and N is an integer greater than or equal to 1; receiving a starting signal sent by a target unit according to a configuration instruction, wherein the starting signal indicates the target unit to execute configuration operation; and generating a first synchronization signal according to the starting signal sent by each target unit, and sending the first synchronization signal to N target units, wherein the first synchronization signal indicates the N target units to synchronously execute the current calculation task. In the method, the first synchronous signals are generated according to the starting signals sent by the target units, and the first synchronous signals are sent to the N target units, so that the N target units can synchronously start to execute the current calculation task according to the first synchronous signals, and the data consistency after the N target units execute the current calculation task is improved.
Drawings
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a synchronization control method according to an embodiment of the present application;
FIG. 3 is a second flowchart of a synchronization control method according to an embodiment of the present disclosure;
FIG. 4 is a timing diagram of synchronous start of N target units according to an embodiment of the present disclosure;
FIG. 5 is a third flow chart of a synchronous control method according to the embodiment of the present disclosure;
FIG. 6 is a timing diagram of synchronization completion of N target units according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of signal transmission provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a synchronous control device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In order to facilitate understanding of the technical solutions of the present application, the technical terms related to the present application are explained first.
A matrix operation unit (Matrix Processing Unit, MPU) for performing matrix operations, such as matrix multiplication.
A vector operation unit (Vector Processing Unit, VPU) for vector operations such as vector addition, vector multiplication, vector reduction, etc.
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application. As shown in fig. 1, the NPU includes a synchronization control device and M arithmetic units. The M arithmetic units include arithmetic units 1 to M. M is an integer greater than or equal to 2.
The M operation units comprise N target units. N is an integer less than or equal to M.
The N target units are used for executing the current computing task. For example, the N target units include an operation unit 1, an operation unit 2, and an operation unit M.
In the embodiment of the present application, the NPU executes the current computing task as follows:
s01, the operation unit 1 receives a configuration instruction 1, and outputs a starting signal 1 after the configuration operation is finished according to the configuration instruction 1;
s02, the operation unit 2 receives the configuration instruction 2, and outputs a starting signal 2 after the configuration operation is finished according to the configuration instruction 2;
s03, the operation unit M receives the configuration instruction M, and outputs a starting signal M after the configuration operation is finished according to the configuration instruction M;
and S04, when the signal processing module receives the starting signal 1, the starting signal 2 and the starting signal M, a first synchronous signal is sent to the operation unit 1, the operation unit 2 and the operation unit M, so that the operation unit 1, the operation unit 2 and the operation unit M synchronously execute the current calculation task.
The execution order of S01 to S04 may be adjusted, and the embodiment of the present application will be described by taking S01 to S04 as an example.
In the related art, the time when each operation unit receives the corresponding instruction may be different, so the starting time of each operation unit to execute the calculation task is also different, so the ending time of each operation unit to execute the calculation task is also different, resulting in poor data consistency after each operation unit executes the calculation task. Or the time when the corresponding instruction is received by each operation unit is the same, the starting time of the operation unit for executing the calculation task is the same, but the time of the operation unit for executing the calculation task is different, so that the ending time of the operation unit for executing the calculation task is also different, and the data consistency after the operation unit for executing the calculation task is poor.
In the application, all the operation units executing the current calculation task output the start signal after the configuration operation is finished, and after the synchronous control device receives the start signal output by all the operation units, the synchronous control device sends the synchronous signal to all the operation units, so that all the operation units can synchronously execute the current calculation task, and the data consistency of all the operation units after executing the current calculation task is improved.
The technical scheme shown in the application is described in detail through specific embodiments. It should be noted that the following embodiments may exist alone or in combination with each other, and for the same or similar content, the description will not be repeated in different embodiments.
Fig. 2 is a schematic flow chart of a synchronization control method according to an embodiment of the present application. As shown in fig. 2, the method may include:
s201, corresponding configuration instructions are sent to N target units, wherein the N target units are operation units for executing a current calculation task in a plurality of operation units, the configuration instructions instruct the target units to execute configuration operation before the current calculation task, and N is an integer greater than or equal to 1.
Alternatively, the execution body of the embodiment of the present application may be an electronic device, and also may be a synchronization control device provided in the electronic device, where the synchronization control device may be implemented by a combination of software and/or hardware. The electronic device may be, for example, a terminal provided with an NPU, a base station, a server, and the like. The synchronization control may be located within the NPU. The following describes a synchronization control method provided in the embodiment of the present application by taking an execution body as an example of a synchronization control device.
Specifically, N is an integer greater than or equal to 1 and less than or equal to M. M is the total number of the plurality of arithmetic units in S201.
The plurality of arithmetic units may be arithmetic units in the NPU.
The configuration of the plurality of arithmetic units may be the same or different. In the case where the plurality of arithmetic units have the same configuration, the arithmetic units may be also referred to as isomorphic arithmetic units.
The arithmetic unit may be an MPU or a VPU.
The configuration instruction may be a register instruction.
The configuration operation may include, for example: analyzing the configuration instruction to obtain an analysis result; and configuring the operation times and the like required by the target unit to execute the current calculation task according to the analysis result.
The current computing task includes subtasks for each target unit.
The target unit executing the current computing task refers to the target unit executing the corresponding subtask in the current computing task.
S202, receiving a starting signal sent by the target unit according to the configuration instruction, wherein the starting signal indicates the target unit to execute the configuration operation.
The enable signal may be a high level signal or a low level signal.
For example, in the case where the start signal is at a high level, each arithmetic unit may continuously output a first low level signal, and the target unit adjusts the signal of the first low level signal to a high level after the end of the execution of the configuration operation according to the configuration instruction, thereby realizing transmission of the start signal (for example, the first low level signal 0_start output by the arithmetic unit 1 in fig. 4) to the synchronous control device.
S203, generating a first synchronization signal according to the starting signal sent by each target unit, and sending the first synchronization signal to N target units, wherein the first synchronization signal indicates the N target units to synchronously execute the current calculation task.
The first synchronization signal may be a high level signal or a low level signal.
Alternatively, the synchronization control means may generate the first synchronization signal after receiving the start signal sent by each target unit.
Alternatively, the synchronization control apparatus may further continuously transmit the synchronization start signal start_sync (for example, a low level signal) to the N target units, and adjust the level of the synchronization start signal start_sync to a high level after receiving the start signal transmitted by each target unit to generate the first synchronization signal (for example, a high level signal).
Optionally, the target operation unit further includes a data calculation module, and the synchronization control device sends a first synchronization signal to the data calculation module of each target unit.
In the embodiment of the application, the first synchronization signal is generated according to the starting signal sent by each target unit, and the first synchronization signal is sent to the N target units, so that the N target units can synchronously start to execute the current calculation task according to the first synchronization signal, and the data consistency after the N target units execute the current calculation task is improved.
Unlike the prior art, in which custom instructions (e.g., barrer instructions) are typically employed, multiple concurrently executing threads (or processes) are synchronized. In the case of synchronizing multiple concurrently executing threads (or processes) with custom instructions, it is generally necessary to set custom instructions corresponding to each thread (or process), and wait when each thread (or process) executes to the corresponding custom instruction until all threads (or processes) reach the instruction, and continue executing program instructions after the custom instruction. In the prior art, under the condition that the number of threads (or processes) is large, setting custom instructions corresponding to each thread (or process) can lead to complex realization logic, and meanwhile, more custom instructions can be introduced, so that the synchronization overhead is large. In the embodiment of the application, the receiving target units generate the first synchronization signals according to the starting signals sent by the configuration instructions and the starting signals sent by the target units, and send the first synchronization signals to the N target units, so that the N target units can synchronously start to execute the current calculation task according to the first synchronization signals, the custom instructions corresponding to the operation units are not required to be set, the realization logic is simplified, and the synchronization cost is reduced.
Fig. 3 is a second flowchart of a synchronization control method according to an embodiment of the present application. As shown in fig. 3, the method may include:
s301, corresponding configuration instructions are sent to N target units.
Specifically, the execution method of S301 is the same as the execution method of S201, and the execution process of S301 is not described here again.
S302, receiving a starting signal sent by the target unit according to the configuration instruction.
Specifically, the execution method of S302 is the same as the execution method of S202, and the execution process of S303 is not described here again.
S303, for each target unit, performing level adjustment on a first preset signal of the target unit according to a starting signal sent by the target unit, so as to obtain a first state signal of the target unit.
In the present application, the plurality of operation units have respective corresponding first preset signals.
The first preset signal may be a high level signal or a low level signal.
The first state signal may be a high level signal or a low level signal.
The first preset signal and the first status signal are different. For example, the first preset signal is a low level signal, and the second preset signal is a high level signal.
When the first preset signal is a low level signal and the first state signal is a high level signal, the synchronous control device adjusts the level of the first preset signal of the target unit to be a high level after receiving the starting signal sent by the target unit, so that the first state signal of the target unit is obtained.
S304, generating a first synchronous signal according to the first state signal of each target unit, a first preset signal of the remaining units and the preset task identification information, wherein the remaining units are operation units except N target units in the plurality of operation units.
The task identification information includes task identifications of the arithmetic units.
The task identification of each operation unit can be set in the task identification information in a single-hot mode. For example, in the case where M is equal to 8, the task identification information may be 00001011. Wherein, the first bit 1 in 00001011 is the task identifier of the operation unit 1, the second bit 1 is the task identifier of the operation unit 2, the third bit 0 is the task identifier of the operation unit 3, the fourth bit 1 is the task identifier of the operation unit 4, the fifth bit 0 is the task identifier of the operation unit 5, the sixth bit 0 is the task identifier of the operation unit 6, the seventh bit 0 is the task identifier of the operation unit 7, and the eighth bit 0 is the task identifier of the operation unit 8.
The task identity may be 0 or 1. For example, a 1 may indicate that the arithmetic unit performs the current computing task, and a 0 may indicate that the arithmetic unit does not perform the current computing task. For example, 0 may indicate that the arithmetic unit performs the current computing task, and 1 may indicate that the arithmetic unit does not perform the current computing task.
When 1 indicates that the operation unit performs the current calculation task and 0 indicates that the operation unit does not perform the current calculation task, the task identification information is 00001011, indicating that the operation unit 1, the operation unit 2, and the operation unit 4 perform the current calculation task. I.e. N is equal to 3, the 3 target units comprise an arithmetic unit 1, an arithmetic unit 2 and an arithmetic unit 4, the remaining units comprise an arithmetic unit 3, an arithmetic unit 5, an arithmetic unit 6, an arithmetic unit 7 and an arithmetic unit 8.
In one possible embodiment, S304 includes S3041 and S3042 as follows.
S3041, determining first state identification information according to the first state signals of the target units and the first preset signals of the rest units.
For each target unit, determining the level corresponding to the first state signal of the target unit as a first state identifier of the target unit;
determining the level corresponding to the first preset signal of the residual unit as a second state identifier of the residual unit;
and sequencing the first state identifiers of the target units and the second state identifiers of the rest units according to a first preset sequence to obtain first state identifier information.
The first state identification is used to instruct the target unit to perform the current computing task.
The second state identification is used to indicate that the remaining units are not performing the current computing task.
For example, when the first status signal is a high level signal and the first preset signal is a low level signal, determining a level "1" corresponding to the first status signal of the target unit as the first status identifier of the target unit; and determining the level '0' corresponding to the first preset signal of the residual unit as a second state identifier of the residual unit.
The first preset order may be an arrangement order of unit identifications of each of the plurality of operation units.
In the case where M is equal to 8, the first preset sequence is, for example: the MPU core 7, MPU core 6, MPU core 5, MPU core4, MPU core 3, MPU core 2, MPU core1 and MPU core 0, wherein MPU core 7 is the unit identifier of the operation unit 8, MPU core 6 is the unit identifier of the operation unit 7, MPU core 5 is the unit identifier of the operation unit 6, MPU core4 is the unit identifier of the operation unit 5, MPU core 3 is the unit identifier of the operation unit 4, MPU core 2 is the unit identifier of the operation unit 3, MPU core1 is the unit identifier of the operation unit 2, and MPU core 0 is the unit identifier of the operation unit 1.
When the first status signal is a high level signal, the first preset signal is a low level signal, and the task identification information is 00001011, the first status identifications of the operation unit 1, the operation unit 2, and the operation unit 4 are all 1, the second status identifications of the operation unit 3, the operation unit 5, the operation unit 6, the operation unit 7, and the operation unit 8 are all 0, and the first status identifications of the respective target units and the second status identifications of the remaining units are sorted according to the first preset order, so that the first status identification information is 00001011.
S3042, generating a first synchronization signal according to the first state identification information and the task identification information.
The task identification information comprises task identifications of the operation units, and the task identifications of the operation units are arranged according to a first preset sequence.
In one possible embodiment, S3042 includes: judging whether the first state identification information is matched with the task identification information; if so, a first synchronization signal is generated.
Determining whether the first state identification information and the task identification information match may include the following manner 11 and/or manner 12.
Mode 11 determines whether the first state identification information and the task identification information are the same.
Mode 12, performing a negation operation on the first state identification information to obtain first negation information;
and judging whether the first negation information and the task identification information are the same.
For example, when the first state identification information is 11110100, the first state identification information is inverted, and the obtained first inverted information is 00001011.
In this embodiment of the present application, the first state identification information and the task identification information are matched, which indicates that, for each operation unit, the state of the operation unit corresponds to the task identification of the operation unit, and the N target units are all ready to execute the current computing task. The first synchronization signal is generated at this time, so that the N target units can synchronously execute the current calculation task after receiving the first synchronization signal, and the data consistency after executing the current calculation task by the N target units is improved.
S305, sending first synchronous signals to N target units.
The following describes the timing of synchronous start of N target units provided in the embodiment of the present application with reference to fig. 4, taking M equal to 8 and task identification information 00001011 as an example.
Fig. 4 is a timing diagram of synchronous start of N target units according to an embodiment of the present application. Exemplary, as shown in fig. 4, includes: the first low level signal 0_start output by the operation unit 1 (target unit), the first preset signal 0_start_hold of the operation unit 1, the first low level signal 1_start output by the operation unit 2 (target unit), the first preset signal 1_start_hold of the operation unit 2, the first low level signal 2_start output by the operation unit 3, the first preset signal 2_start_hold of the operation unit 3, the first low level signal 3_start output by the operation unit 4 (target unit), the first preset signal 3_start_hold of the operation unit 4, the first low level signal 4_start output by the operation unit 5, the first low level signal 5_start output by the operation unit 5, the first preset signal 5_start_hold of the operation unit 6, the first low level signal 6_start output by the operation unit 7, the first preset signal 6_start of the operation unit 7, the first preset signal 8_start of the operation unit 8, and the first preset signal 8_start of the operation unit 8_start.
After the configuration operation is finished, the level of the first low level signal 0_start of the operation unit 1 is adjusted to be high level to obtain a start signal 1, the start signal 1 is sent to the synchronous control device, and after the synchronous control device receives the start signal 1, the level of the first preset signal 0_start_hold of the operation unit 1 is adjusted to be high level to obtain a first state signal 1.
After the configuration operation is finished, the level of the first preset signal 1_start_hold of the operation unit 2 is adjusted to be high level to obtain a start signal 2, the start signal 2 is sent to the synchronous control device, and after the synchronous control device receives the start signal 2, the level of the first preset signal 1_start_hold of the operation unit 2 is adjusted to be high level to obtain a first state signal 2.
After the configuration operation is finished, the level of the first preset signal 3_start_hold of the operation unit 4 is adjusted to be high to obtain a start signal 4, the start signal 4 is sent to the synchronous control device, and after the synchronous control device receives the start signal 4, the level of the first preset signal 3_start_hold of the operation unit 4 is adjusted to be high to obtain a first state signal 4.
For the arithmetic unit 3, the arithmetic unit 5, the arithmetic unit 6, the arithmetic unit 7, and the arithmetic unit 8, which do not perform the configuration operation, and thus continuously output the first low level signal (e.g., 2_start), the synchronization control device keeps its first preset signal (e.g., 2_start_hold) unchanged.
Alternatively, the synchronization control apparatus may continuously output the synchronization start signal start_sync (for example, a low level signal) to the operation unit 1, the operation unit 2, and the operation unit 4, and adjust the level of the synchronization start signal start_sync to a high level to obtain the first synchronization signal when it is determined that the first state identification information 00001011 and the task identification information 00001011 are the same, so as to transmit the first synchronization signal to the operation unit 1, the operation unit 2, and the operation unit 4.
On the basis of any of the above embodiments, after the first synchronization signals are sent to the N target units, the synchronization control method provided in the embodiment of the present application further includes the following method steps shown in fig. 5.
Fig. 5 is a third flowchart of a synchronization control method according to an embodiment of the present application. As shown in fig. 5, the method may further include:
s501, receiving end signals sent by all target units, wherein the end signals indicate the target units to execute the current calculation task to end.
S502, generating a second synchronizing signal according to the ending signals sent by the target units, wherein the second synchronizing signal indicates N target units to synchronously execute the current calculation task to end.
The second synchronization signal may be a high level signal or a low level signal.
Optionally, the synchronization control device generates a second synchronization signal after receiving the end signal sent by each target unit, and sends the second synchronization signal to the target component, where the target component may be software and/or hardware located outside the NPU. The target component is used for issuing a next computing task after the current computing task to the NPU according to the second synchronous signal.
Specifically, the synchronization control device continuously transmits a synchronization end signal done_sync (for example, a low level signal) to the target unit, and adjusts the level of the synchronization end signal done_sync to a high level after receiving the start signal transmitted by each target unit, to generate a second synchronization signal (for example, a high level signal).
In the embodiment of the application, the end signal sent by each target unit is received, and the second synchronization signal is generated according to the end signal sent by each target unit to instruct the N target units to synchronously execute the end of the current calculation task, so that the NPU can execute the next calculation task, and the data consistency after executing the next calculation task is ensured.
In one possible embodiment, S502 includes S5021 and S5022 as follows.
S5021, for each target unit, performing level adjustment on a second preset signal of the target unit according to an end signal sent by the target unit to obtain a second state signal of the target unit.
In the present application, the plurality of operation units have respective second preset signals.
The second preset signal may be a high level signal or a low level signal.
The second state signal may be a high level signal or a low level signal.
The second preset signal and the second status signal are different. For example, the first preset signal is a low level signal, and the second preset signal is a high level signal.
The second preset signal may be the same as or different from the first preset signal.
The second status signal may be the same or different from the first status signal.
And when the second preset signal is a low-level signal and the second state signal is a high-level signal, the synchronous control device adjusts the level of the second preset signal of the target unit to be a high level after receiving the end signal sent by the target unit, so as to obtain the second state signal of the target unit.
S5022, generating a second synchronous signal according to a second state signal of each target unit, a second preset signal of the remaining units and preset task identification information, wherein the remaining units are operation units except N target units in the plurality of operation units.
In one possible embodiment, S5022 can include: determining second state identification information according to the second state signals of the target units and second preset signals of the residual units; and generating a second synchronous signal according to the second state identification information and the task identification information.
In one possible embodiment, determining the second state identification information according to the second state signal of each target unit and the second preset signal of the remaining units includes:
for each target unit, determining the level corresponding to the second state signal of the target unit as a third state identifier of the target unit;
determining the level corresponding to the second preset signal of the residual unit as a fourth state identifier of the residual unit;
and sequencing the third state identifiers of all the target units and the fourth state identifiers of the rest units according to the first preset sequence to obtain second state identifier information.
The third status identifier is used to instruct the target unit to perform the current computing task to end. Alternatively, the third status identifier may be the same as or different from the first status identifier.
The fourth state identification is used to indicate that the remaining units are not performing the current computing task. Alternatively, the fourth status identifier may be the same as or different from the second status identifier.
For example, when the second state signal is a high level signal and the second preset signal is a low level signal, determining a level "1" corresponding to the second state signal of the target unit as a third state identifier of the target unit; and determining the level '0' corresponding to the second preset signal of the residual unit as a fourth state identification of the residual unit.
Specifically, the method for obtaining the second state identification information is similar to the method for obtaining the first state identification information, and will not be described herein.
In one possible implementation, generating the second synchronization signal according to the second state identification information and the task identification information includes:
judging whether the second state identification information is matched with the task identification information;
if so, a second synchronization signal is generated.
Specifically, the method for judging whether the second state identification information and the task identification information are matched is similar to the method for judging whether the first state identification information and the task identification information are matched, and is not repeated here.
The following describes the timing of the synchronization completion of N target units provided in the embodiment of the present application with reference to fig. 6, taking M equal to 8 and task identification information 00001011 as an example.
Fig. 6 is a timing diagram of synchronization ending of N target units according to an embodiment of the present application. Exemplary, as shown in fig. 6, includes: the second low level signal 0_done output by the operation unit 1 (target unit), the second preset signal 0_done_hold of the operation unit 1, the second low level signal 1_done output by the operation unit 2 (target unit), the second preset signal 1_done_hold of the operation unit 2, the second low level signal 2_done output by the operation unit 3, the second preset signal 2_done_hold of the operation unit 3, the second low level signal 3_done output by the operation unit 4 (target unit), the second preset signal 3_done_hold of the operation unit 4, the second low level signal 4_done output by the operation unit 5, the second preset signal 4_done_hold of the operation unit 5, the second low level signal 5_done output by the operation unit 6, the second preset signal 5_done_hold of the operation unit 6, the second low level signal 6_done output by the operation unit 7, the second preset signal 6_done hold of the operation unit 7, the second preset signal 8_done output by the operation unit 8, and the second preset signal 8_done of the operation unit 8_hold of the operation unit are synchronized.
For the operation unit 1, after the current calculation task is executed, the level of the second low level signal 0_done of the operation unit 1 is adjusted to be high level to obtain an end signal 1, the end signal 1 is sent to the synchronous control device, and after the synchronous control device receives the end signal 1, the level of the second preset signal 0_done_hold of the operation unit 1 is adjusted to be high level to obtain a second state signal 1.
For the operation unit 2, after the current calculation task is executed, the level of the second low level signal 1_done of the operation unit 2 is adjusted to be high level to obtain an end signal 2, the end signal 2 is sent to the synchronous control device, and after the synchronous control device receives the end signal 2, the level of the second preset signal 1_done_hold of the operation unit 2 is adjusted to be high level to obtain a second state signal 2.
For the operation unit 4, after the current calculation task is executed, the level of the second low level signal 3_done of the operation unit 4 is adjusted to be high level to obtain an end signal 4, the end signal 4 is sent to the synchronous control device, and after the synchronous control device receives the end signal 4, the level of the second preset signal 3_done_hold of the operation unit 4 is adjusted to be high level to obtain a second state signal 4.
For the arithmetic unit 3, the arithmetic unit 5, the arithmetic unit 6, the arithmetic unit 7 and the arithmetic unit 8, which do not perform the configuration operation, and thus continuously output the second low level signal (e.g., 2_done), the synchronization control device keeps its second preset signal (e.g., 2_done_hold) unchanged.
Alternatively, the synchronization control apparatus may continuously output the synchronization end signal done_sync (for example, a low level signal) to the target component, and in the case where it is determined that the second state identification information 00001011 and the task identification information 00001011 are the same, adjust the level of the synchronization end signal done_sync to a high level to obtain the second synchronization signal, so as to implement transmission of the second synchronization signal to the target component.
In one possible embodiment, S201 includes: acquiring a control instruction; analyzing the control instruction to obtain configuration instructions corresponding to N target units; and sending corresponding configuration instructions to the N target units.
The control instruction is an instruction sent by the target component.
The control instruction may include register address information and configuration instructions corresponding to the N target units.
The control instruction is parsed to obtain register address information.
In the embodiment of the application, the task identification information is stored in a storage location with register address information.
Fig. 7 is a schematic diagram of signal transmission provided in an embodiment of the present application. On the basis of fig. 1, as shown in fig. 7, the method comprises: 3 target units. For example, the 3 target units include an arithmetic unit 1, an arithmetic unit 2, and an arithmetic unit M.
Each operation unit comprises a register instruction analysis module and a data calculation module. The register instruction analysis module is used for receiving the configuration instruction, executing the configuration operation according to the configuration instruction, sending a starting signal to the synchronous control device and the like. The data calculation module is used for receiving the first synchronous signal, sending an end signal to the synchronous control device, receiving the second synchronous signal and executing the current calculation task.
Before executing the current calculation task, the synchronous control module receives a start signal 1 sent by the operation unit 1 after executing the configuration operation according to the configuration instruction 1, a start signal 2 sent by the operation unit 2 after executing the configuration operation according to the configuration instruction 2, and a start signal M sent by the operation unit M after executing the configuration operation according to the configuration instruction M; according to the starting signal 1, the starting signal 2 and the starting signal M, a first synchronization signal is generated, and the first synchronization signal is sent to the operation unit 1, the operation unit 2 and the operation unit M, so that the operation unit 1, the operation unit 2 and the operation unit M execute the current calculation task.
After executing the current calculation task, the synchronous control module receives an end signal 1 sent by the operation unit 1, an end signal 2 sent by the operation unit 2 and an end signal M sent by the operation unit M; and generating a second synchronous signal according to the end signal 1, the end signal 2 and the end signal M, and sending the second synchronous signal to the operation unit 1, the operation unit 2 and the operation unit M to instruct the operation unit 1, the operation unit 2 and the operation unit M to synchronously execute the current calculation task to end.
Fig. 8 is a schematic structural diagram of a synchronous control device according to an embodiment of the present application. The synchronous control device can be electronic equipment, a chip or a chip module and the like. As shown in fig. 8, the synchronization control device 80 includes:
a sending module 801, configured to send corresponding configuration instructions to N target units, where the N target units are operation units that execute a current computing task in a plurality of operation units, and the configuration instructions instruct the target units to execute a configuration operation before the current computing task, and N is an integer greater than or equal to 1;
a receiving module 802, configured to receive a start signal sent by the target unit according to the configuration instruction, where the start signal indicates that the target unit finishes executing the configuration operation;
The generating module 803 is configured to generate a first synchronization signal according to the start signal sent by each target unit, where the first synchronization signal indicates that N target units synchronously execute a current computing task;
the sending module 801 is further configured to send first synchronization signals to N target units.
The synchronous control device provided in the embodiment of the present application may execute the technical solution shown in the foregoing method embodiment, and its implementation principle and beneficial effects are similar, and will not be described herein again.
In one possible implementation, the generating module 803 is specifically configured to: for each target unit, performing level adjustment on a first preset signal of the target unit according to a starting signal sent by the target unit to obtain a first state signal of the target unit; and generating a first synchronous signal according to the first state signal of each target unit, a first preset signal of the residual units and the preset task identification information, wherein the residual units are operation units except N target units in the plurality of operation units.
In one possible implementation, the generating module 803 is specifically configured to: determining first state identification information according to the first state signals of each target unit and the first preset signals of the remaining units; and generating a first synchronous signal according to the first state identification information and the task identification information.
In one possible implementation, the generating module 803 is specifically configured to: for each target unit, determining the level corresponding to the first state signal of the target unit as a first state identifier of the target unit; determining the level corresponding to the first preset signal of the residual unit as a second state identifier of the residual unit; and sequencing the first state identifiers of the target units and the second state identifiers of the rest units according to a first preset sequence to obtain first state identifier information.
In one possible implementation manner, the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged according to a first preset sequence; the generating module 803 specifically is configured to: judging whether the first state identification information is matched with the task identification information; if so, a first synchronization signal is generated.
In a possible implementation manner, the receiving module 802 is further configured to receive an end signal sent by each target unit, where the end signal indicates that the target unit ends to execute the current computing task;
the generating module 803 is further configured to generate a second synchronization signal according to the end signal sent by each target unit, where the second synchronization signal indicates that the N target units synchronously execute the current computing task to end.
In one possible implementation, the generating module 803 is further specifically configured to: for each target unit, performing level adjustment on a second preset signal of the target unit according to an end signal sent by the target unit to obtain a second state signal of the target unit; and generating a second synchronous signal according to the second state signal of each target unit, a second preset signal of the residual units and the preset task identification information, wherein the residual units are operation units except N target units in the plurality of operation units.
In one possible implementation, the generating module 803 is further specifically configured to: determining second state identification information according to the second state signals of the target units and second preset signals of the residual units; and generating a second synchronous signal according to the second state identification information and the task identification information.
In one possible implementation, the generating module 803 is further specifically configured to: for each target unit, determining the level corresponding to the second state signal of the target unit as a third state identifier of the target unit; determining the level corresponding to the second preset signal of the residual unit as a fourth state identifier of the residual unit; and sequencing the third state identifiers of all the target units and the fourth state identifiers of the rest units according to the first preset sequence to obtain second state identifier information.
In one possible implementation manner, the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged according to a first preset sequence; the generating module 803 is further specifically configured to: judging whether the second state identification information is matched with the task identification information; if so, a second synchronization signal is generated.
In one possible implementation, the sending module 801 is specifically configured to: acquiring a control instruction; analyzing the control instruction to obtain configuration instructions corresponding to N target units; and sending corresponding configuration instructions to the N target units.
In one possible embodiment, the plurality of arithmetic units are arithmetic units in a neural network processing unit.
In one possible embodiment, the plurality of arithmetic units are identical in structure.
In one possible embodiment, the arithmetic unit is a matrix arithmetic unit or a vector arithmetic unit.
The synchronous control device provided in the embodiment of the present application may execute the technical solution shown in the foregoing method embodiment, and its implementation principle and beneficial effects are similar, and will not be described herein again.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device 90 may include a processor 901 and a memory 902. The processor 901 and the memory 902 are illustratively interconnected by a bus 903.
Memory 902 stores computer-executable instructions.
Processor 901 executes computer-executable instructions stored in memory 902, causing processor 901 to perform the methods as shown in the method embodiments described above.
All or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a readable memory. The program, when executed, performs steps including the method embodiments described above; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state disk, magnetic tape, floppy disk, optical disk, and any combination thereof.
The present application provides a computer-readable storage medium having stored therein computer-executable instructions for implementing the method of the above-described method embodiments when the computer-executable instructions are executed by a processor.
Embodiments of the present application also provide a computer program product, which includes a computer program, where the computer program can implement the method shown in the above-mentioned method embodiments when executed by a processor.
The embodiment of the application also provides a chip, and a computer program is stored on the chip, and when the computer program is executed by the chip, the method shown in the embodiment of the method is realized.
The embodiment of the application also provides a chip module, and the chip module stores a computer program, and when the computer program is executed by the chip module, the method shown in the embodiment of the method is realized.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to encompass such modifications and variations.
In the present application, the term "include" and variations thereof may refer to non-limiting inclusion; the term "or" and variations thereof may refer to "and/or". The terms "first," "second," and the like in this application are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. In the present application, "plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.

Claims (18)

1. A synchronization control method, comprising:
transmitting corresponding configuration instructions to N target units, wherein the N target units are operation units for executing a current calculation task in a plurality of operation units, the configuration instructions instruct the target units to execute configuration operation before the current calculation task, and N is an integer greater than or equal to 1;
Receiving a starting signal sent by the target unit according to the configuration instruction, wherein the starting signal indicates the target unit to execute the configuration operation;
generating a first synchronization signal according to the starting signal sent by each target unit, and sending the first synchronization signal to the N target units, wherein the first synchronization signal indicates the N target units to synchronously execute the current calculation task.
2. The synchronization control method according to claim 1, wherein the generating a first synchronization signal according to the start signal sent by each target unit includes:
for each target unit, performing level adjustment on a first preset signal of the target unit according to a starting signal sent by the target unit to obtain a first state signal of the target unit;
generating the first synchronization signal according to the first state signal of each target unit, a first preset signal of the remaining units and the pre-configured task identification information, wherein the remaining units are operation units except the N target units in the plurality of operation units.
3. The synchronization control method according to claim 2, wherein the generating the first synchronization signal according to the first status signal of each target unit, the first preset signal of the remaining units, and the pre-configured task identification information includes:
Determining first state identification information according to the first state signals of the target units and the first preset signals of the residual units;
and generating the first synchronization signal according to the first state identification information and the task identification information.
4. The synchronization control method according to claim 3, wherein the determining the first status identification information according to the first status signal of each target unit and the first preset signal of the remaining units includes:
for each target unit, determining a level corresponding to a first state signal of the target unit as a first state identifier of the target unit;
determining the level corresponding to the first preset signal of the residual unit as a second state identifier of the residual unit;
and sequencing the first state identifiers of the target units and the second state identifiers of the rest units according to a first preset sequence to obtain the first state identifier information.
5. The synchronization control method according to claim 3, wherein the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged in the first preset order; the generating the first synchronization signal according to the first state identification information and the task identification information includes:
Judging whether the first state identification information is matched with the task identification information or not;
and if so, generating the first synchronous signal.
6. The synchronization control method according to any one of claims 1 to 5, characterized in that the method further comprises:
receiving an end signal sent by each target unit, wherein the end signal indicates the target unit to execute the current calculation task to end;
and generating a second synchronizing signal according to the ending signals sent by the target units, wherein the second synchronizing signal indicates the N target units to synchronously execute the current computing task to end.
7. The synchronization control method according to claim 6, wherein the generating a second synchronization signal according to the end signal transmitted by each target unit includes:
for each target unit, performing level adjustment on a second preset signal of the target unit according to an end signal sent by the target unit to obtain a second state signal of the target unit;
and generating the second synchronous signal according to the second state signal of each target unit, a second preset signal of the residual units and the preset task identification information, wherein the residual units are operation units except for the N target units in the plurality of operation units.
8. The synchronization control method according to claim 7, wherein the generating the second synchronization signal according to the second status signal of each target unit, the second preset signal of the remaining units, and the pre-configured task identification information includes:
determining second state identification information according to the second state signals of the target units and the second preset signals of the residual units;
and generating the second synchronous signal according to the second state identification information and the task identification information.
9. The synchronization control method according to claim 8, wherein the determining the second state identification information according to the second state signal of each target unit and the second preset signal of the remaining units includes:
for each target unit, determining the level corresponding to the second state signal of the target unit as a third state identifier of the target unit;
determining the level corresponding to the second preset signal of the residual unit as a fourth state identifier of the residual unit;
and sequencing the third state identifiers of the target units and the fourth state identifiers of the residual units according to a first preset sequence to obtain the second state identifier information.
10. The synchronization control method according to claim 9, wherein the task identification information includes task identifications of the operation units, and the task identifications of the operation units are arranged in the first preset order; the generating the second synchronization signal according to the second state identification information and the task identification information includes:
judging whether the second state identification information is matched with the task identification information or not;
and if so, generating the second synchronous signal.
11. The synchronization control method according to any one of claims 1 to 10, wherein the sending the corresponding configuration instructions to the N target units includes:
acquiring a control instruction;
analyzing the control instruction to obtain configuration instructions corresponding to the N target units;
and sending corresponding configuration instructions to the N target units.
12. The synchronization control method according to any one of claims 1 to 11, wherein the plurality of arithmetic units are arithmetic units in a neural network processing unit.
13. The synchronization control method according to any one of claims 1 to 12, wherein the plurality of arithmetic units are identical in structure.
14. The synchronization control method according to any one of claims 1 to 13, wherein the arithmetic unit is a matrix arithmetic unit or a vector arithmetic unit.
15. A synchronous control device, characterized by comprising:
the device comprises a sending module, a configuration module and a control module, wherein the sending module is used for sending corresponding configuration instructions to N target units, the N target units are operation units for executing a current calculation task in a plurality of operation units, the configuration instructions instruct the target units to execute configuration operation before the current calculation task, and N is an integer greater than or equal to 1;
the receiving module is used for receiving a starting signal sent by the target unit according to the configuration instruction, and the starting signal indicates the target unit to execute the configuration operation to finish;
the generating module is used for generating a first synchronous signal according to the starting signal sent by each target unit, and the first synchronous signal indicates the N target units to synchronously execute the current calculation task;
the sending module is further configured to send the first synchronization signals to the N target units.
16. An electronic device, comprising: a memory and a processor;
the memory stores computer-executable instructions;
The processor executing computer-executable instructions stored in the memory, causing the processor to perform the method of any one of claims 1 to 14.
17. A computer readable storage medium having stored therein computer executable instructions for implementing the method of any of claims 1 to 14 when the computer executable instructions are executed by a processor.
18. A computer program product, comprising: a computer program; the computer program implementing the method of any one of claims 1 to 14 when executed by a processor.
CN202311546136.8A 2023-11-17 2023-11-17 Synchronous control method, device and equipment Pending CN117573210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311546136.8A CN117573210A (en) 2023-11-17 2023-11-17 Synchronous control method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311546136.8A CN117573210A (en) 2023-11-17 2023-11-17 Synchronous control method, device and equipment

Publications (1)

Publication Number Publication Date
CN117573210A true CN117573210A (en) 2024-02-20

Family

ID=89891228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311546136.8A Pending CN117573210A (en) 2023-11-17 2023-11-17 Synchronous control method, device and equipment

Country Status (1)

Country Link
CN (1) CN117573210A (en)

Similar Documents

Publication Publication Date Title
CN112035238A (en) Task scheduling processing method and device, cluster system and readable storage medium
US10824469B2 (en) Reordering avoidance for flows during transition between slow-path handling and fast-path handling
EP2551768A1 (en) Multi-core system and start-up method
CN108733527B (en) System, method and apparatus for testing server functionality
CN114172915A (en) Message synchronization method, automatic driving system, storage medium and electronic equipment
CN116893912B (en) Inter-core communication method, system, device, equipment and medium for vehicle-mounted software
CN109660310B (en) Clock synchronization method and device, computing equipment and computer storage medium
US7707584B2 (en) Method and apparatus for synchronizing calls in a server and client system
CN117573210A (en) Synchronous control method, device and equipment
CN113033806A (en) Method and device for training deep reinforcement learning model and scheduling method
CN108833532B (en) Service processing method, device and system based on Internet of things
CN115361382B (en) Data processing method, device, equipment and storage medium based on data group
CN109462491B (en) System, method and apparatus for testing server functionality
CN114912587A (en) Neural network distributed training system, method, device, computing unit and medium
CN114493980A (en) Kernel function transmission method, device and equipment
US9887928B2 (en) System and method for identifying performance characteristics in asynchronous networks
CN114675954A (en) Task scheduling method and device
CN113778916A (en) Data processing method and device
CN109151007B (en) Data processing method, core server and transmission server for application scheduling
CN111581042B (en) Cluster deployment method, deployment platform and server to be deployed
CN112766486A (en) Searching method of neural network structure, terminal, server and readable storage medium
CN111431892A (en) Accelerator management architecture and method and accelerator interface controller
CN112905254B (en) Method and device for sending request
CN110737533A (en) task scheduling method and device, electronic equipment and storage medium
CN114546928B (en) Method and device for synchronizing core cluster, control method and device, core and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination