Skip to content

Conversation

@wchargin
Copy link
Contributor

@wchargin wchargin commented Jan 19, 2021

Summary:
Instead of computing checksums for every record, we can now compute
checksums only for records that fail proto parsing. This means that bit
flips in payloads like string fields may not be caught. But it comes
with a significant performance improvement:

  • 2.42× (±0.24×) faster for mnist (125 ms → 50 ms)
  • 1.20× (±0.03×) faster for edge_cgan (10.4 s → 8.7 s)
  • 1.23× (±0.01×) faster for nndiv (182 s → 148 s)

Both the main RustBoard binary and the bench binary now take
--checksum/--no-checksum flags, defaulting to --no-checksum.

Test Plan:
Unit tests extended. Benchmarked with:

hyperfine -w3 \
    './target/release/bench --logdir ~/testdata/edge_cgan/ {cksum}' \
    -L cksum --checksum,--no-checksum

wchargin-branch: rust-optional-crc

Summary:
Instead of computing checksums for every record, we can now compute
checksums only for records that fail proto parsing. This means that bit
flips in payloads like string fields may not be caught. But it comes
with a significant performance improvement:

  - 2.42× (±0.24×) faster for `mnist` (125 ms → 50 ms)
  - 1.19× (±0.02×) faster for `edge_cgan` (10 s → 8.5 s)
  - 1.23× (±0.01×) faster for `nndiv` (182 s → 148 s)

Both the main RustBoard binary and the `bench` binary now take
`--checksum`/`--no-checksum` flags, defaulting to `--no-checksum`.

Test Plan:
Unit tests extended. Benchmarked with:

```
hyperfine -w3 \
    './target/release/bench --logdir ~/testdata/edge_cgan/ {cksum}' \
    -L cksum --checksum,--no-checksum
```

wchargin-branch: rust-optional-crc
wchargin-source: 767e7133f9f14808acff0f8f1f64f746b5b853bd
@wchargin wchargin added theme:performance Performance, scalability, large data sizes, slowness, etc. core:rustboard //tensorboard/data/server/... labels Jan 19, 2021
@google-cla google-cla bot added the cla: yes label Jan 19, 2021
@wchargin wchargin mentioned this pull request Jan 19, 2021
34 tasks
@wchargin wchargin requested a review from stephanwlee January 19, 2021 22:18
wchargin-branch: rust-optional-crc
wchargin-source: 11c8a1780124e7ab9023f5e78f04bca48f8028d1
wchargin-branch: rust-optional-crc
wchargin-source: 11c8a1780124e7ab9023f5e78f04bca48f8028d1
} else {
match Event::decode(&record.data[..]) {
Ok(proto) => proto,
Err(e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. Checking checksum on error!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I figured that it could come in handy, and it’s easy enough and
costs nothing in the happy path.

@wchargin wchargin merged commit ec1ec35 into master Jan 20, 2021
@wchargin wchargin deleted the wchargin-rust-optional-crc branch January 20, 2021 04:51
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/... theme:performance Performance, scalability, large data sizes, slowness, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants