-
Notifications
You must be signed in to change notification settings - Fork 35
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
[WIP] replace new compiler driver by calling compiler-cli using subprocess #1285
base: main
Are you sure you want to change the base?
Conversation
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.
You can also test locally and not have to wait for CI/CD by typing "make wheel" and then pip installing the wheel in your local machine and then removing the build directories and running the tests. The tests should pass as catalyst-cli
should now be available on the wheel itself as long as the path is correct.
Hey @mehrdad2m
Why is this preferred? Using the Python extension module should be the way to go about this no? Everything lives in the same process space, no need to share data/clean up directories/no need for IPC. |
Hi @mlxd, Performance wise, you are definitely right. However one of the main objectives of this story (@erick-xanadu please feel free to elaborate if I miss something) is to detach the address space of the compiler form the python frontend so we avoid any symbol clash. |
Thanks for the context @mehrdad2m |
@mlxd , happy to document everything in the shortcut ticket and/or discuss offline :) |
bc74409
to
b27eacf
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1285 +/- ##
==========================================
+ Coverage 97.95% 98.37% +0.41%
==========================================
Files 77 78 +1
Lines 11321 11361 +40
Branches 982 990 +8
==========================================
+ Hits 11090 11176 +86
+ Misses 181 127 -54
- Partials 50 58 +8 ☔ View full report in Codecov by Sentry. |
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.
Just small changes.
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'll repeat what I commented offline: I think this PR is ready to be merged. It would also be good to benchmark the compilation time. Seeing this difference between the implementations would help prioritize the need for IPC next quarter. Let's try and benchmark before merging, I know there are other stories depending on this so if it takes too long to set up the benchmarks, we can discuss offline and approve.
Context: The old compiler driver api which uses the pybind11 as an interface between the python frontend and the compiler should be replaced with the new CLI tool (catalyst-cli).
Description of the Change:
Removes the pybind11 interface in favour of calling catalyst-cli using python subprocess.
Benefits:
the catalyst-cli will be completely independent of the python frontend and consequently, compiler symbols will be separated from the frontend
Possible Drawbacks:
Using subprocess requires us to connect with the catalyst-cli using files on disk. Therefore we need to save the IR to a file temporarily and parse it again in the compiler which can be problematic when IR size grows. This should be improved in future using interprocess communication.
[sc-73537]
[sc-73538]