Skip to content

Conversation

@dkales
Copy link
Collaborator

@dkales dkales commented Jul 2, 2025

This is in preperation for the fragile bits effort for iris codes. Up until now, mask code shares have had the same imaginary and real part, which meant that we could reduce the storage and memory costs by only storing half and multiplying the results by 2. This PR extends them to the full length again, such that future iris codes may have different real and imaginary parts.

The DB and S3 loader are modified in a way that they extend half-sized mask codes to full ones if needed.

Also: DO NOT MERGE FOR NOW, this may need some sync for correct DB exporting in future.

Impact of merging this:

  • Will increase memory requirements for InMemoryStore of IrisDB from 38.4kB to 51.2kB per iris code (a 33% increase over current).
  • Processing time will increase slightly (mask dot products go from size 6400 to size 12800). For GPU, this time is relatively negligible compared to the remainder of the MPC protocol. For CPU, I do not have current breakdowns but I would also expect this to be not that significant.
  • Will enable iris codes to have masks with different real/imaginary part in the future. The request shares currently sent via SNS are already in extended format.

@dkales dkales force-pushed the dk/full_mask_size branch from 61d9cea to 4cabefa Compare July 2, 2025 12:01
@dkales dkales requested review from bgillesp and naure July 2, 2025 12:54
@dkales
Copy link
Collaborator Author

dkales commented Jul 2, 2025

@bgillesp @naure I tried to also handle changes in the HNSW variant, please take another look if I missed something

@dkales dkales requested a review from philsippl July 2, 2025 12:55
@dkales dkales marked this pull request as ready for review July 2, 2025 15:35
Copy link
Collaborator

@bgillesp bgillesp left a comment

Choose a reason for hiding this comment

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

Leaving this review as a Comment to help avoid accidental merge, but the PR looks fine to me. I can't speak to all of the changes in iris-mpc-gpu, but the changes in iris-mpc-cpu seem to cover all of the relevant touch points with the mask shares.

@dkales dkales changed the title refactor: Make mask shares full length again [POP-2513] Make mask shares full length again Jul 3, 2025
IRIS_CODE_LENGTH,
);

// Pad partial mask if needed, since the DB may contain partial masks, where the imaginary and real parts are the same and deduplicated.
Copy link
Contributor

Choose a reason for hiding this comment

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

So with this handling here we can continue without performing any migration for the existing mask codes right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the DB masks, yes, however the S3 ones have hard-coded length checks that are now wrong and will need some handling

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.

4 participants