Skip to content

[FEA] Matrix column shift #2634

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

Open
wants to merge 10 commits into
base: branch-25.06
Choose a base branch
from
Open

Conversation

jinsolp
Copy link
Contributor

@jinsolp jinsolp commented Apr 15, 2025

Implementation for in-place row or column shifting for matrices.

Currently needed for the case where we need to add a self loop in a knn graph.

@jinsolp jinsolp requested review from a team as code owners April 15, 2025 22:45
Copy link

copy-pr-bot bot commented Apr 15, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@jinsolp jinsolp added enhancement New feature or request feature request New feature or request non-breaking Non-breaking change and removed enhancement New feature or request labels Apr 15, 2025
* @param[in] k: shift size
*/
template <typename math_t, typename matrix_idx_t>
void col_right_shift(raft::resources const& handle,
Copy link
Member

Choose a reason for hiding this comment

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

This naming is a bit confusing. Could we please instead have a "shift" function with an enum for "Direction::Left", "Direction::Right" and maybe use another enum for ShiftType::Row/ShiftType::Column? That would clean this up and minimize the number of free functions the user has to worry about invoking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestion, totally agree.
We have towards_end and towards_zero as the shift direction because left/right doesn't work with row shifting.

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 Non-breaking change
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants