COO input for lanczos solver should be sorted

Open
#2,874 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@aamijar is already working on this.

Since Nov 19, 2025.

Assessment

This issue has not been assessed yet.

Description

documentation

While working on https://github.com/rapidsai/cuml/issues/7225 and with the new COO input support recently introduced in the lanczos solver https://github.com/rapidsai/raft/issues/2832 I came across a important constraint that the COO input must be sorted.

This was a very tricky bug to catch since a COO sparse matrix represents the same underlying matrix whether it is sorted or not. However when running the lanczos solver on an unsorted coo input it would not give good results.
Upon investigating this further I saw that cusparse COO formats actually make the following a requirement
https://docs.nvidia.com/cuda/cusparse/#coordinate-coo

The COO format is assumed to be sorted by row.

However the columns within each row do not need to be sorted.

cuSPARSE supports both sorted and unsorted column indices within a given row.

Since the lanczos solver uses cusparse under the hood we should clearly document that the input should be sorted in the public function header.

Dominant language
Cuda
Stars
1.1k
Forks
260
Avg merge
1d 18h
Merged PRs (30d)
21

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/raft

All issues in NVIDIA/raft

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.