[enhancement] reduction across shards in TestBench.
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
### What's hard to do? (limit 100 words)
The XLS TestBenchBuilder is missing an efficient way to reduce over shards. Specifically, we need it to merge histograms of errors over shards when doing exhaustive testing of the of circuits. With the current API for TestBenchBuilder, the only way to do the reduction is to take a lock on every call to the LogErrorsFn callback. But that slows down the computation by ~15x due to lock contention on my 72-core machine, which is annoying. Since we already had an older implementation based on fibers [0], I ended up switching to that [1].
### Current best alternative workaround (limit 100 words)
Currently you have to tack a lock and do the reduction pointwise, e.g. in LogErrorFn. But lock contention severely limits scalability.
### Your view of the "best case XLS enhancement" (limit 100 words)
Add a method to enable such reductions in the TectBenchBuilder, e.g. a "FinalizeShardFn" callback or the like.
Contributor guide
Assessment
This issue has not been assessed yet.