Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(gpu): add inputs to erc20 throughput bench with multiple GPUs #1897

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tfhe/benches/high_level_api/erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,12 @@ fn bench_transfer_throughput<FheType, F>(
F: for<'a> Fn(&'a FheType, &'a FheType, &'a FheType) -> (FheType, FheType) + Sync,
{
let mut rng = thread_rng();
#[cfg(not(feature = "gpu"))]
let num_gpus = 1u64;
#[cfg(feature = "gpu")]
let num_gpus = unsafe { cuda_get_number_of_gpus() } as u64;

for num_elems in [10, 100, 500] {
for num_elems in [10 * num_gpus, 100 * num_gpus, 500 * num_gpus] {
group.throughput(Throughput::Elements(num_elems));
let bench_id = format!("{bench_name}::{fn_name}::{type_name}::{num_elems}_elems");
group.bench_with_input(&bench_id, &num_elems, |b, &num_elems| {
Expand Down Expand Up @@ -262,6 +266,8 @@ fn bench_transfer_throughput<FheType, F>(

#[cfg(feature = "pbs-stats")]
use pbs_stats::print_transfer_pbs_counts;
#[cfg(feature = "gpu")]
use tfhe_cuda_backend::cuda_bind::cuda_get_number_of_gpus;

fn main() {
#[cfg(not(feature = "gpu"))]
Expand Down
Loading