-
Notifications
You must be signed in to change notification settings - Fork 148
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
Update TFHE-rs to 0.10.0 and use safe serialization for secret keys #1154
Conversation
youben11
commented
Nov 19, 2024
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.
Benchmark
Benchmark suite | Current: ccf491e | Previous: 4d6afba | Ratio |
---|---|---|---|
v0 PBS table generation |
58836953 ns/iter (± 891893 ) |
61206032 ns/iter (± 915254 ) |
0.96 |
v0 PBS simulate dag table generation |
37239574 ns/iter (± 338641 ) |
39067802 ns/iter (± 517224 ) |
0.95 |
v0 WoP-PBS table generation |
52402617 ns/iter (± 291817 ) |
53923124 ns/iter (± 503951 ) |
0.97 |
This comment was automatically generated by workflow using github-action-benchmark.
f00eb11
to
0f0f04b
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.
@IceTDrinker If I well understand that should break GPU code as levels has been reversed in bsk right?
btw gpu test seems not launched... 🤔 |
Else LGTM |
if you are using code that is not the cuda backend then yes, also to note that it breaks GPU PBS levels in your case (going from 0.8 to 0.10 the KS levels are preserved) and the order in which the circuirt bootstrap does the pfpks for the wopbs |
which primitives do you have in your GPU code ? |
ksk/bsk conversion, ks/bs, levelled op (with the old cuda backend, i.e. if fixed in cnversion function we are not up to date) |
no wopbs on GPU ? |
nop |
@youben11 check python tests (cannot serialize sk) |
so KSK and packing KSK levels are the same in 0.8 and 0.10, bsk are reversed in 0.10 vs 0.8 |
weird this only happened after I rebased on main! Initial run had only one flaky test https://github.com/zama-ai/concrete/actions/runs/11911805689/job/33194835318 |
Compiler GPU tests passed https://github.com/zama-ai/concrete/actions/runs/11930839707/job/33252527434 |
Hmm ok |
do the GPU tests have pbs_level_count > 1 ? |
@aPere3 do you have an idea? |
Don't known for the GPU test but we could have level > 1 there are no restriction on the search space |
just that the level reversal would not show up on a single level BSK, but if you are confident it's all good, I won't stop you 🙂 |
Ok so I'm not confident :) |
what happened with serialization ? |
The old computation of buffer size no longer worked. It's due to additional headers now included in the safe serialisation. The fix was to add some additional (approximate) room for the headers. |
we don't account for those headers ? @nsarlin-zama |
No. It's not your computation, but our own. We can't easily use yours as we don't yet hold the value at the point of creating the buffer. Our process is like:
AFAICT, if we need to call your function, then we need to copy the key, which is not quite efficient. So since it's not a cheap operation then having a homemade estimation (which is not 100% accurate) sound better |
You have the key at step one, so call the size right after ? I might be missing something |
I can call it, but It would require a copy as
wouldn't work. It would require a LweSecretKey<Vec>, which then require a copy, and computing on our side avoid the copy. |
hmm... no ? use a view ? LweSecretKey<&[u64]> ? Edit: sorry did not see the code, but it should work there is no copy there |
Why does calling the function on a view not work ? If it does not it's a bug on our end |
I will get this if I try to do it
|
ah ha! @nsarlin-zama this should be an easy fix I would think ? |
This is not so easy, it would require to rework a bit the proc macro as currently the impl of Versionize and Unversionize are linked together... |
a8f9ab0
to
272ab8d
Compare
cc82e8f
to
ccf491e
Compare