Static versioning in the polyhedral model
AssigneeReservoir Labs, Inc.
InventorsBenoit J. Meister, Adithya Dattatri
Life of this patent
Estimating the term…
Abstract
An approach is presented to enhancing the optimization process in a polyhedral compiler by introducing compile-time versioning, i.e., the production of several versions of optimized code under varying assumptions on its run-time parameters. We illustrate this process by enabling versioning in the polyhedral processor placement pass. We propose an efficient code generation method and validate that versioning can be useful in a polyhedral compiler by performing benchmarking on a small set of deep learning layers defined for dynamically-sized tensors.
Claims16
A method for compiling source code, the method comprising performing by a processor the steps of:
- receiving and transforming source code comprising one or more run-time-determinable parameters into a base internal representation (IR) of a polyhedral compiler;
- creating a plurality of dedicated versions of the base IR, each dedicated version comprising a respective context that represents a distinct respective combination of potential values of the parameters;
- generating a respective source code version corresponding to each dedicated version of the base IR;
- and
- deriving a wrapper function for conditionally invoking the respective source code versions.
A system for compiling source code, the system comprising:
- a first processor;
- and
- a first memory in electrical communication with the first processor, and comprising instructions that, when executed by a processing unit that comprises one or more computing units, wherein one of the one or more computing units comprises the first processor or a second processor, and wherein the processing unit is in electronic communication with a memory module that comprises the first memory or a second memory, program the processing unit to:
- receive and transform source code comprising one or more run-time-determinable parameters into a base internal representation (IR) of a polyhedral compiler;
- create a plurality of dedicated versions of the base IR, each dedicated version comprising a respective context that represents a distinct respective combination of potential values of the parameters;
- generate a respective source code version corresponding to each dedicated version of the base IR;
- and
- derive a wrapper function for conditionally invoking the respective source code versions.
Dependencies are inferred from the claim text.