Skip to content
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

[prism] Add fusion. #29306

Merged
merged 7 commits into from
Nov 6, 2023
Merged

[prism] Add fusion. #29306

merged 7 commits into from
Nov 6, 2023

Conversation

lostluck
Copy link
Contributor

@lostluck lostluck commented Nov 5, 2023

Add robust fusion heuristics to Prism's graph Pre-processing, leading to improved performance when it's enabled. In this PR it's enabled by default, but in a subsequent PR, it'll be enabled by default in the stand alone command, and generally all variants except the "test" variant.

  • Largely cribbed from Python fn_api_runner/translations.py, which is based on two main heuristics: Avoiding side input conflicts, and indicating situations where a producing transform must not be fused with a consuming transform.
  • Updated handlers and fact computation to use return structs.
  • Add simple benchmarks for the Go Direct Runner, and Prism to demonstrate fusion was effective.
  • Clean up no-longer necessary exec side override for environments (handled in handlers now).
  • Fix Bug in ProcessBundle handling where a stage without data outputs would not send progress or split requests. This broke the channel splitting test in particular.
    • As a bonus, this moves that async processing into the progress handling loop, cleaning up that handling.

Minor fixes:

  • Fix Transform UniqueName for Combine extract output.
  • Fix channel splitting separation harness test to have an explicit Reshuffle, as it can't be automatically added for that synthetic test.
    • Reduce wait time for separation harness polling.

Note: This can be improved if we add "Flatten Unnzipping/Sinking" where Flattens can be removed from the graph, and executed implicitly. It's a more elaborate graph transformation however, since it involves duplicating downstream transforms, and allowing PCollections to have multiple producers. For now, we ignore SDK side flattens (which are only sometimes permittable), and force Runner side flattens to not be fused, since runner side transforms can't fuse at this time.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: 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, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

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)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

Copy link

codecov bot commented Nov 5, 2023

Codecov Report

Merging #29306 (95e3f11) into master (87ca614) will increase coverage by 0.01%.
Report is 7 commits behind head on master.
The diff coverage is 90.61%.

❗ Current head 95e3f11 differs from pull request most recent head 39939ce. Consider uploading reports for the commit 39939ce to get more accurate results

@@            Coverage Diff             @@
##           master   #29306      +/-   ##
==========================================
+ Coverage   38.30%   38.32%   +0.01%     
==========================================
  Files         690      690              
  Lines      102048   102123      +75     
==========================================
+ Hits        39088    39135      +47     
- Misses      61378    61402      +24     
- Partials     1582     1586       +4     
Flag Coverage Δ
go 53.48% <90.61%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
sdks/go/pkg/beam/runners/prism/internal/execute.go 86.95% <ø> (-0.28%) ⬇️
.../go/pkg/beam/runners/prism/internal/handlepardo.go 95.89% <100.00%> (+0.23%) ⬆️
...go/pkg/beam/runners/prism/internal/handlerunner.go 82.19% <93.33%> (-1.81%) ⬇️
...s/go/pkg/beam/runners/prism/internal/preprocess.go 94.44% <95.74%> (-0.23%) ⬇️
...o/pkg/beam/runners/prism/internal/handlecombine.go 87.39% <46.15%> (-4.43%) ⬇️
sdks/go/pkg/beam/runners/prism/internal/stage.go 82.90% <74.07%> (-0.08%) ⬇️

... and 4 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@github-actions github-actions bot added the direct label Nov 5, 2023
Copy link
Contributor

github-actions bot commented Nov 5, 2023

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @riteshghorse for label go.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@riteshghorse riteshghorse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the detailed description!

@lostluck lostluck merged commit 9acf947 into master Nov 6, 2023
@lostluck lostluck deleted the prismFusion branch November 6, 2023 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants