-
Notifications
You must be signed in to change notification settings - Fork 282
Part 1: Restructuring of compiler pipelines. #3423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There are a variety of compiler pass pipelines that exist in the project. It has long been acknowledged that they don't meet our needs very well. For the C++ AOT compiler, there are two sets of pipelines primarily. There is the pipeline that is built in the compiler driver and then a pipeline that is used to generate code for default simulation. For the C++ JIT compiler, every target can (and did) specify its own special pipeline, leading to inconsistencies and maintenance problems. Furthermore, this pipeline may have been incorrect and patched on-the-fly by the JIT compilation process. Finally, it was augmented by running the same pipeline as the AOT compiler for code generation with various minor changes. This situation was both far too flexible (anyone could run any pass in any order in the JIT pipeline) and far too inflexible (high-level and low-level passes were thrown together in ad hoc ways, preventing downstream passes from running correctly). For Python, the pipelines are done in a completely different way for the most part, but some of the pipelines are the same. For example, the code generation pipeline remains largely the same, but has its own minor tweaks. Python doesn't really distinguish between AOT and JIT compilation. The changes: - Instead of a single "lowering pipeline" that was used by the JIT compiler, the JIT pipeline has been decomposed into target agnostic and target dependent passes. Furthermore, the JIT pipeline has been broken into 3 levels: high level, mid level, and low level. Each of these levels runs the target dependent passes (from the .yml target config) followed by the target independent passes for that level. - The code generation pipeline now has distinct AOT vs. JIT separation. This eliminates the running of passes at JIT time that are not required. - Python's compilation model is changed to better reflect that of C++. Compilation is done in 2 phases: AOT and JIT. These phases are not completely custom, but better mirror those of the C++ compilation and execution. (Todo) Signed-off-by: Eric Schweitz <[email protected]>
Signed-off-by: Eric Schweitz <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Signed-off-by: Eric Schweitz <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Pull request was converted to draft
8ed7b4e
to
965559b
Compare
Signed-off-by: Eric Schweitz <[email protected]>
965559b
to
3afcd39
Compare
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
There are a variety of compiler pass pipelines that exist in the project. It has long been acknowledged that they don't meet our needs very well.
For the C++ AOT compiler, there are two sets of pipelines primarily. There is the pipeline that is built in the compiler driver and then a pipeline that is used to generate code for default simulation.
For the C++ JIT compiler, every target can (and did) specify its own special pipeline, leading to inconsistencies and maintenance problems. Furthermore, this pipeline may have been incorrect and patched on-the-fly by the JIT compilation process. Finally, it was augmented by running the same pipeline as the AOT compiler for code generation with various minor changes. This situation was both far too flexible (anyone could run any pass in any order in the JIT pipeline) and far too inflexible (high-level and low-level passes were thrown together in ad hoc ways, preventing downstream passes from running correctly).
For Python, the pipelines are done in a completely different way for the most part, but some of the pipelines are the same. For example, the code generation pipeline remains largely the same, but has its own minor tweaks. Python doesn't really distinguish between AOT and JIT compilation.
The changes:
Instead of a single "lowering pipeline" that was used by the JIT compiler, the JIT pipeline has been decomposed into target agnostic and target dependent passes. Furthermore, the JIT pipeline has been broken into 3 levels: high level, mid level, and low level. Each of these levels runs the target dependent passes (from the .yml target config) followed by the target independent passes for that level.
The code generation pipeline now has distinct AOT vs. JIT separation. This eliminates the running of passes at JIT time that are not required.