Skip to content
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

Standardize the sample format to CSR sparse tensor. #200

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

liruilong940607
Copy link
Collaborator

@liruilong940607 liruilong940607 commented Apr 11, 2023

I recently realize that the current way of using the packed_info to represent sparse samples along rays, is very similar to the standard CSR sparse matrix formula, but not entirely the same. And various toolboxes either already or on the way to support this formula with operations, including:

So it would be great to switch to the standard CSR formula in this repo as well, to benefit from the existing and future supports in the PyTorch community.

For example, the conversion between packed_info and ray_indices were required some CUDA programming, but with CSR formula it is already supported by torch_scatter.segment_csr and torch_scatter.gather_csr.

Also, hopefully it will be less difficult for users to get hands on using this repo, when it comes to understanding how batched data is packed. Following the CSR standard there would be tones of tutorial / docs users can refer to, and for users that are already familiar with CSR sparse matrix there will be zero learning curve.

However, this would inevitably leads to some API changes, which we want to minimize as we go.

This PR is to start a trial on the migration and see how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants