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

Generalized Sparse Convolution #77

Merged
merged 19 commits into from
Jun 21, 2021
Merged

Conversation

kentang-mit
Copy link
Collaborator

In this PR we implement the generalized sparse convolution operation. This operation mainly differs from the current sparse convolution in downsampling stage with kernel_size not equal to stride. The output will be dilated (similar to strided nn.Conv3d) and is not calculated with c_out = torch.floor(c_in // 2) * 2. Besides, we also added support for asymmetric convolutional kernel sizes and strides.

Copy link
Collaborator

@CCInc CCInc left a comment

Choose a reason for hiding this comment

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

Great work! I will take a closer look more this week and test it.

I was wondering, will this make cpp functions like convert_map_forward and insertion_forward obsolete? Unless maybe somebody is using torchsparse.nn.functional.voxelize outside of torchsparse.nn.functional.downsample for some reason? We might want to see if we can remove these

torchsparse/nn/functional/convert_neighbor_map.py Outdated Show resolved Hide resolved
Copy link

@zhijian-liu zhijian-liu left a comment

Choose a reason for hiding this comment

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

Thanks! It looks good to me overall.

torchsparse/nn/functional/conv.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/convert_neighbor_map.py Outdated Show resolved Hide resolved
torchsparse/nn/modules/conv.py Outdated Show resolved Hide resolved
torchsparse/utils/kernel_region.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/convert_neighbor_map.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/downsample.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/conv.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/conv.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/conv.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/convert_neighbor_map.py Outdated Show resolved Hide resolved
CCInc
CCInc previously approved these changes Jun 14, 2021
Copy link
Collaborator

@CCInc CCInc left a comment

Choose a reason for hiding this comment

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

The code looks good to me! And it's much cleaner than the code on master which is great.

I haven't tested the code but I assume you checked it on different stride/kernel configs and it worked as expected?

torchsparse/nn/functional/conv.py Outdated Show resolved Hide resolved
zhijian-liu
zhijian-liu previously approved these changes Jun 19, 2021
Copy link

@zhijian-liu zhijian-liu left a comment

Choose a reason for hiding this comment

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

LGTM.

torchsparse/src/interpolation/devox_cpu.cpp Outdated Show resolved Hide resolved
torchsparse/src/interpolation/devox_deterministic.cpp Outdated Show resolved Hide resolved
torchsparse/sparse_tensor.py Outdated Show resolved Hide resolved
torchsparse/sparse_tensor.py Outdated Show resolved Hide resolved
torchsparse/nn/functional/squeeze_nmap.py Outdated Show resolved Hide resolved
torchsparse/utils/kernel_region.py Show resolved Hide resolved
torchsparse/utils/kernel_region.py Outdated Show resolved Hide resolved
torchsparse/utils/kernel_region.py Show resolved Hide resolved
torchsparse/utils/kernel_region.py Show resolved Hide resolved
torchsparse/nn/modules/conv.py Outdated Show resolved Hide resolved
zhijian-liu
zhijian-liu previously approved these changes Jun 21, 2021
@zhijian-liu zhijian-liu merged commit 313c9b0 into master Jun 21, 2021
@zhijian-liu zhijian-liu deleted the dev/generalized_sparseconv branch June 24, 2021 04:05
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.

None yet

3 participants