-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New compiler driver interface (#1208)
**Context:** The compiler driver previously had limited flexibility regarding compiler passes, pipelines, and option management. There was also a need for a standalone command-line compiler tool to facilitate easier compilation and testing of MLIR files without python dependancy. Additionally, the handling of intermediate compiler outputs in the Python frontend was complex and needed simplification. **Description of the Change:** 1. Refactored Compiler Driver: - Updated CompilerOptions and related functions to accommodate new options and pipeline configurations. - Enhanced the handling of compiler pipelines to allow for custom pipelines and better integration with MLIR’s pass management. 2. New Standalone Compiler Tool (catalyst-cli): - catalyst-cli enables users to compile MLIR files from the command line. - Ability to isolate different tools that are used in the compilation process (quantum-opt, mlir-translate, llc) 3. Improved Intermediate File Handling - Changed the keepIntermediate option, allowing users to save intermediate IR after each pass or pipeline. Currently, this is only available via catalyst-cli and the python frontend is still unchanged, which can updated later. 4. Pipeline Configuration: - Defined catalyst pipelines explicitly in Pipelines.h and Pipelines.cpp and also registered them as individual passes. Therefore, user can easily run an specific pipeline on an mlir file. 5. Removed self.last_compiler_output - Modified the compiler to search the workspace directory for outputs which is inline with the keep_intermediate option. **Benefits:** 1. Standalone executable to run the catalyst compilation pipeline without dependancy to python frontend 2. Easier Debugging capabilities 3. mlir options are directly accessible from catalyst-cli e.g. -mlir-print-ir-after-failure -mlir-print-ir-before-all -mlir-print-op-generic -mlir-timing -pass-pipeline 4. New options added for catalyst compiler e.g. -tool=[opt|translate|llc] -keep-intermediate=[true|false] -save-ir-after-each=[pass|pipeline] -catalyst-pipeline=pipeline1(pass1;pass2),pipeline2(pass3) 5. The options that are required for enabling MLIR plugins are now available. e.g. -load-pass-plugin ,and -load-dialect-plugin **Possible Drawbacks:** **Related GitHub Issues:** [sc-73536], [sc-73353] --------- Co-authored-by: paul0403 <[email protected]>
- Loading branch information
Showing
25 changed files
with
1,042 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.