Skip to content
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

shortint/small optim #536

Merged
merged 7 commits into from
Oct 17, 2023
Merged

shortint/small optim #536

merged 7 commits into from
Oct 17, 2023

Conversation

mayeul-zama
Copy link
Contributor

  • cleanup inputs of smart ops instead of cleanup clones
  • do not bootstrap when not necessary
  • add asserts on smart ops

@cla-bot cla-bot bot added the cla-signed label Sep 11, 2023
@github-actions
Copy link

@slab-ci cpu_fast_test

@mayeul-zama mayeul-zama mentioned this pull request Sep 11, 2023
@mayeul-zama mayeul-zama force-pushed the mz/refactor/cleanup_shortint branch 3 times, most recently from 57ab09d to 3f13028 Compare September 12, 2023 11:30
@github-actions
Copy link

@slab-ci cpu_fast_test

Base automatically changed from mz/refactor/cleanup_shortint to main September 13, 2023 07:44
@github-actions
Copy link

@slab-ci cpu_fast_test

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #536 (79eeb0d) into main (ed83fbb) will decrease coverage by 0.19%.
Report is 61 commits behind head on main.
The diff coverage is 35.23%.

❗ Current head 79eeb0d differs from pull request most recent head aa7b393. Consider uploading reports for the commit aa7b393 to get more accurate results

@@            Coverage Diff             @@
##             main     #536      +/-   ##
==========================================
- Coverage   23.11%   22.93%   -0.19%     
==========================================
  Files         256      256              
  Lines       19573    19633      +60     
==========================================
- Hits         4525     4503      -22     
- Misses      15048    15130      +82     
Files Coverage Δ
tfhe/src/integer/server_key/radix/scalar_mul.rs 0.00% <ø> (ø)
...rc/integer/server_key/radix_parallel/scalar_mul.rs 0.00% <ø> (ø)
tfhe/src/shortint/server_key/mod.rs 31.62% <ø> (ø)
tfhe/src/shortint/engine/server_side/neg.rs 81.25% <50.00%> (-2.09%) ⬇️
tfhe/src/integer/server_key/radix/scalar_add.rs 0.00% <0.00%> (ø)
tfhe/src/integer/server_key/radix/scalar_sub.rs 0.00% <0.00%> (ø)
tfhe/src/integer/server_key/radix_parallel/add.rs 0.00% <0.00%> (ø)
...rc/integer/server_key/radix_parallel/scalar_add.rs 0.00% <0.00%> (ø)
...rc/integer/server_key/radix_parallel/scalar_sub.rs 0.00% <0.00%> (ø)
tfhe/src/shortint/engine/server_side/comp_op.rs 79.87% <83.33%> (-1.38%) ⬇️
... and 7 more

... and 12 files with indirect coverage changes

@github-actions
Copy link

@slab-ci cpu_fast_test

@github-actions
Copy link

@slab-ci cpu_fast_test

@mayeul-zama
Copy link
Contributor Author

@slab-ci cpu_fast_test

Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the pattern where we check if the operation is possible, clean the ciphertexts and then assert right after 🤔

@@ -176,15 +172,14 @@ impl ServerKey {
if !self.is_crt_scalar_mul_possible(ctxt, scalar) {
self.full_extract_message_assign(ctxt);
}

// assert!(self.is_crt_scalar_mul_possible(ctxt, scalar));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is breaking this ?

@@ -255,6 +255,7 @@ impl ServerKey {
if !self.is_small_scalar_mul_possible(ctxt, scalar) {
self.full_propagate(ctxt);
}
// assert!(self.is_small_scalar_mul_possible(ctxt, scalar));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question everywhere, why is it commented here and in this case even more so given it's not commented below

@github-actions
Copy link

@slab-ci cpu_fast_test

@mayeul-zama
Copy link
Contributor Author

@slab-ci cpu_fast_test

@github-actions
Copy link

@slab-ci cpu_fast_test

@github-actions
Copy link

Pull Request has been approved 🎉
Launching full test suite...
@slab-ci cpu_test
@slab-ci cpu_integer_test
@slab-ci cpu_multi_bit_test
@slab-ci cpu_wasm_test
@slab-ci csprng_randomness_testing

@IceTDrinker
Copy link
Member

that one https://github.com/zama-ai/tfhe-rs/actions/runs/6275470013/job/17043013270#step:8:3202

is a hard coded test that can be updated safely and was a sanity check with the previous accpeted degree value (though we knew it was broken, and needed updating later)

@github-actions
Copy link

@slab-ci cpu_fast_test

@github-actions
Copy link

Pull Request has been approved 🎉
Launching full test suite...
@slab-ci cpu_test
@slab-ci cpu_integer_test
@slab-ci cpu_multi_bit_test
@slab-ci cpu_wasm_test
@slab-ci csprng_randomness_testing

@IceTDrinker
Copy link
Member

@slab-ci csprng_randomness_testing

@github-actions
Copy link

@slab-ci cpu_fast_test

@mayeul-zama
Copy link
Contributor Author

Moved add assert commit to PR #590

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Pull Request has been approved 🎉
Launching full test suite...
@slab-ci cpu_test
@slab-ci cpu_integer_test
@slab-ci cpu_multi_bit_test
@slab-ci cpu_wasm_test
@slab-ci csprng_randomness_testing

@mayeul-zama mayeul-zama merged commit f08ea8c into main Oct 17, 2023
20 checks passed
@mayeul-zama mayeul-zama deleted the mz/shortint/small_optim branch October 17, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants