Skip to content

Conversation

@wchargin
Copy link
Contributor

Summary:
The crossbeam crate provides utilities for concurrent programming.
It’s best known for its scoped threads, which enable safe sharing of
local variables
, often considered too dangerous in C++. For loading
runs concurrently, we’ll used scoped threads and also concurrent queues.

Test Plan:
It builds: bazel build //third_party/rust:crossbeam.

wchargin-branch: rust-dep-crossbeam

Summary:
The [`crossbeam`] crate provides utilities for concurrent programming.
It’s best known for its [scoped threads, which enable safe sharing of
local variables][2p], often considered too dangerous in C++. For loading
runs concurrently, we’ll used scoped threads and also concurrent queues.

[2p]: https://matklad.github.io/2020/07/15/two-beautiful-programs.html
[`crossbeam`]: https://crates.io/crates/crossbeam

Test Plan:
It builds: `bazel build //third_party/rust:crossbeam`.

wchargin-branch: rust-dep-crossbeam
wchargin-source: 4903950564d6e54b4a057d87ecac8f0c8d5d590f
@wchargin wchargin added dependencies Pull requests that update a dependency file core:rustboard //tensorboard/data/server/... labels Jan 29, 2021
@google-cla google-cla bot added the cla: yes label Jan 29, 2021
@wchargin wchargin requested a review from stephanwlee January 29, 2021 08:05
Copy link
Contributor

@stephanwlee stephanwlee left a comment

Choose a reason for hiding this comment

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

Where do we intend to use the concurrency?

@wchargin
Copy link
Contributor Author

For loading runs concurrently within a logdir (i.e., every run loads
sequentially, but there is parallelism across runs).

@wchargin wchargin merged commit 2f5b421 into master Jan 29, 2021
@wchargin wchargin deleted the wchargin-rust-dep-crossbeam branch January 29, 2021 18:07
@wchargin
Copy link
Contributor Author

If curious, you can see the draft implementation of concurrent run
loading, which uses Crossbeam in roughly the same manner that I expect
to use it for in TensorBoard.

wchargin added a commit that referenced this pull request Jan 30, 2021
Summary:
The [`rayon`] crate provides easy data parallelism: change `iter()` to
`par_iter()` and you’re off to the races—but not the data races, which
are prevented at compile time. We can use it to load runs concurrently.

[`rayon`]: https://crates.io/crates/rayon

Test Plan:
It builds: `bazel build //third_party/rust:rayon`.

wchargin-branch: rust-dep-rayon
wchargin-source: 743dee6a68571fd8849ea4dfd240169bcfbe1feb
wchargin added a commit that referenced this pull request Feb 2, 2021
Summary:
The [`rayon`] crate provides easy data parallelism: change `iter()` to
`par_iter()` and you’re off to the races—but not the data races, which
are prevented at compile time. We can use it to load runs concurrently.

[`rayon`]: https://crates.io/crates/rayon

Test Plan:
It builds: `bazel build //third_party/rust:rayon`.

wchargin-branch: rust-dep-rayon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes core:rustboard //tensorboard/data/server/... dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants