-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Enable prism by default (where supported) #34612
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
Conversation
…mccorm/prismByDefault
…mccorm/prismByDefault
Looks like
EDIT: I think that this is actually a function of pipelines double executing before #34921 was patched. So I think this is fine and my temporary patch can be removed |
@@ -405,7 +405,7 @@ def get_all_options( | |||
# sub-classes in the main session might be repeated. Pick last unique | |||
# instance of each subclass to avoid conflicts. | |||
subset = {} | |||
parser = _BeamArgumentParser() | |||
parser = _BeamArgumentParser(allow_abbrev=False) |
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.
This was causing all sorts of problems because --output was getting assigned to --output_executable_path (https://github.com/apache/beam/blob/f6d209ff6a3ea638f11dfb96e52f7c21292dfbc1/sdks/python/apache_beam/options/pipeline_options.py#L1693C12-L1693C34) which meant the portable runner couldn't find prism
…mccorm/prismByDefault
…mccorm/prismByDefault
R: @shunping |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
@@ -128,7 +128,8 @@ def test_predict_tensor_with_batch_size(self): | |||
model = _create_mult2_model() | |||
model_path = os.path.join(self.tmpdir, f'mult2_{uuid.uuid4()}.keras') | |||
tf.keras.models.save_model(model, model_path) | |||
with TestPipeline() as pipeline: | |||
# FnApiRunner guarantees large batches, which this pipeline assumes |
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.
This could be due to the fact that prism is using accelerated processing time by default. The processing-time timer in BatchElements may not work as expected.
PR #35202 added an experimental flag for using real-time processing time, which may help to resolve this problem.
# more targeted, but for now we'll just ignore all unsafe triggers. | ||
if pipeline.allow_unsafe_triggers: | ||
self.supported_by_prism_runner = False | ||
# TODO(https://github.com/apache/beam/issues/33623): Prism currently |
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.
What else problems do you face here when using prism in interactive mode?
@@ -254,8 +254,8 @@ def test_constant_batch_no_metrics(self): | |||
self.assertEqual(len(results["distributions"]), 0) | |||
|
|||
def test_grows_to_max_batch(self): | |||
# Assumes a single bundle... | |||
with TestPipeline() as p: | |||
# Assumes a single bundle, so we pin to the FnApiRunner |
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.
Do we have a reliable way of getting elements in a single bundle? Maybe only for testing purpose. This seems to be a recurrent issue I meet when I am working on some other tests.
Alternatively, we may be able to change the tests so that they won't rely on this assumption, but it is not working all the time.
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.
Thank you for making this big step for prism! I really appreciate the thorough and detailed work you've put into this.
The overall PR looks solid. I've left a few minor comments for your consideration.
There were failing postcommit tests, but not on prism, so I'm not going to block merging |
There are tests failing after this PR, could it be related? |
Changes the default Python runner to be prism (when prism is supported). Excludes it from interactive environments for now.
There are a bunch of use cases automatically excluded, but this also required updating a bunch of tests. The 2 main breaking changes this introduces are:
RuntimeError
is always raised. To fix any tests relying on the old error, change your exception catching logic to look for broader errors and use regexes to verify the contents of the error. There are lots of examples of this in this PR.If this change breaks you in unexpected ways, please:
FnApiRunner
instead of theDirectRunner
. There are lots of examples of this in this PR.Part of #34549
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.