-
Notifications
You must be signed in to change notification settings - Fork 315
fix(hpu): erc20 whitepaper bench #3143
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
Conversation
Add knobs to select ripple or kogge adder in ERC_20/ERC_20_SIMD. Previously, it was hardcoded to ripple carry and thus degraded latency performance of ERC_20.
…HPU uses if_then_zero
752e213 to
b0d7727
Compare
|
I dont know if we should do this optimisation as stricly speaking the whitepaper uses a select |
I think it is a select, just a select between amount or 0, which is exactly what the whitepaper is describing, no? |
|
Previously, pgardratzama (Pierre Gardrat) wrote…
Semantically yes, but in practice, the whitepaper cast So it depends on whether we want the benches here to reflect what the contract should be getting as perf on the blockchain, or if its another variant that is better like the others (no_cmux, overflow ,etc) |
|
Well @tmontaigu I have no idea what rules we want to follow here but my impression is that we wanted to do things faster. So either we go back to "pure" implementation of whitepaper ERC20 and I remove whitepaper ERC20 from HPU bench. |
| /// | ||
| /// - if `self` is true, the output will have the value of `ct_then` | ||
| /// - if `self` is false, the output will be an encryption of 0 | ||
| fn if_then_zero(&self, ct_then: &FheUint<Id>) -> FheUint<Id> { |
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 use tests (even if it uses existing primitives)
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.
a test has been added for CPU & HPU... and it works both on CPU & FPGA!!!
|
@tmontaigu summary of short discussion I had with @IceTDrinker:
Are you ok with that? |
|
Yes seems good |
…when encrypt_trivial becomes available on HPU), adds test of if_then_zero for both CPU & HPU
tmontaigu
left a comment
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.
@tmontaigu reviewed 8 files and all commit messages, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @soonum).
soonum
left a comment
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.
Good to me for benchmarks changes. 👍
Full story is:
I have run the CPU version on our HPU machines but not the GPU version.
So we need to check that it still works on GPU.
We also need to discuss if adding if_then_zero in HLAPI is ok?