Skip to content

feat(gpu): implement shuffle#3472

Draft
enzodimaria wants to merge 1 commit intomainfrom
edm/shuffle
Draft

feat(gpu): implement shuffle#3472
enzodimaria wants to merge 1 commit intomainfrom
edm/shuffle

Conversation

@enzodimaria
Copy link
Copy Markdown
Contributor

@enzodimaria enzodimaria commented Apr 14, 2026

This PR contains

the new feature FHE bitonic_sort:

  • Inputs: a mutable slice of CudaUnsignedRadixCiphertext (or signed)
  • Outputs: the same slice, sorted in ascending order (in-place)

Goal:

  • Shuffle a list in numerical order (e.g., cards, participants, orders) without revealing the final order.
  • Ensure fairness in applications.

Benchmarks:

| Parameter Set                      | Elements | Execution Time (Median) |
|------------------------------------|----------|-------------------------|
| unchecked_bitonic_sort (multibit)  | 8        | 224.19 ms               |
| unchecked_bitonic_sort (multibit)  | 16       | 683.26 ms               |
| unchecked_bitonic_sort (multibit)  | 32       | 1.9839 s                |
| unchecked_bitonic_sort (multibit)  | 64       | 5.4894 s                |
|------------------------------------|----------|-------------------------|
| unchecked_bitonic_sort (classical) | 8        | 265.90 ms               |
| unchecked_bitonic_sort (classical) | 16       | 698.71 ms               |
| unchecked_bitonic_sort (classical) | 32       | 1.8683 s                |
| unchecked_bitonic_sort (classical) | 64       | 4.9841 s                |

1 x H100-SXM5

@cla-bot cla-bot bot added the cla-signed label Apr 14, 2026
@enzodimaria enzodimaria force-pushed the edm/shuffle branch 5 times, most recently from cd04181 to 0ae7754 Compare April 15, 2026 12:34
Copy link
Copy Markdown
Contributor

@andrei-stoian-zama andrei-stoian-zama left a comment

Choose a reason for hiding this comment

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

Should the API work with GpuFheXYArray ?

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.

2 participants