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

Document parallelism and thread scheduling in the architecture guide #8986

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jan 24, 2024

Which issue does this PR close?

Part of #7013

Rationale for this change

The topic of thread scheduling and why not use Rayon or morsel driven parallelism has come up several times, most recently in the Discord channel: https://discord.com/channels/885562378132000778/1166447479609376850/1198721509842235402

I would like to document what is going on so that we can refer people to the documentation when these questions inevitably arise in the future

What changes are included in this PR?

  1. Add a note on pull execution and why Datafusion doesn't implement morsel driven paralleism directly
  2. Add a note about using tokio as the thread pool

Are these changes tested?

Existing CI checks

Are there any user-facing changes?

More docs

@alamb alamb added the documentation Improvements or additions to documentation label Jan 24, 2024
@github-actions github-actions bot added core Core DataFusion crate and removed documentation Improvements or additions to documentation labels Jan 24, 2024
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

Just some minor copy suggestions

datafusion/core/src/lib.rs Outdated Show resolved Hide resolved
@@ -364,8 +368,26 @@
//!
//! [`RepartitionExec`]: https://docs.rs/datafusion/latest/datafusion/physical_plan/repartition/struct.RepartitionExec.html
//! [Volcano style]: https://w6113.github.io/files/papers/volcanoparallelism-89.pdf
//! [Morsel-Driven Parallelism]: https://db.in.tum.de/~leis/papers/morsels.pdf
//! [DataFusion paper submitted SIGMOD]: https://github.com/apache/arrow-datafusion/files/13874720/DataFusion_Query_Engine___SIGMOD_2024.pdf
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//! [DataFusion paper submitted SIGMOD]: https://github.com/apache/arrow-datafusion/files/13874720/DataFusion_Query_Engine___SIGMOD_2024.pdf
//! [DataFusion paper submitted to SIGMOD]: https://github.com/apache/arrow-datafusion/files/13874720/DataFusion_Query_Engine___SIGMOD_2024.pdf

datafusion/core/src/lib.rs Outdated Show resolved Hide resolved
datafusion/core/src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Raphael Taylor-Davies <[email protected]>
//! DataFusion incrementally computes output from a [`SendableRecordBatchStream`]
//! with `target_partitions` threads. Parallelism is implementing using multiple
//! [Tokio] [`task`]s, which are executed by threads managed by a tokio Runtime.
//! While tokio is most commonly used
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should probably also point out that this phrasing came from the SIGMOD paper and I think at least @yjshen and @ozankabak had a part in authoring it

@alamb alamb changed the title Document parallelism and thread scheduling in the architecture guid Document parallelism and thread scheduling in the architecture guide Jan 25, 2024
@alamb alamb merged commit 7005e2e into apache:main Jan 26, 2024
23 checks passed
@alamb alamb added the documentation Improvements or additions to documentation label Jan 26, 2024
@alamb alamb deleted the alamb/execution_notes branch January 26, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants