-
Notifications
You must be signed in to change notification settings - Fork 45
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
[compiler driver] improving pipeline parsing #1519
base: main
Are you sure you want to change the base?
Conversation
Hello. You may have forgotten to update the changelog!
|
d68e5dc
to
c22bc18
Compare
c22bc18
to
765267a
Compare
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.
Thanks @erick-xanadu, This looks good. The only comment I have is that this change should be reflected on the catalyst CLI documentation as well.
765267a
to
6c854ee
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1519 +/- ##
==========================================
- Coverage 96.08% 96.08% -0.01%
==========================================
Files 81 81
Lines 8615 8614 -1
Branches 816 817 +1
==========================================
- Hits 8278 8277 -1
Misses 280 280
Partials 57 57 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -212,7 +221,7 @@ pass that is applied, and the ``-o`` option to set the name of the output IR fil | |||
|
|||
catalyst my_circuit.mlir \ | |||
--tool=opt \ | |||
--catalyst-pipeline="pipe(remove-chained-self-inverse;merge-rotations)" \ | |||
--catalyst-pipeline="pipe:builtin(remove-chained-self-inverse,merge-rotations)" \ |
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.
--catalyst-pipeline="pipe:builtin(remove-chained-self-inverse,merge-rotations)" \ | |
--catalyst-pipeline="pipe:remove-chained-self-inverse,merge-rotations" \ |
same here and some other places in the docs
applies the passes ``split-multiple-tapes`` and ``apply-transform-sequence``, and where ``pipe2`` | ||
applies the pass ``inline-nested-module``, we would specify this pipeline configuration as: | ||
|
||
.. code-block:: | ||
|
||
--catalyst-pipeline="pipe1(split-multiple-tapes;apply-transform-sequence),pipe2(inline-nested-module)" | ||
--catalyst-pipeline='pipe1:builtin-module(split-multiple-tapes,apply-transform-sequence)' |
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.
--catalyst-pipeline='pipe1:builtin-module(split-multiple-tapes,apply-transform-sequence)' | |
--catalyst-pipeline='pipe1:split-multiple-tapes,apply-transform-sequence' |
I don't think we actually need to have the builtin.module wrapper anymore do we?
This is how the tests are calling the pipeline anyways.
// RUN: catalyst --tool=opt %s -cse --dump-catalyst-pipeline --verify-diagnostics 2>&1 | FileCheck %s --check-prefix=CHECK-ONE-PASS | ||
// RUN: not catalyst --tool=opt %s -cse --catalyst-pipeline="pipe1(split-multiple-tapes;apply-transform-sequence),pipe2(inline-nested-module)" --dump-catalyst-pipeline --verify-diagnostics 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL | ||
// RUN: not catalyst --tool=opt %s -cse --catalyst-pipeline="pipe1:builtin.module(split-multiple-tapes,apply-transform-sequence)" --catalyst-pipeline="pipe2:inline-nested-module" --dump-catalyst-pipeline --verify-diagnostics 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL |
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.
I guess we have one case with builtin.module
here, but this is a case that should fail so it is not actually verifying whether builtin.module
is working.
// RUN: not catalyst --tool=opt %s -cse --catalyst-pipeline="pipe1:builtin.module(split-multiple-tapes,apply-transform-sequence)" --catalyst-pipeline="pipe2:inline-nested-module" --dump-catalyst-pipeline --verify-diagnostics 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL | |
// RUN: not catalyst --tool=opt %s -cse --catalyst-pipeline="pipe1:split-multiple-tapes,apply-transform-sequence" --catalyst-pipeline="pipe2:inline-nested-module" --dump-catalyst-pipeline --verify-diagnostics 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL |
Context: MLIR uses pipelines, Catalyst also uses pipelines. However, unlike MLIR pipelines, Catalyst's pipelines have names. This makes the syntax for denoting pipelines a little bit different.
Description of the Change: Make the syntax match better. Use multiple --catalyst-pipeline commands to denote multiple pipelines. Detects whether async is necessary by checking the passes instead of passing it through the command line.
Benefits: Avoid custom parsing. Have the same syntax for MLIR pipelines and Catalyst pipelines. Unlocks the possibility of multithreading compilation by using the regular pipeline syntax to denote function level passes.
Possible Drawbacks:
Related GitHub Issues: