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(bench): add throughput for integer benchmarks #1741

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

soonum
Copy link
Contributor

@soonum soonum commented Oct 31, 2024

No description provided.

@soonum soonum requested a review from IceTDrinker October 31, 2024 13:30
@soonum soonum self-assigned this Oct 31, 2024
@cla-bot cla-bot bot added the cla-signed label Oct 31, 2024
Comment on lines 386 to 407
/// Generate a number of threads to use to saturate current machine for throughput measurements.
pub fn throughput_num_threads() -> u64 {
let num_threads = rayon::current_num_threads() as f64;
// Add 20% more to maximum threads available.
(num_threads + (num_threads * 0.2)) as u64
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unclear this is enough, check with @tmontaigu probably

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes its unclear to know if its enough, for some ops it might for others not, or it could be enough for all,

I think a manual check needs to be done by running and trying different values and see if the throughput drastically changes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we do any manual checks ?

@agnesLeroy
Copy link
Contributor

We'll need also to add throughput benches for the GPU 🙂

@soonum
Copy link
Contributor Author

soonum commented Oct 31, 2024

We'll need also to add throughput benches for the GPU 🙂

Yes for sure, I just wanted to check for the design before deploying to all the functions.

@IceTDrinker
Copy link
Member

@soonum I see commits not having the right format it seems and a failing build, should I still review ?

@soonum
Copy link
Contributor Author

soonum commented Nov 8, 2024

@soonum I see commits not having the right format it seems and a failing build, should I still review ?

Yes, please review now. I'll squash all the commits after this first review.

Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things to update

ci/benchmark_parser.py Outdated Show resolved Hide resolved
Comment on lines +171 to +180
if stat_name == "mean" and bench_type == BenchType.throughput:
value = (elements * ONE_SECOND_IN_NANOSECONDS) / value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the units of value on the right here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's operations per second.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value after the / sign ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the value in nanoseconds recorded by criterion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and elements ?

it's unclear by looking at the formula if this si correct

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are rescaling the nanosecond measurement to seconds ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to display elements / second

tfhe/benches/integer/bench.rs Show resolved Hide resolved
tfhe/benches/integer/glwe_packing_compression.rs Outdated Show resolved Hide resolved
tfhe/benches/integer/zk_pke.rs Outdated Show resolved Hide resolved
.github/workflows/benchmark_integer.yml Outdated Show resolved Hide resolved
@soonum soonum force-pushed the dt/bench/throughput branch 6 times, most recently from fae1e07 to d375ed2 Compare November 12, 2024 11:50
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally ok for the pattern you want to use

.github/workflows/benchmark_signed_integer.yml Outdated Show resolved Hide resolved
@soonum soonum force-pushed the dt/bench/throughput branch from d375ed2 to dd5e944 Compare November 12, 2024 15:07
Comment on lines +150 to +160
if bench_type == BenchType.throughput and elements is None:
# Current subdir contains only latency measurements
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could print a warning

@soonum soonum force-pushed the dt/bench/throughput branch 3 times, most recently from 13ba2ee to 58b248c Compare November 15, 2024 12:06
@soonum soonum force-pushed the dt/bench/throughput branch from 58b248c to cdb34ba Compare November 15, 2024 13:51
@soonum soonum force-pushed the dt/bench/throughput branch 2 times, most recently from b35932e to 474695e Compare November 18, 2024 11:58
@soonum soonum requested a review from IceTDrinker November 18, 2024 11:58
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a conflict, I think you were ising the preprod slab at some point, please fix the conflict and remove the preprod slab if there was any usage left

@soonum soonum force-pushed the dt/bench/throughput branch 7 times, most recently from f40bb4b to 7857afc Compare November 18, 2024 16:40
All integer benchmarks make recipes can be run to ouput throughput
results.
Only CPU is supported for throughput benchmarks in GitHub CI.
@soonum soonum force-pushed the dt/bench/throughput branch from 7857afc to 8ab150a Compare November 18, 2024 16:46
@soonum soonum requested a review from IceTDrinker November 18, 2024 17:51
@soonum soonum merged commit 9059dde into main Nov 19, 2024
96 checks passed
@soonum soonum deleted the dt/bench/throughput branch November 19, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants