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

Improve performance of Tensorflow and PyTorch modules #3550

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

stotko
Copy link
Contributor

@stotko stotko commented Jun 7, 2021

Retrieving properties from Tensorflow and Pytorch in our find modules is expensive because calling Python and importing either of them comes with a significant cost. Improve the performance by fetching all required properties in a single pass instead of 1 property per pass:

time cmake -DCMAKE_INSTALL_PREFIX=../bin -DBUILD_CUDA_MODULE=ON -DBUILD_UNIT_TESTS=ON -DBUILD_BENCHMARKS=ON -DBUILD_PYTORCH_OPS=ON -DBUILD_TENSORFLOW_OPS=ON -DBUNDLE_OPEN3D_ML=ON -DOPEN3D_ML_ROOT=../../Open3D-ML -DOPEN3D_THIRD_PARTY_DOWNLOAD_DIR=~/workspace/open3d-downloads -DBUILD_JUPYTER_EXTENSION=ON -DBUILD_RPC_INTERFACE=ON -DBUILD_LIBREALSENSE=ON -DBUILD_AZURE_KINECT=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..

Before

real 0m19,039s
user 0m21,909s
sys 0m22,577s

After

real 0m9,561s
user 0m8,882s
sys 0m6,575s

In a future PR, the performance could be improved even further by only calling the find modules once instead of twice.


This change is Reviewable

@stotko stotko requested a review from benjaminum June 7, 2021 15:04
@update-docs
Copy link

update-docs bot commented Jun 7, 2021

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

Copy link
Contributor

@benjaminum benjaminum left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @stotko)

@yxlao yxlao merged commit bad073b into master Jun 8, 2021
@yxlao yxlao deleted the stotko/tensorflow-pytorch-find-performance branch June 8, 2021 02:46
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