-
Notifications
You must be signed in to change notification settings - Fork 155
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
Conversation
tfhe/benches/utilities.rs
Outdated
/// 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 | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
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. |
e16e88c
to
f20e6e7
Compare
@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. |
There was a problem hiding this 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
if stat_name == "mean" and bench_type == BenchType.throughput: | ||
value = (elements * ONE_SECOND_IN_NANOSECONDS) / value |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
fae1e07
to
d375ed2
Compare
There was a problem hiding this 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
d375ed2
to
dd5e944
Compare
if bench_type == BenchType.throughput and elements is None: | ||
# Current subdir contains only latency measurements | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could print a warning
13ba2ee
to
58b248c
Compare
58b248c
to
cdb34ba
Compare
b35932e
to
474695e
Compare
There was a problem hiding this 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
f40bb4b
to
7857afc
Compare
All integer benchmarks make recipes can be run to ouput throughput results. Only CPU is supported for throughput benchmarks in GitHub CI.
7857afc
to
8ab150a
Compare
No description provided.