cuvs icon indicating copy to clipboard operation
cuvs copied to clipboard

Moving dice distance from raft to cuvs and support for half types

Open aamijar opened this issue 5 months ago • 8 comments

Resolves #966

aamijar avatar Jun 03 '25 02:06 aamijar

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

copy-pr-bot[bot] avatar Jun 03 '25 02:06 copy-pr-bot[bot]

Adding @rhdong as a reviewer since he worked on half types for the other distances https://github.com/rapidsai/cuvs/pull/225

aamijar avatar Jun 03 '25 02:06 aamijar

@aamijar I know this isn't your fault, but we're closely monitoring the cuVS binary size going forward and the pairwise distance APIs are by far the largest offender. Can you check the metrics logs that are produced in this PR to see how much this new distance affects the libcuvs binary size?

cjnolet avatar Jun 03 '25 21:06 cjnolet

Hi @cjnolet, sure where can I check the binary size/metrics for this pr?

aamijar avatar Jun 04 '25 01:06 aamijar

@aamijar See the conda C++ build logs for the build metrics reports: https://github.com/rapidsai/cuvs/actions/runs/15453622193/job/43501422197#step:14:31

The HTML report here (https://downloads.rapids.ai/ci/cuvs/pull-request/971/59cb596/cuda12_x86_64.compile_lib.html) shows some data for the new files:

CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_float_float_float_int.cu.o	8.331 s	3.280 MB
CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_half_float_float_int.cu.o	8.622 s	2.857 MB
CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_double_double_double_int.cu.o	8.796 s	1.106 MB

So at least 7 MB just from the new files. There may be other changes that affect the binary size of existing objects too. Maybe distance.cu?

CMakeFiles/cuvs_objs.dir/src/distance/distance.cu.o	13.587 s	6.872 MB

bdice avatar Jun 05 '25 03:06 bdice

Thank you @bdice! It would be nice if there was a way to highlight in the html report which files are edited from the PR and the increase or decrease in binary size.

aamijar avatar Jun 05 '25 21:06 aamijar

@aamijar I suspect the binary size is higher because we are using cutlass. @cjnolet given that this will be an infrequently used distance type, can we skip using cutlass and just use our normal pairwise kernel?

divyegala avatar Jun 12 '25 17:06 divyegala

To follow up here are the binary size reports. The libcuvs size increases by 6.06 MB

  • (1209.31 MB) Nightly https://downloads.rapids.ai/nightly/cuvs/2025-07-08/23c6dc0/cuda12_x86_64.compile_lib.html
  • (1215.37 MB) This PR https://downloads.rapids.ai/ci/cuvs/pull-request/971/d91ffdb/cuda12_x86_64.compile_lib.html
--- Added Files ---
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_double_double_double_int.cu.o: 981.89 KB
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_float_float_float_int.cu.o: 3.09 MB
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_half_float_float_int.cu.o: 2.69 MB

aamijar avatar Jul 08 '25 20:07 aamijar

Is this still targeting 25.12?

csadorf avatar Nov 19 '25 16:11 csadorf

This one is not targeting 25.12, and yep will update to add the new header format.

aamijar avatar Nov 19 '25 17:11 aamijar