Data processing apparatus and method for providing compiler with polyhedral scheduler
A data processing apparatus is provided, comprising a processing circuitry configured to implement a scheduling constraints injection entity configured to, based on one or more scheduling constraints, adapt a polyhedral intermediate representation of an input code for obtaining an adapted polyhedral intermediate representation of the input code. The processing circuitry is further configured to implement a polyhedral scheduler configured to generate, based on the adapted polyhedral intermediate representation of the input code, a scheduled polyhedral intermediate representation of the input code. The scheduling constraints injection entity is further configured to, based on the one or more scheduling constraints, adjust the polyhedral scheduler. Moreover, a corresponding data processing method is disclosed.
1 . A data processing apparatus, comprising:
processing circuitry configured to implement:
a scheduling constraints injection entity configured to:
receive scheduling constraints with user-specified priorities,
separate the scheduling constraints with the user-specified priorities into domain information constraints and prioritized scheduling constraints,
adapt a polyhedral intermediate representation of an input code based on the domain information constraints,
compute data dependence affine sets based on the adapted polyhedral intermediate representation of the input code,
translate the data dependence affine sets into validity constraints comprising constraints on scheduling coefficients, optimization constraints comprising affine constraints, and cost functions, and
translate the prioritized scheduling constraints into external constraints comprising affine constraints on scheduling coefficients;
and polyhedral scheduler configured to generate, based on the validity constraints, the optimization constraints, the cost functions, the external constraints, and the adapted polyhedral intermediate representation of the input code, a scheduled polyhedral intermediate representation of the input code
wherein the scheduling constraints injection entity is further configured to relax the external constraints comprising the affine constraints on the scheduling coefficients with different priority levels.
2 . The data processing apparatus of claim 1 , wherein the processing circuitry is further configured to process the input code into an executable output code based on the scheduled polyhedral intermediate representation of the input code.
3 . The data processing apparatus of claim 1 , further comprising a communication interface and/or user interface, configured to receive the scheduling constraints with the user-specified priorities and to provide the scheduling constraints with the user-specified priorities to the scheduling constraints injection entity.
4 . The data processing apparatus of claim 1 , wherein the of scheduling constraints with the user-specified priorities are defined by one or more text files, binary files and/or encoded files.
5 . The data processing apparatus of claim 1 , wherein the scheduling constraints injection entity further comprises a constraints dispatcher configured to perform the separation of the scheduling constraints with the user-specified priorities into the domain information constraints and the prioritized scheduling constraints.
6 . The data processing apparatus of claim 1 , wherein the scheduling constraints injection entity further comprises data dependence analysis circuitry configured to perform the adapting the polyhedral intermediate representation of the input code based on the domain information constraints for obtaining the adapted polyhedral intermediate representation of the input code.
7 . The data processing apparatus of claim 5 , wherein the scheduling constraints injection entity further comprises an external constraint builder, configured to receive the prioritized scheduling constraints from the constraints dispatcher and to generate, based on the prioritized scheduling constraints, one or more affine constraints for one or more scheduling coefficients associated with the scheduled polyhedral intermediate representation of the input code.
8 . The data processing apparatus of claim 1 , wherein the polyhedral scheduler further comprises an integer linear programming solver, configured to determine the one or more scheduling coefficients based on the affine constraints of the external constraints and the cost functions, wherein the one or more scheduling coefficients are associated with the scheduled polyhedral intermediate representation of the input code.
9 . The data processing apparatus of claim 8 , wherein the polyhedral scheduler further comprises a prioritized scheduling constraint system builder, configured to disable one or more of the affine constraints of the external constraints for the one or more scheduling coefficients associated with the scheduled polyhedral intermediate representation of the input code.
10 . The data processing apparatus of claim 1 , wherein the polyhedral intermediate representation of the input code comprises one or more affine sets and/or functions defining iteration domain information, data access information and/or ordering information about the input code.
11 . A data processing method applied to an electronic device, the method comprising:
performing, by a scheduling constraints injection entity:
receiving scheduling constraints with user-specified priorities,
separating the scheduling constraints with the user-specified priorities into domain information constraints and prioritized scheduling constraints,
adapting a polyhedral intermediate representation of an input code, based on the domain information constraints;
computing data dependence affine sets based on the adapted polyhedral intermediate representation of the input code,
translating the data dependence affine sets into validity constraints comprising constraints on scheduling coefficients, optimization constraints comprising affine constraints, and cost functions,
translating the prioritized scheduling constraints into external constraints comprising affine constraints on scheduling coefficients; and
performing, by a polyhedral scheduler:
generating, based on the validity constraints, the optimization constraints, the cost functions, the external constraints, and the adapted polyhedral intermediate representation of the input code, a scheduled polyhedral intermediate representation of the input code.
12 . The data processing method of claim 11 , further comprising adjusting, by the scheduling constraints injection entity, the polyhedral scheduler based on the scheduling constraints with the user-specified priorities and the polyhedral intermediate representation of the input code.
13 . The data processing method of claim 11 , further comprising:
processing the input code into an executable output code based on the scheduled polyhedral intermediate representation of the input code.
14 . A non-transitory computer-readable storage medium storing program code, which upon execution by a computer or a processor, causes the computer or the processor to perform the data processing method according to claim 11 .
15 . A data processing apparatus, comprising:
processing circuitry configured to implement:
a scheduling constraints injection entity; and
a polyhedral scheduler;
wherein the scheduling constraints injection entity is configured to adapt a polyhedral intermediate representation of an input code for obtaining an adapted polyhedral intermediate representation of the input code, based on one or more scheduling constraints,
wherein the scheduling constraints injection entity comprises a constraints dispatcher configured to extract from each of the one or more scheduling constraints a domain information portion and a prioritized scheduling information portion,
wherein the polyhedral scheduler is configured to cooperate with the processing circuitry to generate, based on the adapted polyhedral intermediate representation of the input code, a scheduled polyhedral intermediate representation of the input code;
wherein the scheduling constraints injection entity is further configured to adjust the polyhedral scheduler, based on the one or more scheduling constraints.
16 . The data processing apparatus of claim 15 , wherein the scheduling constraints injection entity further comprises an external constraint builder, configured to receive the prioritized scheduling information portion for the one or more scheduling constraints from the constraints dispatcher and to generate, based on the prioritized scheduling information portion for the one or more scheduling constraints, one or more affine constraints for one or more scheduling coefficients associated with the scheduled polyhedral intermediate representation of the input code.
17 . The data processing apparatus of claim 16 , wherein the polyhedral scheduler comprises a scheduling entity, configured to generate the scheduled polyhedral intermediate representation of the input code, based on the adapted polyhedral intermediate representation of the input code and the one or more affine constraints for the one or more scheduling coefficients associated with the scheduled polyhedral intermediate representation of the input code.
18 . The data processing apparatus of claim 17 , wherein the one or more affine constraints for the one or more scheduling coefficients associated with the scheduled polyhedral intermediate representation of the input code comprise priority information.
19 . The data processing apparatus of claim 17 , wherein the polyhedral scheduler further comprises an integer linear programming solver, configured to determine the one or more scheduling coefficients associated with the scheduled polyhedral intermediate representation of the input code, based on the one or more affine constraints and one or more cost functions.
20 . The data processing apparatus of claim 16 , wherein the polyhedral scheduler further comprises a prioritized scheduling constraint system builder, configured to disable one or more of the one or more affine constraints for the one or more scheduling coefficients associated with the scheduled polyhedral intermediate representation of the input code.