Software and hardware partitioning and task scheduling model and method based on graph convolutional network

Through the software and hardware division and task scheduling model based on the graph convolution network, the existing technology solves the problems of high model complexity and failure to consider the connection relationship of the task graph, and achieves efficient and accurate software and hardware division and task scheduling, which meets the needs of Modern SoC complexity and the need for fast time to market.

CN113946424BActive Publication Date: 2024-08-27GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111266532.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2024-08-27
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

Existing software and hardware partitioning algorithms have shortcomings such as high model complexity, failure to consider the connection relationship of task graphs, and non-reusability, making it difficult to meet the complexity of modern SoCs and the needs for rapid market launch.

Method used

The software and hardware division and task scheduling model based on the graph convolution network are adopted, including the data processing module, the graph neural network module and the task scheduling module. Through the graph convolution layer, Dropout layer, RelU activation layer, linear classification layer and Softmax classifier, Combined with cosine similarity calculation and neighborhood aggregation operation, the software and hardware implementation probabilities of the task are output, and task scheduling is performed to optimize the system running time.

Benefits of technology

It improves the information utilization, parameter reusability, convergence speed and accuracy of software and hardware division, reduces model complexity, and improves division efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113946424B
    Figure CN113946424B
Patent Text Reader

Abstract

The present invention discloses a software and hardware partitioning and task scheduling model and method based on a graph convolutional network. The model includes a data processing module, a graph neural network module, a task scheduling module, and a main function module. In the method, cosine similarity is used to characterize the similarity between adjacent nodes, which greatly improves the modeling accuracy; a graph convolutional network is used to extract the dependencies between tasks, which further improves the accuracy; the software and hardware partitioning is combined with task scheduling to obtain a model with higher integration; and information utilization is greatly improved through features that are more meaningful for partitioning: hardware gain and unit area gain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software and hardware partitioning, and in particular to a software and hardware partitioning and task scheduling model and method based on a graph convolutional network. Background Art

[0002] Driven by the technological progress predicted by Gordon Moore, the scale of integrated circuits is getting larger and larger, and a design trend represented by SoC has gradually emerged. Driven by market competition, SOC needs to be better, faster, and earlier to ensure its product competitiveness, which puts strict requirements on design quality and design cycle. The traditional design mode of hardware first and software later can no longer meet the requirements of modern SOC to be quickly put on the market; and the design of SoC needs to reasonably consider the synergy between software and hardware, so the software-hardware co-design methodology came into being. As a key link in software-hardware co-design, the division of software and hardware determines the quality of the entire co-design result.

[0003] Most hardware-software partitioning problems have been proven to be NP-hard problems. In order to solve these problems, classic heuristic partitioning algorithms represented by genetic algorithms, simulated annealing, taboo search, ant colony algorithms, and KL algorithms have gradually emerged. These algorithms have their own advantages and disadvantages, and the ideas for solving problems are similar, but they all have shortcomings such as high model complexity, failure to consider the connection relationship of the task graph, and non-reusability of the model. The complexity of modern SoCs is getting higher and higher, and the scale of the corresponding hardware-software partitioning problems is also getting larger and larger. In order to handle large-scale hardware-software partitioning problems more efficiently and improve the speed and quality of hardware-software partitioning algorithms, it is necessary to introduce graph convolutional networks with reusable parameters, strong feature extraction capabilities, and low complexity into the field of hardware-software partitioning. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a software and hardware partitioning and task scheduling model based on a graph convolutional network with high information utilization, reusable parameters, fast convergence speed, high partitioning efficiency and accuracy.

[0005] To achieve the above purpose, the technical solution provided by the present invention is:

[0006] The hardware and software division and task scheduling model based on graph convolutional network includes data processing module, graph neural network module, task scheduling module and main function module;

[0007] in,

[0008] The data processing module is used to read the feature matrix F and the adjacency matrix A of the task graph, and preprocess the feature matrix F and the adjacency matrix A;

[0009] The graph neural network module is used to receive the feature matrix F and adjacency matrix A of the preprocessed task graph from the data processing module, and output an X∈R N×2 The first column of X represents the probability that each task is implemented by software, and the second column represents the probability that each task is implemented by hardware, and the sum of each row is 1. By setting the probability threshold, the probability vector is converted into a partition label vector.

[0010] The task scheduling module is used to receive the partition label vector and the corresponding task graph data output by the graph neural network module, schedule the partitioned task graph, and obtain the system running time corresponding to the partition label vector through task scheduling;

[0011] The main function module is responsible for integrating the data processing module, graph neural network module and task scheduling module into a whole model in the order of operations, setting the number of training times, optimization algorithm and loss function, and evaluating and testing the trained final model.

[0012] Furthermore, the graph neural network module (2) comprises a first graph convolution layer, a first Dropout layer, a first RelU activation layer, a second graph convolution layer, a second Dropout layer, a linear classification layer, and a Softmax classifier, which are connected in sequence;

[0013] The first graph convolution layer and the second graph convolution layer both include two parts: cosine similarity calculation and neighborhood aggregation operation.

[0014] To achieve the above object, the present invention further provides a method for hardware and software partitioning and task scheduling based on a graph convolutional network, comprising the following steps:

[0015] S1. Read the feature matrix F and the adjacency matrix A of the task graph through the data processing module, and preprocess the read feature matrix F and the adjacency matrix A of the task graph;

[0016] S2, receive the feature matrix and adjacency matrix of the preprocessed task graph from the data processing module through the graph neural network module, and output an X∈R N×2 The probability vector of N is the number of nodes in the task graph. The first column in X represents the probability that each task belongs to software implementation, and the second column represents the probability that each task belongs to hardware implementation, and the sum of each row is 1.

[0017] S3. Combine the output of the graph convolutional network, construct the loss function and derive it, and then use the Adam optimization algorithm to update the parameters of the graph convolutional network;

[0018] S4, divide the task graph through the graph convolutional network with updated parameters;

[0019] S5. By setting a probability threshold, the probability vector output by the graph convolutional network partitioning described in step S4 is converted into a partition label vector;

[0020] S6. Receive the partition label vector and the corresponding task graph data outputted in step S5 through the task scheduling module, schedule the partitioned task graph, and obtain the system running time corresponding to the partition label vector through task scheduling.

[0021] Furthermore, in step S1,

[0022] In the reading stage, the genfromtxt function of numpy is used to read the feature matrix F and adjacency matrix A of the task graph from the .content and .cites files respectively;

[0023] In the preprocessing stage, the adjacency matrix A and the feature matrix F are preprocessed according to the following formulas:

[0024] A sym =A+A T (1)

[0025]

[0026]

[0027]

[0028] HG i =F i0 -F i1 (5)

[0029]

[0030] F′=F||HG||HGP (7)

[0031] Formula (1) represents the symmetric processing of the adjacency matrix A in order to convert the directed graph into an undirected graph;

[0032] Formula (2) represents adding self-loops to the adjacency matrix A so that when the neighborhood is aggregated, the feature information of the node itself is also included and participates in the generation of new node features; I is the NxN unit matrix, and N is the number of nodes in the task graph;

[0033] Formulas (3) and (4) represent the normalization of A after symmetry and self-loop addition. The first step is to calculate the degree matrix D of the adjacency matrix A. D is a diagonal matrix, and the value of the diagonal elements is the sum of the non-zero elements of the corresponding rows in the adjacency matrix A. The second step is to perform a normalization operation on the adjacency matrix A, that is, the left and right sides of the adjacency matrix A are simultaneously normalized with multiply; To symmetrize and add self-loops The element in row i and column j of ;

[0034] Formulas (5)-(7) are the preprocessing of the feature matrix F; among them, Formula (5) defines hardware gain as the partitioning feature based on the original features. The hardware gain is expressed as the difference between the software execution time and the hardware execution time of each task. The larger the value, the more inclined the task is to hardware. Formula (6) multiplies the hardware gain of the task by the area of ​​the hardware on the basis of Formula (5) to define the unit area gain. This value reflects the constraint relationship between the hardware gain of the task and the hardware area. Formula (7) represents merging these two columns of new features into the original feature matrix F to form a new feature matrix F'; F i0 、F i1 、F i2 are the software time consumption, hardware time consumption, and hardware area of ​​the i-th task in the original feature matrix F respectively.

[0035] Furthermore, in the step S2, a graph convolutional network is modeled, and the network framework includes a first graph convolutional layer, a first Dropout layer, a first RelU activation layer, a second graph convolutional layer, a second Dropout layer, a linear classification layer, and a Softmax classifier connected in sequence; the first graph convolutional layer and the second graph convolutional layer both include two parts: cosine similarity calculation and neighborhood aggregation operation;

[0036] The framework formula is as follows:

[0037]

[0038]

[0039] H l+1 =ReLu(Dropout(H l+1 )), l=0, 1,..., L-1 (10)

[0040] H L =H L-1 W (11)

[0041] Y=Softmax(H L )) (12)

[0042] In the above formula, formula (8) represents the calculation of cosine similarity between nodes. Cosine similarity represents the similarity between two nodes in terms of features. is the cosine similarity coefficient between tasks i and j; f i , f j is the row feature vector of tasks i and j;

[0043] Formula (9) represents the most important neighborhood aggregation operation in the graph convolution layer, which is used to aggregate the feature information of neighboring nodes and the current node to update the feature representation of the current node. Represent the adjacency matrix, convolution weight matrix, input feature matrix and output feature matrix of the lth layer respectively;

[0044] Formula (10) indicates that the output of the graph convolutional layer is subjected to Dropout and ReLU activation processing;

[0045] Formula (11) represents the linear transformation layer, which linearly combines the original input features to form a new feature representation; W is the weight matrix of the linear classification layer;

[0046] Formula (12) represents the Softmax classifier, which accepts the output of the linear transformation layer and outputs a vector X∈R representing the probability of task division after processing. N×2 , the first column in X represents the probability that each task belongs to software implementation, and the second column represents the probability that each task belongs to hardware implementation, where N is the number of nodes in the task graph.

[0047] Furthermore, in step S6, the divided task graph is scheduled, which is divided into two stages: task priority calculation and task scheduling;

[0048] In the task priority calculation phase, the task graph is first topologically sorted, and then the priority of each task is calculated from bottom to top according to the result of the topological sorting. The formula is as follows:

[0049]

[0050] In formula (13), T i_ec represents the execution time of the task, S(T i ) represents task T i The neighbor node set of tc ij Indicates T i With T j The communication time between

[0051] In the task scheduling stage, firstly, a ready list and a completed list are created to store ready and completed tasks respectively. A ready task means that all the predecessor tasks of the task have been completed. Then, the tasks with the highest priority are taken out from the ready list for scheduling. Scheduling means assigning a start time and an end time to each task, and at the same time allocating time on the bus for the data transmission related to the task.

[0052] When a task is scheduled, it is deleted from the ready list and added to the completed list, and the ready list is updated. The scheduling process is repeated until all tasks are scheduled, and the maximum task completion time is output as the scheduling result.

[0053] Furthermore, when scheduling tasks, the following situations are classified according to different task types:

[0054] A) The task is the starting task

[0055] The starting task refers to the task node with in-degree 0 in the task graph. In this case, there is no corresponding predecessor data to be transmitted, so the starting time of the task is the earliest idle time of the corresponding processing unit; if the task is implemented by hardware, the task is completed at the current time t current The task starts execution, and the task termination time is the current time plus the task execution time. If the task is implemented by software, it is necessary to consider whether the processor is idle. If the earliest idle time of the processor is t idle_cpu Than the current time t current If the task starts earlier, the starting time is t current ; Conversely, the start time of the task is the earliest idle time of the processor t idle_cpu With the current time t current Compared to taking a longer time;

[0056] The above formula can be expressed as follows:

[0057]

[0058] t finish =t start +t ec (15)

[0059] t start ,t finish are the start time and completion time of the task respectively; t ec is the execution time of the task; hardware is the hardware; software is the software;

[0060] B) The task has a predecessor task

[0061] First, it is necessary to determine the types of the task and the predecessor task, that is, to determine whether the communication time between them is 0. If the current task and the predecessor task belong to the same category, the edge between them can be ignored; if they do not belong to the same category, the corresponding edge needs to be transmitted on the bus, that is, the start time and end time on the bus are assigned to the edge; the allocation rule is as follows:

[0062]

[0063] tc finish =tc start +c (17)

[0064] Formula (16) shows that if the bus is idle at the current time, the start time assigned to the edge is the current time tcurrent , the end time is the current time plus the data transmission time c; if the bus is not idle at the current time, the start time assigned to this edge is the next time the bus is idle t idle_cpu ;tc start 、tc finish are the start time and completion time of data transmission respectively;

[0065] C) A task has multiple predecessor edges

[0066] If there is a current task T i With multiple predecessor tasks T j ∈P(T i ), its predecessor edge c ij There are many situations; if the communication time tc of all predecessor edges of the current task is ij If both are 0, the earliest start time of the task is the earliest idle time of the processing unit; if the communication time part of the predecessor edge of the task is 0 or both are not 0, the end time of the predecessor edge is assumed to be tc ij_finish , then the start time of the task is not only related to the earliest idle time of the processing unit, but also to the earliest idle time of the bus. The rule is as follows:

[0067]

[0068] t finish =t start +t ec (19).

[0069] Compared with the existing technology, the principle and advantages of this solution are as follows:

[0070] 1) Cosine similarity is used to characterize the similarity between adjacent nodes, which greatly improves the modeling accuracy.

[0071] 2) A graph convolutional network is used to extract dependencies between tasks, further improving the accuracy.

[0072] 3) By combining software and hardware partitioning with task scheduling, the resulting model has a higher degree of integration.

[0073] 4) Information utilization is greatly improved through more meaningful features: hardware gain and unit area gain. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the services required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0075] Figure 1 It is a structural schematic diagram of the software and hardware partitioning and task scheduling model based on the graph convolutional network of the present invention;

[0076] Figure 2 This is a principle flow chart of the software and hardware partitioning and task scheduling method based on graph convolutional network of the present invention. DETAILED DESCRIPTION

[0077] The present invention will be further described below in conjunction with specific embodiments:

[0078] like Figure 1 As shown, the software and hardware partitioning and task scheduling model based on the graph convolutional network described in this embodiment includes a data processing module 1, a graph neural network module 2, a task scheduling module 3, and a main function module 4;

[0079] in,

[0080] The data processing module 1 is used to read the feature matrix F and the adjacency matrix A of the task graph, and preprocess the feature matrix F and the adjacency matrix A;

[0081] The graph neural network module 2 is used to receive the feature matrix F and adjacency matrix A of the preprocessed task graph from the data processing module 1, and output an X∈R N×2 The first column of X represents the probability that each task is implemented by software, and the second column represents the probability that each task is implemented by hardware, and the sum of each row is 1. By setting the probability threshold, the probability vector is converted into a partition label vector.

[0082] The task scheduling module 3 is used to receive the partition label vector and the corresponding task graph data output by the graph neural network module 2, schedule the partitioned task graph, and obtain the system running time corresponding to the partition label vector through task scheduling;

[0083] The main function module 4 is responsible for integrating the data processing module 1, the graph neural network module 2 and the task scheduling module 3 into a model as a whole according to the order of operations, setting the number of training times, the optimization algorithm and the loss function, and evaluating and testing the trained final model.

[0084] Furthermore, in this embodiment, the graph neural network module 2 includes a first graph convolution layer, a first Dropout layer, a first RelU activation layer, a second graph convolution layer, a second Dropout layer, a linear classification layer, and a Softmax classifier connected in sequence; the first graph convolution layer and the second graph convolution layer both include two parts: cosine similarity calculation and neighborhood aggregation operation.

[0085] like Figure 2 As shown, the working process of the model includes the following steps:

[0086] S1. Read the feature matrix F∈R of the task graph through data processing module 1. N×M and the adjacency matrix A∈R N×N , through the feature matrix F∈R N×M and the adjacency matrix A∈R N×N Represent the input task graph. This representation method can accurately represent the properties of the task graph and represent the dependencies between task graphs as edge connections and connection weights.

[0087] And the feature matrix F∈R of the read task graph N×M and the adjacency matrix A∈R N×N Perform preprocessing to eliminate differences between features and speed up subsequent model training and improve model accuracy;

[0088] Furthermore, in this step,

[0089] In the reading stage, the genfromtxt function of numpy is used to read the feature matrix F∈R of the task graph from the .content and .cites files respectively. N×M and the adjacency matrix A∈R N×N ;

[0090] In the preprocessing stage, the adjacency matrix A∈R N×N And the feature matrix F∈R N×M Preprocessing is performed according to the following formula:

[0091] A sym =A+A T (1)

[0092]

[0093]

[0094]

[0095] HG i =F i0 -F i1 (5)

[0096]

[0097] F′=F||HG||HGP (7)

[0098] Formula (1) represents the adjacency matrix A∈R N×N Symmetric processing is performed to convert the directed graph into an undirected graph;

[0099] Formula (2) represents the adjacency matrix A∈R N×N Add self-loops so that when the neighborhood is aggregated, the node's own feature information is also included and participates in the generation of new node features; I is the NxN unit matrix, and N is the number of nodes in the task graph;

[0100] Formulas (3) and (4) represent A∈R after symmetry and self-ring addition. N×N Normalize; the first step is to calculate the adjacency matrix A∈R N×N The degree matrix D is a diagonal matrix, and the values ​​of the diagonal elements are the adjacency matrix A∈R N×N The second step is to sum the non-zero elements of the corresponding rows in the adjacency matrix A∈R N×N Perform normalization operation, that is, in the adjacency matrix A∈R N×N The left and right sides of multiply; To symmetrize and add self-loops The element in row i and column j of ;

[0101] Formulas (5)-(7) are the characteristic matrix F∈R N×M preprocessing; where formula (5) defines hardware gain as the partitioning feature based on the original feature. The hardware gain is expressed as the difference between the software execution time and the hardware execution time of each task. The larger the value, the more inclined the task is to hardware. Formula (6) multiplies the hardware gain of the task by the area of ​​the hardware on the basis of formula (5) to define the unit area gain. This value reflects the constraint relationship between the hardware gain of the task and the hardware area. Formula (7) represents merging these two columns of new features into the original feature matrix F∈R N×M In the new feature matrix F'; F i0 、F i1 、F i2 are the software time consumption, hardware time consumption, and hardware area of ​​the i-th task in the original feature matrix F respectively.

[0102] S2, receive the feature matrix and adjacency matrix of the preprocessed task graph from the data processing module through the graph neural network module, and output an X∈R N×2The probability vector of N is the number of nodes in the task graph. The first column in X represents the probability that each task belongs to software implementation, and the second column represents the probability that each task belongs to hardware implementation, and the sum of each row is 1.

[0103] Among them, the formula of the graph neural network framework is as follows:

[0104]

[0105]

[0106] H l+1 =ReLu(Dropout(H l+1 )), l=0, 1,..., L-1 (10)

[0107] H L =H L-1 W (11)

[0108] Y=Softmax(H L )) (12)

[0109] In the above formula, formula (8) represents the calculation of cosine similarity between nodes. Cosine similarity represents the similarity between two nodes in terms of features. is the cosine similarity coefficient between tasks i and j; f i , f j is the row feature vector of tasks i and j;

[0110] Formula (9) represents the most important neighborhood aggregation operation in the graph convolution layer, which is used to aggregate the feature information of neighboring nodes and the current node to update the feature representation of the current node. Represent the adjacency matrix, convolution weight matrix, input feature matrix and output feature matrix of the lth layer respectively;

[0111] Formula (10) indicates that the output of the graph convolutional layer is subjected to Dropout and ReLU activation processing;

[0112] Formula (11) represents the linear transformation layer, which linearly combines the original input features to form a new feature representation; W is the weight matrix of the linear classification layer;

[0113] Formula (12) represents the Softmax classifier, which accepts the output of the linear transformation layer and outputs a vector X∈R representing the probability of task division after processing. N×2 , the first column in X represents the probability that each task belongs to software implementation, and the second column represents the probability that each task belongs to hardware implementation, where N is the number of nodes in the task graph.

[0114] S3. Combine the output of the graph convolutional network, construct the loss function and derive it, and then use the Adam optimization algorithm to update the parameters of the graph convolutional network;

[0115] S4, divide the task graph through the graph convolutional network with updated parameters;

[0116] S5. By setting a probability threshold, the probability vector output by the graph convolutional network partitioning described in step S4 is converted into a partition label vector;

[0117] S6, receiving the partition label vector and the corresponding task graph data outputted in step S5 through the task scheduling module, and scheduling the partitioned task graph, and obtaining the system running time corresponding to the partition label vector through task scheduling;

[0118] In this step, the divided task graph is scheduled, which is divided into two stages: task priority calculation and task scheduling;

[0119] In the task priority calculation phase, the task graph is first topologically sorted, and then the priority of each task is calculated from bottom to top according to the result of the topological sorting. The formula is as follows:

[0120]

[0121] In formula (13), T i_ec represents the execution time of the task, S(T i ) represents task T i The neighbor node set of tc ij Indicates T i With T j The communication time between

[0122] In the task scheduling stage, firstly, a ready list and a completed list are created to store ready and completed tasks respectively. A ready task means that all the predecessor tasks of the task have been completed. Then, the tasks with the highest priority are taken out from the ready list for scheduling. Scheduling means assigning a start time and an end time to each task, and at the same time allocating time on the bus for the data transmission related to the task.

[0123] When scheduling tasks, the following situations are classified according to different task types:

[0124] A) The task is the starting task

[0125] The starting task refers to the task node with in-degree 0 in the task graph. In this case, there is no corresponding predecessor data to be transmitted, so the starting time of the task is the earliest idle time of the corresponding processing unit; if the task is implemented by hardware, the task is completed at the current time t currentThe task starts execution, and the task termination time is the current time plus the task execution time. If the task is implemented by software, it is necessary to consider whether the processor is idle. If the earliest idle time of the processor is t idle_cpu Than the current time t current If the task starts earlier, the starting time is t current ; Conversely, the start time of the task is the earliest idle time of the processor t idle_cpu With the current time t current Compared to taking a longer time;

[0126] The above formula can be expressed as follows:

[0127]

[0128] t finish =t start +t ec (15)

[0129] t start ,t finish are the start time and completion time of the task respectively; t ec is the execution time of the task; hardware is the hardware; software is the software;

[0130] B) The task has a predecessor task

[0131] First, it is necessary to determine the types of the task and the predecessor task, that is, to determine whether the communication time between them is 0. If the current task and the predecessor task belong to the same category, the edge between them can be ignored; if they do not belong to the same category, the corresponding edge needs to be transmitted on the bus, that is, the start time and end time on the bus are assigned to the edge; the allocation rule is as follows:

[0132]

[0133] tc finish =tc start +c (17)

[0134] Formula (16) shows that if the bus is idle at the current time, the start time assigned to the edge is the current time t current , the end time is the current time plus the data transmission time c; if the bus is not idle at the current time, the start time assigned to this edge is the next time the bus is idle t idle_cpu ;tc start 、tc finish are the start time and completion time of data transmission respectively;

[0135] C) A task has multiple predecessor edges

[0136] If there is a current task T i With multiple predecessor tasks T j ∈P(T i ), its predecessor edge c ij There are many situations; if the communication time tc of all predecessor edges of the current task is ij If both are 0, the earliest start time of the task is the earliest idle time of the processing unit; if the communication time part of the predecessor edge of the task is 0 or both are not 0, the end time of the predecessor edge is assumed to be tc ij_finish , then the start time of the task is not only related to the earliest idle time of the processing unit, but also to the earliest idle time of the bus. The rule is as follows:

[0137]

[0138] t finish =t start +t ec (19)

[0139] When a task is scheduled, it is deleted from the ready list and added to the completed list, and the ready list is updated. The scheduling process is repeated until all tasks are scheduled, and the maximum task completion time is output as the scheduling result.

[0140] The embodiments described above are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, all changes made according to the shape and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. Software and hardware partitioning and task scheduling model based on graph convolutional network, It is characterized in that It includes a data processing module (1), a graph neural network module (2), a task scheduling module (3), and a main function module (4); in, The data processing module (1) is used to read the feature matrix F and the adjacency matrix A of the task graph, and pre-process the feature matrix F and the adjacency matrix A; The graph neural network module (2) is used to receive the feature matrix F and adjacency matrix A of the preprocessed task graph from the data processing module (1), and output an X∈R N×2 The probability vector of N is the number of nodes in the task graph. The first column in X represents the probability that each task belongs to software implementation, and the second column represents the probability that each task belongs to hardware implementation, and the sum of each row is 1. By setting the probability threshold, the probability vector is converted into a partition label vector. The task scheduling module (3) is used to receive the partition label vector and the corresponding task graph data output by the graph neural network module (2), schedule the partitioned task graph, and obtain the system running time corresponding to the partition label vector through task scheduling; The main function module (4) is responsible for integrating the data processing module (1), the graph neural network module (2) and the task scheduling module (3) into a model as a whole according to the order of operations, setting the number of training times, the optimization algorithm and the loss function, and evaluating and testing the trained final model.

2. According to the graph convolutional network-based software and hardware partitioning and task scheduling model of claim 1, It is characterized in that The graph neural network module (2) comprises a first graph convolution layer, a first Dropout layer, a first RelU activation layer, a second graph convolution layer, a second Dropout layer, a linear classification layer, and a Softmax classifier which are connected in sequence; The first graph convolution layer and the second graph convolution layer both include two parts: cosine similarity calculation and neighborhood aggregation operation.

3. Software and hardware partitioning and task scheduling method based on graph convolutional network, It is characterized in that The following steps are involved: S1. Read the feature matrix F and the adjacency matrix A of the task graph through the data processing module, and preprocess the read feature matrix F and the adjacency matrix A of the task graph; S2, receive the feature matrix and adjacency matrix of the preprocessed task graph from the data processing module through the graph neural network module, and output an X∈R N×2 The probability vector of N is the number of nodes in the task graph. The first column in X represents the probability that each task belongs to software implementation, and the second column represents the probability that each task belongs to hardware implementation, and the sum of each row is 1. S3. Combine the output of the graph convolutional network, construct the loss function and derive it, and then use the Adam optimization algorithm to update the parameters of the graph convolutional network; S4, divide the task graph through the graph convolutional network with updated parameters; S5. By setting a probability threshold, the probability vector output by the graph convolutional network partitioning described in step S4 is converted into a partition label vector; S6. Receive the partition label vector and the corresponding task graph data outputted in step S5 through the task scheduling module, schedule the partitioned task graph, and obtain the system running time corresponding to the partition label vector through task scheduling.

4. The method for hardware and software partitioning and task scheduling based on graph convolutional network according to claim 3, It is characterized in that In the step S1, In the reading stage, the genfromtxt function of numpy is used to read the feature matrix F and adjacency matrix A of the task graph from the .content and .cites files respectively; In the preprocessing stage, the adjacency matrix A and the feature matrix F are preprocessed according to the following formulas: A sym =A+A T (1) HG i =F i0 -F i1 (5) F′=F||HG||HGP (7) Formula (1) represents the symmetric processing of the adjacency matrix A in order to convert the directed graph into an undirected graph; Formula (2) represents adding self-loops to the adjacency matrix A so that when the neighborhood is aggregated, the feature information of the node itself is also included and participates in the generation of new node features; I is the NxN unit matrix, and N is the number of nodes in the task graph; Formulas (3) and (4) represent the normalization of A after symmetry and self-loop addition. The first step is to calculate the degree matrix D of the adjacency matrix A. D is a diagonal matrix, and the value of the diagonal elements is the sum of the non-zero elements of the corresponding rows in the adjacency matrix A. The second step is to perform a normalization operation on the adjacency matrix A, that is, the left and right sides of the adjacency matrix A are simultaneously normalized with multiply; To symmetrize and add self-loops The element in row i and column j of ; Formulas (5)-(7) are the preprocessing of the feature matrix F; among them, Formula (5) defines hardware gain as the partitioning feature based on the original features. The hardware gain is expressed as the difference between the software execution time and the hardware execution time of each task. The larger the value, the more inclined the task is to hardware. Formula (6) multiplies the hardware gain of the task by the area of ​​the hardware on the basis of Formula (5) to define the unit area gain. This value reflects the constraint relationship between the hardware gain of the task and the hardware area. Formula (7) represents merging these two columns of new features into the original feature matrix F to form a new feature matrix F'; F i0 、F i1 、F i2 are the software time consumption, hardware time consumption, and hardware area of ​​the i-th task in the original feature matrix F respectively.

5. The method for hardware and software partitioning and task scheduling based on graph convolutional network according to claim 3, It is characterized in that In the step S2, a graph convolutional network is modeled, and the network framework includes a first graph convolutional layer, a first Dropout layer, a first ReIU activation layer, a second graph convolutional layer, a second Dropout layer, a linear classification layer, and a Softmax classifier connected in sequence; the first graph convolutional layer and the second graph convolutional layer both include two parts: cosine similarity calculation and neighborhood aggregation operation; The framework formula is as follows: H l+1 =ReLu(Dropout(H l+1 )),l,0,1,...,L-1 (10) H L =H L-1 W (11) X=Softmax(H L )) (12) In the above formula, formula (8) represents the calculation of cosine similarity between nodes. Cosine similarity represents the similarity between two nodes in terms of features. is the cosine similarity coefficient between tasks i and j; f i , f j is the row feature vector of tasks i and j; Formula (9) represents the most important neighborhood aggregation operation in the graph convolution layer, which is used to aggregate the feature information of neighboring nodes and the current node to update the feature representation of the current node; A l , H l , H l+1 Represent the adjacency matrix, convolution weight matrix, input feature matrix and output feature matrix of the lth layer respectively; Formula (10) indicates that the output of the graph convolutional layer is subjected to Dropout and ReLU activation processing; Formula (11) represents the linear transformation layer, which linearly combines the original input features to form a new feature representation; W is the weight matrix of the linear classification layer; Formula (12) represents the Softmax classifier, which accepts the output of the linear transformation layer and outputs a vector X∈R representing the probability of task division after processing. N×2 , the first column in X represents the probability that each task belongs to software implementation, and the second column represents the probability that each task belongs to hardware implementation, where N is the number of nodes in the task graph.

6. The method for hardware and software partitioning and task scheduling based on graph convolutional network according to claim 3, It is characterized in that In step S6, the divided task graph is scheduled, which is divided into two stages: task priority calculation and task scheduling; In the task priority calculation phase, the task graph is first topologically sorted, and then the priority of each task is calculated from bottom to top according to the result of the topological sorting. The formula is as follows: In formula (13), T i_ec represents the execution time of the task, S(T i ) represents task T i The neighbor node set of tc ij Indicates T i With T j The communication time between In the task scheduling stage, firstly, a ready list and a completed list are created to store ready and completed tasks respectively. A ready task means that all the predecessor tasks of the task have been completed. Then, the tasks with the highest priority are taken out from the ready list for scheduling. Scheduling means assigning a start time and an end time to each task, and at the same time allocating time on the bus for the data transmission related to the task. When a task is scheduled, it is deleted from the ready list and added to the completed list, and the ready list is updated. The scheduling process is repeated until all tasks are scheduled, and the maximum task completion time is output as the scheduling result.

7. The method for hardware and software partitioning and task scheduling based on graph convolutional network according to claim 6, It is characterized in that When scheduling tasks, the following situations are classified according to different task types: A) The task is the starting task The starting task refers to the task node with in-degree 0 in the task graph. In this case, there is no corresponding predecessor data to be transmitted, so the starting time of the task is the earliest idle time of the corresponding processing unit; if the task is implemented by hardware, the task is completed at the current time t current The task starts execution, and the task termination time is the current time plus the task execution time itself; if the task is implemented by software, it is necessary to consider whether the processor is idle. If the earliest idle time of the processor is t idle_cpu Than the current time t current If the task starts earlier, the starting time of the task is t current ; Conversely, the start time of the task is the earliest idle time of the processor t idle_cpu With the current time t current Compared to taking a longer time; The above formula can be expressed as follows: t finish =t start +t ec (15) t start ,t finish are the start time and completion time of the task respectively; t ec is the execution time of the task; hardware is the hardware; software is the software; B) The task has a predecessor task First, it is necessary to determine the types of the task and the predecessor task, that is, to determine whether the communication time between them is 0. If the current task and the predecessor task belong to the same category, the edge between them can be ignored; if they do not belong to the same category, the corresponding edge needs to be transmitted on the bus, that is, the start time and end time on the bus are assigned to the edge; the allocation rule is as follows: tc finish =tc start +c (17) Formula (16) shows that if the bus is idle at the current time, the start time assigned to the edge is the current time t current , the termination time is the current time plus the data transmission time c; If the bus is not idle at the current moment, the start time assigned to this edge is the next time the bus is idle, t idle_bus ;tc start 、tc finish are the start time and completion time of data transmission respectively; C) A task has multiple predecessor edges If there is a current task T i With multiple predecessor tasks T j ∈P(T i ), its predecessor edge c ij There are many situations; if the communication time tc of all predecessor edges of the current task is ij If both are 0, the earliest start time of the task is the earliest idle time of the processing unit; if the communication time part of the predecessor edge of the task is 0 or both are not 0, the end time of the predecessor edge is assumed to be tc ij_finish , then the start time of the task is not only related to the earliest idle time of the processing unit, but also to the earliest idle time of the bus. The rule is as follows: t finish =t start +t ec (19)。