Skip to content

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

Open
aamijar wants to merge 20 commits intorapidsai:mainfrom
aamijar:umap-dice-coefficient
Open

Moving dice distance from raft to cuvs and support for half types#971
aamijar wants to merge 20 commits intorapidsai:mainfrom
aamijar:umap-dice-coefficient

Conversation

@aamijar
Copy link
Member

@aamijar aamijar commented Jun 3, 2025

Resolves #966

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jun 3, 2025

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.

@aamijar aamijar self-assigned this Jun 3, 2025
@aamijar aamijar added non-breaking Introduces a non-breaking change feature request New feature or request labels Jun 3, 2025
@aamijar aamijar marked this pull request as ready for review June 3, 2025 02:31
@aamijar aamijar requested review from a team as code owners June 3, 2025 02:31
@aamijar
Copy link
Member Author

aamijar commented Jun 3, 2025

Adding @rhdong as a reviewer since he worked on half types for the other distances #225

@cjnolet
Copy link
Member

cjnolet commented Jun 3, 2025

@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?

@aamijar
Copy link
Member Author

aamijar commented Jun 4, 2025

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

@bdice
Copy link
Contributor

bdice commented Jun 5, 2025

@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

@aamijar
Copy link
Member Author

aamijar commented Jun 5, 2025

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.

Copy link
Member

@rhdong rhdong left a comment

Choose a reason for hiding this comment

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

LGTM

@divyegala
Copy link
Member

@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?

@aamijar
Copy link
Member Author

aamijar commented Jul 8, 2025

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

--- 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 aamijar changed the base branch from branch-25.08 to main November 5, 2025 00:29
@csadorf
Copy link
Contributor

csadorf commented Nov 19, 2025

Is this still targeting 25.12?

Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

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

All new files added via this PR need to use the SPDX header format now

@aamijar
Copy link
Member Author

aamijar commented Nov 19, 2025

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

@aamijar
Copy link
Member Author

aamijar commented Dec 16, 2025

I've removed the cutlass operator and the binary size looks like this now:

CUDA 12

--- Added Files ---
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_double_double_double_int.cu.o: 651.816 KB
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_float_float_float_int.cu.o: 1.186 MB
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_half_float_float_int.cu.o: 2.010 MB

CUDA 13

--- Added Files ---
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_double_double_double_int.cu.o: 454.032 KB
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_float_float_float_int.cu.o: 770.896 KB
[+] CMakeFiles/cuvs_objs.dir/src/distance/detail/pairwise_matrix/dispatch_dice_half_float_float_int.cu.o: 1.143 MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake cpp feature request New feature or request non-breaking Introduces a non-breaking change

Projects

Development

Successfully merging this pull request may close these issues.

[FEA] Move dice dense distance from raft and support for half types

7 participants