-
Notifications
You must be signed in to change notification settings - Fork 150
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
Expand integer math operations #1143
Comments
hey @lognorman20 thanks for following up here, we are in the process of streamlining contributions, thanks for your interest in TFHE-rs and wanting to expand it We'll get back to you when we have more precise ways to contribute bigger chunks of code. In the meantime, @tmontaigu if you can keep track of the proposals |
@lognorman20 do you have a priority list on those operations ? And use cases corresponding to each ? There are a few functions that look trivial to implement |
@IceTDrinker The use cases will be for more general computational purposes in areas ranging from machine learning to data analysis, computer graphics, and compression algorithms. Some ideas off the top my head:
As for the priority list, I'd imagine those relating to machine learning operations would cater to a fair amount of users the most. I can come up with more functions relating to ML if you'd like. More useful functions can be added once support for floating point numbers is added as well. I agree some functions are quite trivial, I just think it'd be nice to have an abstraction for the programmer. Another aspect is the optimization of these algorithms. The implementation of a trivial algorithm by a user who is unfamiliar with FHE concepts such as the costs of primitive operations (i.e. multiplication) could be quite slow and potentially unreliable. By implementing these functions for the user, the process of writing more complex programs based on standard operations such as |
@lognorman20 when I said trivial I meant that maybe those could be the first to be implemented to see what it would look like and start working on that with people external to Zama |
@IceTDrinker ah okay, sure I can implement them externally |
@lognorman20 unless you did not mean to contribute those 🙂 it's just that there have been discussions lately about external contributions, also as we have a lot of things to do external requests/ideas might not get prioritized as much as you'd expect |
@IceTDrinker these operations don't seem too difficult to add and I was hoping to contribute them to this repo; however, I can write them on my own if other features are being prioritized |
Yep, I understood you wanted to contribute, what I meant is that some of those are easier to implement and you could likely start with those, and that unless you did the implementation we would not have much time to do them ourselves |
@IceTDrinker Thanks for clarifying, yes I'm okay with that |
@IceTDrinker hey any updates on contributing? I'd love to get started on this or #1162 :) |
Hey @lognorman20 we are in our release week so we’ll be busy, with that said you should take a look at the easier implementations for this issue, so that we iron out the contribution process we know some of the CI will need some improvements to work properly. You should look at the is_even/is_odd implementation first as there is no critical design decisions to be made. You will want to add that to integer first (maybe shortint as well) at which point you can likely open a first PR so that you can familiarize yourself with the normal PR process and given the functionality is easy to understand we’ll look at making the CI work properly. In the meantime you will be able to look at how to expose that in the high level API for FheUint/FheInt and then the C API. When you start working on other more complicated functions, could you ping us here so that we can discuss design ? |
hey @lognorman20 just to check in to see if you started work on the is_even/is_odd primitive ? |
What is the problem you want to solve and can not with the current version?
Currently, tfhe-rs supports basic operations on integers such as arithmetic, bitwise operations, comparisons, and min/max comparison. I propose this project to extend these existing primitives to more complicated integer operations in areas such as number theory. With this addition to tfhe-rs, users can abstract away functions they would have needed to implement themselves and focus on building meaningful projects. Further, this project aims to ensure its functions are high-speed and reliable.
Describe the solution you'd like
An extension of tfhe-rs with more functions similar to Rust's BigInt library.
Describe alternatives you've considered
Writing my own functions using already existing primitive operations (addition, multiplication, etc..)
Additional context
A few examples of functions to be added are the following:
These functions will leverage the already existing implementations of basic arithmetic. They would be added for both FheUint and FheInt.
Related links/References:
Python Math Library
Sage Integer Arithmetic
GNU Exponentiation and Logarithms
Rust num-bigint
ruint
I am happy to work on this project and discuss it further.
The text was updated successfully, but these errors were encountered: