Skip to content

Conversation

bbarbakadze
Copy link
Contributor

PR content/description

New optimized algorithm for div_rem when using message=2 and carry = 2 parameters.

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

Copy link
Contributor

@agnesLeroy agnesLeroy left a comment

Choose a reason for hiding this comment

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

Hey @bbarbakadze! Thanks a lot for the changes! Overall it looks really good: I think it could be optimized more, maybe to try and reuse some buffers/luts. The main caveat in this implementation is the number of streams used: could you measure throughput on 8xH100-SXM5 to see how it compares to current throughput please? Thanks!

}
};

template <typename Torus> struct int_sub_and_propagate {
Copy link
Contributor

Choose a reason for hiding this comment

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

This and the int_bitop_buffer are just changing places right? Could you put them where they were before to avoid unnecessary conflicts later on please?

delete c3;
delete q1;
delete q2;
delete q3;
Copy link
Contributor

Choose a reason for hiding this comment

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

After every delete, could you also reset every pointer to nullptr please? Andrei's PR is not merged yet but that's what will become the new pattern very soon.

as_radix_ciphertext_slice<Torus>(d_msb, d, slice_start, slice_end);
comparison_blocks->num_radix_blocks = d_msb->num_radix_blocks;
if (d_msb->num_radix_blocks == 0) {
cuda_memset_async((Torus *)out_boolean_block->ptr, 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here I think you could use set_zero_radix_ciphertext_slice_async instead

gpu_count: u32,
mem_ptr_void: *mut *mut i8,
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know why the bindings file format is changing, could be worth checking what happens if you revert the changes here?

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