Skip to content

Add binary_mult and const fixes for ratio and sqrt apis#2940

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
aamijar:fix-const-sqrt
Feb 11, 2026
Merged

Add binary_mult and const fixes for ratio and sqrt apis#2940
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
aamijar:fix-const-sqrt

Conversation

@aamijar

@aamijar aamijar commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

This PR does the following:

  1. Adds a mdspan api binary_mult for matrixVectorBinaryMult and corresponding gtests.
  2. Fixes a bug where the seqRoot api does not have a const qualifier for the input (the wrapper mdspan api sqrt has a const input which causes the bug)
  3. Fixes a bug where the ratio api does not have a const qualifier for the input (the wrapper mdspan api ratio has a const input which causes the bug)
  4. Fix to use the correct include in sqrt.cuh and ratio.cuh.
    #include <raft/matrix/detail/math.cuh> instead of #include <raft/matrix/detail/matrix.cuh>

@aamijar aamijar requested a review from a team as a code owner February 3, 2026 09:14
@aamijar aamijar added bug Something isn't working non-breaking Non-breaking change labels Feb 3, 2026
@aamijar aamijar self-assigned this Feb 3, 2026
@aamijar aamijar moved this to In Progress in Unstructured Data Processing Feb 3, 2026

@viclafargue viclafargue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! But, could you add some tests in matrix_vector_op.cu?

@aamijar

aamijar commented Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

LGTM! But, could you add some tests in matrix_vector_op.cu?

Thanks for the review @viclafargue! I've added the new gtests for binary_mult in matrix_vector.cu as that's where it seems the other binary tests are such as binary_mult_skip_zero are located.

@viclafargue viclafargue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, looks great!

@divyegala

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot rapids-bot Bot merged commit a9323ba into NVIDIA:main Feb 11, 2026
77 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Unstructured Data Processing Feb 11, 2026
rapids-bot Bot pushed a commit to rapidsai/cuml that referenced this pull request Feb 13, 2026
Depends on NVIDIA/raft#2940. Resolves #7750.

This PR does the following:
1. Decompose usage of `#include <raft/matrix/math.cuh>` into necessary required headers such as:
```cpp
#include <raft/linalg/matrix_vector.cuh>
#include <raft/linalg/power.cuh>
#include <raft/linalg/sqrt.cuh> 
#include <raft/matrix/threshold.cuh>
#include <raft/matrix/ratio.cuh>
#include <raft/matrix/copy.cuh>
```
2. Use the new mdspan apis.
3. Use a new handle per stream where necessary. This is because the mdspan apis accept handle and not stream.

Authors:
  - Anupam (https://github.com/aamijar)

Approvers:
  - Victor Lafargue (https://github.com/viclafargue)

URL: #7752
dantegd added a commit to dantegd/cuml that referenced this pull request Feb 17, 2026
Depends on NVIDIA/raft#2940. Resolves rapidsai#7750.

This PR does the following:
1. Decompose usage of `#include <raft/matrix/math.cuh>` into necessary required headers such as:
```cpp
#include <raft/linalg/matrix_vector.cuh>
#include <raft/linalg/power.cuh>
#include <raft/linalg/sqrt.cuh>
#include <raft/matrix/threshold.cuh>
#include <raft/matrix/ratio.cuh>
#include <raft/matrix/copy.cuh>
```
2. Use the new mdspan apis.
3. Use a new handle per stream where necessary. This is because the mdspan apis accept handle and not stream.

Authors:
  - Anupam (https://github.com/aamijar)

Approvers:
  - Victor Lafargue (https://github.com/viclafargue)

URL: rapidsai#7752
rapids-bot Bot pushed a commit that referenced this pull request Feb 23, 2026
Depends on NVIDIA/cuvs#1763. Resolves #2937

This PR does the following:
1. Removes files with the following message
```cpp
#ifndef RAFT_HIDE_DEPRECATION_WARNINGS
#pragma message(__FILE__                                                  \
                " is deprecated and will be removed in a future release." \
                " Please use the raft/sparse/solver version instead.")
#endif
```
2. Removes files with the following message
```cpp
/**
 * This file is deprecated and will be removed in a future release.
 */
```
3. Pulls from correct non-deprecated headers like using`raft/util/cudart_utils.cuh` instead of `raft/core/cudart_utils.cuh`
4. Pulls correct functionality from non-deprecated headers like using `raft/linalg/matrix_vector.cuh` instead of `raft/matrix/math.cuh`. This requires using the newer mdspan based apis.
5. Consolidates `gemm.cuh` and `gemm.hpp` into just `gemm.cuh`

**Update:**
There were a couple of fixes included in this PR that I have decoupled. Instead those fixes should be merged in #2940.
This will allow us to unravel the merging sequence better to avoid breaking changes altogether. Still marking this PR as breaking for awareness purposes.
After merging #2940, the cuml side and cuvs side can be updated to use the non-deprecated apis. Then we can merge this raft PR to remove the deprecated and unused headers.

**Update:**
There are a couple of breaking changes that affect cugraph and cuopt, so we will need to merge fixes for those first.

**Merging sequence:**
#2940 -> NVIDIA/cuvs#1763 -> rapidsai/cuml#7752 -> rapidsai/cuml#7797 -> rapidsai/cugraph#5429 -> NVIDIA/cuopt#865 -> #2939

**Downstream libraries CI status:**
cuvs: 🟢
cuml: 🟢
cugraph: 🟢
cuopt: 🟢

Authors:
  - Anupam (https://github.com/aamijar)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Divye Gala (https://github.com/divyegala)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #2939
Kaweees pushed a commit to Kaweees/cuml that referenced this pull request May 8, 2026
Depends on NVIDIA/raft#2940. Resolves rapidsai#7750.

This PR does the following:
1. Decompose usage of `#include <raft/matrix/math.cuh>` into necessary required headers such as:
```cpp
#include <raft/linalg/matrix_vector.cuh>
#include <raft/linalg/power.cuh>
#include <raft/linalg/sqrt.cuh> 
#include <raft/matrix/threshold.cuh>
#include <raft/matrix/ratio.cuh>
#include <raft/matrix/copy.cuh>
```
2. Use the new mdspan apis.
3. Use a new handle per stream where necessary. This is because the mdspan apis accept handle and not stream.

Authors:
  - Anupam (https://github.com/aamijar)

Approvers:
  - Victor Lafargue (https://github.com/viclafargue)

URL: rapidsai#7752
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants