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(lidar_apollo_segmentation_tvm/_nodes): remove autoware_auto_common dependency #3136

Merged
merged 4 commits into from
Apr 17, 2023

Conversation

xmfcx
Copy link
Contributor

@xmfcx xmfcx commented Mar 22, 2023

Description

Continuation of: #2234
Related to: #2229

Moved here to collaborate easier on AWF organization branch.

In order to build these packages, you need to pass --cmake-args -DDOWNLOAD_ARTIFACTS=1 to them.

I use colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DDOWNLOAD_ARTIFACTS=1 --packages-select lidar_apollo_segmentation_tvm lidar_apollo_segmentation_tvm_nodes tvm_utility for convenience.

Summary

🤖 Generated by Copilot at 1f601f7

This pull request refactors the code and types of the lidar_apollo_segmentation_tvm package and its node, to use standard types instead of custom ones for the inference input and output data. This simplifies the code, improves the performance, and avoids unnecessary conversions and dependencies. It affects the files pipeline.hpp, lidar_apollo_segmentation_tvm_node.cpp, and all the files in the lidar_apollo_segmentation_tvm module and its test. It also updates the package.xml files to remove unused dependencies.

Walkthrough

🤖 Generated by Copilot at 1f601f7

  • Replace bool8_t, char8_t, float32_t and float64_t types with standard types bool, int8_t, float and double in all files (F0-F13)
  • Remove unnecessary dependencies and header files for autoware_auto_msgs and autoware_auto_common packages, which defined the replaced types (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add header file <cstdint> to include the definition of int8_t type, which is used for the model version (link, link, link)
  • Modify the type of the version_from parameter in the tvm_utility::Pipeline constructor from std::array<char, 3> to std::array<int8_t, 3>, to match the type of the modelzoo_version field in the config_ object (link)
  • Modify the types of the parameters and fields related to the point cloud data, such as pc_ptr, pos_x, pos_y, affine_matrix, offset, point_step, etc., from float32_t to float, to avoid unnecessary conversions and use a standard type (link, link, link, link, link)
  • Modify the type of the epsilon variable in the FeatureGenerator::generate function from float64_t to double, to avoid unnecessary conversions and use a standard type (link)
  • Modify the types of the fields related to the clustering algorithm, such as node_rank, traversed, is_center and is_object, from char8_t and bool8_t to int8_t and bool, to use standard types and avoid unnecessary conversions (link)
  • Modify the type of the v vector in the main test function from uchar8_t to unsigned char, to use a standard type (link)

Poem

🤖 Generated by Copilot at 1f601f7

We're heaving away the old types, me hearties
We're making the code more simple and smart
We're using the standard float and bool, me hearties
We're matching the types with the inference part

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.

@xmfcx xmfcx requested review from ambroise-arm, a team and angry-crab as code owners March 22, 2023 09:41
@github-actions github-actions bot added component:common Common packages from the autoware-common repository. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) labels Mar 22, 2023
@xmfcx xmfcx force-pushed the refactor/remove-autoware_auto_common-dependency branch from d8d1e03 to 1f601f7 Compare March 22, 2023 09:44
@xmfcx
Copy link
Contributor Author

xmfcx commented Mar 22, 2023

@ambroise-arm this way it compiles on my machine. Also used int8_t instead of char to keep things consistent.

Could you review it please?

@xmfcx xmfcx requested a review from takayuki5168 March 22, 2023 09:48
@ambroise-arm
Copy link
Contributor

I just want to double check if the char -> int8_t needs to be applied in other places as well (other Autoware packages and maybe modelzoo). I should be able to review later this week.

@xmfcx
Copy link
Contributor Author

xmfcx commented Mar 28, 2023

@ambroise-arm I've checked, colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DDOWNLOAD_ARTIFACTS=1 --packages-select lidar_apollo_segmentation_tvm lidar_apollo_segmentation_tvm_nodes tvm_utility lidar_centerpoint_tvm compiles ok.

Which makes all the packages in the universe:

  • lidar_apollo_segmentation_tvm
  • lidar_apollo_segmentation_tvm_nodes
  • lidar_centerpoint_tvm
  • tvm_utility

I didn't check if they work in runtime though.

Copy link
Contributor

@ambroise-arm ambroise-arm left a comment

Choose a reason for hiding this comment

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

Generally looks good to me. I ran colcon test on the packages and it passes, so the inference doesn't fail catastrophically.
Just nitpicking, can you change char to int8_t in common/tvm_utility/include/tvm_utility/pipeline.hpp lines 204 (modelzoo_version) and 348 (version_up_to) as well please? For consistency.

@xmfcx xmfcx force-pushed the refactor/remove-autoware_auto_common-dependency branch from 1f601f7 to d31b865 Compare April 17, 2023 10:57
@codecov
Copy link

codecov bot commented Apr 17, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (80385ab) 13.25% compared to head (cb1d451) 13.25%.

❗ Current head cb1d451 differs from pull request most recent head 21b629b. Consider uploading reports for the commit 21b629b to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3136   +/-   ##
=======================================
  Coverage   13.25%   13.25%           
=======================================
  Files        1384     1384           
  Lines       97018    97017    -1     
  Branches    28213    28213           
=======================================
  Hits        12855    12855           
+ Misses      70354    70353    -1     
  Partials    13809    13809           
Flag Coverage Δ *Carryforward flag
differential ∅ <ø> (?)
total 13.25% <ø> (+<0.01%) ⬆️ Carriedforward from db7b5dd

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

see 2 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@xmfcx
Copy link
Contributor Author

xmfcx commented Apr 17, 2023

@ambroise-arm I've squashed+rebased the PR and applied the suggestions in cb1d451

Could you review again? (I've compiled it just to make sure)

@xmfcx xmfcx requested a review from ambroise-arm April 17, 2023 11:13
M. Fatih Cırıt and others added 4 commits April 17, 2023 16:46
…common dependency

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

update

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

replace char and char8_t with int8_t and fix a missed float

Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
@xmfcx xmfcx force-pushed the refactor/remove-autoware_auto_common-dependency branch from cb1d451 to 21b629b Compare April 17, 2023 13:47
@xmfcx xmfcx requested a review from ambroise-arm April 17, 2023 13:49
@xmfcx xmfcx merged commit 33d9325 into main Apr 17, 2023
@xmfcx xmfcx deleted the refactor/remove-autoware_auto_common-dependency branch April 17, 2023 14:01
@xmfcx
Copy link
Contributor Author

xmfcx commented Apr 17, 2023

Thank you for reviewing!

Mingyu1991 pushed a commit to Mingyu1991/autoware.universe that referenced this pull request Jun 26, 2023
…common dependency (autowarefoundation#3136)

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: Mingyu Li <mingyu.li@tier4.jp>
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants