-
Notifications
You must be signed in to change notification settings - Fork 109
Instantiate only specific RAFT linewise kernels #1018
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
base: branch-25.08
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2020-2024, NVIDIA CORPORATION. | ||
* Copyright (c) 2020-2025, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -199,15 +199,13 @@ void kmeansPlusPlus(raft::resources const& handle, | |
// Outputs minDistanceBuf[n_trials x n_samples] where minDistance[i, :] contains updated | ||
// minClusterDistance that includes candidate-i | ||
auto minDistBuf = distBuffer.view(); | ||
raft::linalg::matrixVectorOp(minDistBuf.data_handle(), | ||
pwd.data_handle(), | ||
minClusterDistance.data_handle(), | ||
pwd.extent(1), | ||
pwd.extent(0), | ||
true, | ||
true, | ||
raft::min_op{}, | ||
stream); | ||
raft::linalg::matrixVectorOp<true, true>(minDistBuf.data_handle(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC the camel case one was being deprecated? Looks like we are using both -- There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure sounds good |
||
pwd.data_handle(), | ||
minClusterDistance.data_handle(), | ||
pwd.extent(1), | ||
pwd.extent(0), | ||
raft::min_op{}, | ||
stream); | ||
|
||
// Calculate costPerCandidate[n_trials] where costPerCandidate[i] is the cluster cost when using | ||
// centroid candidate-i | ||
|
@@ -325,15 +323,13 @@ void update_centroids(raft::resources const& handle, | |
// weight_per_cluster[n_clusters] - 1D array, weight_per_cluster[i] contains sum of weights in | ||
// cluster-i. | ||
// Note - when weight_per_cluster[i] is 0, new_centroids[i] is reset to 0 | ||
raft::linalg::matrixVectorOp(new_centroids.data_handle(), | ||
new_centroids.data_handle(), | ||
weight_per_cluster.data_handle(), | ||
new_centroids.extent(1), | ||
new_centroids.extent(0), | ||
true, | ||
false, | ||
raft::div_checkzero_op{}, | ||
raft::resource::get_cuda_stream(handle)); | ||
raft::linalg::matrixVectorOp<true, false>(new_centroids.data_handle(), | ||
new_centroids.data_handle(), | ||
weight_per_cluster.data_handle(), | ||
new_centroids.extent(1), | ||
new_centroids.extent(0), | ||
raft::div_checkzero_op{}, | ||
raft::resource::get_cuda_stream(handle)); | ||
|
||
// copy centroids[i] to new_centroids[i] when weight_per_cluster[i] is 0 | ||
cub::ArgIndexInputIterator<DataT*> itr_wt(weight_per_cluster.data_handle()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert later