-
Notifications
You must be signed in to change notification settings - Fork 130
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
[service] Add a CompilationSession abstract base class. #261
[service] Add a CompilationSession abstract base class. #261
Conversation
f6b63e1
to
b54a667
Compare
Codecov Report
@@ Coverage Diff @@
## development #261 +/- ##
===============================================
- Coverage 83.33% 83.12% -0.21%
===============================================
Files 76 76
Lines 4338 4338
===============================================
- Hits 3615 3606 -9
- Misses 723 732 +9
Continue to review full report at Codecov.
|
b54a667
to
efa8dc0
Compare
Marking this ready for review but no rush to merge it while we're still discussing the design in #254. |
efa8dc0
to
3ac01aa
Compare
The CompilationSession class encapsulates an incremental compilation session. This is the first in a series of patches that separates the RPC server from the compilation session. Issue facebookresearch#254.
3ac01aa
to
9126512
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.
If the protobuf stuff is okay to keep then this LGTM :-)
|
||
def __init__( | ||
self, working_dir: Path, action_space: ActionSpace, benchmark: Benchmark | ||
): |
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 curious: why doesn't this return a status
like the c++ code?
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.
We don't use exceptions in C++ (FWIW I don't have particularly strong opinions on the matter), the CompilationSession
constructor in C++ is a safe default, and any of the three methods that can fail (init, compute feature, run action) return Status
.
For Python, exceptions are fine and all of the runtime logic that interacts with CompilationSession
will catch exceptions and set the relevant RPC error code
The CompilationSession class encapsulates an incremental compilation
session.
This is the first in a series of patches that separates the RPC server
from the compilation session.
Issue #254.