google / google/xls

[enhancement] reduction across shards in TestBench.

Open
#2,237 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.