Skip to content

Commit

Permalink
test: try using different thread combos with tch
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvollger committed Aug 21, 2024
1 parent e6d0e61 commit 08b3616
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,10 @@ pub fn main() -> Result<(), Error> {
);
#[cfg(feature = "tch")]
{
let mut tch_threads = 1;
if args.global.threads >= 16 {
tch_threads = 1;
//set_rayon_threads(args.global.threads / tch_threads + 1)?;
log::info!(
"Setting tch threads to: {} and rayon threads to: {}",
tch_threads,
args.global.threads / tch_threads + 1
);
}
// setting this to 1 since I do paralyzation via processing multiple reads
tch::set_num_threads(tch_threads as i32);
tch::set_num_interop_threads(tch_threads as i32);
// one threads works best for CPU inference performance
// with rayon handling the parallelism using multiple reads
tch::set_num_threads(1);
tch::set_num_interop_threads(1);
}
subcommands::predict_m6a::read_bam_into_fiberdata(predict_m6a_opts);
}
Expand Down

0 comments on commit 08b3616

Please sign in to comment.