A parameter generation apparatus, rearrangement method and related apparatus
Patent Information
- Application Number
- CN202211303908.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-24
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-10-24
AI Technical Summary
目前可以通过执行参数生成程序得到矢量重排列电路的控制参数,将该控制参数配置到矢量重排列电路中,可以使重排列电路具有实现数据的重排列的功能,然而这种参数生成方式的时间复杂性较高,不能满足高频切换的场景
[0020]另一方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,所述计算机程序用于执行上述方面所述的对话视频创建方法。
Smart Images

Figure CN117014307B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a parameter generation apparatus, a rearrangement method, and related apparatus. Background Technology
[0002] Currently, vector processing capability is a key factor in processor flexibility. For example, for mainstream Artificial Intelligence (AI) processors, high-performance vector processing units can significantly improve AI processor performance. In vector processing scenarios, vectors often need to be rearranged. The vector rearrangement process is quite complex, especially when vector parallelism is high, as vector rearrangement consumes a significant amount of runtime.
[0003] Vector rearrangement can be achieved through vector rearrangement circuits. For example, the Benes network, with its non-blocking characteristics, can be used in vector rearrangement circuits. Currently, the control parameters of the vector rearrangement circuit can be obtained by executing a parameter generation program. By configuring these control parameters into the vector rearrangement circuit, the circuit can be enabled to rearrange data. However, this parameter generation method has high time complexity and cannot meet the requirements of high-frequency switching scenarios. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a parameter generation apparatus, a rearrangement method, and a related apparatus, which reduce the time complexity of determining the state parameters of the target network and improve the configuration efficiency of the target network.
[0005] The embodiments of this application disclose the following technical solutions:
[0006] On one hand, this application provides a parameter generation device, the device comprising: a control unit, a calculation unit, and multiple parameter generation units:
[0007] The control unit is used to determine the target node layer to be processed in the target network; the target network includes multiple switching nodes, which form a node array, and there is a connection relationship between two adjacent node layers in the node array; the target network is used to rearrange the data elements in the initial data vector to obtain the target data vector.
[0008] The plurality of parameter generation units correspond one-to-one with the exchange nodes of the target node layer, and are used to determine the first parameter value relationship between the plurality of parameter generation units and a designated unit in parallel according to the structural information of the target network, the initial data vector and the target data vector, wherein the designated unit is the unit among the plurality of parameter generation units that has a preset parameter value.
[0009] The calculation unit is used to determine the predicted parameter values of the plurality of parameter generation units according to the first parameter value relationship and the preset parameter values, respectively. The predicted parameter values are used as the status parameters of the switching nodes corresponding to the plurality of parameter generation units. The status parameters are used to indicate whether the switching state of the switching node is a pass-through state or a switching state.
[0010] On the other hand, this application provides a rearrangement method, the method comprising:
[0011] An initial data vector is input to the target network, and the data elements in the initial data vector are rearranged using the target network to obtain the target data vector; the state parameters of the switching nodes in the target network are obtained through the parameter generation device.
[0012] On the other hand, this application provides a rearrangement apparatus, the apparatus comprising:
[0013] The data input unit is used to input an initial data vector into the target network, so as to rearrange the data elements in the initial data vector using the target network to obtain a target data vector; the state parameters of the switching nodes in the target network are obtained through the parameter generation device.
[0014] On the other hand, this application provides a rearrangement system, including: a rearrangement controller, a target network, and the parameter generation device;
[0015] The rearrangement controller is used to execute the rearrangement method.
[0016] The target network is used to rearrange the data elements in the initial data vector to obtain the target data vector, and the state parameters of the exchange nodes in the target network are obtained through the parameter generation device.
[0017] On the other hand, this application provides a computer device, the device including a processor and a memory:
[0018] The memory is used to store computer programs and to transfer the computer programs to the processor;
[0019] The processor is configured to execute the dialogue video creation method described above according to instructions in the computer program.
[0020] On the other hand, embodiments of this application provide a computer-readable storage medium for storing a computer program for executing the dialogue video creation method described above.
[0021] On the other hand, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to execute the aforementioned dialogue video creation method.
[0022] As can be seen from the above technical solution, the target network includes multiple switching nodes, which form a node array. Adjacent node layers in the node array are connected. The target network is used to rearrange multiple data elements in the initial data vector to obtain the target data vector. The parameter generation device can include a control unit, a calculation unit, and multiple parameter generation units. The control unit can determine the target node layer to be processed in the target network. Each parameter generation unit corresponds one-to-one with a switching node in the target node layer. Based on the hierarchical information of the target network, the initial data vector, and the target data vector, the control unit can determine the first parameter value relationship between each parameter generation unit and a designated unit within the multiple parameter generation units. This first parameter value relationship indicates whether the parameter values of the multiple parameter generation units are the same as or opposite to the parameter values of the designated units. Since the designated units have preset parameter values, the calculation unit can determine the predicted parameter values of the multiple parameter generation units based on the first parameter value relationship and the preset parameter values. The predicted parameter values can be used as state parameters of the switching nodes corresponding to the multiple parameter generation units. These state parameters indicate whether the switching node is in a pass-through state or a switching state. Since the value relationship of the first parameter can be determined in parallel by multiple parameter generation units, the determination time of the state parameters of the target node layer can be reduced, making the determination of the state parameters of the target network have a lower time complexity. Furthermore, the parameter generation device can determine the state parameters of the target network in real time when the target network obtains the initial data vector and rearranges it, thereby improving the configuration efficiency of the target network and making it suitable for high-frequency switching scenarios. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram illustrating an application scenario of a rearrangement method provided in an embodiment of this application;
[0025] Figure 2 A flowchart of a rearrangement method provided in an embodiment of this application;
[0026] Figure 3 This is a schematic diagram of a rearrangement process provided in an embodiment of this application;
[0027] Figure 4 This is a schematic diagram of the structure of a target network provided in an embodiment of this application;
[0028] Figure 5 This is a schematic diagram illustrating the generation of state parameters for a target network, provided as an embodiment of this application.
[0029] Figure 6 This is a schematic diagram of the structure of a parameter generation device provided in an embodiment of this application;
[0030] Figure 7 A schematic diagram of the structure of the target network in the process of determining the state parameters of the switching node, as provided in an embodiment of this application;
[0031] Figure 8 This application provides a schematic diagram of a process for determining adjacent units in an embodiment of the present application.
[0032] Figure 9 A schematic diagram illustrating the expansion process of a unit adjacency relationship chain provided in an embodiment of this application;
[0033] Figure 10 This is another structural diagram illustrating the process of determining the state parameters of the target network at the switching node, as provided in an embodiment of this application.
[0034] Figure 11 A schematic diagram illustrating another process for expanding a unit adjacency relationship chain, provided in an embodiment of this application;
[0035] Figure 12 This is another structural diagram illustrating the process of determining the state parameters of the target network at the switching node, as provided in the embodiments of this application.
[0036] Figure 13 This is another structural diagram illustrating the process of determining the state parameters of the target network at the switching node, as provided in the embodiments of this application.
[0037] Figure 14 This is another structural diagram illustrating the process of determining the state parameters of the switching node in the target network provided in this application embodiment;
[0038] Figure 15 This is yet another structural diagram illustrating the process of determining the state parameters of the target network at the switching node, as provided in the embodiments of this application.
[0039] Figure 16 This is a schematic diagram of the structure of a parameter generation unit provided in an embodiment of this application;
[0040] Figure 17 A schematic diagram of the storage state of a register provided in an embodiment of this application;
[0041] Figure 18 A structural block diagram of a rearrangement device provided in an embodiment of this application;
[0042] Figure 19 A structural diagram of a terminal device provided in an embodiment of this application;
[0043] Figure 20 This is a structural diagram of a server provided in an embodiment of this application. Detailed Implementation
[0044] The embodiments of this application will now be described with reference to the accompanying drawings.
[0045] Currently, the control parameters of the vector rearrangement circuit can be obtained by executing a parameter generation program. By configuring these control parameters into the vector rearrangement circuit, the rearrangement circuit can be enabled to perform data rearrangement. However, this parameter generation method has high time complexity and cannot meet the requirements of high-frequency switching scenarios.
[0046] To address the aforementioned technical issues, this application provides a parameter generation device, a rearrangement method, and related apparatus. The parameter generation device includes a control unit, a computing unit, and multiple parameter generation units. The control unit is used to determine the target node layer to be processed in the target network. The first parameter value relationship can be determined in parallel by multiple parameter generation units to determine the state parameters of the target node layer. This parallel processing method can reduce the determination time of the state parameters of the target node layer, making the determination of the state parameters of the target network have lower time complexity. Furthermore, the parameter generation device can determine the state parameters of the target network in real time when the target network obtains the initial data vector and performs rearrangement, improving the configuration efficiency of the target network and making it suitable for high-frequency switching scenarios.
[0047] The rearrangement method provided in this application is based on AI. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.
[0048] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.
[0049] In the embodiments of this application, the main artificial intelligence software technologies involved include the aforementioned machine learning / deep learning directions. For example, it may involve deep learning in machine learning (ML), including various artificial neural networks (ANNs).
[0050] The rearrangement method provided in this application can be implemented using a computer device, which can be a terminal device or a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitations on this connection.
[0051] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, smart customer service, vehicle networking, and intelligent transportation. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.
[0052] To facilitate understanding of the technical solutions provided in this application, the following section will introduce a rearrangement method provided in an embodiment of this application, in conjunction with a practical application scenario.
[0053] See Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of a rearrangement method provided in an embodiment of this application. Figure 1The illustrated application scenario includes a rearrangement system for vector rearrangement. The rearrangement system comprises a rearrangement controller 11, a target network 12, and a parameter generation device 13. The target network 12 is connected to both the rearrangement controller 11 and the parameter generation device 13. The rearrangement controller 11, target network 12, and parameter generation device 13 can be configured within a server 10, enabling the server 10 to perform vector rearrangement. In other embodiments, the rearrangement controller 11 can be configured within the server 10, while the target network 12 and parameter generation device 13 can be configured outside the server 10. Data transmission can occur between the server 10 and the target network 12, allowing the server 10 to utilize the target network 12 for data rearrangement. This is not illustrated here.
[0054] The rearrangement controller 11 is used to execute the rearrangement method. Specifically, it can input an initial data vector into the target network 12, so that the target network 12 can rearrange the data elements in the initial data vector to obtain the target data vector. The target network 12 includes multiple exchange nodes, which form a node array. There is a connection between adjacent node layers in the node array. The target network 12 is used to rearrange multiple data elements in the initial data vector to obtain the target data vector.
[0055] The state parameters of the switching nodes in the target network 12 are obtained through the parameter generation device 13. The parameter generation device 13 may include a control unit 131, a calculation unit 132, and multiple parameter generation units 133. The control unit 131 can determine the target node layer to be processed in the target network 12. The multiple parameter generation units 133 correspond one-to-one with the switching nodes of the target node layer. Based on the hierarchical information of the target network 12, the initial data vector, and the target data vector, the control unit 131 can determine in parallel the first parameter value relationship between the multiple parameter generation units 133 and the specified unit among the multiple parameter generation units 133. The first parameter value relationship is used to indicate whether the parameter values of the multiple parameter generation units 133 are the same as or opposite to the parameter values of the specified unit.
[0056] Since the designated unit has preset parameter values, the calculation unit 132 can determine the predicted parameter values of multiple parameter generation units 133 according to the first parameter value relationship and the preset parameter values. The predicted parameter values can be used as the state parameters of the switching nodes 121 corresponding to the multiple parameter generation units 133. The state parameters are used to indicate whether the switching state of the switching node 121 is a pass-through state or a switching state. Since the first parameter value relationship can be determined in parallel by multiple parameter generation units 133, the determination time of the state parameters of the target node layer can be reduced, making the determination of the state parameters have lower time complexity. Moreover, the parameter generation device 13 can determine the state parameters of the target network 12 in real time when the target network 12 obtains the initial data vector and rearranges it, improving the configuration efficiency of the target network 12 and making it suitable for high-frequency switching scenarios.
[0057] Next, with reference to the accompanying drawings, a rearrangement method provided by an embodiment of this application will be described.
[0058] See Figure 2 As shown, Figure 2 A flowchart of a rearrangement method provided in this application embodiment, the method comprising:
[0059] S101, input the initial data vector to the target network, and use the target network to rearrange the data elements in the initial data vector to obtain the target data vector. The state parameters of the switching nodes in the target network are obtained through the parameter generation device.
[0060] In this embodiment, the target network is used to rearrange data elements and can be used in a vector rearrangement circuit. An initial data vector (payload vector) is input to the target network, and the target network can rearrange the data elements in the initial data vector to obtain the target data vector. Specifically, the input data to the target network may also include a destination index vector (dst_idx vector), which includes multiple destination element numbers, each indicating the element number of a data element in the initial data vector within the target data vector; that is, the destination element number to which the data element of the current channel is to be routed.
[0061] refer to Figure 3The diagram illustrates a rearrangement process according to an embodiment of this application. The initial data vector includes four data elements: payload0, payload1, payload2, and payload3. The destination number vector includes four destination element numbers: 3, 0, 1, and 2, which correspond to the four data elements respectively. Destination element number 3 indicates that the element number of data element payload0 in the target data vector is 3, destination element number 0 indicates that the element number of data element payload1 in the target data vector is 0, destination element number 1 indicates that the element number of data element payload2 in the target data vector is 1, and destination element number 2 indicates that the element number of data element payload3 in the target data vector is 2. The element numbers in the target data vector reflect the position of the data elements in the target data vector. Therefore, the data elements can be sorted according to their element numbers in the target data vector, resulting in four data elements in the target data vector: payload1, payload2, payload3, and payload0, corresponding to element numbers 0, 1, 2, and 3 respectively. This achieves the transformation from the initial data vector to the target data vector, i.e., the rearrangement of data elements.
[0062] The target network includes multiple switching nodes, each of which can process multiple input data elements sequentially. These multiple switching nodes form a node array, making the target network consist of multiple node layers. Each node layer includes multiple switching nodes, and there are connections between adjacent node layers in the node array. The connections between adjacent node layers in the target network are determined during the construction of the target network. Therefore, the data elements input to the target network are transmitted layer by layer using the connections between adjacent node layers in the target network and then output. In this way, each data element can be routed to the required position through the switching nodes of multiple node layers, thus having a new order.
[0063] The target network can be a network capable of rearranging data elements, such as a Benes network. The Benes network, with its conjugate path property, is a well-known rearrangeable, non-blocking network in circuit switching. Each switching node in the target network can process two data elements sequentially. Therefore, when the number of input data elements to the target network is N, two data elements can be input to the same switching node. The number of switching nodes in each layer of the target network is N / 2, and the number of node layers in the target network is 2log2N-1, allowing the N input data elements to be rearranged into any desired order.
[0064] For example, if N is 8, each layer has 4 switching nodes, and the target network has 5 node layers. (Reference) Figure 4The diagram shown is a schematic representation of a target network provided in an embodiment of this application. The target network includes five node layers, numbered 0, 1, 2, 3, and 4. Each node layer includes four switching nodes, numbered 0, 1, 2, and 3. Each switching node can be named according to its layer number and node number, denoted as S0,0, S0,1, ..., S4,3, where S0,0 represents the 0th switching node in layer 0, S0,1 represents the 1st switching node in layer 0, and so on. The connection relationships between the switching nodes in the target network are known information, and each switching node has two inputs and two outputs.
[0065] Specifically, the sequential processing state of each switching node in the target network for input data elements can also be called a switching state, which can include a switching state and a pass-through state. When the switching state of a switching node is the switching state, the order of multiple data elements input to that switching node is swapped; when the switching state of a switching node is the pass-through state, the order of multiple data elements input to that switching node is not swapped. Figure 4 Taking the switching node S4,0 as an example, its switch state is no switching, the left input data element is 1, and the right input data element is 0. Therefore, its left output data element is 1, and its right output data element is 0. Figure 4 Taking the switching node S4,1 as an example, its switch is switching, the left input data element is 2, the right input data element is 3, the left output data element is 3, and the right output data element is 2.
[0066] In practical implementation, by configuring the on / off states of each switching node, different order processing rules can be applied to each switching node, thereby enabling the target network to possess specific rearrangement capabilities. The on / off states of each switching node can be represented by corresponding state parameters. Specifically, the state parameters of each switching node can indicate whether the switching node is in a pass-through or exchange state for multiple input data elements. For example, a first parameter can indicate a pass-through state, and a second parameter can indicate an exchange state; the first parameter could be 0, and the second parameter could be 1.
[0067] Currently, the state parameters of each switching node in the target network can be obtained by executing a parameter generation program, which serves as the control parameters for the target network. However, the parameter generation program has low parallelism during execution, resulting in high time complexity. The parameter generation program typically performs calculations on each data element, with a time complexity of O(N). Furthermore, the parameter generation program can be executed by the central processing unit (CPU), and the obtained state parameters are then written to memory. The target network then reads the state parameters from memory and configures them to each switching node for data element rearrangement. This operation needs to be performed before the target network performs the rearrangement. Therefore, different rearrangement requirements necessitate pre-calculation and storage of state parameters. As the target network size increases, more storage units are needed to store the state parameters, wasting valuable on-chip cache capacity. Moreover, due to the significant memory read / write latency, this method has low performance for data rearrangement scenarios with high real-time requirements.
[0068] In this embodiment, the state parameters of the switching nodes in the target network can be obtained through a parameter generation device, referencing... Figure 5 The diagram shown is a schematic of generating state parameters for a target network according to an embodiment of this application. The target network has multiple switching nodes, which are connected to each other. The input data of the target network includes an initial data vector (75206341) and a destination encoding vector. The target data vector (01234567) can be obtained from the initial data vector and the destination encoding vector. By generating state parameters for multiple switching nodes layer by layer through the parameter generation device, the switching nodes can have corresponding switching states, thereby enabling the target network to transform the initial data vector into the target data vector.
[0069] refer to Figure 6 The diagram shown is a structural schematic of a parameter generation device provided in an embodiment of this application. The parameter generation device includes a control unit 131, a calculation unit 132, and multiple parameter generation units 133. The control unit 131 controls the multiple parameter generation units 133 to perform calculations, and the calculation unit 132 processes the calculation results of the multiple parameter generation units 133 to obtain the state parameters of multiple switching nodes in the target network. Specifically, the multiple parameter generation units can process the target node layers to be processed in the target network in parallel. The control unit can determine the current target node layer to be processed in the target network. By sequentially using multiple node layers in the target network as target node layers, the multiple node layers can be processed sequentially, thereby determining the state parameters of multiple switching nodes in the target network layer by layer.
[0070] The parameter generation unit, also known as the switch generate engine (SGE), corresponds one-to-one with the switching nodes in the target node layer. That is, the number of parameter generation units and the number of switching nodes in the target node layer are the same. When the number of switching nodes in a node layer is N / 2, the number of parameter generation units is also N / 2. For example, if the number of data elements is 8, then the number of parameter generation units is 4. The parameter generation unit can determine the relationship between its first parameter value and that of a specified unit based on the target network's structural information, the initial data vector, and the target data vector. Multiple parameter generation units can determine their respective first parameter value relationships with the specified unit in parallel. The specified unit can be a unit among the multiple parameter generation units that has preset parameter values. The specified unit can be set according to actual conditions; for example, it can be a unit with a preset number, the unit with the largest number, or the unit with the smallest number.
[0071] The first parameter value relationship is used to indicate whether the predicted parameter values of multiple parameter generation units are the same as or opposite to the preset parameter values of a specified unit. The predicted parameter values of the parameter generation units are the status parameters generated by the parameter generation units for the corresponding switching nodes, used to indicate the on / off state of their corresponding switching nodes. Similarly, the preset parameter values of the specified units are the status parameters generated by the specified units for their corresponding switching nodes, used to indicate the on / off state of their corresponding switching nodes. For example, if the predicted parameter value of a parameter generation unit is 0, then the status parameter of the switching node corresponding to the parameter generation unit is 0, indicating that the switching node corresponding to the parameter generation unit is in a pass-through state. When the predicted parameter value of a parameter generation unit is the same as the preset parameter value of a specified unit, the switching state of the switching node corresponding to that parameter generation unit is the same as the switching state of the switching node corresponding to the specified unit. When the predicted parameter value of a parameter generation unit is opposite to the preset parameter value of a specified unit, the switching state of the switching node corresponding to that parameter generation unit is opposite to the switching state of the switching node corresponding to the specified unit.
[0072] After multiple parameter generation units determine the relationship between the first parameter values of the multiple parameter generation units and the specified unit in parallel, the calculation unit can determine the predicted parameter values of the multiple parameter generation units according to the relationship between the first parameter values and the preset parameter values of the specified unit. The predicted parameter values of the multiple parameter generation units are used as the state parameters of the exchange nodes corresponding to the multiple parameter generation units.
[0073] In the parameter generation device, multiple parameter generation units can operate in parallel, reducing the time required to determine state parameters and making the determination of state parameters less time-complex. For high-frequency switching scenarios, the performance is significantly improved. Moreover, the parameter generation device can determine the state parameters of the target network in real time when the target network obtains the initial data vector and rearranges it. Compared with data transfer through memory, this improves data transmission efficiency and the configuration efficiency of the target network, making it suitable for high-frequency switching scenarios, while reducing the waste of storage resources caused by pre-computation.
[0074] The target node layer is a node layer in the target network. The target network may also have intermediate node layers, which are the middle layers among all node layers. All other layers in the target network, except for the intermediate layers, have symmetric node layers that are symmetrical about the intermediate node layers. The target network can have symmetric node layers that are symmetrical to the target node layers about the intermediate node layers. The target node layer can be any layer in the first direction from the input side to the output side of the target network, specifically any layer before the intermediate node layers. Node layers located after the center node layer in the target network serve as symmetric node layers for these target node layers. When the target network includes node layers from layer 0 to layer 2log2N-1, the intermediate node layer is the layer 2log2N-1.
[0075] In the following description, the target unit among multiple parameter generation units will be used as the object of description. The target unit can be any unit among the multiple parameter generation units. The execution process of other units in the multiple parameter generation units besides the target unit can be referred to the description of the target unit. Reference Figure 7 The figure shows a schematic diagram of the target network in the process of determining the state parameters of the switching nodes according to an embodiment of this application. The target network includes 5 node layers, each node layer includes 4 switching nodes, and the node connection information between different node layers is shown in the figure. The initial data vector and the target data vector are shown in the figure. The switching state of each switching node is unknown and needs to be determined by the parameter generation device.
[0076] The first parameter value relationship between the target unit and the designated unit can be determined as follows: The target unit determines the input data vector of the target node layer and the output data vector of the symmetric node layer based on the structural information of the target network, the initial data vector, and the target data vector. Then, the target unit determines its adjacent units based on the input data vector of the target node layer and the output data vector of the symmetric node layer, ensuring that the input elements of the adjacent nodes and the input elements of the target node are output through the same switching node in the symmetric node layer. Here, the target node is the switching node in the target node layer corresponding to the target unit, and the adjacent nodes are the switching nodes in the target node layer corresponding to the adjacent nodes of the target unit. Next, the target unit determines the second parameter value relationship between the target unit and its adjacent units based on the node connection information between the target node layer and the symmetric node layer. This second parameter value relationship indicates whether the predicted parameter value of the target unit is the same as or opposite to the predicted parameter value of its adjacent units. Finally, the target unit determines the first parameter value relationship between the target unit and the designated unit based on the second parameter value relationship between the target unit and its adjacent units. Each parameter generation unit can be used in parallel as a target unit. The relationship between the first parameter value of each unit and the specified unit can be determined using the above method, thereby saving computation time.
[0077] Specifically, taking a target network with a total number of node layers of 2log2N-1 as an example, the target node layer is the j-th node layer in the first direction of the target network, where j is an integer greater than or equal to 0 and less than or equal to log2N-2. The intermediate node layer is the log2N-1-th node layer. If j is 0, the symmetric node layer is the 2log2N-2-th node layer in the first direction of the target network. In this case, the target unit can determine the initial data vector as the input data vector of the target node layer and the target data vector as the output data vector of the symmetric node layer. If j is greater than 0, the symmetric node layer is the 2log2N-2-j-th node layer in the first direction of the target network. In this case, the target... A node can determine the input data vector of a target node layer based on the input data vector of the (j-1)th layer node layer in the first direction of the target network, the state parameters of the exchange nodes in the (j-1)th layer node layer, and the node connection information between the target node layer (i.e., the jth layer node layer) and the (j-1)th layer node layer. It can also determine the output data vector of a symmetric node layer based on the input data vector of the target node layer in the target network, the output data vector of the 2log2N-1-jth layer node layer in the first direction of the target network, and the node connection information between the target node layer and the 2log2N-1-jth layer node layer, where j is an integer greater than 0 and less than or equal to log2N-1.
[0078] Thus, based on the network structure of the target network, the input data vector of the target node layer can be obtained from the state parameters of the outer layer and the input data vector of the target node layer. While determining the state parameters of the target node layer layer by layer starting from the data input end, the input data vector of the inner layer is determined layer by layer, so that the inner layer can be used as the target node layer for determining its state parameters. Based on the target network structure, the output data vector of the symmetric node layer can also be obtained from the output data vector of the outer layer. While determining the state parameters of the symmetric node layer layer by layer starting from the data output end, the output data vector of the inner layer is determined layer by layer, so that the inner layer can be used as the symmetric node layer for determining its corresponding target node layer's state parameters.
[0079] For example, refer to Figure 7 As shown, N is 8, the total number of node layers in the target network is 5, the input data vector of the 0th node layer in the target network is the initial data vector, the input data vector of the 1st node layer is determined according to the initial data vector, the state parameters of the exchange nodes of the 0th node layer, and the node connection information between the 1st and 0th node layers, realizing layer-by-layer calculation starting from the data input end, the output data vector of the 4th node layer is the target data vector, and the output data of the 3rd node layer is determined according to the input data vector of the 1st node layer, the target data vector, and the node connection information between the 1st and 3rd node layers, realizing layer-by-layer calculation starting from the data output end.
[0080] Specifically, the adjacent nodes of a given target node can have their input elements and the target node's input elements output via the same exchange node in the symmetric node layer. For example, the number of parameter generation units is 4. (Refer to...) Figure 8 The diagram shown is a schematic of a process for determining adjacent units according to an embodiment of this application. Multiple parameter generation units are denoted as SGE0, SGE1, SGE2 and SGE3. When the 0th node layer is the target node layer and the 4th node layer is the symmetric node layer, for the exchange nodes S0,0,S0,1,S0,2 and S0,3 of the 0th node layer, SGE0,SGE1,SGE2 and SGE3 correspond to the exchange nodes S0,0,S0,1,S0,2 and S0,3 respectively.
[0081] refer to Figure 6As shown, based on the order of the exchange nodes in the 0th layer and the initial data vector, each pair of data elements is input into the exchange node corresponding to an SGE. The input data for exchange node S0,0 corresponding to parameter generation unit SGE0 is 5 and 7; the input data for exchange node S0,1 corresponding to SGE1 is 2 and 0; the input data for exchange node S0,2 corresponding to SGE2 is 6 and 3; and the input data for exchange node S0,3 corresponding to SGE3 is 4 and 1. For the 4th layer, its output data vector is the target data vector. Based on the order of the exchange nodes in the 4th layer and the target data vector, each pair of data elements is output by the same exchange node corresponding to the same SGE. Therefore, exchange node S4,0 outputs 0 and 1, exchange node S4,1 outputs 2 and 3, exchange node S4,2 outputs 4 and 5, and exchange node S4,3 outputs 6 and 7.
[0082] As mentioned earlier, if exchange node S4,0 outputs 0 and 1, then in the 0th layer node layer, exchange node S0,1 (outputting 0) corresponding to SGE1 and exchange node S0,3 (outputting 1) corresponding to SGE3 are adjacent units. Similarly, based on other data elements, SGE0 and SGE2 are determined to be adjacent units, SGE0 and SGE3 are adjacent units, and SGE1 and SGE2 are adjacent units. (Refer to...) Figure 8 As shown, the adjacency relationship between parameter generation units that are adjacent to each other can be represented by the lines connecting them. In specific implementation, each parameter generation unit can determine its own adjacent units. For example, SGE0 can determine SGE2 and SGE3 as its adjacent units, SGE1 can determine SGE2 and SGE3 as its adjacent units, SGE2 can determine SGE1 and SGE0 as its adjacent units, and SGE3 can determine SGE0 and SGE1 as its adjacent units.
[0083] Specifically, after determining the adjacent elements of the target element, the relationship between the second parameter values of the target element and its adjacent elements can be determined. In specific implementation, there are 2log2N-1-2*M layers of nodes between the target node layer and the symmetric node layer. Therefore, the target element can divide the exchange nodes between the target node layer and the symmetric node layer into 2 structurally identical nodes. M There are 12 node subarrays, each containing a total of 2log2N-1-2*M node layers. The number of swapped nodes in each subarray is the same, i.e., N / 2. M+1 ,2 M The node subarrays are grouped in pairs according to their arrangement order to obtain 2 M-1 There are 2 array groups, M is a positive integer; then, based on the target node and 2... M The connection relationships of the exchange nodes in the subarray of nodes, and the relationship between adjacent nodes and 2 MThe connection relationship of the exchange nodes in the subarray of nodes is determined to satisfy the condition that the second parameter value relationship between the target node and its adjacent nodes is used as the second parameter value relationship between the target unit and its adjacent units. The exchange condition is that data elements output by the same exchange node in the symmetric node layer are output by the target node and its adjacent nodes to different subarrays in the same array group, respectively. It can be understood that 2 M If the number of nodes is less than or equal to N / 2, then the nodes exchanged between the target node layer and the symmetric node layer are divided into 2 nodes with the same structure. M The operation continues for each node subarray until each node subarray includes a swap node.
[0084] refer to Figure 7 As shown, the left half of the switching nodes in the first, second, and third node layers constitute the first node subarray 121, and the right half of the switching nodes in the first, second, and third node layers constitute the second node subarray 122. Both the first and second node subarrays have four input elements. It can be seen from the figure that the data elements output by the same switching node in the fourth node layer come from different node subarrays. Therefore, 0 and 1 need to be transmitted to different node subarrays, and similarly, 2 and 3, 4 and 5, and 6 and 7 need to be transmitted to different node subarrays. Thus, it can be determined that adjacent units SGE1 and SGE3 need to have opposite parameter values, so that S0,1 and S0,3 have opposite switching states, thereby outputting 0 and 1 to different node subarrays. Similarly, SGE0 and SGE2 have opposite parameter values, SGE0 and SGE3 have the same parameter values, and SGE1 and SGE3 have the same parameter values. (Reference) Figure 8 As shown, solid lines can be used to represent two adjacent parameter generating units that have the same parameter values, while dashed lines can be used to represent two adjacent parameter generating units that have opposite parameter values.
[0085] Specifically, after determining the second parameter value relationship between the target unit and its adjacent units, the first parameter value relationship between the target unit and the designated unit can be determined. Specifically, when the adjacent units of the target unit are designated units, the second parameter value relationship between the target unit and its adjacent units can be used as the first parameter value relationship between the target unit and the designated unit. When the adjacent units of the target unit are not designated units, the adjacent units of the target unit's adjacent units can be determined based on the adjacent units of the target unit, as well as the second parameter value relationship between the adjacent units of the target unit and their adjacent units. Based on this second parameter value relationship, the first parameter value relationship between the target unit and the designated unit can be determined. This process continues when the number of parameter generation units is large.
[0086] In practical implementation, the target unit can construct a unit adjacency chain centered on its adjacent units. Adjacent parameter generation units within this chain are connected by connecting lines, which have either a first state or a second state, representing whether the second parameter values are the same or opposite. The target unit can then determine the first parameter value relationship between itself and the specified unit based on the connecting lines in the unit adjacency chain. When the number of parameter generation units is small, the target unit's adjacent units can be specified units, allowing for direct determination of the first parameter value relationship between the target unit and the specified unit, saving computation time.
[0087] When there are many parameter generation units, the adjacent units of the target unit are often not the specified units. Therefore, the unit adjacency relationship chain can be extended to include the specified units. That is, the relationship between the first parameter value of the target unit and the specified unit is determined according to the connection line between the target unit and the specified unit in the unit adjacency relationship chain. Specifically, the unit adjacency relationship chain is extended, and then the relationship between the first parameter value of the target unit and the specified unit is determined according to the connection line between the target unit and the specified unit in the extended unit adjacency relationship chain.
[0088] In practice, the control unit can determine the number of times the unit adjacency relationship chain is expanded based on the number of units generated by multiple parameters. If the number of units generated by multiple parameters is N / 2, the number of expansions can be log2(N / 2)-1. The establishment of the unit adjacency relationship chain is taken as the first iteration. Combined with log2(N / 2)-1 expansions, it is equivalent to log2(N / 2) iterations. Each iteration corresponds to one clock cycle. Therefore, the parameter determination of each node layer requires log2(N / 2) clock cycles.
[0089] The target unit can expand its adjacency chain based on the number of expansions. Then, based on the connections between the target unit and the specified unit in the expanded adjacency chain, the first parameter value relationship between the target unit and the specified unit is determined. Specifically, during the i-th expansion of the adjacency chain, the target unit obtains the adjacency information of its neighboring units and, based on this information, adds the target unit's second [parameter value] to the adjacency chain. i-1 +1 to 2 i The system generates a level-1 adjacency unit and adds connecting lines to the parameter generation units of adjacent units in the unit adjacency relationship chain. In the unit adjacency relationship chain, the (k+1)th level adjacency unit of the target unit is the adjacency unit of the kth level adjacency unit of the target unit, and the adjacency unit of the target unit is the first level adjacency unit of the target unit. i and k are integers greater than 0.
[0090] refer to Figure 9 The diagram illustrates the process of expanding a unit adjacency relationship chain according to an embodiment of this application. Solid lines represent two parameter generating units that are adjacent to each other and have the same parameter value, while dashed lines represent two parameter generating units that are adjacent to each other and have opposite parameter values. SGE0 can determine SGE2 and SGE3 as its adjacent units, SGE1 can determine SGE2 and SGE3 as its adjacent units, SGE2 can determine SGE1 and SGE0 as its adjacent units, and SGE3 can determine SGE0 and SGE1 as its adjacent units. When SGE3 is a designated unit, SGE2 cannot determine its second parameter value relationship with the designated unit based on its adjacent units. Therefore, it is necessary to obtain the second-level adjacent units of SGE2, namely the adjacent units of SGE2, SGE1 and SGE0, thereby adding SGE3 to the unit adjacency relationship chain.
[0091] After extending the adjacency chain, as long as the parameter values of each SGE satisfy the connection relationship shown in the diagram above, the state parameters of the switching nodes in the target node layer of the target network can be determined. For example, if the parameter value of SGE3 is given as 0, according to the connection relationship, the values of other SGEs can be determined, that is, the parameter value of SGE0 is 0, and the parameter values of SGE1 and SGE2 are both 1. Therefore, the switching states of the corresponding switching nodes S0,0,S0,1,S0,2 and S0,3 for SGE0,SGE1,SGE2 and SGE3 can be determined. (Refer to...) Figure 10 The diagram shown is another structural schematic of the target network in the process of determining the state parameters of the switching node in an embodiment of this application. The switching states of S0,0,S0,1,S0,2 and S0,3 are respectively pass-through, switch, switch and pass-through.
[0092] refer to Figure 11The diagram illustrates another process for expanding a unit adjacency chain according to an embodiment of this application. It includes 22 parameter generation units. Small squares in the diagram identify these units. The numbers adjacent to each square indicate the level of the parameter generation unit as an adjacency of the target unit. The square adjacent to the number 0 is the target unit. Gray-filled squares represent parameter generation units in the unit adjacency chain. Unfilled squares represent the positions of parameter generation units unknown to the target unit. Lines connecting the gray-filled squares indicate the second parameter value relationship of the connected parameter generation units. Figure 11 The study did not investigate the value relationship of the second parameter, so it did not distinguish the state of each connection. In actual use, each connection may have a different state.
[0093] Based on the number of generated units, it can be determined that the unit adjacency chain needs to be expanded log2^22 times. Rounding down from log2^22, it needs to be expanded 5 times. (See reference...) Figure 11 The first circular unit adjacency chain includes the target unit and its two first-level adjacent units, forming the initial unit adjacency chain for the target node. At this point, the unit adjacency chain includes three parameter-generating units. After completing the first expansion of the unit adjacency chain, the two second-level (2...) adjacent units of the target unit can be obtained. 0 The second ring is used to expand the adjacency chain of the target cell into a second ring, which includes 5 parameter generating units. After the second expansion of the adjacency chain, the two levels of adjacency units of the target cell can be obtained, namely the third and fourth (2) levels of adjacency units of the target cell. 1 +1 to 2 2 The first level of adjacency units, consisting of 4 parameter generating units, expands to obtain the unit adjacency relationship chain shown in the third ring. At this point, the unit adjacency relationship chain includes 9 parameter generating units. After completing the third expansion of the unit adjacency relationship chain, the fourth level of adjacency units of the target unit can be obtained, namely, the 5th, 6th, 7th, and 8th (2)th level adjacency units of the target unit. 2 +1 to 2 3 The fourth ring contains 17 parameter-generating units. After the fourth expansion of the unit adjacency chain, the 9th, 10th, and 11th (2)th (3)th (4)th (5)th (6)th (7)th (8 ... 3 +1 to 2 4 There are 5 parameter generation units in total. The 12th, 13th, 14th, 15th and 16th level adjacent units of the target unit do not exist, so they cannot be obtained. Thus, the expansion of the unit adjacency relationship chain is completed, and the unit adjacency relationship chain shown in the fifth ring is obtained. At this time, the unit adjacency relationship chain includes all 22 parameter generation units. Figure 11 The diagram shows a unit adjacency chain corresponding to one of the target units. For each parameter generation unit, there is a similar unit adjacency chain diagram, that is, after the unit adjacency chain is established.
[0094] After expanding the adjacency chain of the target unit, the first parameter value relationship between the target unit and the specified unit can be determined based on the connecting lines between the target unit and the specified unit in the expanded adjacency chain. If there are other parameter generating units before the target unit and the specified unit, there are multiple connecting lines between them, and the first parameter value relationship between the target unit and the specified unit can be determined based on these multiple connecting lines. For example, the first parameter value relationship between the target unit and the specified unit can be determined based on the number of connecting lines with a second state. Since a connecting line having a second state indicates that the second parameter value relationship of adjacent parameter generating units is opposite, if the number of connecting lines with a second state is odd, the first parameter value relationship between the target unit and the specified unit is opposite; if the number of connecting lines with a second state is even, the first parameter value relationship between the target unit and the specified unit is the same.
[0095] Based on the above method, the value relationship of the first parameter can be determined, and the state parameters of the exchange nodes of the target node layer can be determined using the computing unit. Then, the next node layer of the target node layer can be taken as the new target node layer, and a new symmetric node layer can be determined based on the new target node layer. Using the state parameters of the exchange nodes of the target node layer, the input data vector of the new target node layer and the output data vector of the new symmetric node layer can be determined, thereby determining the state parameters of the exchange nodes of the new target node layer, until the state parameters of the exchange nodes of all target node layers are determined.
[0096] refer to Figure 12The diagram shows another structural schematic of the target network in the process of determining the state parameters of the switching nodes in an embodiment of this application. The switching states of S0,0,S0,1,S0,2 and S0,3 are respectively pass-through, switch, switch, and pass-through. Therefore, the first layer node layer can be used as the new target node layer, and the third layer node layer as the new symmetric node layer. The input data vector of the first layer node layer is determined based on the input data vector of the 0th layer node layer, the state parameters of the switching nodes in the 0th layer node layer, and the node connection information between the 0th and 1st layer node layers, which is 70345261. 7034 is input to the second node subarray, and 526... 1. The data input to the first node subarray is used to determine the output data vector of the third node layer based on the input data vector of the first node layer, the output data vector of the fourth node layer, and the node connection information of the first to fourth node layers. Specifically, data element 1 input to the first node subarray will be output to S4,0. This data element 1 is output through the right port of S3,2 connected to S4,0. Data element 0 input to the second node subarray will be output to S4,0. This data element 0 is output through the right port of S3,0 connected to S4,0. And so on, the output data vector of the third node layer can be obtained as 03471256.
[0097] After determining the output data vector of the new symmetric node layer, the computational unit can use the output data vectors of the new and old symmetric node layers to determine the state parameters of the swapped nodes in the old symmetric node layer. Taking the old symmetric node layer as the 2log2N-2-j layer and the new symmetric node layer as the 2log2N-3-j layer as an example, the state parameters of the swapped nodes in the 2log2N-2-j layer can be determined based on the output data vectors of the 2log2N-3-j layer and the output data vectors of the 2log2N-2-j layer. Specifically, the input data vector of the 2log2N-2-j layer can be determined based on the output data vectors of the 2log2N-3-j layer and the node connection information of the 2log2N-2-j and 2log2N-3-j layer nodes. Then, based on the input and output data vectors of the 2log2N-2-j layer, the state parameters of the swapped nodes in the 2log2N-2-j layer can be determined. (Reference) Figure 12 As shown, for example, the old symmetric node layer is the 4th node layer, and the new symmetric node layer is the 3rd node layer. Based on the output data vector of the 3rd node layer and the node connection information of the 3rd and 4th node layers, the state parameters of the switching nodes of the 4th node layer can be obtained. The state parameters of S4,0, S4,1, S4,2 and S4,3 are 0, 1, 0 and 1 respectively, and the corresponding switching states are pass-through, switch, pass-through and switch respectively.
[0098] Then, based on the input data vector of the first-layer node and the output data vector of the third-layer node, the state parameters of the switching nodes in the first-layer node can be determined, referring to... Figure 13 The diagram illustrates another structural representation of the target network in the process of determining the state parameters of the switching nodes in this embodiment. The switching nodes between the first and third node layers are divided into four (M=2) node subarrays, including S2,0, S2,1, S2,2, and S2,3. These switching nodes belong to the first array group 123 and the second array group 124, respectively. Therefore, it can be determined that SGE2 corresponding to S1,2 and SGE3 corresponding to S1,3 are adjacent units with opposite values for their second parameters. Similarly, SGE1 corresponding to S1,1 and SGE0 corresponding to S1,0 are adjacent units with the same value for their second parameters. SGEs in different array groups can each have their own designated units, thus determining the switching states of S1,0, S1,1, S1,2, and S1,3 as pass-through, pass-through, pass-through, and switch, respectively. This completes the determination of the state parameters of the switching nodes in each target node layer of the target network.
[0099] refer to Figure 14 The diagram shown illustrates another structural approach to determining the state parameters of the switching nodes in the target network according to an embodiment of this application. The switching states of S1,0, S1,1, S1,2, and S1,3 are respectively: pass-through, pass-through, pass-through, and switch. Subsequently, the state parameters of the switching nodes in the symmetric node layer can be determined to ascertain their switching states. (Reference) Figure 15 The diagram shown is another structural schematic of the target network in the process of determining the state parameters of the switching nodes in this embodiment of the application. It can be determined that the switching states of the switching nodes S3,0,S3,1,S3,2,S3,3 in the symmetric node layer are switching, switching, pass-through, and pass-through, respectively. The determination process will not be described in detail.
[0100] In this embodiment, after determining the state parameters of the exchange nodes in the target node layer, if the target node layer and the intermediate node layer are adjacent, the target unit can determine the input data vector of the intermediate node layer based on the input data vector of the target node layer, the state parameters of the exchange nodes in the target node layer, and the node connection information between the target node layer and the intermediate node layer. Based on the input data vector of the intermediate node layer, the output data vector of the symmetric node layer, and the node connection information between the intermediate node layer and the symmetric node layer, the calculation unit can determine the state parameters of the exchange nodes in the intermediate node layer based on the input data vector and the output data vector of the intermediate node layer.
[0101] In other words, from the input to the output of the target network, the node layers before the intermediate node layers can be taken as the target node layers, and the node layers after the intermediate node layers can be taken as the symmetric node layers. The state parameters of the exchange nodes of the target node layers are determined sequentially. Then, the state parameters of the exchange nodes of the intermediate node layers and the symmetric node layers can be determined accordingly. Thus, the state parameters of the exchange nodes of all node layers of the target network are determined. The parameter generation unit calculates the parameters for the first log2N node layers, with a time complexity of O(log2N), which greatly reduces the time complexity. As the parallelism of the input vector of the target network increases, the configuration efficiency of the target network will be greatly improved, thus greatly improving the performance of the target network.
[0102] refer to Figure 14 As shown, the second-layer node layer serves as the intermediate node layer. Based on the input data vector of the first-layer node layer, the state parameters of the exchange nodes in the first-layer node layer, and the node connection information between the first and second-layer node layers, the input data vector of the second-layer node layer is determined to be 73045126. Based on the input data vector of the second-layer node layer, the output data vector of the third-layer node layer, and the node connection information between the second and third-layer node layers, the output data vector of the intermediate node layer is determined to be 37041526. (Refer to...) Figure 15 The diagram shown illustrates another structural schematic of the target network in the process of determining the state parameters of the switching nodes in this embodiment of the application. Based on this, the switching states of the intermediate node layer switching nodes S2,0,S2,1,S2,2,S2,3 can be determined as switching, pass-through, switching, pass-through, respectively, thus obtaining... Figure 4 The target network is shown.
[0103] In this embodiment, multiple parameter generation units can be implemented in hardware, eliminating the need to run a program to generate state parameters and thus improving the performance of the target network. Utilizing parallel computing across multiple hardware units significantly reduces time complexity. These parameter generation units, acting as separate blocks, can perform independent calculations with minimal signal interaction, facilitating chip backend placement and routing. Specifically, these multiple parameter generation units can be connected to a unified bus to enable data exchange, resulting in low placement and routing complexity, a small chip area footprint, and high area efficiency.
[0104] In the process of calculating the state parameters of the exchanged nodes in the target node layer, the construction and expansion of the cell adjacency relationship chain requires log2(N / 2) iterations. This further reduces the time complexity of the computation at each node layer to O(log2(N / 2)). Thus, by performing log2N layers of computation, with each layer undergoing log2(N / 2) iterations, the total time complexity is O(log2(N / 2)*log2N), fully utilizing the parallel characteristics of the hardware, reducing time complexity, and significantly improving performance. Furthermore, by using hardware to calculate the state parameters online, the calculated state parameters are immediately configured into the target network without requiring additional storage, saving valuable on-chip cache resources.
[0105] The target cell may include a destination number register to store the destination element number corresponding to the target cell. The destination number register is connected to a destination number bus (DST INDEX BUS) to provide the stored target element number to other cells in the multiple parameter generation cells besides the target cell. This allows other cells to obtain the destination number vector using the destination number bus for subsequent determination of adjacent cells. (Reference) Figure 16 The diagram shown is a structural schematic of a parameter generation unit provided in an embodiment of this application. Taking SGE0 as the target unit as an example, it has two input data elements. Correspondingly, the target unit includes a destination number register 1 and a destination number register 2, which are used to store the destination element numbers dst_ids0 and dst_ids1 corresponding to the two data elements, respectively.
[0106] The target unit may include an adjacency selector (neighbor search unit) for determining its neighboring units and the second parameter value relationship between the target unit and its neighboring units. The target unit may also include a unit register for storing the unit identifiers of at least one level neighboring units in the unit adjacency chain. The target unit may further include a second value relationship register for storing the second parameter value relationship between the target unit and its at least one level neighboring units. The unit register and the second value relationship register are connected to a neighbor bus (neighborBUS) to provide the stored unit identifiers and the second parameter value relationship between the target unit and its at least one level neighboring units to other units in the multiple parameter generation units via the neighbor bus. For example, the unit register may be used to store the unit identifier of the highest-level neighboring unit of the target unit in the unit adjacency chain.
[0107] refer to Figure 16As shown, the adjacency selector includes adjacency selector 1 and adjacency selector 2, which are used to determine the adjacency unit and the second parameter value relationship based on two input data elements, respectively; the unit register includes unit register 1 and unit register 2, which are used to store at least one level of adjacency units of the target unit determined based on two input data elements: neighbor0 and neighbor1, respectively; the second value relationship register includes second value relationship register 1 and second value relationship register 2, which are used to store the second parameter value relationship determined based on two input data elements: inv_flag0 and inv_flag1, respectively; neighbor0 and neighbor1 will be transmitted to the unit bus.
[0108] The target unit may further include a first data selector, which is connected to the unit bus and is used to obtain, from the unit bus, at least one level adjacent unit of the highest-level adjacent unit among the at least one level adjacent units, and the second parameter value relationship between the at least one level adjacent unit and the highest-level adjacent unit of the target unit, based on the at least one level adjacent units of the target unit. (Reference) Figure 16 As shown, the cell register is connected to the first data selector, which includes a first data selector 1 and a first data selector 2, which are respectively used to obtain at least one level of adjacent cells of the highest-level adjacent cell based on cell register 1 and cell register 2, as well as the relationship between the at least one level of adjacent cells of the highest-level adjacent cell and the second parameter value of the highest-level adjacent cell.
[0109] In this embodiment, the designated unit may have the largest number value among multiple parameter generation units. When multiple parameter generation units are divided into multiple array groups, the designated unit may be the unit with the largest number value in a single array group. The target unit may include a comparator and a second data selector. The comparator is used to determine the largest number value of the parameter generation unit in the unit adjacency chain, and the second data selector is used to output the number value of the parameter generation unit in the unit adjacency chain to the comparator. (Reference) Figure 16 As shown, the second data selector includes a second data selector 1 and a second data selector 2, which are used to output the parameter generation unit number values int_max0 and int_max1 in the cell adjacency relationship chain determined by the two input elements to the comparator, respectively.
[0110] The target unit also includes a maximum number register and a first value relationship register. The maximum number register stores the unit identifier corresponding to the maximum number value of the parameter generation unit in the unit adjacency chain. The first value relationship register stores the second parameter value relationship between the parameter generation unit with the maximum number value and the target unit. Both the maximum number register and the first value relationship register are connected to the unit bus and are used to provide the stored unit identifier corresponding to the maximum number value and the second parameter value relationship between the parameter generation unit with the maximum number value and the target unit to other units among multiple parameter generation units (excluding the target unit) via the unit bus. The unit identifier corresponding to the maximum number value stored in the maximum number register is `interval max`, and the second parameter value relationship between the parameter generation unit with the maximum number value and the target unit is `inv_flag2`.
[0111] refer to Figure 17 The diagram shown is a schematic representation of the storage state of a register according to an embodiment of this application. Figure 9 The cell adjacency relationship chain is established after the first iteration based on the target cell and its adjacent cells. Each target node establishes its own cell adjacency relationship chain. The adjacent cells of each target cell and the second parameter value relationship with the adjacent cells are stored in the register. The SGE with the largest number in the cell adjacency relationship chain and the second storage value relationship between the target node and the SGE with the largest number are also stored in the register. At this time, SGE0 is adjacent to SGE2 and SGE3 respectively. The second storage value relationship of SGE0 and SGE2 is opposite, and the second storage value relationship of SGE0 and SGE3 is the same. The interval max is S3, and so on.
[0112] In the second iteration, the cell adjacency chain is expanded. SGE0's adjacent cells expand to SGE1, SGE2's adjacent cells expand to SGE3, and their interval max values change to S3, and so on. When the interval max value corresponding to each SGE is the same, it indicates that the effective range of the SGE (i.e., the adjacency chain of each cell) has expanded to the entire ring containing all parameter generating cells. The value stored in inv_flag2 can then be used to calculate the switching state of the SGE.
[0113] Based on the rearrangement method provided in the embodiments of this application, the embodiments of this application also provide a rearrangement apparatus, referencing... Figure 18 The diagram shown is a structural block diagram of a rearrangement device provided in an embodiment of this application. The rearrangement device 1300 includes:
[0114] The data input / output unit is used to input an initial data vector into the target network, so as to rearrange the data elements in the initial data vector using the target network to obtain a target data vector; the state parameters of the switching nodes in the target network are obtained through the parameter generation device.
[0115] This application also provides a computer device, which is the computer device described above, and may include a terminal device or a server. The aforementioned rearrangement device may be configured in the computer device. The computer device will now be described in conjunction with the accompanying drawings.
[0116] If the computer device is a terminal device, please refer to Figure 19 As shown, this application provides a terminal device, taking a mobile phone as an example:
[0117] Figure 19 This diagram illustrates a partial structural representation of a mobile phone related to the terminal device provided in this embodiment. (Reference) Figure 19 The mobile phone includes components such as a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a Wi-Fi module 1470, a processor 1480, and a power supply 1490. Those skilled in the art will understand that... Figure 19 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0118] The following is combined Figure 19 A detailed introduction to each component of a mobile phone:
[0119] The RF circuit 1410 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 1480; in addition, it transmits uplink data to the base station.
[0120] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0121] The input unit 1430 can be used to receive input numeric or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432.
[0122] The display unit 1440 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1440 may include a display panel 1441.
[0123] The mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors.
[0124] Audio circuitry 1460, speaker 1461, and microphone 1462 provide an audio interface between the user and the mobile phone.
[0125] WiFi is a short-range wireless transmission technology. Through the WiFi module 1470, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access.
[0126] The processor 1480 is the control center of the mobile phone. It connects to various parts of the mobile phone through various interfaces and lines. It performs various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 1420 and calling data stored in the memory 1420.
[0127] The phone also includes a power supply 1490 (such as a battery) that powers the various components.
[0128] In this embodiment, the processor 1480 included in the terminal device also has the following functions:
[0129] An initial data vector is input to the target network, and the data elements in the initial data vector are rearranged using the target network to obtain the target data vector; the state parameters of the switching nodes in the target network are obtained through the parameter generation device.
[0130] If the computer device is a server, this application embodiment also provides a server; please refer to [link to relevant documentation]. Figure 20 As shown, Figure 20 This is a structural diagram of a server 1500 provided in an embodiment of this application. The server 1500 can vary significantly due to different configurations or performance. It may include one or more processors 1522, such as a Central Processing Unit (CPU), a memory 1532, and one or more storage media 1530 (e.g., one or more mass storage devices) for storing application programs 1542 or data 1544. The memory 1532 and storage media 1530 can be temporary or persistent storage. The program stored in the storage media 1530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the processor 1522 may be configured to communicate with the storage media 1530 and execute the series of instruction operations in the storage media 1530 on the server 1500.
[0131] Server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input / output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0132] The steps performed by the server in the above embodiments can be based on Figure 20 The server structure shown.
[0133] In addition, this application embodiment also provides a storage medium for storing a computer program for executing the method provided in the above embodiment.
[0134] This application also provides a computer program product including instructions that, when run on a computer, cause the computer to perform the methods provided in the above embodiments.
[0135] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disk, etc., and other media capable of storing program code.
[0136] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. 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, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0137] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Moreover, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A parameter generation device, characterized in that, The device includes: a control unit, a computing unit, and multiple parameter generation units. The control unit is used to determine the target node layer to be processed in the target network; the target network includes multiple switching nodes, which form a node array, and there is a connection relationship between two adjacent node layers in the node array; the target network is used to rearrange the data elements in the initial data vector to obtain the target data vector. The plurality of parameter generation units correspond one-to-one with the exchange nodes of the target node layer, and are used to determine the first parameter value relationship between the plurality of parameter generation units and a designated unit in parallel based on the structural information of the target network, the initial data vector and the target data vector, wherein the designated unit is the unit among the plurality of parameter generation units that has a preset parameter value. The calculation unit is used to determine the predicted parameter values of the plurality of parameter generation units according to the first parameter value relationship and the preset parameter values, respectively. The predicted parameter values are respectively used as the status parameters of the switching nodes corresponding to the plurality of parameter generation units. The status parameters are used to indicate whether the switching state of the switching node is a pass-through state or a switching state. The target network has a symmetric node layer that is symmetrical to the target node layer with respect to the intermediate node layer. For the target unit among the multiple parameter generation units, the relationship between the first parameter values of the target unit and the designated unit is determined as follows: The target unit determines the input data vector of the target node layer and the output data vector of the symmetric node layer based on the structural information of the target network, the initial data vector, and the target data vector. The target unit determines its adjacent units based on the input data vector of the target node layer and the output data vector of the symmetric node layer, such that the input elements of the adjacent nodes and the input elements of the target node are output through the same exchange node in the symmetric node layer; the target node is the exchange node in the target node layer corresponding to the target unit, and the adjacent node is the exchange node in the target node layer corresponding to the adjacent unit of the target unit. The target unit determines the second parameter value relationship between the target unit and the adjacent unit of the target unit based on the node connection information between the target node layer and the symmetric node layer; The target unit determines the first parameter value relationship between the target unit and the designated unit based on the second parameter value relationship between the target unit and the adjacent units of the target unit.
2. The apparatus according to claim 1, characterized in that, Each of the aforementioned exchange nodes is used to process two data elements sequentially. The initial data vector contains N data elements. The number of the plurality of parameter generation units and the number of exchange nodes in the target node layer are N / 2. The number of node layers in the target network is... The target node layer is the first node in the target network along the first direction from the input side to the output side. Any layer in the layer node layer.
3. The apparatus according to claim 2, characterized in that, The target node layer is the j-th node layer in the first direction of the target network, where j is greater than or equal to 0 and less than or equal to 1. The integer, the intermediate node layer is the first in the target network. In the target node layer, the target unit determines the input data vector of the target node layer and the output data vector of the symmetric node layer based on the structural information of the target network, the initial data vector, and the target data vector, including: If j is 0, the symmetric node layer is the nth node in the target network in the first direction. In the symmetric node layer, the initial data vector is determined to be the input data vector of the target node layer, and the target data vector is the output data vector of the symmetric node layer. If j is greater than 0, the symmetric node layer is the nth node in the target network in the first direction. For each layer of nodes, the input data vector of the target node layer is determined based on the input data vector of the (j-1)th layer of nodes in the first direction of the target network, the state parameters of the switching nodes in the (j-1)th layer of nodes, and the node connection information between the target node layer and the (j-1)th layer of nodes. The output data vector of the layer node and the target node layer and the first The node connection information between the layers determines the output data vector of the symmetric node layer.
4. The apparatus according to claim 3, characterized in that, The computing unit is also used for: According to the target network in the first direction, the first The output data vectors of the layer node layer and the output data vectors of the symmetric node layer are used to determine the state parameters of the exchange nodes of the symmetric node layer.
5. The apparatus according to claim 1, characterized in that, The target unit is also used for: After determining the state parameters of the switching nodes of the target node layer, if the target node layer and the intermediate node layer are adjacent, the input data vector of the intermediate node layer is determined based on the input data vector of the target node layer, the state parameters of the switching nodes of the target node layer, and the node connection information of the target node layer and the intermediate node layer. The output data vector of the intermediate node layer is determined based on the input data vector of the intermediate node layer, the output data vector of the symmetric node layer, and the node connection information between the intermediate node layer and the symmetric node layer. The computing unit is also used to: determine the state parameters of the switching nodes of the intermediate node layer based on the input data vector and the output data vector of the intermediate node layer.
6. The apparatus according to claim 1, characterized in that, The target node layer and the symmetric node layer have a In the target node layer, the target unit determines the second parameter value relationship between itself and its adjacent units based on the node connection information between the target node layer and the symmetric node layer, including: The target unit divides the exchange nodes between the target node layer and the symmetric node layer into those with the same structure. There are 10 node subarrays, and the total number of node layers contained in each node subarray is 100. The The node subarrays are grouped in pairs according to their arrangement order. There are array groups, where M is a positive integer; According to the target node and the The connection relationships of the exchange nodes in the node subarray, and the relationship between the adjacent nodes and the... The connection relationship of the exchange nodes in the node subarray is determined, and the second parameter value relationship between the target node and the adjacent node is determined when the exchange condition is met. This relationship is used as the second parameter value relationship between the target unit and the adjacent unit of the target unit. The exchange condition is that the data element output by the same exchange node in the symmetric node layer is output by the target node and the adjacent node to different node subarrays in the same array group.
7. The apparatus according to any one of claims 1 or 3-6, characterized in that, The target unit determines the first parameter value relationship between the target unit and the designated unit based on the second parameter value relationship between the target unit and its adjacent units, including: The target unit constructs a unit adjacency relationship chain centered on the target unit based on its adjacent units. The parameter generation units adjacent to each other in the unit adjacency relationship chain are connected by connecting lines. The connecting lines have a first state or a second state, which are used to reflect whether the second parameter values are the same or opposite. The target unit determines the first parameter value relationship between the target unit and the designated unit based on the connection line between the target unit and the designated unit in the unit adjacency relationship chain.
8. The apparatus according to claim 7, characterized in that, The control unit is also used for: The number of times the unit adjacency relationship chain is expanded is determined based on the number of units generated by the multiple parameters; The target unit determines the first parameter value relationship between the target unit and the designated unit based on the connection line between the target unit and the designated unit in the unit adjacency relationship chain, including: The target unit expands the unit adjacency relationship chain according to the number of expansions of the unit adjacency relationship chain; during the i-th expansion of the unit adjacency relationship chain, the target unit obtains the adjacency information of its neighboring units, and adds the i-th extension of the target unit to the unit adjacency relationship chain based on the adjacency information of the target unit's neighboring units. to Level adjacency unit, and add connection lines to the parameter generation units of adjacent units in the unit adjacency relationship chain. In the unit adjacency relationship chain, the (k+1)th level adjacency unit of the target unit is the adjacency unit of the kth level adjacency unit of the target unit, and the adjacency unit of the target unit is the first level adjacency unit of the target unit. i and k are integers greater than 0. The target unit determines the first parameter value relationship between the target unit and the designated unit based on the connection line between the target unit and the designated unit in the extended unit adjacency relationship chain.
9. The apparatus according to claim 8, characterized in that, The target unit includes an adjacency selector, a unit register, a second value relationship register, and a first data selector; The adjacency selector is used to determine the adjacency units of the target unit, and the second parameter value relationship between the target unit and the adjacency units of the target unit; The unit register is used to store the unit identifier of at least one level adjacent unit of the target unit in the unit adjacency relationship chain. The second value relationship register is used to store the second parameter value relationship between the target unit and at least one level adjacent unit of the target unit. The unit register and the second value relationship register are respectively connected to the unit bus and are used to provide the stored unit identifier and the second parameter value relationship between the target unit and at least one level adjacent unit of the target unit to other units in the plurality of parameter generation units through the unit bus. The first data selector is connected to the unit bus and is used to obtain, from the unit bus, at least one level neighbor of the highest level neighbor among the at least one level neighbor, and the second parameter value relationship between the at least one level neighbor and the highest level neighbor.
10. The apparatus according to claim 8, characterized in that, The designated unit has the largest number value among the plurality of parameter generation units. The target unit includes a comparator and a second data selector. The comparator is used to determine the largest number value of the parameter generation unit in the unit adjacency chain. The second data selector is used to output the number value of the parameter generation unit in the unit adjacency chain to the comparator.
11. The apparatus according to claim 10, characterized in that, The target unit includes a maximum number register and a first value relationship register; The maximum number register is used to store the unit identifier corresponding to the maximum number value of the parameter generation unit in the unit adjacency relationship chain. The first value relationship register is used to store the second parameter value relationship between the parameter generation unit with the maximum number value and the target unit. The maximum number register and the first value relationship register are respectively connected to the unit bus and are used to provide the stored unit identifier corresponding to the maximum number value and the second parameter value relationship between the parameter generation unit with the maximum number value and the target unit to other units among the plurality of parameter generation units other than the target unit through the unit bus.
12. The apparatus according to any one of claims 1-6, characterized in that, The input data of the target network also includes a destination number vector, which includes multiple destination element numbers, each used to indicate the element number of multiple data elements in the initial data vector in the target data vector; The target unit includes a destination number register for storing the destination element number corresponding to the target unit. The destination number register is connected to a destination number bus for providing the stored destination element number to other units in the plurality of parameter generation units other than the target unit through the destination number bus.
13. A rearrangement method, characterized in that, The method includes: An initial data vector is input to the target network, and the data elements in the initial data vector are rearranged using the target network to obtain a target data vector; the state parameters of the switching nodes in the target network are obtained by the parameter generation apparatus as described in any one of claims 1-12.
14. A rearrangement device, characterized in that, The device includes: A data input unit is used to input an initial data vector into the target network, so as to rearrange the data elements in the initial data vector using the target network to obtain a target data vector; the state parameters of the switching nodes in the target network are obtained by the parameter generation device as described in any one of claims 1-12.
15. A rearrangement system, characterized in that, include: The rearrangement controller, the target network, and the parameter generation apparatus as described in any one of claims 1-12; The rearrangement controller is used to perform the rearrangement method as described in claim 13; The target network is used to rearrange the data elements in the initial data vector to obtain the target data vector, and the state parameters of the exchange nodes in the target network are obtained through the parameter generation device.
16. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is configured to execute the rearrangement method of claim 13 according to instructions in the computer program.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the rearrangement method of claim 13.
18. A computer program product comprising a computer program, characterized in that, When it is run on a computer device, it causes the computer device to perform the rearrangement method of claim 13.