Compiling computer programs to exploit parallelism without exceeding available processing resources
First Claim
1. A method of compiling a computer program, said method comprising the steps of:
- (i) forming from said computer program a data flow graph corresponding to a plurality of linked vertices, a vertex representing a data processing operation performed by said computer program and a link between vertices representing data flow between data processing operations;
(ii) associating linked vertices within said data flow graph to form clusters of linked vertices corresponding to data processing operations to be scheduled together for execution, said clusters being grown with vertices being added to a cluster until an arbitrary selection of a next vertex to be added to said cluster has to be made between two or more vertices;
(iii) scheduling said vertices within each cluster and then scheduling said clusters for non-overlapped execution to form a current schedule and associating a timestamp with vertices within said clusters indicative of a scheduled time of execution;
(iv) disassociating said vertices within said clusters;
(v) associating a plurality of vertices adjacent in timestamp order to form a candidate cluster, vertices being added to a current candidate cluster until a threshold criteria for said current candidate cluster is exceeded whereupon adding of vertices to said candidate cluster is stopped;
(vi) rescheduling said vertices within said candidate cluster to form a candidate schedule;
(vii) determining if a time for execution of said vertices within said candidate cluster in accordance with said candidate schedule is less than with said current schedule and that said threshold criteria is not exceeded;
(viii) if said time for execution is less and said threshold criteria is not exceeded, then retaining said candidate schedule as a new current schedule for said vertices within said candidate cluster and rescheduling and modifying timestamps for following vertices within said data flow graph to compensate for said new current schedule;
(ix) if said time for execution is not less or said threshold criteria exceeded, then discarding said candidate schedule and retaining said current schedule;
(x) if attempted rescheduling of a sufficient proportion of said vertices of said data flow graph has not been performed, then returning to step (v) to start forming a next candidate cluster starting from a vertex having different starting timestamp;
(xi) if rescheduling of at least one candidate cluster has reduced said time for execution of said computer program sufficiently in accordance with a convergence criteria, then returning to step (v); and
(xii) if rescheduling of at least one candidate cluster has not reduced said time for execution of said computer program sufficiently in accordance with said convergence criteria, then generating an output compiled computer program in accordance with said current scheduling.
5 Assignments
0 Petitions
Accused Products
Abstract
A compilation technique for computer programs forms a data flow graph of vertices which are analysed to form clusters C for parallel execution where those clusters are added to up to the point at which arbitrary selection between further vertices C, D to be added must be made. This data flow graph with these small clusters is then scheduled such that the clusters do not overlap with other clusters or with vertices outside of clusters. This starting point scheduled data flow graph is then subject to iterative processing whereby a window of timestamps is analysed to see if a candidate cluster formed by the parallel execution of the vertices within that window will result in faster execution whilst avoiding exceeding architectural constraints, such as register occupancy. If the rescheduled vertices do improve performance without exceeding architectural constraints, then this new schedule is adopted and the following vertices are subject to an adjustment in their timestamps to account for this. A window at a different point within the schedule is then adopted and an attempted rescheduling examined. This process is repeated until no progress is being made in reducing the overall execution time.
29 Citations
10 Claims
-
1. A method of compiling a computer program, said method comprising the steps of:
-
(i) forming from said computer program a data flow graph corresponding to a plurality of linked vertices, a vertex representing a data processing operation performed by said computer program and a link between vertices representing data flow between data processing operations; (ii) associating linked vertices within said data flow graph to form clusters of linked vertices corresponding to data processing operations to be scheduled together for execution, said clusters being grown with vertices being added to a cluster until an arbitrary selection of a next vertex to be added to said cluster has to be made between two or more vertices; (iii) scheduling said vertices within each cluster and then scheduling said clusters for non-overlapped execution to form a current schedule and associating a timestamp with vertices within said clusters indicative of a scheduled time of execution; (iv) disassociating said vertices within said clusters; (v) associating a plurality of vertices adjacent in timestamp order to form a candidate cluster, vertices being added to a current candidate cluster until a threshold criteria for said current candidate cluster is exceeded whereupon adding of vertices to said candidate cluster is stopped; (vi) rescheduling said vertices within said candidate cluster to form a candidate schedule; (vii) determining if a time for execution of said vertices within said candidate cluster in accordance with said candidate schedule is less than with said current schedule and that said threshold criteria is not exceeded; (viii) if said time for execution is less and said threshold criteria is not exceeded, then retaining said candidate schedule as a new current schedule for said vertices within said candidate cluster and rescheduling and modifying timestamps for following vertices within said data flow graph to compensate for said new current schedule; (ix) if said time for execution is not less or said threshold criteria exceeded, then discarding said candidate schedule and retaining said current schedule; (x) if attempted rescheduling of a sufficient proportion of said vertices of said data flow graph has not been performed, then returning to step (v) to start forming a next candidate cluster starting from a vertex having different starting timestamp; (xi) if rescheduling of at least one candidate cluster has reduced said time for execution of said computer program sufficiently in accordance with a convergence criteria, then returning to step (v); and (xii) if rescheduling of at least one candidate cluster has not reduced said time for execution of said computer program sufficiently in accordance with said convergence criteria, then generating an output compiled computer program in accordance with said current scheduling. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
Specification