Skip to content

Commit

Permalink
feat: Parallel taso with crossbeam (#113)
Browse files Browse the repository at this point in the history
Simplifies the multithreading logic by using a multi-consumer channel.
Includes some small improvements to the TASO bin.


Now, why is this a draft:

I'm testing with `barenco_tof_5_rm` and `Nam_6_3_complete_ECC_set` on my
12-core laptop. Here are some results with a timeout of `10` seconds:

|            | circuits seen after 10s | best size after 10s |
| ----------------- | ------ | ---- |
| single-threaded | 7244 | 178 |
| -j 2 | 31391 | 204 |
| -j 10 | 42690 | 204 |

There's something wrong somewhere :P
(note that `-j N` means `N` worker threads, plus the master)

---------

Co-authored-by: Luca Mondada <[email protected]>
Co-authored-by: Luca Mondada <[email protected]>
  • Loading branch information
3 people authored and ss2165 committed Sep 25, 2023
1 parent ce753b7 commit ae292f5
Show file tree
Hide file tree
Showing 10 changed files with 425 additions and 317 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ csv = { version = "1.2.2" }
chrono = { version ="0.4.30" }
bytemuck = "1.14.0"
stringreader = "0.1.1"
crossbeam-channel = "0.5.8"

[features]
pyo3 = [
Expand Down
9 changes: 8 additions & 1 deletion compile-matcher/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::fs;
use std::path::Path;
use std::process::exit;

use clap::Parser;
use itertools::Itertools;
Expand Down Expand Up @@ -42,7 +43,13 @@ fn main() {

let all_circs = if input_path.is_file() {
// Input is an ECC file in JSON format
let eccs = load_eccs_json_file(input_path);
let Ok(eccs) = load_eccs_json_file(input_path) else {
eprintln!(
"Unable to load ECC file {:?}. Is it a JSON file of Quartz-generated ECCs?",
input_path
);
exit(1);
};
eccs.into_iter()
.flat_map(|ecc| ecc.into_circuits())
.collect_vec()
Expand Down
Loading

0 comments on commit ae292f5

Please sign in to comment.