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

feat(trtexec_vendor): add vendor package for trtexec #1821

Merged
merged 5 commits into from
Sep 16, 2022

Conversation

wep21
Copy link
Contributor

@wep21 wep21 commented Sep 9, 2022

Description

a vendor package for trtexec

Related links

Tests performed

Please check if you can build tensorrt engine from onnx file with trtexec

colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release  --symlink-install --continue-on-error --packages-up-to trtexec_vendor lidar_centerpoint
source install/setup.bash
trtexec --onnx=$(ros2 pkg prefix lidar_centerpoint --share)/data/pts_backbone_neck_head_centerpoint.onnx --shapes=spatial_features:1x32x560x560 --saveEngine=$(ros2 pkg prefix lidar_centerpoint --share)/data/pts_backbone_neck_head_centerpoint.engine --buildOnly

Notes for reviewers

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@wep21 wep21 force-pushed the feature/trtexec_vendor branch from b509460 to 11cfd53 Compare September 9, 2022 02:16
@kenji-miyake
Copy link
Contributor

kenji-miyake commented Sep 9, 2022

If you plan to release this package, I think it's better to manage this package in a separate repository and add it to build_depends.repos.
@wep21 Could you tell me your thought about it?
cc @xmfcx @mitsudome-r @yukkysaito

@wep21 wep21 force-pushed the feature/trtexec_vendor branch from 11cfd53 to e466bec Compare September 9, 2022 02:58
@wep21 wep21 marked this pull request as draft September 9, 2022 08:07
@wep21 wep21 force-pushed the feature/trtexec_vendor branch 2 times, most recently from 3939184 to 17db227 Compare September 10, 2022 15:23
@wep21
Copy link
Contributor Author

wep21 commented Sep 10, 2022

@kenji-miyake I won't make this package released because ros build farm cannot handle cuda libraries.
I will create a separate repository if it is preferable.

@wep21 wep21 marked this pull request as ready for review September 10, 2022 15:32
@wep21 wep21 force-pushed the feature/trtexec_vendor branch from 17db227 to 532f70f Compare September 10, 2022 15:33
@codecov
Copy link

codecov bot commented Sep 10, 2022

Codecov Report

Base: 10.45% // Head: 10.44% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (51d1eab) compared to base (03b4741).
Patch has no changes to coverable lines.

❗ Current head 51d1eab differs from pull request most recent head a2e8969. Consider uploading reports for the commit a2e8969 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1821      +/-   ##
==========================================
- Coverage   10.45%   10.44%   -0.02%     
==========================================
  Files        1231     1221      -10     
  Lines       87879    87744     -135     
  Branches    20501    20498       -3     
==========================================
- Hits         9191     9164      -27     
+ Misses      69175    69106      -69     
+ Partials     9513     9474      -39     
Flag Coverage Δ *Carryforward flag
differential ∅ <ø> (?)
total 10.42% <ø> (-0.02%) ⬇️ Carriedforward from fb01e98

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...n/motion_utils/test/src/resample/test_resample.cpp 25.66% <0.00%> (-0.28%) ⬇️
...ils/include/motion_utils/trajectory/trajectory.hpp 78.81% <0.00%> (-0.11%) ⬇️
perception/tensorrt_yolo/src/nodelet.cpp 0.00% <0.00%> (ø)
perception/lidar_centerpoint/src/node.cpp 0.00% <0.00%> (ø)
control/shift_decider/src/shift_decider.cpp 0.00% <0.00%> (ø)
planning/route_handler/src/route_handler.cpp 0.00% <0.00%> (ø)
planning/rtc_interface/src/rtc_interface.cpp 0.00% <0.00%> (ø)
perception/tensorrt_yolo/lib/src/trt_yolo.cpp 0.00% <0.00%> (ø)
localization/ekf_localizer/src/ekf_localizer.cpp 0.00% <0.00%> (ø)
planning/obstacle_avoidance_planner/src/node.cpp 0.00% <0.00%> (ø)
... and 119 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kenji-miyake
Copy link
Contributor

kenji-miyake commented Sep 10, 2022

@wep21 I see, thanks!
Considering that CUDA is only used in autoware.universe, I feel it's reasonable to manage this package in this repository. 👍

If it's okay for @yukke42, I think you can merge this.

@yukke42
Copy link
Contributor

yukke42 commented Sep 14, 2022

I have checked that almost the same performance is reproduced using engine files built with the following trtexec command.

trtexec \
    --onnx=$(ros2 pkg prefix lidar_centerpoint --share)/data/pts_voxel_encoder_centerpoint.onnx \
    --saveEngine=$(ros2 pkg prefix lidar_centerpoint --share)/data/pts_voxel_encoder_centerpoint.engine \
    --shapes=input_features:40000x32x9 \
    --optShapes=input_features:40000x32x9 \
    --workspace=1024 \
    --fp16 \
    --buildOnly

trtexec \
    --onnx=$(ros2 pkg prefix lidar_centerpoint --share)/data/pts_backbone_neck_head_centerpoint.onnx \
    --saveEngine=$(ros2 pkg prefix lidar_centerpoint --share)/data/pts_backbone_neck_head_centerpoint.engine \
    --shapes=spatial_features:1x32x560x560 \
    --optShapes=spatial_features:1x32x560x560 \
    --workspace=1024 \
    --fp16 \
    --buildOnly

But, it takes more than 3 times than the lidar_centerpoint package implementation to build two TensorRT engine files.
lidar_centerpoint package: about 1 min
trtexec: about 3 min 30 sec

@yukke42 yukke42 added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Sep 14, 2022
Daisuke Nishimatsu and others added 5 commits September 16, 2022 00:52
Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
@wep21 wep21 force-pushed the feature/trtexec_vendor branch from 294cd19 to a2e8969 Compare September 15, 2022 15:52
Copy link
Contributor

@yukke42 yukke42 left a comment

Choose a reason for hiding this comment

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

I have checked that trtexec can convert onnx files and lidar_centerpoint can load engine files.

@wep21 wep21 merged commit 7780879 into main Sep 16, 2022
@wep21 wep21 deleted the feature/trtexec_vendor branch September 16, 2022 01:00
@shmpwk shmpwk mentioned this pull request Sep 16, 2022
3 tasks
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Sep 28, 2022
…ion#1821)

* feat(trtexec_vendor): add vendor package for trtexec

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* support the previous CUDA environemt

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* remove required for nvidia libraries

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* add sampleUtils.cpp if trt version is greater than 8.4

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* do not install trt submodules

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Oct 3, 2022
…ion#1821)

* feat(trtexec_vendor): add vendor package for trtexec

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* support the previous CUDA environemt

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* remove required for nvidia libraries

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* add sampleUtils.cpp if trt version is greater than 8.4

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* do not install trt submodules

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Oct 3, 2022
…ion#1821)

* feat(trtexec_vendor): add vendor package for trtexec

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* support the previous CUDA environemt

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* remove required for nvidia libraries

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* add sampleUtils.cpp if trt version is greater than 8.4

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* do not install trt submodules

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Oct 19, 2022
…ion#1821)

* feat(trtexec_vendor): add vendor package for trtexec

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* support the previous CUDA environemt

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* remove required for nvidia libraries

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* add sampleUtils.cpp if trt version is greater than 8.4

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* do not install trt submodules

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
11Takanori pushed a commit to 11Takanori/autoware.universe that referenced this pull request Dec 5, 2022
…ion#1821)

* feat(trtexec_vendor): add vendor package for trtexec

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* support the previous CUDA environemt

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* remove required for nvidia libraries

Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>

* add sampleUtils.cpp if trt version is greater than 8.4

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* do not install trt submodules

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants