Computing devices, data processing methods and related products

By scheduling histogram operation tasks across multiple processing circuits and leveraging the parallel computing capabilities of deep learning processing hardware architecture, the problem of low efficiency in histogram operation in existing technologies is solved, achieving more efficient histogram operation processing.

CN115237373BActive Publication Date: 2026-11-17SHANGHAI CAMBRICON INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110449502.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-25
Publication Date
2026-11-17
Estimated Expiration
2041-04-25

AI Technical Summary

Technical Problem

Existing hardware and/or instruction sets cannot effectively support histogram operation-related operations, resulting in low efficiency in histogram operation processing.

Method used

A computing device and a data processing method are provided, which realize the distributed execution of histogram operation by scheduling histogram operation tasks on multiple slave processing circuits and utilizing the parallel computing capabilities of deep learning processing hardware architecture.

Benefits of technology

Parallel computing improves machine processing efficiency, fully utilizes the computing advantages of the hardware architecture, and enhances the speed and efficiency of histogram calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237373B_ABST
    Figure CN115237373B_ABST
Patent Text Reader

Abstract

This disclosure discloses a computing device, a data processing method, and related products. The computing device may be included in a combined processing unit, which may further include an interface device and other processing units. The computing device interacts with the other processing units to jointly complete user-specified computational operations. The combined processing unit may also include a storage device connected to both the computing device and the other processing units to store data from those devices. The disclosed solution provides a hardware architecture for executing histogram calculation instructions, which simplifies processing and improves machine processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of processors. More specifically, this disclosure relates to computing devices, data processing methods, chips, and circuit boards. Background Technology

[0002] Histograms are a common data statistics tool suitable for processing large amounts of quantitative data to identify statistical patterns and infer the distribution characteristics of the data. Histograms are widely used in various engineering fields. For example, in image processing, histograms can be used to statistically analyze the distribution of image pixel data, such as the number of pixels of various colors. In computer vision, histograms can be used for object detection and tracking.

[0003] On the other hand, with the rapid development of deep learning, hardware architectures such as chips and processors suitable for deep learning processing have also made leaps and bounds. If histogram operations can be ported to hardware architectures suitable for deep learning processing, it is possible to accelerate histogram operation processing and improve processing efficiency in areas such as image processing and object tracking. Existing hardware and / or instruction sets cannot effectively support histogram operation-related tasks. Summary of the Invention

[0004] In order to at least partially solve one or more of the technical problems mentioned in the background art, the present disclosure provides a computing device, a data processing method, a chip, and a board.

[0005] In a first aspect, this disclosure discloses a computing device including a control circuit and an arithmetic circuit, wherein: the control circuit is used to parse a histogram calculation instruction, the histogram calculation instruction operating on data to be detected and target data, the histogram calculation instruction instructing the counting of the occurrences of the target data in the data to be detected as output data; and the arithmetic circuit includes a plurality of slave processing circuits, and the arithmetic circuit is used to schedule a corresponding number of slave processing circuits to perform histogram calculation tasks according to the histogram calculation instruction, wherein each scheduled slave processing circuit performs the histogram calculation on a portion of the data to be detected and / or the target data.

[0006] In a second aspect, this disclosure provides a chip that includes a computing device according to any of the embodiments of the first aspect.

[0007] In a third aspect, this disclosure provides a board including the chip of any of the embodiments of the second aspect above.

[0008] In a fourth aspect, this disclosure provides a data processing method implemented by a computing device, the computing device including a control circuit and an arithmetic circuit, the arithmetic circuit including a plurality of slave processing circuits, the method comprising: the control circuit parsing a histogram calculation instruction, the histogram calculation instruction operating on data to be detected and target data, the histogram calculation instruction instructing the counting of the occurrences of the target data in the data to be detected as output data; and the arithmetic circuit scheduling a corresponding number of slave processing circuits to perform a histogram calculation task according to the histogram calculation instruction, wherein each scheduled slave processing circuit performs the histogram calculation on a portion of the data to be detected and / or the target data.

[0009] Using the computing device, data processing method, integrated circuit chip, and board provided above, this disclosure provides a scheme for executing histogram calculation instructions on a hardware architecture including multiple slave processing circuits. The histogram calculation task can be distributed across multiple slave processing circuits, thereby fully utilizing the computational advantages of deep learning processing hardware architectures and improving machine processing efficiency through parallel computation. Attached Figure Description

[0010] The above and other objects, features, and advantages of exemplary embodiments of this disclosure will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this disclosure are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein:

[0011] Figure 1 This diagram shows the structure of the board card according to an embodiment of this disclosure;

[0012] Figure 2 This diagram illustrates the structure of the combined processing apparatus according to an embodiment of the present disclosure.

[0013] Figure 3 A schematic diagram illustrating the internal structure of a processor core in a single-core or multi-core computing device according to embodiments of the present disclosure;

[0014] Figure 4 This diagram illustrates an exemplary structural schematic of a computing device according to an embodiment of the present disclosure.

[0015] Figure 5 A partial structural schematic diagram of the arithmetic circuit in a computing device according to an embodiment of this disclosure is shown;

[0016] Figure 6 A partial structural schematic diagram of the slave processing circuit according to an embodiment of this disclosure is shown; and

[0017] Figure 7 An exemplary flowchart of a data processing method 700 according to an embodiment of this disclosure is shown. Detailed Implementation

[0018] The technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, not all of them. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0019] It should be understood that the terms "first," "second," "third," and "fourth," etc., that may appear in the claims, specification, and drawings of this disclosure are used to distinguish different objects, rather than to describe a specific order. The terms "comprising" and "including" as used in the specification and claims of this disclosure indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0020] It should also be understood that the terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. As used in this disclosure and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this disclosure and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0021] As used in this specification and claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection."

[0022] The specific embodiments disclosed herein will now be described in detail with reference to the accompanying drawings.

[0023] Figure 1 A schematic diagram of the structure of a board 10 according to an embodiment of this disclosure is shown. Figure 1As shown, board 10 includes chip 101, which is a system-on-chip (SoC) integrating one or more combined processing units. These combined processing units are artificial intelligence computing units used to support various deep learning and machine learning algorithms, meeting the intelligent processing needs of complex scenarios in fields such as computer vision, speech, natural language processing, and data mining. In particular, deep learning technology is widely used in cloud intelligence. A significant characteristic of cloud intelligence applications is the large volume of input data, placing high demands on the platform's storage and computing capabilities. Board 10 in this embodiment is suitable for cloud intelligence applications, possessing massive off-chip storage, on-chip storage, and powerful computing capabilities.

[0024] Chip 101 is connected to external device 103 via external interface device 102. External device 103 may be, for example, a server, computer, camera, monitor, mouse, keyboard, network card, or Wi-Fi interface. Data to be processed can be transmitted from external device 103 to chip 101 via external interface device 102. The calculation results from chip 101 can be transmitted back to external device 103 via external interface device 102. Depending on the application scenario, external interface device 102 may have different interface forms, such as a PCIe interface.

[0025] The board 10 also includes a storage device 104 for storing data, which includes one or more memory cells 105. The storage device 104 is connected to and transmits data with the controller 106 and the chip 101 via a bus. The controller 106 in the board 10 is configured to regulate the state of the chip 101. Therefore, in one application scenario, the controller 106 may include a microcontroller (MCU).

[0026] Figure 2 This is a structural diagram illustrating the combined processing device in chip 101 of this embodiment. (As shown) Figure 2 As shown, the combined processing device 20 includes a computing device 201, an interface device 202, a processing device 203, and a storage device 204.

[0027] The computing device 201 is configured to perform user-specified operations. It is mainly implemented as a single-core intelligent processor or a multi-core intelligent processor to perform deep learning or machine learning calculations. It can interact with the processing device 203 through the interface device 202 to jointly complete the user-specified operations.

[0028] Interface device 202 is used to transmit data and control commands between computing device 201 and processing device 203. For example, computing device 201 can obtain input data from processing device 203 via interface device 202 and write it to on-chip storage device of computing device 201. Further, computing device 201 can obtain control commands from processing device 203 via interface device 202 and write them to on-chip control cache of computing device 201. Alternatively or optionally, interface device 202 can also read data from storage device of computing device 201 and transmit it to processing device 203.

[0029] Processing device 203, as a general-purpose processing device, performs basic control including but not limited to data transfer, and starting and / or stopping computing device 201. Depending on the implementation, processing device 203 may be one or more types of processors, including but not limited to digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., and their number can be determined according to actual needs. As mentioned above, computing device 201 disclosed herein can be considered as having a single-core structure or a homogeneous multi-core structure. However, when computing device 201 and processing device 203 are considered together, they are considered to form a heterogeneous multi-core structure.

[0030] Storage device 204 is used to store data to be processed. It may be DRAM or DDR memory, typically 16G or larger in size, and is used to store data of computing device 201 and / or processing device 203.

[0031] Figure 3 The diagram shows the internal structure of the processing core when the computing device 201 is a single-core or multi-core device. The computing device 301 is used to process input data such as computer vision, speech, natural language, and data mining. The computing device 301 includes three main modules: a control module 31, a processing module 32, and a storage module 33.

[0032] The control module 31 coordinates and controls the operation of the computation module 32 and the storage module 33 to complete the deep learning task. It includes an instruction fetch unit (IFU) 311 and an instruction decode unit (IDU) 312. The instruction fetch unit 311 fetches instructions from the processing device 203, and the instruction decode unit 312 decodes the fetched instructions and sends the decoding result as control information to the computation module 32 and the storage module 33.

[0033] The computation module 32 includes a vector operation unit 321 and a matrix operation unit 322. The vector operation unit 321 is used to perform vector operations and can support complex operations such as vector multiplication, addition, and nonlinear transformations; the matrix operation unit 322 is responsible for the core computations of deep learning algorithms, namely matrix multiplication and convolution.

[0034] The storage module 33 is used to store or move relevant data, including a neuron RAM (NRAM) 331, a weight RAM (WRAM) 332, and a direct memory access (DMA) module 333. The NRAM 331 stores the input neurons, output neurons, and intermediate results after computation; the WRAM 332 stores the convolution kernels of the deep learning network, i.e., the weights; the DMA 333 is connected to the DRAM 204 via bus 34 and is responsible for data transfer between the computing device 301 and the DRAM 204.

[0035] Based on the aforementioned hardware environment, in one aspect, this disclosure provides a computing device that executes a histogram calculation task according to histogram calculation instructions. The histogram calculation task can generally be understood as counting the number of times a target data point appears in the data to be detected. It is understood that there may be multiple target data points, meaning there are multiple histogram statistical elements to be counted. Furthermore, the size of the data to be detected may be very large. Therefore, by fully utilizing the aforementioned hardware environment and exploring the possibility of parallel data processing, the computation can be accelerated and efficiency improved.

[0036] Figure 4 A schematic structural block diagram of a computing device 400 according to an embodiment of this disclosure is shown. It can be understood that this structure can be considered as... Figure 3 The refinement of the internal structure of a single processing core can also be viewed as the refinement of multiple cores. Figure 3 The diagram shows the functional partitioning based on the processing core. Figure 4As shown, the computing device 400 of this embodiment can be used to perform histogram calculation tasks. It may include a storage circuit 40, a control circuit 41 and a calculation circuit 42, which are interconnected to transmit various data and instructions.

[0037] The function of control circuit 41 and Figure 3 Similar to the control module 31, it may also include, for example, an instruction fetch unit (IFU) 411 and an instruction decode unit (IDU) 412. In various arithmetic operations, such as computation, the control circuit 41 can be configured to fetch computation instructions, parse them to obtain arithmetic instructions, and then send the arithmetic instructions to the arithmetic circuit 42 and the storage circuit 40. The computation instructions can be a form of hardware instruction and include one or more opcodes, each opcode representing one or more specific operations to be executed by the arithmetic circuit 42. These operations can include different types depending on the application scenario, such as arithmetic operations like addition or multiplication, logical operations, comparison operations, or table lookup operations, or any combination of the aforementioned operations. Correspondingly, the arithmetic instructions can be one or more microinstructions executed internally by the arithmetic circuit after parsing the computation instructions.

[0038] Furthermore, depending on the application scenario, the arithmetic instruction obtained after parsing the calculation instruction can be an arithmetic instruction decoded by the control circuit 41 or an arithmetic instruction not decoded by the control circuit 41. When the arithmetic instruction is an arithmetic instruction not decoded by the control circuit 41, the arithmetic circuit 42 may include a corresponding decoding circuit to perform the decoding of the arithmetic instruction, so as to obtain, for example, multiple microinstructions.

[0039] The arithmetic circuit 42 may include a main processing circuit 421 and multiple slave processing circuits 422. The main processing circuit and the slave processing circuits, as well as the multiple slave processing circuits, can communicate with each other through various connections.

[0040] The main processing circuit and the slave processing circuits can cooperate to achieve parallel computation. In this configuration, the main processing circuit can, for example, perform pre-processing on the input data, such as splitting the data, and receive intermediate results from multiple slave processing circuits and perform subsequent processing to obtain the final computation result of the computation instruction. The slave processing circuits can, for example, perform intermediate operations in parallel on the corresponding data (e.g., split data) according to the computation instruction to obtain multiple intermediate results, and transmit the multiple intermediate results back to the main processing circuit.

[0041] In different application scenarios, the connection between multiple slave processing circuits can be either a hard connection arranged by hardwires or a logical connection configured according to, for example, microinstructions, to form various topologies of slave processing circuit arrays. The embodiments disclosed herein are not limited in this respect.

[0042] By configuring the arithmetic circuit 42 into a master-slave structure (e.g., a master-multiple-slave structure, or a multi-master-multiple-slave structure, which is not limited in this disclosure), for the calculation instructions of forward operation, the data can be split according to the calculation instructions, so that the part with a large amount of calculation can be performed in parallel by multiple slave processing circuits to improve the calculation speed, save the calculation time, and thus reduce the power consumption.

[0043] To support computational functions, the main processing circuit and the slave processing circuit can include various computing circuits, such as vector operation units and matrix operation units. The vector operation unit is used to perform vector operations and can support complex operations such as vector multiplication, addition, and nonlinear transformations; the matrix operation unit is responsible for the core computations of deep learning algorithms, such as matrix multiplication and convolution.

[0044] Storage circuit 40 is used to store or move relevant data. In deep learning, storage circuitry can be used to store computational data such as neurons and weights, or to store computation results. Storage circuitry may include, for example, one or any combination of cache 402, register 404, and direct memory access (DMA) module 406. DMA module 406 can be used to interact with off-chip memory (not shown).

[0045] The foregoing describes an exemplary computing device according to embodiments of the present disclosure, in which the main processing circuit and the slave processing circuit may belong to different modules of the same processor or chip, or to different processors, and the present disclosure is not limited in this respect.

[0046] In one embodiment, the control circuit 41 may be configured to, for example, parse a histogram calculation instruction using an instruction decoding unit 412. The histogram calculation instruction operates on both the data to be detected and the target data. The histogram calculation instruction instructs the counting of the occurrences of the target data in the data to be detected as output data. Further, in this embodiment, the arithmetic circuit 42 may be configured to schedule a corresponding number of slave processing circuits 422 to perform histogram calculation tasks according to the histogram calculation instruction, wherein each scheduled slave processing circuit performs a histogram calculation on a portion of the data to be detected and / or the target data.

[0047] In some embodiments, in order to make full use of the parallel computing resources of the computing device, the main processing circuit 421 in the arithmetic circuit 42 may be configured to determine a splitting scheme for the histogram calculation task according to the histogram calculation instructions and the processing capabilities of the slave processing circuits, in accordance with the splitting rules.

[0048] The amount of computation to be performed can be determined based on the histogram calculation instructions. These instructions can specify information such as the size of the data to be detected and the size of the target data. For example, the data to be detected can be one-dimensional, two-dimensional, or higher-dimensional; the target data can include one or more histogram statistical elements, each of which can be a numerical value.

[0049] The processing capacity of a slave processing circuit represents the available computing resources, which may include, for example, the number of available slave processing circuits, the amount of data that each slave processing circuit can process at one time, and so on.

[0050] Therefore, based on the amount of computation to be completed and the amount of available computing resources, the main processing circuit can determine the partitioning scheme of the histogram operation task according to the partitioning rules.

[0051] Specifically, the splitting scheme may include one or more of the following: the transmission method of the data to be detected and the target data, the splitting method of the data to be detected and the target data, and the number of times the data to be detected is reused (R). N The number of times the target data is reused, R S ,etc.

[0052] Figure 5 A partial structural schematic diagram of the computing circuitry in a computing device according to an embodiment of this disclosure is shown in order to describe various splitting schemes by illustrating the allocation, transmission, and processing of various data in the computing circuitry.

[0053] As shown in the figure, the operational circuit 500 (for example) Figure 4 In addition to the main processing circuit 510 and multiple slave processing circuits 520 described above, the arithmetic circuit 42) may also include a first storage circuit 530 and a second storage circuit 540.

[0054] The first storage circuit 530 can be used to store multicast data, meaning the data in the first storage circuit will be transmitted to multiple slave processing circuits via a broadcast bus, and these slave processing circuits will receive the same data. It is understood that broadcasting and multicasting can be implemented via a broadcast bus. Multicast refers to a communication method that transmits a single data set to multiple slave processing circuits; while broadcasting is a communication method that transmits a single data set to all slave processing circuits, and is a special case of multicast. Since both multicast and broadcasting correspond to one-to-many transmission methods, they are not specifically distinguished in this document; broadcasting and multicast can be collectively referred to as multicast, and those skilled in the art will understand their meaning from the context. The second storage circuit 540 can be used to store distributed data, meaning the data in the second storage circuit will be transmitted to different slave processing circuits respectively, and each slave processing circuit will receive different data. By providing the first storage circuit and the second storage circuit respectively, it is possible to support the transmission of data to be processed using different transmission methods, thereby reducing data throughput by multiplexing multicast data among multiple slave processing circuits.

[0055] In some embodiments, the main processing circuit 510 may be further configured to: determine one of the data to be detected and the target data as multicast data, and determine the other of the data to be detected and the target data as distribution data; store the multicast data in a first storage circuit 530 for transmission to a plurality of scheduled slave processing circuits 520 via a broadcast bus during operation; and store the split distribution data in a second storage circuit 540 for the scheduled slave processing circuits 520 to load the corresponding portion of the distribution data for operation.

[0056] In the first scenario, the target data contains a large number of histogram statistical elements, for example, the number of histogram statistical elements is comparable to the number of slave processing circuits. In this case, the histogram calculation task can be broken down into performing statistics on one histogram statistical element on each slave processing circuit. In this embodiment, the main processing circuit is further used to determine the data to be detected as broadcast data and the target data as distribution data. Therefore, the number of times the data to be detected is reused, R... N This corresponds to the number of scheduled slave processing circuits minus 1 (i.e., subtracting the number of times it will be used), for example, 64-1=63. In this case, each slave processing circuit processes different histogram statistical elements, thus the target data is not reused, and the number of times the target data is reused is R. S =0. It can be seen that (R) N +1)*(R S +1) = Ns, where Ns is the number of slave processing circuits scheduled.

[0057] Furthermore, the size of the data to be detected may be quite large, making it impossible for the processing circuit to process it all at once. In this case, the data to be detected can be split into detection data blocks, with the size of each detection data block not exceeding the processing capacity of a single processing circuit in one operation. Because the counting of the occurrences of histogram elements in histogram operations is independent of the dimension and / or direction of the data to be detected—meaning that counting any dimension of the data to be detected first does not affect the final result—a suitable dimension can be chosen for data splitting.

[0058] Although multidimensional data has multiple dimensions, because the layout of the storage circuits (e.g., the first storage circuit and the second storage circuit) is always one-dimensional, there is a correspondence between the multidimensional data and the storage order on the storage circuits. Multidimensional data is typically allocated in contiguous storage space; that is, it can be unfolded one-dimensionally and stored sequentially on the storage circuits. It is usually unfolded in order from low to high dimensions, i.e., a low-dimensional priority approach, thus ensuring that low-dimensional data is contiguous on the storage circuits.

[0059] Therefore, in some embodiments, the data to be detected can be split into L according to the storage dimension from low to high. N The detection data blocks can be directly split and read according to their storage order without needing to rearrange the storage order. The data is split into L... N Each detection data block can be accessed via L N The above histogram calculation task is accomplished through round-robin operations, that is, in each round of operations, a detection data block is transmitted to the multiple scheduled slave processing circuits via a broadcast bus.

[0060] Furthermore, the target data identified as the data to be distributed can be split according to the histogram statistical elements it contains, that is, split into multiple histogram statistical elements, to be allocated to different slave processing circuits, so that each slave processing circuit counts a different histogram statistical element.

[0061] In this embodiment, each slave processing circuit can retrieve its assigned target data, such as a histogram statistical element, from the second storage circuit. Then, for each round of broadcast detection data blocks, each slave processing circuit counts the occurrences of its assigned histogram statistical element to obtain the statistical result for the current round. Since this statistical result represents only a portion of all the data to be detected, it can also be called a partial statistical value. Each slave processing circuit accumulates the partial statistical values ​​obtained from all rounds of processing to obtain the final statistical value for the corresponding statistical element across the entire dataset.

[0062] In the second scenario, the target data contains fewer histogram statistical elements; for example, the number of histogram statistical elements is only half the number of processing circuits. In this case, the histogram calculation task can be broken down into performing statistical analysis on the same histogram statistical element on multiple (e.g., Ng, where Ng can be 2, 4, etc.) processing circuits. In this embodiment, the main processing circuit can determine the data to be detected as multicast data and the target data as distributed data. Therefore, the number of times the data to be detected is reused, R... N Corresponding to 1 / Ng-1 of the number of scheduled slave processing circuits, for example, when Ng = 2 and the number of scheduled slave processing circuits Ns is 64, R N =64 / 2-1=31. At this point, every Ng histogram statistical elements processed by the processing circuit are identical, therefore the number of times the target data is reused, R... S =Ng-1. Similarly, it can be seen that (R) N +1)*(R S +1) = Ns, where Ns is the number of slave processing circuits scheduled.

[0063] Typically, the data to be detected is quite large, and the processing circuit cannot process it all at once. Therefore, the data to be detected can be divided into detection data blocks, with the size of each detection data block not exceeding the processing capacity of a single processing circuit in one operation. The splitting method can be the same as before, and will not be repeated here.

[0064] In this scenario, multiple (e.g., Ng) slave processing circuits will perform statistics on the same histogram statistical element. Therefore, in each round of computation, it is necessary to transmit Ng = R. S +1 detection data block, each detection data block is transmitted via multicast to the corresponding R in the multiple scheduled slave processing circuits. S +1 group. Taking Ng=2 as an example, in each round of operation, one detection data block needs to be transmitted via multicast to the first group (e.g., the first half) of the multiple slave processing circuits scheduled; while another detection data block is transmitted via multicast to the second group (e.g., the other half) of the multiple slave processing circuits scheduled.

[0065] Furthermore, the target data identified for distribution is also split according to the included histogram statistical elements, that is, split into multiple histogram statistical elements. However, at this time, the same histogram statistical element will be assigned to Ng slave processing circuits.

[0066] In this embodiment, each slave processing circuit can retrieve its assigned target data, such as a histogram statistical element, from the second storage circuit. Then, for each multicast detection data block in each round of computation, each slave processing circuit counts the occurrences of its assigned histogram statistical element in the detection data block, obtaining the statistical result for the current round, which is also a partial statistical value. Each slave processing circuit accumulates the partial statistical values ​​obtained from all rounds of computation to obtain the statistical value of the corresponding statistical element on 1 / Ng of the entire data to be detected. Therefore, in this embodiment, it is also necessary to accumulate the statistical values ​​of slave processing circuits assigned the same histogram statistical element separately to obtain the final statistical value of the corresponding statistical element on the entire data to be detected.

[0067] As mentioned above, the main processing circuit can receive intermediate results from multiple slave processing circuits and perform subsequent processing to obtain the final calculation result of the calculation instruction. Specifically, in the above embodiment, the main processing circuit 510 can be used to accumulate the statistical values ​​of every Ng slave processing circuits corresponding to the same histogram statistical element to obtain the final statistical value for all histogram statistical elements.

[0068] In other embodiments, multiple slave processing circuits assigned to the same histogram statistical element can accumulate and summarize their respective partial statistical values ​​before returning them to the main processing circuit. For example, each Ng slave processing circuit can accumulate and summarize the values ​​pairwise in a multi-level tree structure before returning the final statistical value to the main processing circuit. This disclosure embodiment does not limit the specific accumulation method.

[0069] As can be seen from the above description, the first scenario can also be considered a special case of the second scenario corresponding to Ng=1. When Ng becomes larger, that is, when the target data includes very few histogram statistical elements, for example, the number of histogram statistical elements is 4, which is only 1 / 16 of the number of processing circuits (e.g., 64), the implementation method in the second scenario can still be used to split the histogram calculation task, that is, to split it into statistical calculations on the same histogram statistical element on every Ng (Ng=16 in this example) processing circuits. However, in this embodiment, the transmission method of the data to be detected and the target data can be adjusted to better reduce data access to memory and improve transmission efficiency.

[0070] Therefore, in the third scenario, the main processing circuit can determine the data to be detected as distribution data and the target data as multicast data. In this case, the number of times the data to be detected is R. N It still corresponds to 1 / Ng-1 of the number of scheduled slave processing circuits. For example, when Ng = 16 and the number of scheduled slave processing circuits Ns is 64, R N=64 / 16-1=3. At this point, every Ng histogram statistical elements processed by the processing circuit are identical, therefore the number of times the target data is reused, R... S =Ng-1=15. It can be seen that (R N +1)*(R S +1) = Ns, where Ns is the number of slave processing circuits scheduled.

[0071] Similarly, the data to be detected can be split into detection data blocks, each no larger than the processing volume of a single slave processing circuit in one operation. The splitting method can be the same as before. Since multiple (e.g., 16) slave processing circuits will be performing statistics on the same histogram statistical element in this scenario, 16 detection data blocks need to be transmitted in each round of computation. These detection data blocks are stored in a second storage circuit, from which the slave processing circuits can read the detection data blocks assigned to them. For example, each group of 16 slave processing circuits reads these 16 detection data blocks separately, for a total of 4 groups, so each detection data block will be used 4 times, i.e., the reuse count is 3.

[0072] As the target data for multicast data, it is transmitted via the broadcast bus to the corresponding groups in the multiple slave processing circuits that are scheduled. Taking Ng=16 as an example, that is, 16 slave processing circuits perform statistics on different detection data blocks for a histogram statistical element. In each round of operation, 4 histogram statistical elements can be transmitted to 4 groups of slave processing circuits respectively, and each group includes 16 slave processing circuits.

[0073] Then, for each round of computation, each slave processing circuit, based on the histogram statistical element assigned to it via multicast, counts the number of times it appears in the detection data block, obtaining the statistical result for the current round. This statistical result is also a partial statistical value. Each slave processing circuit accumulates the partial statistical values ​​obtained from all rounds of computation to obtain the statistical value of the corresponding statistical element on 1 / Ng of the entire data to be detected. Since every Ng slave processing circuits process the same histogram statistical element, similar to the second scenario, it is also necessary to accumulate the statistical values ​​of the slave processing circuits assigned the same histogram statistical element separately to obtain the final statistical value of the corresponding statistical element on the entire data to be detected. The further accumulation process can be similar to the second scenario and will not be repeated here.

[0074] Those skilled in the art will understand that, although Figure 5The various processing and storage circuits are shown as separate modules, but depending on the configuration, the storage and processing circuits can also be combined into a single module. For example, the first storage circuit 530 can be combined with the main processing circuit 510, while the second storage circuit 540 can be shared by multiple slave processing circuits 520, with each slave processing circuit allocated an independent storage area to accelerate access. This disclosure embodiment is not limited in this respect.

[0075] The above combination Figure 5 This describes the partitioning method for histogram operations. As can be seen from the example above, the partitioning scheme for histogram operation tasks can follow at least one of the following rules: partition according to alignment requirements at the lowest dimension of the data to be detected; prioritize satisfying the reuse count R of multicast data. N Reaching the maximum value, selectively satisfying the number of times R of distributed data can be reused. S Prioritize round-robin multiplexing and splitting of multicast data based on the dimension of the output data. When the dimension of the output data is less than a predetermined threshold, jointly distribute the data for round-robin multiplexing and splitting. The number of times multicast data is reused in each round of operation is greater than the minimum number of times multicast data is reused M and does not exceed the maximum number of times multicast data is reused N.

[0076] In one implementation, the data to be detected is split according to alignment requirements at its lowest dimension. The preceding description preferred to split the data into multiple detection blocks according to storage dimensions from low to high. Here, "alignment requirements" refers to the data size requirements imposed during computation, for example, to maximize hardware utilization, such as filling the arithmetic unit. In one example, the alignment requirement is, for example, 64 bytes, so the data to be detected can be split into 64-byte detection blocks, allowing each detection block to fully utilize the scheduled slave processing circuitry.

[0077] Optionally or additionally, in one implementation, to fully utilize the transmission advantages of the broadcast bus and reduce data memory access, when determining the splitting scheme, priority is given to satisfying the multiplexing count R of multicast data. N Reaching the maximum value, selectively satisfying the number of times R of distributed data can be reused. S As can be seen from the previous examples, (R) N +1)*(R S +1)=Ns, where Ns is the number of slave processing circuits scheduled. Therefore, with a fixed number of slave processing circuits, the multiplexing times of multicast data and distribution data can be allocated according to the above rules.

[0078] Optionally or additionally, in one implementation, multicast data is preferentially split into round-robin multiplexing segments based on the dimension of the output data. In the histogram operation processing of this disclosure embodiment, the output data is the number of occurrences of each histogram statistical element in the data to be detected; therefore, the dimension of the output data corresponds to the number of histogram statistical elements. Thus, the splitting method can be determined based on the number of histogram statistical elements. For example, when the number of histogram statistical elements N... hist When the number of schedulable slave processing circuits Ns is greater than or equal to the number of slave processing circuits that can be scheduled, it can be divided into units of Ns. In each round, Ns histogram statistical elements are counted, and each slave processing circuit corresponds to one histogram statistical element.

[0079] In some cases, N hist After splitting the data into units of Ns, the number of remaining blocks might be much smaller than Ns. If this method is still used, the hardware efficiency might be low in the final round of computation due to a large proportion of unused hardware. Therefore, optionally or additionally, in an implementation, the number of multicast data reuses in each round can be controlled to be greater than the minimum number of multicast data reuses M, but not exceeding the maximum number of multicast data reuses N. In the example above, N = Ns.

[0080] The two rules above can be combined and expressed as the following logic:

[0081] Mode 0, if N hist If N ≥ N, proceed to S0_1;

[0082] S0_1: Search in units of 2N across the histogram's statistical elements, and simultaneously split in units of N. If N... hist If N > 2N, proceed to S0_2; if N + M <N hist If N ≤ 2N, proceed to S0_3; if N <N hist If the value is ≤N+M, proceed to S0_4; otherwise, proceed to S0_5.

[0083] S0_2: For every N reuses, N hist =N hist -N, enter S0_1;

[0084] S0_3: Reuse in two rounds, each round using N times and N times respectively. hist -N times;

[0085] S0_4: Multiplexing in two rounds, each round using N hist -M times and M times;

[0086] S0_5: Use N directly hist Second-rate.

[0087] For example, suppose N histIf M = 136, N = 64, and M = 4, then the operation will be split into 3 rounds, with the multicast data used 64, 64, and 8 times in each round, respectively. If M = 16, and other data remain unchanged, the operation will be split into 3 rounds, with the multicast data used 64, 56, and 16 times in each round, respectively.

[0088] When the histogram counts the number of elements N hist When the number of schedulable slave processing circuits Ns is less than the number of schedulable slave processing circuits, the histogram statistical elements can be reused as described in the second and third scenarios above.

[0089] For example, suppose N hist If N = 40 and N = 64, then the multicast data will be used 40 times directly. hist If N = 32 and N = 64, then the processing circuit will be split into two groups. In each round of computation, multicast data will be used 32 times, and distributed data will be used 2 times. If N... hist If N = 20 and N = 64, then the processing circuits will be split into 3 groups, with 20 processing circuits in each group. In each round of operation, the number of times multicast data is used is 20 and the number of times distributed data is used is 3.

[0090] Figure 6 A partial structural schematic diagram of a slave processing circuit according to an embodiment of this disclosure is shown. In this embodiment, based on the requirements of the histogram calculation task, each slave processing circuit 600 (e.g.) Figure 5 The processing circuit 520 may include a comparison circuit 610 and an accumulation circuit 620.

[0091] In each round of computation, the comparison circuit 610 can be used to perform a positional comparison between the target data (i.e., histogram statistical elements) allocated to the current slave processing circuit and the detection data block of the current round, and output the comparison result.

[0092] In some implementations, the comparison circuit 610 may include multiple comparators 611, each comparator comparing a histogram statistical element assigned to the current processing circuit with a piece of data to be detected in the detection data block, and outputting a comparison result indicating whether the two are the same. For example, when the histogram statistical element is the same as a piece of data to be detected in the detection data block, it may output "1", otherwise it may output "0".

[0093] In each round of calculation, the accumulation circuit 620 can be used to accumulate the comparison results of the comparison circuit to obtain partial statistical values, and to accumulate the partial statistical values ​​of the current round with those of the previous round. The comparison results can indicate whether the histogram statistical elements appear in the detection data block, so accumulating the comparison results can count the number of occurrences. When the data to be detected is split into multiple detection data blocks, it is necessary to accumulate the partial statistical values ​​for each detection data block.

[0094] In some implementations, the accumulator circuit 620 may include an adder circuit 621 and a register 622. The adder circuit 621 performs an addition operation on the comparison results of multiple comparators to obtain a partial statistical value for the current round. Further, the adder circuit 621 may also perform an addition operation on the partial statistical value of the current round and the partial statistical value of the previous round to update the partial statistical value. The adder circuit 621 may, for example, include a multi-level Wallace tree compressor group arranged in a multi-level tree structure; or the adder circuit 621 may include a multi-level adder group arranged in a multi-level tree structure, and the embodiments disclosed herein are not limited in this respect.

[0095] Register 622 can be used in conjunction with adder circuit 621 to store updated partial statistical values, that is, the register stores the latest accumulated result.

[0096] In some embodiments, such as the scenario where every Ng slave processing circuits perform statistics on a single histogram element, instead of the main processing circuit accumulating the statistical values, the slave processing circuits can accumulate the values ​​and then output them to the main processing circuit. For example, every Ng slave processing circuits can follow a multi-level tree structure, accumulating and summing the values ​​pairwise before returning the final statistical value to the main processing circuit. In this implementation, the Ng slave processing circuits can be designed with appropriate accumulation and summarization methods based on the interconnection circuit topology to save computation time. The embodiments disclosed herein do not limit the specific accumulation method.

[0097] This disclosure also provides a method for performing data processing using the aforementioned computing device. Figure 7 An exemplary flowchart of a data processing method 700 according to an embodiment of this disclosure is shown.

[0098] like Figure 7 As shown, in step 710, a histogram calculation instruction is parsed. This instruction operates on both the data to be detected and the target data, and it instructs the output data to count the number of times the target data appears in the data to be detected. This step can be, for example, performed by... Figure 4 The control circuit 41 is used to execute this.

[0099] Next, in step 720, according to the histogram calculation instructions, a corresponding number of slave processing circuits are scheduled to perform histogram calculation tasks, wherein each scheduled slave processing circuit performs histogram calculations on a portion of the data to be detected and / or the target data. This step can, for example, be performed by... Figure 4 The operation circuit 42 is used to execute it.

[0100] In some embodiments, the arithmetic circuit includes a main processing circuit, multiple slave processing circuits, a first storage circuit, and a second storage circuit. Therefore, step 720 may further include sub-step 721, whereby the main processing circuit determines one of the data to be detected and the target data as multicast data, and the other of the data to be detected and the target data as distribution data. The main processing circuit can determine a partitioning scheme for the histogram calculation task according to the histogram calculation instructions and the processing capabilities of the slave processing circuits, following partitioning rules. The partitioning scheme includes one or more of the following: the transmission method of the data to be detected and the target data (e.g., broadcast, multicast, distribution, etc.), the partitioning method of the data to be detected and the target data, and the number of times the data to be detected is reused (R). N The number of times the target data is reused, R S .

[0101] Step 720 may further include sub-step 722, in which the main processing circuit stores multicast data in a first storage circuit for transmission to multiple scheduled slave processing circuits via a broadcast bus during operation; and sub-step 723, in which the main processing circuit stores the split distribution data in a second storage circuit for the scheduled slave processing circuits to load the corresponding portion of the distribution data for operation.

[0102] Step 720 may further include sub-step 724, whereby the processing circuit performs a histogram operation on the transmitted data to be detected and target data and returns the result. Specifically, the histogram operation may include bitwise comparison and accumulation operations, as described above.

[0103] Step 720 may further include sub-step 725, which involves accumulating the partial statistical values ​​obtained from the processing circuits based on the reuse status. This step can be performed by either the slave processing circuit or the main processing circuit. For example, if the number of reuses of the target data Rs is 0, meaning each slave processing circuit performs statistics for a different histogram element, then each slave processing circuit only needs to accumulate the partial statistical values ​​from each round of calculation, and the accumulated result of all rounds is the final statistical value. As another example, if the number of reuses of the target data Rs > 0, meaning every Rs+1 slave processing circuits performs statistics for the same histogram element, then the partial statistical values ​​from all rounds of every Rs+1 slave processing circuit need to be accumulated again to obtain the final statistical value.

[0104] Those skilled in the art will understand that the steps described in the method flowchart are combined with the preceding steps. Figure 4-6 The various circuits of the described computing device correspond to each other, so the features described above also apply to the method steps, and will not be repeated here.

[0105] This disclosure also provides a chip that may include the computing device of any of the embodiments described above in conjunction with the accompanying drawings. Furthermore, this disclosure also provides a board that may include the aforementioned chip.

[0106] Depending on the application scenario, the electronic devices or apparatus disclosed herein may include servers, cloud servers, server clusters, data processing devices, robots, computers, printers, scanners, tablets, smart terminals, PC devices, IoT terminals, mobile terminals, mobile phones, dashcams, navigators, sensors, cameras, video cameras, projectors, watches, headphones, mobile storage, wearable devices, visual terminals, autonomous driving terminals, vehicles, home appliances, and / or medical devices. The vehicles include airplanes, ships, and / or vehicles; the home appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, lights, gas stoves, and range hoods; the medical devices include MRI scanners, ultrasound machines, and / or electrocardiographs. The electronic devices or apparatus disclosed herein can also be applied in fields such as the Internet, IoT, data centers, energy, transportation, public management, manufacturing, education, power grids, telecommunications, finance, retail, construction sites, and healthcare. Furthermore, the electronic devices or apparatus disclosed herein can also be used in application scenarios related to artificial intelligence, big data, and / or cloud computing, such as cloud computing, edge computing, and terminal applications. In one or more embodiments, the high-computing-power electronic devices or apparatuses according to the present disclosure can be applied to cloud devices (e.g., cloud servers), while the low-power electronic devices or apparatuses can be applied to terminal devices and / or edge devices (e.g., smartphones or cameras). In one or more embodiments, the hardware information of the cloud devices and the hardware information of the terminal devices and / or edge devices are compatible with each other, so that suitable hardware resources can be matched from the hardware resources of the cloud devices to simulate the hardware resources of the terminal devices and / or edge devices based on the hardware information of the terminal devices and / or edge devices, so as to complete the unified management, scheduling and collaborative work of end-to-cloud or cloud-edge-end integration.

[0107] It should be noted that, for the sake of brevity, this disclosure describes some methods and their embodiments as a series of actions and combinations thereof. However, those skilled in the art will understand that the solutions disclosed herein are not limited by the order of the described actions. Therefore, based on the disclosure or teachings of this document, those skilled in the art will understand that some steps can be performed in a different order or simultaneously. Furthermore, those skilled in the art will understand that the embodiments described in this disclosure can be considered optional embodiments, that is, the actions or modules involved are not necessarily essential for the implementation of one or more solutions disclosed herein. In addition, depending on the solution, the description of some embodiments in this disclosure may have different emphases. In view of this, those skilled in the art will understand that parts not described in detail in a certain embodiment of this disclosure can also be referred to the relevant descriptions of other embodiments.

[0108] In terms of specific implementation, based on the disclosure and teachings of this document, those skilled in the art will understand that several embodiments disclosed herein can also be implemented in other ways not disclosed herein. For example, regarding the various units in the electronic device or apparatus embodiments described above, this document has divided them based on logical functions, but in actual implementation, there may be other ways of division. As another example, multiple units or components can be combined or integrated into another system, or some features or functions in a unit or component can be selectively disabled. Regarding the connection relationships between different units or components, the connections discussed above in conjunction with the accompanying drawings can be direct or indirect couplings between units or components. In some scenarios, the aforementioned direct or indirect couplings involve communication connections utilizing interfaces, where the communication interface can support electrical, optical, acoustic, magnetic, or other forms of signal transmission.

[0109] In this disclosure, the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. The aforementioned components or units may be located in the same location or distributed across multiple network units. Furthermore, depending on actual needs, some or all of the units can be selected to achieve the purpose of the solution described in the embodiments of this disclosure. Additionally, in some scenarios, multiple units in the embodiments of this disclosure may be integrated into one unit or each unit may exist physically independently.

[0110] In other implementation scenarios, the integrated units described above can also be implemented in hardware, i.e., as specific hardware circuits, which may include digital circuits and / or analog circuits. The physical implementation of the circuit's hardware structure may include, but is not limited to, physical devices, which may include, but are not limited to, transistors or memristors. Therefore, the various devices described herein (e.g., computing devices or other processing devices) can be implemented using appropriate hardware processors, such as central processing units, GPUs, FPGAs, DSPs, and ASICs. Furthermore, the aforementioned storage units or storage devices can be any suitable storage medium (including magnetic storage media or magneto-optical storage media), such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), ROM, and RAM.

[0111] The foregoing can be better understood in accordance with the following terms:

[0112] Clause 1. A computing device, comprising a control circuit and an arithmetic circuit, wherein:

[0113] The control circuit is used to parse histogram calculation instructions. The histogram calculation instructions operate on both the data to be detected and the target data. The histogram calculation instructions instruct the counting of the occurrences of the target data in the data to be detected as output data.

[0114] The computing circuit includes multiple slave processing circuits, and the computing circuit is used to schedule a corresponding number of slave processing circuits to perform histogram calculation tasks according to the histogram calculation instructions, wherein each scheduled slave processing circuit performs the histogram calculation for a portion of the data to be detected and / or the target data.

[0115] Clause 2. The computing device according to Clause 1, wherein the arithmetic circuitry further comprises a main processing circuitry, the main processing circuitry being used for:

[0116] Based on the histogram calculation instructions and the processing capabilities of the processing circuit, the histogram calculation task is divided into several parts according to the division rules.

[0117] The splitting scheme includes one or more of the following: the transmission method of the data to be detected and the target data, the splitting method of the data to be detected and the target data, and the number of times the data to be detected is reused (R). N and the number of times the target data is reused, R S .

[0118] Clause 3. The computing device according to Clause 2, wherein the arithmetic circuitry further includes a first storage circuit and a second storage circuit, and the main processing circuitry is further configured to:

[0119] One of the data to be detected and the target data is determined as multicast data, and the other of the data to be detected and the target data is determined as distribution data;

[0120] The multicast data is stored in the first storage circuit for transmission to the scheduled slave processing circuits via a broadcast bus during operation; and

[0121] The split distribution data is stored in the second storage circuit so that the scheduled slave processing circuit can load the corresponding part of the distribution data for processing.

[0122] Clause 4. The computing device pursuant to Clause 3, wherein the splitting rule includes at least one of the following:

[0123] The data to be detected is split according to alignment requirements at its lowest dimension.

[0124] Prioritize satisfying the multiplexing count R of the multicast data N When the maximum value is reached, the number of times R of the distributed data is selectively satisfied. S ;

[0125] The multicast data is preferentially split into round-robin multiplexing based on the dimension of the output data; when the dimension of the output data is less than a predetermined threshold, the jointly distributed data is split into round-robin multiplexing.

[0126] The number of times multicast data is reused in each round of computation is greater than the minimum number of times multicast data is reused M, but does not exceed the maximum number of times multicast data is reused N.

[0127] Clause 5. The computing device according to Clause 3, wherein the main processing circuitry is further configured to:

[0128] The data to be detected is determined as multicast data, and the target data is determined as distribution data;

[0129] The data to be detected is split into L according to the storage dimension from low to high. NA detection data block is used to perform the histogram calculation through multiple rounds of computation. In each round of computation, based on the number of times the target data is reused (Rs), Rs+1 detection data blocks are transmitted via the broadcast bus to the corresponding Rs+1 groups in the multiple scheduled slave processing circuits.

[0130] The target data is split into multiple histogram statistical elements and assigned to different processing circuits to perform statistics on the corresponding histogram statistical elements.

[0131] Clause 6. The computing device according to Clause 5, wherein each of the slave processing circuits includes a comparison circuit and an accumulation circuit, and in each round of operation:

[0132] The comparison circuit is used to perform a positional comparison between the target data allocated to the current slave processing circuit and the detection data block of the current round, and output the comparison result; and

[0133] The accumulation circuit is used to accumulate the comparison results of the comparison circuit to obtain a partial statistical value, and to accumulate the partial statistical value with the partial statistical value of the previous round.

[0134] Clause 7. The computing device according to Clause 6, wherein the comparison circuit includes a plurality of comparators, each comparator being configured to compare a data to be detected in a histogram statistical element and a detection data block assigned to the processing circuit, and output a comparison result indicating whether the two are the same.

[0135] Clause 8. The computing device according to Clause 7, wherein the accumulation circuit includes an adder circuit and a register, wherein:

[0136] The addition circuit is used to perform an addition operation on the comparison results of the plurality of comparators to obtain a partial statistical value for the current round, and to perform an addition operation on the partial statistical value for the current round and the partial statistical value for the previous round to update the partial statistical value; and

[0137] The register is used to store the updated partial statistics.

[0138] Clause 9. The computing device according to any one of Clauses 5-8, wherein the arithmetic circuitry is further configured to:

[0139] Based on the number of times R of the target data is reused S The R-values ​​of the statistical elements of the same histogram will be calculated. S The partial statistical values ​​from the processing circuit are accumulated by adding 1 to obtain the final statistical value corresponding to the histogram statistical element.

[0140] Clause 10. A chip comprising a computing device according to any one of Clauses 1-9.

[0141] Clause 11. A board card including the chip described in Clause 10.

[0142] Clause 12. A data processing method implemented by a computing device, the computing device including a control circuit and an arithmetic circuit, the arithmetic circuit including a plurality of slave processing circuits, the method comprising:

[0143] The control circuit parses the histogram calculation instruction, which operates on both the data to be detected and the target data. The histogram calculation instruction instructs the counting of the occurrences of the target data in the data to be detected as output data.

[0144] The computation circuit is used to schedule a corresponding number of slave processing circuits to perform histogram calculation tasks according to the histogram calculation instructions, wherein each scheduled slave processing circuit performs the histogram calculation for a portion of the data to be detected and / or the target data.

[0145] Clause 13. The method according to Clause 12, wherein the arithmetic circuit further includes a main processing circuit, and the method further includes:

[0146] The main processing circuit determines the splitting scheme of the histogram calculation task according to the histogram calculation instructions and the processing capabilities of the slave processing circuits, following the splitting rules.

[0147] The splitting scheme includes one or more of the following: the transmission method of the data to be detected and the target data, the splitting method of the data to be detected and the target data, and the number of times the data to be detected is reused (R). N and the number of times the target data is reused, R S .

[0148] Clause 14. The method according to Clause 13, wherein the arithmetic circuit further includes a first storage circuit and a second storage circuit, and the method further includes:

[0149] The main processing circuit determines one of the data to be detected and the target data as multicast data, and the other of the data to be detected and the target data as distribution data;

[0150] The multicast data is stored in the first storage circuit for transmission to the scheduled slave processing circuits via a broadcast bus during operation; and

[0151] The split distribution data is stored in the second storage circuit so that the scheduled slave processing circuit can load the corresponding part of the distribution data for processing.

[0152] Clause 15. The method described in Clause 14, wherein the splitting rule includes at least one of the following:

[0153] The data to be detected is split according to alignment requirements at its lowest dimension.

[0154] Prioritize satisfying the multiplexing count R of the multicast data N When the maximum value is reached, the number of times R of the distributed data is selectively satisfied. S ;

[0155] The multicast data is preferentially split into round-robin multiplexing based on the dimension of the output data; when the dimension of the output data is less than a predetermined threshold, the jointly distributed data is split into round-robin multiplexing.

[0156] The number of times multicast data is reused in each round of computation is greater than the minimum number of times multicast data is reused M, but does not exceed the maximum number of times multicast data is reused N.

[0157] Clause 16. The method according to Clause 14, wherein the method further comprises:

[0158] The main processing circuit determines the data to be detected as multicast data and the target data as distribution data;

[0159] The data to be detected is split into L according to the storage dimension from low to high. N A detection data block is used to perform the histogram calculation through multiple rounds of computation. In each round of computation, based on the number of times the target data is reused (Rs), Rs+1 detection data blocks are transmitted via the broadcast bus to the corresponding Rs+1 groups in the multiple scheduled slave processing circuits.

[0160] The target data is split into multiple histogram statistical elements and assigned to different processing circuits to perform statistics on the corresponding histogram statistical elements.

[0161] Clause 17. The method according to Clause 16, wherein each of the slave processing circuits includes a comparison circuit and an accumulation circuit, and the method includes: in each round of operation,

[0162] The comparison circuit performs a positional comparison between the target data allocated to the current processing circuit and the detection data block of the current round, and outputs the comparison result; and

[0163] The accumulation circuit accumulates the comparison results of the comparison circuit to obtain a partial statistical value, and accumulates the partial statistical value with the partial statistical value of the previous round to update the partial statistical value.

[0164] Clause 18. The method according to any one of Clauses 16-17, wherein the method further comprises:

[0165] Based on the number of times R of the target data is reused S The R-values ​​of the statistical elements of the same histogram will be calculated. S The partial statistical values ​​from the processing circuit are accumulated by adding 1 to obtain the final statistical value corresponding to the histogram statistical element.

[0166] The embodiments of this disclosure have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this disclosure. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this disclosure. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this disclosure. Therefore, the content of this specification should not be construed as a limitation of this disclosure.

Claims

1. A computing device, comprising a control circuit and an arithmetic circuit, wherein: The control circuit is used to parse histogram calculation instructions. The histogram calculation instructions operate on both the data to be detected and the target data. The histogram calculation instructions instruct the counting of the occurrences of the target data in the data to be detected as output data. The computing circuit includes multiple slave processing circuits, and the computing circuit is used to schedule a corresponding number of slave processing circuits to perform histogram calculation tasks according to the histogram calculation instructions, wherein each scheduled slave processing circuit performs the histogram calculation for a portion of the data to be detected and / or the target data; The arithmetic circuit further includes a main processing circuit, which is used for: Based on the histogram calculation instructions and the processing capabilities of the processing circuit, the histogram calculation task is divided into several parts according to the division rules. The splitting scheme includes one or more of the following: the transmission method of the data to be detected and the target data, the splitting method of the data to be detected and the target data, and the number of times the data to be detected is reused (R). N and the number of times the target data is reused, R S ; The arithmetic circuit further includes a first storage circuit and a second storage circuit, and the main processing circuit is further used for: One of the data to be detected and the target data is determined as multicast data, and the other of the data to be detected and the target data is determined as distribution data; The multicast data is stored in the first storage circuit so that it can be transmitted to the scheduled slave processing circuits via a broadcast bus during operation. as well as The split distribution data is stored in the second storage circuit so that the scheduled slave processing circuit can load the corresponding part of the distribution data for processing.

2. The computing device according to claim 1, wherein the splitting rule includes at least one of the following: The data to be detected is split according to alignment requirements at its lowest dimension. Prioritize satisfying the multiplexing count R of the multicast data N When the maximum value is reached, the number of times the distributed data is reused, R, is selectively satisfied. S ; The multicast data is preferentially split into round-robin multiplexing based on the dimension of the output data; when the dimension of the output data is less than a predetermined threshold, the jointly distributed data is split into round-robin multiplexing. The number of times multicast data is reused in each round of computation is greater than the minimum number of times multicast data is reused M, but does not exceed the maximum number of times multicast data is reused N.

3. The computing device according to claim 1, wherein the main processing circuitry is further configured to: The data to be detected is determined to be multicast data, and the target data is determined to be distribution data; The data to be detected is split into L according to the storage dimension from low to high. N A detection data block is used to perform the histogram calculation through multiple rounds of computation. In each round of computation, based on the number of times the target data is reused (Rs), Rs+1 detection data blocks are transmitted via the broadcast bus to the corresponding Rs+1 groups in the multiple scheduled slave processing circuits. The target data is split into multiple histogram statistical elements and assigned to different processing circuits to perform statistics on the corresponding histogram statistical elements.

4. The computing device of claim 3, wherein each of the slave processing circuits includes a comparison circuit and an accumulation circuit, and in each round of operation: The comparison circuit is used to perform a positional comparison between the target data allocated to the current slave processing circuit and the detection data block of the current round, and output the comparison result; and The accumulation circuit is used to accumulate the comparison results of the comparison circuit to obtain a partial statistical value, and to accumulate the partial statistical value with the partial statistical value of the previous round.

5. The computing device of claim 4, wherein the comparison circuit comprises a plurality of comparators, each comparator being configured to compare a data to be detected in a histogram statistical element and a detection data block allocated to the processing circuit, and to output a comparison result indicating whether the two are the same.

6. The computing device according to claim 5, wherein the accumulation circuit comprises an adder circuit and a register, wherein: The addition circuit is used to perform an addition operation on the comparison results of the plurality of comparators to obtain a partial statistical value for the current round, and to perform an addition operation on the partial statistical value for the current round and the partial statistical value for the previous round to update the partial statistical value. as well as The register is used to store the updated partial statistics.

7. The computing device according to any one of claims 3-6, wherein the arithmetic circuitry is further configured to: Based on the number of times R of the target data is reused S The R-values ​​of the statistical elements of the same histogram will be calculated. S The partial statistical values ​​from the processing circuit are accumulated by adding 1 to obtain the final statistical value corresponding to the histogram statistical element.

8. A chip comprising a computing device according to any one of claims 1-7.

9. A circuit board comprising the chip according to claim 8.

10. A data processing method implemented by a computing device, the computing device including a control circuit and an arithmetic circuit, the arithmetic circuit including a plurality of slave processing circuits, the method comprising: The control circuit parses the histogram calculation instruction, which operates on both the data to be detected and the target data. The histogram calculation instruction instructs the counting of the occurrences of the target data in the data to be detected as output data. The computing circuit is used to schedule a corresponding number of slave processing circuits to perform histogram calculation tasks according to the histogram calculation instructions, wherein each scheduled slave processing circuit performs the histogram calculation for a portion of the data to be detected and / or the target data; The arithmetic circuit further includes a main processing circuit, and the method further includes: The main processing circuit determines the splitting scheme of the histogram calculation task according to the histogram calculation instructions and the processing capabilities of the slave processing circuits, following the splitting rules. The splitting scheme includes one or more of the following: the transmission method of the data to be detected and the target data, the splitting method of the data to be detected and the target data, and the number of times the data to be detected is reused (R). N and the number of times the target data is reused, R S ; The arithmetic circuit further includes a first storage circuit and a second storage circuit, and the method further includes: The main processing circuit determines one of the data to be detected and the target data as multicast data, and the other of the data to be detected and the target data as distribution data; The multicast data is stored in the first storage circuit for transmission to the scheduled slave processing circuits via a broadcast bus during operation; and The split distribution data is stored in the second storage circuit so that the scheduled slave processing circuit can load the corresponding part of the distribution data for processing.

11. The method of claim 10, wherein the splitting rule includes at least one of the following: The data to be detected is split according to alignment requirements at its lowest dimension. Prioritize satisfying the multiplexing count R of the multicast data N When the maximum value is reached, the number of times the distributed data is reused, R, is selectively satisfied. S ; The multicast data is preferentially split into round-robin multiplexing based on the dimension of the output data; when the dimension of the output data is less than a predetermined threshold, the jointly distributed data is split into round-robin multiplexing. The number of times multicast data is reused in each round of computation is greater than the minimum number of times multicast data is reused M, but does not exceed the maximum number of times multicast data is reused N.

12. The method of claim 10, wherein the method further comprises: The main processing circuit determines the data to be detected as multicast data and the target data as distribution data; The data to be detected is split into L according to the storage dimension from low to high. N The detection data blocks are used to perform the histogram operation through multiple rounds of operation. In each round of operation, based on the number of times the target data is reused (Rs), Rs+1 detection data blocks are transmitted through the broadcast bus to the corresponding Rs+1 groups in the multiple scheduled slave processing circuits. as well as The target data is split into multiple histogram statistical elements and assigned to different processing circuits to perform statistics on the corresponding histogram statistical elements.

13. The method of claim 12, wherein each of the slave processing circuits includes a comparison circuit and an accumulation circuit, and the method comprises: In each round of calculation, The comparison circuit will perform a positional comparison between the target data assigned to the current processing circuit and the detection data block of the current round, and output the comparison result. as well as The accumulation circuit accumulates the comparison results of the comparison circuit to obtain a partial statistical value, and accumulates the partial statistical value with the partial statistical value of the previous round to update the partial statistical value.

14. The method according to any one of claims 12-13, wherein the method further comprises: Based on the number of times R of the target data is reused S The R-values ​​of the statistical elements of the same histogram will be calculated. S The partial statistical values ​​from the processing circuit are accumulated by adding 1 to obtain the final statistical value corresponding to the histogram statistical element.

Citation Information

Patent Citations

  • Chip device and related product

    CN109729734A

  • Neural network training device and related products

    CN109993301A