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

Multithreaded Encryption #1491

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Multithreaded Encryption #1491

merged 2 commits into from
Dec 12, 2024

Conversation

tyurek
Copy link
Collaborator

@tyurek tyurek commented Dec 12, 2024

Adds a seq_join and async_move to the shard code operating on encrypted report streams to make decryption parallelizable.

To make sure it is in fact running in multiple cores, I added a print line to the lambda that calls the decrypt function and tested with the multi-threading feature
cargo test --package ipa-core --test hybrid --no-default-features --features "cli compact-gate web-app real-world-infra test-fixture relaxed-dp multi-threading" -- test_hybrid --exact
Example output:

thread id: Thread { id: ThreadId(12), name: Some("query-executor"), .. }
thread id: Thread { id: ThreadId(8), name: Some("query-executor"), .. }
thread id: Thread { id: ThreadId(8), name: Some("query-executor"), .. }
thread id: Thread { id: ThreadId(9), name: Some("query-executor"), .. }
thread id: Thread { id: ThreadId(12), name: Some("query-executor"), .. }
thread id: Thread { id: ThreadId(12), name: Some("query-executor"), .. }
thread id: Thread { id: ThreadId(8), name: Some("query-executor"), .. }

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.30%. Comparing base (ff37b8a) to head (1f72fb4).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1491      +/-   ##
==========================================
+ Coverage   93.06%   93.30%   +0.23%     
==========================================
  Files         239      237       -2     
  Lines       43546    43515      -31     
==========================================
+ Hits        40526    40600      +74     
+ Misses       3020     2915     -105     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tyurek
Copy link
Collaborator Author

tyurek commented Dec 12, 2024

hmm, not sure why this fails but ./pre-commit runs okay...

@eriktaubeneck
Copy link
Member

hmm, not sure why this fails but ./pre-commit runs okay...

the unit test needs the mult-threading flag now

@akoshelev
Copy link
Collaborator

or worker_threads attribute if it is a tokio test

@tyurek
Copy link
Collaborator Author

tyurek commented Dec 12, 2024

changing the #[tokio::test] to
#[tokio::test(flavor = "multi_thread", worker_threads = 3)] for duplicate_encrypted_hybrid_reports appears to fix this

@tyurek tyurek merged commit 4f112ad into private-attribution:main Dec 12, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants