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

Implement yolo_TVM #2309

Closed
3 of 7 tasks
angry-crab opened this issue Nov 17, 2022 · 19 comments
Closed
3 of 7 tasks

Implement yolo_TVM #2309

angry-crab opened this issue Nov 17, 2022 · 19 comments
Assignees
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) type:new-feature New functionalities or additions, feature requests.

Comments

@angry-crab
Copy link
Contributor

angry-crab commented Nov 17, 2022

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I've agreed with the maintainers that I can plan this task.

Description

Implement yolo with TVM

Purpose

Implement yolo with TVM

Possible approaches

Implement cuda kernels using cpp/tvm

Definition of done

  • verify accuracy of compiled model
  • Create PR under modelzoo
  • implement cuda kernel using cpp/tvm
  • port yolo peripheral functions
@angry-crab angry-crab added type:new-feature New functionalities or additions, feature requests. priority:low Lower urgency, can be addressed later. component:perception Advanced sensor data processing and environment understanding. (auto-assigned) labels Nov 17, 2022
@raminterpl raminterpl assigned sujithvemi and Deepak3994 and unassigned sujithvemi Dec 6, 2022
@raminterpl
Copy link

@angry-crab : Could you pls provide more technical details
documents for this task @Deepak3994 : will look into it and we will plan any discussion if required

@angry-crab
Copy link
Contributor Author

angry-crab commented Dec 7, 2022

@raminterpl @Deepak3994
Thank you so much for your interest.
For information about tvm, please see the link above.
AS for the current tvm pipeline of Universe and steps to port TensorRT packages to tvm, please check the following link:
tvm_overview
FYI, we have already ported some packages from TensorRT, ie lidar_centerpoint_tvm and lidar_apollo_segmentation_tvm. Maybe you can take these as examples.

To put simply,

  1. we need to first verify the accuracy of compiled model for llvm and opencl backend. Please see
    tvm_test for an example.
  2. Create a PR under modelzoo repo to upload the model.
  3. Implement cuda kernel functions with cpp/tvmscript
  4. Port other functions to the tvm package.

Please let me know if there is any question/problem.

@angry-crab angry-crab mentioned this issue Dec 7, 2022
5 tasks
@raminterpl
Copy link

@Deepak3994 : Deepak is looking into it.

@Deepak3994
Copy link

@angry-crab

I see the initial step for verifying accuracy of the compiled model is to run the test from "https://github.com/angry-crab/tvm_example/blob/main/python/tvm_test.py". But in that script i see that we will be importing the pre-compiled models, backbone etc. From where can we find these models for the current yolo part?

@angry-crab
Copy link
Contributor Author

From where can we find these models for the current yolo part?

Hi, maybe you can check the one currently being used by tensorrt.
https://github.com/autowarefoundation/autoware.universe/blob/main/perception/tensorrt_yolox/CMakeLists.txt

@Deepak3994
Copy link

Hi, I went through the camke file. It mentioned that models will be downloaded. For now i tried "https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/docker-installation-devel/"
this link for setting up the enviornment. But after the last step of running "colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release", i am not able to see any model files getting downloaded.

Is it the ryt way or there are some other commands/ methods to get the model files downloaded?

@angry-crab
Copy link
Contributor Author

Is it the ryt way or there are some other commands/ methods to get the model files downloaded?

Hi, sry for the confusion. We need to do colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DDOWNLOAD_ARTIFACTS=ON to download the package.
Further information could be found here.
https://github.com/autowarefoundation/autoware.universe/blob/main/common/tvm_utility/design/tvm-utility-design.md

@angry-crab angry-crab removed the priority:low Lower urgency, can be addressed later. label Feb 7, 2023
@Deepak3994
Copy link

Hi @angry-crab , I have downloaded the models for yolo-tinyx. Currently I am working on the test script which you have suggested to look into for getting accuracy of compiled model for llvm and opencl backend.

Script: https://github.com/angry-crab/tvm_example/blob/main/python/tvm_test.py

I cloned the code and ryt now working on running this script for the "yolo-tinyx.onnx" model file. Few libraries its requesting to be installed, currently doing the same. I will post the test results here once its generated.

@Deepak3994
Copy link

Deepak3994 commented Feb 14, 2023

Hi I have installed tvm and other libraries. But, when i execute the "test" script with updated .onnx file, I get the following issue..

image

Any suggestion?

@angry-crab
Copy link
Contributor Author

@Deepak3994 It seems that the operation is available. Which version of tvm are you using?

@Deepak3994
Copy link

Actually, import tvm itself is throwing error. Do you happen to have any doc which has installations for tvm?

image

@angry-crab
Copy link
Contributor Author

Do you happen to have any doc which has installations for tvm?

I'm simply following the instructions from official tvm doc.
https://tvm.apache.org/docs/install/index.html

btw, maybe you can use the docker image from model_zoo. but make sure to change the entry point and rebuild the image.
https://github.com/autowarefoundation/modelzoo

@sujithvemi
Copy link
Contributor

Hi,

The issue we are facing is registered as a bug on TVM Github issues page here.

apache/tvm#13507

Please let us know what call to take because I am facing this issue even after a thorough source installation and not just through package installation.

Regards,
Sujith.

@angry-crab
Copy link
Contributor Author

@sujithvemi
Thanks for the info. I've never met this issue before. Have you tried to use the docker image of modelzoo?
https://github.com/autowarefoundation/modelzoo

@stale
Copy link

stale bot commented Apr 23, 2023

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Apr 23, 2023
@raminterpl
Copy link

raminterpl commented Jun 27, 2023

@xmfcx @mitsudome-r : Deepak is leaving Interplai this week. could you please assign this task to any other team who can take up this .sorry for any inconvenience

@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label Jun 27, 2023
@stale
Copy link

stale bot commented Aug 29, 2023

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Aug 29, 2023
@amadeuszsz
Copy link
Contributor

@kminoda
I see we slowly move towards TensoRT based inference only. Since we keep removing TVM based package, should we close this issue?

@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label Jul 31, 2024
@xmfcx
Copy link
Contributor

xmfcx commented Jul 31, 2024

Yeah, this task is long overdue.

@xmfcx xmfcx closed this as completed Jul 31, 2024
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) type:new-feature New functionalities or additions, feature requests.
Projects
None yet
Development

No branches or pull requests

6 participants