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

fix(gpu): enable larger number of samples in the keyswitch #2067

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

guillermo-oyarzun
Copy link
Member

closes: please link all relevant issues

PR content/description

Check-list:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Relevant issues are marked as resolved/closed, related issues are linked in the description
  • Check for breaking changes (including serialization changes) and add them to commit message following the conventional commit specification

@guillermo-oyarzun
Copy link
Member Author

I ran the benchmark integer tests, and performance is not affected

@@ -114,7 +114,7 @@ __host__ void host_keyswitch_lwe_ciphertext_vector(
num_blocks, num_threads_x);

int shared_mem = sizeof(Torus) * num_threads_y * num_threads_x;
dim3 grid(num_blocks, num_samples, 1);
dim3 grid(num_samples, num_blocks, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the way to go. We should not have to support more than a few thousands blocks, and the y-axis supports up to 65k.

Can you add maybe a comment justifying this line change and add an assert checking if the number of blocks is greater than the maximum number of y-blocks?

@guillermo-oyarzun guillermo-oyarzun force-pushed the go/fix/allow-large-number-of-samples-in-ks branch from 0a328f1 to 6d0f664 Compare February 14, 2025 18:26
@pdroalves
Copy link
Contributor

Thanks @guillermo-oyarzun . Let's merge when we have a green CI.

@pdroalves pdroalves merged commit 0f44ffd into main Feb 17, 2025
110 checks passed
@pdroalves pdroalves deleted the go/fix/allow-large-number-of-samples-in-ks branch February 17, 2025 22:34
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