-
Notifications
You must be signed in to change notification settings - Fork 30
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
Change --split-multiple-tapes
into a module pass
#1130
Merged
Merged
Conversation
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1130 +/- ##
=======================================
Coverage 97.62% 97.62%
=======================================
Files 75 75
Lines 10758 10758
Branches 1251 1251
=======================================
Hits 10503 10503
Misses 205 205
Partials 50 50 ☔ View full report in Codecov by Sentry. |
erick-xanadu
approved these changes
Sep 12, 2024
mehrdad2m
pushed a commit
that referenced
this pull request
Sep 17, 2024
**Context:** It was discovered that if `--split-multiple-tapes` were a function pass, then the outlining for the multitape functions will be done in parallel, causing their outlined functions to be created (and hence injected into the parent module) at stochastic times, so the order of the outlined functions is not guaranteed. This is causing a mlir lit test to be flaky https://github.com/PennyLaneAI/catalyst/blob/main/mlir/test/Quantum/SplitMultipleTapesTest.mlir#L67. Moreover, MLIR mandates that `OperationPass` cannot change the parent operation of the pass's target https://mlir.llvm.org/docs/PassManagement/#operation-pass. In our case the target of the pass is the multitape functions, but the outlined single tape functions are injected into their parent module. This violates the MLIR standards. **Description of the Change:** Change `--split-multiple-tapes` to a module pass. Also move the pass to `Quantum` dialect. **Benefits:** No race condition during tests; better conforming to MLIR standards.
rauletorresc
pushed a commit
that referenced
this pull request
Oct 9, 2024
**Context:** It was discovered that if `--split-multiple-tapes` were a function pass, then the outlining for the multitape functions will be done in parallel, causing their outlined functions to be created (and hence injected into the parent module) at stochastic times, so the order of the outlined functions is not guaranteed. This is causing a mlir lit test to be flaky https://github.com/PennyLaneAI/catalyst/blob/main/mlir/test/Quantum/SplitMultipleTapesTest.mlir#L67. Moreover, MLIR mandates that `OperationPass` cannot change the parent operation of the pass's target https://mlir.llvm.org/docs/PassManagement/#operation-pass. In our case the target of the pass is the multitape functions, but the outlined single tape functions are injected into their parent module. This violates the MLIR standards. **Description of the Change:** Change `--split-multiple-tapes` to a module pass. Also move the pass to `Quantum` dialect. **Benefits:** No race condition during tests; better conforming to MLIR standards.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
It was discovered that if
--split-multiple-tapes
is a function pass, then the outlining for the multitape functions will be done in parallel, causing their outlined functions to be created (and hence injected into the parent module) at stochastic times, so the order of the outlined functions is not guaranteed. This is causing a mlir lit test to be flaky https://github.com/PennyLaneAI/catalyst/blob/main/mlir/test/Catalyst/SplitMultipleTapesTest.mlir#L67.Moreover, MLIR mandates that
OperationPass
cannot change the parent operation of the pass's target https://mlir.llvm.org/docs/PassManagement/#operation-pass. In our case the target of the pass is the multitape functions, but the outlined single tape functions are injected into their parent module. This violates the MLIR standards.Description of the Change:
Change
--split-multiple-tapes
to a module pass.Also move the pass to
Quantum
dialect.Benefits:
No race condition during tests; better conforming to MLIR standards.