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

[Enhancement] faster but nondeterministic version of hard voxelization #904

Merged
merged 7 commits into from
Sep 17, 2021
Merged

[Enhancement] faster but nondeterministic version of hard voxelization #904

merged 7 commits into from
Sep 17, 2021

Conversation

zhanggefan
Copy link
Contributor

@zhanggefan zhanggefan commented Sep 1, 2021

Small enhancement -- reimplement hard voxelization and make it faster at the cost of deterministic property

It is now an optional feature and is disabled by default. Set deterministic=False inside Voxelization config to enable it. It only works for hard voxelization and has no effect when using dynamic voxelization.

Performance comparison:

conf training iter time tested on iter time before iter time after
pointpillars-kitti-3class 2080Ti
bs=6
0.340 0.303
pointpillars-kitti-car 2080Ti
bs=6
0.281 0.246
pointpillars-waymo-3class 3090
bs=2
0.412 0.296
pointpillars-waymo-car 3090
bs=2
0.365 0.237
centerpoint-pillar0.2-nuscenes 3090
bs=4
0.858 0.441
centerpoint-pillar0.2-nuscenes 3090
bs=8
1.681 0.832
centerpoint-voxel0.075-nuscenes 3090
bs=4
1.638 1.212

Score comparison with MMDet3D Original (May Not Precise!!!!! I also made a lot of code revisions besides voxelization and I messed them up)

conf training on score of this version score by MMDet3D
pointpillars-kitti-3class 3090*4
bs=12
mAP=61.3359 mAP=59.5
pointpillars-kitti-car 3090*4
bs=12
mAP=76.7144 mAP=77.1
pointpillars-waymo-3class 3090*4
bs=8 fp16
L1-mAP=70.04
L1-mAPH=63.94
L2-mAP=63.62
L2-mAPH=58.08
L1-mAP=68.843
L1-mAPH=63.318
L2-mAP=62.619
L2-mAPH=57.573
centerpoint-pillar0.2-nuscenes 3090*4
bs=8
mAP=49.43
NDS=60.14
mAP=49.07
NDS=59.66

@zhanggefan
Copy link
Contributor Author

Seems something went wrong with your CICD pipeline when building MMCV exts

@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #904 (72c0541) into master (2efdb6b) will increase coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #904   +/-   ##
=======================================
  Coverage   49.33%   49.33%           
=======================================
  Files         210      210           
  Lines       16021    16023    +2     
  Branches     2556     2556           
=======================================
+ Hits         7904     7905    +1     
- Misses       7614     7615    +1     
  Partials      503      503           
Flag Coverage Δ
unittests 49.33% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdet3d/ops/voxel/voxelize.py 80.76% <50.00%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2efdb6b...72c0541. Read the comment docs.

@ZwwWayne
Copy link
Collaborator

ZwwWayne commented Sep 2, 2021

Hi @zhanggefan ,
Thanks for the efforts. Faster implementation of voxelization is definitely beneficial to the model training and testing with MMDetection3D. For completeness, shall we also leave a comparison of accuracy in this PR? For example, it is better to leave a table to compare the AP of a similar model as a reference, and we may also leave more detailed comments to indicate why it is faster but non-deterministic in the code and documentation.

@zhanggefan
Copy link
Contributor Author

zhanggefan commented Sep 3, 2021

Hi, @ZwwWayne
This PR is related to issue #894. Some details of the implementation can be found there.
The score comparison table is added in the PR description now. It may not be precise!!! Because I made many code optimizations(to improve the training speed, but I cannot guarantee that they have no impact on scores) and the voxelization is just one of them.

@ZwwWayne
Copy link
Collaborator

ZwwWayne commented Sep 7, 2021

Hi, @ZwwWayne
This PR is related to issue #894. Some details of the implementation can be found there.
The score comparison table is added in the PR description now. It may not be precise!!! Because I made many code optimizations(to improve the training speed, but I cannot guarantee that they have no impact on scores) and the voxelization is just one of them.

I see. Can we refer to this PR and issue #894 in the docstring of the module? So that future developers could know the trade-off and discussion. Furthermore, we also welcome you to create PRs for optimization to improve the training speed.

@zhanggefan
Copy link
Contributor Author

Docstring is revised. Besides, a bug similar to #768 in the previous commit is fixed.

@ZwwWayne ZwwWayne merged commit 234bf97 into open-mmlab:master Sep 17, 2021
@zhanggefan zhanggefan deleted the nondeterministic_hv branch September 25, 2021 11:42
tpoisonooo pushed a commit to tpoisonooo/mmdetection3d that referenced this pull request Sep 5, 2022
* init

* update UT

* fix UT except SAR

* update to latest 2.0

* fix ncnn UT

* export info
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.

2 participants