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

Add API: Sparse Convolution3D #41434

Merged
merged 25 commits into from Apr 15, 2022
Merged

Conversation

zkh2016
Copy link
Contributor

@zkh2016 zkh2016 commented Apr 6, 2022

PR types

New features

PR changes

APIs

Describe

  1. 新增API:paddle.sparse.Conv3D
  2. 新增API:paddle.sparse.SubmConv3D
  3. 修复反向计算错误问题
  4. 优化submanifold conv的性能
  5. 当前限制:
    • 只支持layout="NDHWC"
    • 还不支持bias(等另一个PR#41586合入后可以在python端调用elementwise_add实现)
    • 支持groups=1
    • subm_conv3d要求输入indices是有序的。

使用例子:

import paddle
from paddle.fluid.framework import _test_eager_guard

with _test_eager_guard():
  indices = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 2], [1, 3, 2, 3]]
  values = [[1], [2], [3], [4]]
  dense_shape = [1, 1, 3, 4, 1]
  sparse_x = paddle.sparse.sparse_coo_tensor(indices, values, dense_shape, stop_gradient=True)
  conv = paddle.sparse.Conv3D(1, 1, (1, 3, 3))
  y = conv(sparse_x)
  print(y.shape)
  # (1, 1, 1, 2, 1)

英文文档:
image
image
image
image

@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 6, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@zkh2016 zkh2016 changed the title Sparse Convolution 【WIP】Sparse Convolution Apr 8, 2022
@zkh2016 zkh2016 changed the title 【WIP】Sparse Convolution Add API: Sparse Convolution Apr 11, 2022
python/paddle/fluid/dygraph/varbase_patch_methods.py Outdated Show resolved Hide resolved
python/paddle/fluid/dygraph/varbase_patch_methods.py Outdated Show resolved Hide resolved
python/paddle/fluid/dygraph/varbase_patch_methods.py Outdated Show resolved Hide resolved
python/paddle/fluid/dygraph/varbase_patch_methods.py Outdated Show resolved Hide resolved
python/paddle/sparse/functional/conv.py Outdated Show resolved Hide resolved
python/paddle/sparse/functional/conv.py Show resolved Hide resolved
python/paddle/sparse/layer/conv.py Outdated Show resolved Hide resolved
python/paddle/sparse/layer/conv.py Show resolved Hide resolved
python/paddle/sparse/layer/conv.py Outdated Show resolved Hide resolved
@zkh2016 zkh2016 changed the title Add API: Sparse Convolution Add API: Sparse Convolution3D Apr 12, 2022
xingfeng01
xingfeng01 previously approved these changes Apr 13, 2022
TCChenlong
TCChenlong previously approved these changes Apr 14, 2022
Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM

@zkh2016 zkh2016 dismissed stale reviews from TCChenlong and xingfeng01 via 0768215 April 14, 2022 06:13
@zkh2016 zkh2016 changed the title Add API: Sparse Convolution3D Add API: Sparse Convolution3D Apr 15, 2022
@zkh2016 zkh2016 closed this Apr 15, 2022
@zkh2016 zkh2016 reopened this Apr 15, 2022
@zkh2016 zkh2016 merged commit 1665594 into PaddlePaddle:develop Apr 15, 2022
@zkh2016 zkh2016 deleted the sparse_python branch August 19, 2022 04:02
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

4 participants