open-mmlab / OpenPCDet

OpenPCDet Toolbox for LiDAR-based 3D Object Detection.
Apache License 2.0
4.72k stars 1.31k forks source link

fast vector operation for pillar scatter #1676

Open dmund95 opened 3 weeks ago

dmund95 commented 3 weeks ago

This PR introduces fast vector operations for pillar scatter module. The for loop in exisiting module make model forward very slow. Especially with larger batch sizes.

The code has been tested to check for equal outputs before and after the changes and included in this PR

latency experiments:

  1. forward times as a function of batch_size

image

  1. Overall training time before and after the change

Before -> Average per iteration training time ~2.9sec

image

After -> Average per iteration training time ~1.9sec

image

The training time per iteration reduces by 35% with this PR (for my set of parameters / dataset)