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

refactor: update TRT build log #6117

Merged
merged 11 commits into from
Jan 29, 2024

Conversation

ktro2828
Copy link
Contributor

@ktro2828 ktro2828 commented Jan 19, 2024

Description

This PR updates to use throttle logging while building TRT engine from onnx every 5 seconds.

The target packages are as follows.

  • lidar_centerpoint( & pointpainting)
  • lidar_apollo_instance_segmentation
  • tensorrt_yolo
  • tensorrt_yolox
  • traffic_light_classifier
  • traffic_light_fine_detector
  • traffic_light_ssd_fine_detector

Sample usage

#include <tensorrt_common/logger.hpp>

{
  tensorrt_common::Logger logger;

  // throttle logging every 1 sec
  auto log_thread = logger.log_throttle(nvinfer1::ILogger::Severity::kINFO, "SOME MESSAGE", 1);
  /* SOME OPERATION */
  logger.stop_throttle(log_thread);
}

Tests performed

vokoscreenNG-2024-01-19_14-46-04.mp4

Effects on system behavior

Not applicable.

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.

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.

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

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:common Common packages from the autoware-common repository. (auto-assigned) labels Jan 19, 2024
@ktro2828 ktro2828 assigned ktro2828 and unassigned ktro2828 Jan 19, 2024
@miursh miursh added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jan 19, 2024
Copy link

codecov bot commented Jan 20, 2024

Codecov Report

Attention: 53 lines in your changes are missing coverage. Please review.

Comparison is base (1c4c3e3) 14.57% compared to head (449edae) 14.56%.

Files Patch % Lines
...lidar_centerpoint/lib/network/tensorrt_wrapper.cpp 0.00% 14 Missing ⚠️
...tensorrt_common/include/tensorrt_common/logger.hpp 0.00% 13 Missing ⚠️
perception/tensorrt_yolo/lib/src/trt_yolo.cpp 0.00% 12 Missing ⚠️
...raffic_light_ssd_fine_detector/lib/src/trt_ssd.cpp 0.00% 12 Missing ⚠️
common/tensorrt_common/src/tensorrt_common.cpp 0.00% 1 Missing ⚠️
...tion/lidar_centerpoint/lib/network/network_trt.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6117      +/-   ##
==========================================
- Coverage   14.57%   14.56%   -0.01%     
==========================================
  Files        1874     1874              
  Lines      127671   127706      +35     
  Branches    37317    37317              
==========================================
  Hits        18605    18605              
- Misses      88145    88180      +35     
  Partials    20921    20921              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 14.57% <ø> (+<0.01%) ⬆️ Carriedforward from 1c4c3e3

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@manato
Copy link
Contributor

manato commented Jan 22, 2024

@ktro2828
Thank you very much for the improvement. The modification to notify users that tensorrt-related operations are in progress looks user-friendly.
One quick question: It looks you have replaced some RCLCPP_ERROR into tensorrt_common::LOG_ERROR (like this). Do you have intention regarding this replacement?

@ktro2828
Copy link
Contributor Author

@manato

One quick question: It looks you have replaced some RCLCPP_ERROR into tensorrt_common::LOG_ERROR (like this). Do you have intention regarding this replacement?

Thanks your comment.
Because the classes containing these replacements are not ROS nodes but just TensorRT library classes I think it is better to use TensorRT logging operation.

@manato
Copy link
Contributor

manato commented Jan 22, 2024

@ktro2828
Thank you for the prompt response.

One quick question: It looks you have replaced some RCLCPP_ERROR into tensorrt_common::LOG_ERROR (like this). Do you have intention regarding this replacement?

Thanks your comment. Because the classes containing these replacements are not ROS nodes but just TensorRT library classes I think it is better to use TensorRT logging operation.

I completely agree with your opinion. Thanks for clarifying.
Besides, I've tested the behavior by ros2 launch tensorrt_yolox yolox.launch.xml and confirmed the PR looks working as expected.

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@miursh
Copy link
Contributor

miursh commented Jan 25, 2024

@ktro2828
I could not find the message in traffic_light_fine_detector.
Could you take a look at this?

centerpoint: LGTM
image

pointpainting: LGTM
image

apollo: LGTM
image

yolo: LGTM
image

yolox: LGTM
image

traffic_light_classifier: LGTM
image

traffic_light_fine_detector
image

traffic_light_ssd_fine_detector: LGTM
image

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@ktro2828
Copy link
Contributor Author

@miursh Thanks for your review.

I found missing to update the log output setting in launcher. I added output="screen" in a9e7b2d

  • before

Screenshot from 2024-01-25 11-50-14

  • after

Screenshot from 2024-01-25 11-44-58

Copy link
Contributor

@miursh miursh left a comment

Choose a reason for hiding this comment

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

Thanks!
LGTM

@ktro2828 ktro2828 enabled auto-merge (squash) January 26, 2024 02:57
@miursh miursh merged commit 6835bc4 into autowarefoundation:main Jan 29, 2024
20 of 24 checks passed
anhnv3991 pushed a commit to anhnv3991/autoware.universe that referenced this pull request Jan 29, 2024
* feat: add support of throttle logging

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: replace custom `Logger` to `tensorrt_common::Logger`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update to display standard output on screen

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update log message while building engine from onnx

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update logger in `lidar_centerpoint`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update log message

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: set default verbose=true for bulding engine from onnx

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: remove including unused `rclcpp.hpp`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update launcher to output logs on screen

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

---------

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Co-authored-by: Shunsuke Miura <37187849+miursh@users.noreply.github.com>
Signed-off-by: anhnv3991 <anh.nguyen.2@tier4.jp>
kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Jan 29, 2024
* feat: add support of throttle logging

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: replace custom `Logger` to `tensorrt_common::Logger`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update to display standard output on screen

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update log message while building engine from onnx

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update logger in `lidar_centerpoint`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update log message

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: set default verbose=true for bulding engine from onnx

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: remove including unused `rclcpp.hpp`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update launcher to output logs on screen

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

---------

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Co-authored-by: Shunsuke Miura <37187849+miursh@users.noreply.github.com>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
* feat: add support of throttle logging

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: replace custom `Logger` to `tensorrt_common::Logger`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update to display standard output on screen

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update log message while building engine from onnx

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update logger in `lidar_centerpoint`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update log message

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: set default verbose=true for bulding engine from onnx

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: remove including unused `rclcpp.hpp`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* refactor: update launcher to output logs on screen

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

---------

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Co-authored-by: Shunsuke Miura <37187849+miursh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:common Common packages from the autoware-common repository. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants