-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat(integer): improve carry propagation algorithm #1323
Conversation
e40a339
to
46290c2
Compare
3ac064a
to
599fa1f
Compare
the GPU crash is what you reported to the GPU team ? |
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.
Lots of stuff (mainly because there is so much to make the addition happen), happy to discuss to avoid too much back and forth here :)
tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_add.rs
Outdated
Show resolved
Hide resolved
tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_add.rs
Outdated
Show resolved
Hide resolved
tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_add.rs
Outdated
Show resolved
Hide resolved
for i in 1..grouping_size { | ||
let state_fn = |block| { | ||
let r = if block >= message_modulus { | ||
2 // Generates Carry | ||
} else if block == message_modulus - 1 { |
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.
IIRC from your sprint demo this is one of the genius part of the new algo, a small illustration might be useful to show how the addition of the bits will naturally compute the propagation
Yes the GPU crash is the thing I reported and a PR that has the fix has been openned |
79967a7
to
b3f7e39
Compare
let carry = self.create_trivial_boolean_block(true); | ||
let mut result = lhs.clone(); | ||
let overflowed = self | ||
.advanced_add_assign_with_carry_sequential_parallelized( |
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.
parallelized algo in sequential non parallel code ?
Btw should we get rid of the non parallel code ?
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 parallel sequential only uses 2 threads at a time so its okayish
And yes I don't think non parallel code provide much 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.
Thanks a lot for all the hard work and for the patches on the PR you can squash in one and I'll approve the squash
de7b9d1
to
2574083
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.
Thanks !
Todo