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

[VTA] YoloV3 Support #4887

Merged
merged 8 commits into from
Feb 26, 2020
Merged

[VTA] YoloV3 Support #4887

merged 8 commits into from
Feb 26, 2020

Conversation

huajsj
Copy link
Contributor

@huajsj huajsj commented Feb 14, 2020

Issue:
YoloV3 use some operator and logic that not get good support by
existing vta logic, like nn.pad, upsample, and 255 output channel.

Solution:
add related logic to let darknet YoloV3 can running on VTA

@tmoreau89 ,could you help to do a review? thanks.

@huajsj huajsj requested a review from tmoreau89 February 14, 2020 23:44
@huajsj
Copy link
Contributor Author

huajsj commented Feb 14, 2020

After this patch, I can run Yolov3 tiny on VTA(simulator + FPGA), but it still have some accuracy issue, It may caused by test application parameter usage or VTA existing logic, I am not very sure, at same time please kindly advise if i missing any logic for Yolov3-tiny support in this patch.

@huajsj huajsj requested a review from vinx13 February 15, 2020 00:38
@cbalint13
Copy link
Contributor

FYI,
Please lets have this PR too (yolo3 conf): dmlc/web-data#201

@huajsj
Copy link
Contributor Author

huajsj commented Feb 17, 2020

small frame accuracy issue fixed.

@tmoreau89
Copy link
Contributor

Hi @huajsj, thanks for adding YoloV3 support for VTA. Do you think that along with this PR you can also construct a tutorial similar to this one: https://github.com/apache/incubator-tvm/blob/master/vta/tutorials/frontend/deploy_vision_on_vta.py

We could have one tutorial called deploy_classification_on_vta.py, and deploy_detection_on_vta.py to differentiate between object classification vs. detection. In addition, this will exercise compilation support for Yolo to make sure that support does not break.

@huajsj
Copy link
Contributor Author

huajsj commented Feb 18, 2020

Hi @tmoreau89 , Thanks for the follow up , sure, would work for a tutorial and upload soon.

Regards
Hua

Hi @huajsj, thanks for adding YoloV3 support for VTA. Do you think that along with this PR you can also construct a tutorial similar to this one: https://github.com/apache/incubator-tvm/blob/master/vta/tutorials/frontend/deploy_vision_on_vta.py

We could have one tutorial called deploy_classification_on_vta.py, and deploy_detection_on_vta.py to differentiate between object classification vs. detection. In addition, this will exercise compilation support for Yolo to make sure that support does not break.

@liangfu
Copy link
Member

liangfu commented Feb 19, 2020

Since the python script deploy_vision_on_vta.py exists in the vta directory already, how about renaming those to deploy_classification.py and deploy_detection.py?

@tmoreau89
Copy link
Contributor

@liangfu that is correct; we'd need to rename deploy_vision_on_vta to deploy_classification_on_vta!

@liangfu
Copy link
Member

liangfu commented Feb 20, 2020

Sorry, I meant removing the '_on_vta' suffix in the file names.

@tmoreau89
Copy link
Contributor

Oh my bad, I read your comment too quickly; I like your suggestion and agree; shortening the filename makes sense!

@huajsj huajsj changed the title [VTA] YoloV3 Support [WIP][VTA] YoloV3 Support Feb 22, 2020
@huajsj
Copy link
Contributor Author

huajsj commented Feb 22, 2020

just add the tutorial which work good in simulator, but not work properly in FPGA, still in the process of trouble shooting.

@liangfu
Copy link
Member

liangfu commented Feb 22, 2020

I'm glad to hear that. For now, I suggest keep an eye on free CMA memory space on the FPGA device.

@tmoreau89
Copy link
Contributor

@huajsj which platform are you using for the FPGA demo?

@huajsj
Copy link
Contributor Author

huajsj commented Feb 24, 2020

@huajsj which platform are you using for the FPGA demo?

Hi @tmoreau89, I am using pynq board for testing.

Issue:
YoloV3 use some operator and logic that not get good support by
existing vta logic, like nn.pad, upsample, and 255 output channel.

Solution:
add related logic to let darknet YoloV3 can running on VTA
@huajsj huajsj changed the title [WIP][VTA] YoloV3 Support [VTA] YoloV3 Support Feb 25, 2020
@huajsj
Copy link
Contributor Author

huajsj commented Feb 25, 2020

after apply AutoTVM configure file, now we can run Yolov3-tiny tutorial correctly on PYNQ board, the autotvm configure file in this pull request tlc-pack/tophub#17

Copy link
Member

@liangfu liangfu left a comment

Choose a reason for hiding this comment

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

I tested this on PYNQ board, it worked correctly as expected. Thanks @huajsj for the great work!

I left some comment in the code, otherwise LGTM.

vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection_on_vta.py Outdated Show resolved Hide resolved
@huajsj
Copy link
Contributor Author

huajsj commented Feb 25, 2020

Hi @liangfu, nice to know the tutorial worked in your environment, and thanks for the kindly follow up , all review comments get addressed, please check.

@liangfu
Copy link
Member

liangfu commented Feb 26, 2020

Would you please also rename the files as requested above, see #4887 (comment)

@huajsj
Copy link
Contributor Author

huajsj commented Feb 26, 2020

Would you please also rename the files as requested above, see #4887 (comment)

sure, already changed.

Copy link
Member

@liangfu liangfu left a comment

Choose a reason for hiding this comment

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

LGTM

@huajsj
Copy link
Contributor Author

huajsj commented Feb 26, 2020

@tmoreau89 , if you have time , could you help to have reivew? thanks.

Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

Thanks Hua for this great addition to TVM/VTA! I've left some comments to address, and then the PR is good to go!

vta/python/vta/top/graphpack.py Show resolved Hide resolved
vta/python/vta/top/graphpack.py Show resolved Hide resolved
vta/python/vta/top/graphpack.py Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection.py Outdated Show resolved Hide resolved
vta/tutorials/frontend/deploy_detection.py Outdated Show resolved Hide resolved
@huajsj huajsj requested a review from tmoreau89 February 26, 2020 21:21
Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

Thank you @huajsj, LGTM

@huajsj
Copy link
Contributor Author

huajsj commented Feb 26, 2020

@tmoreau89 , Thanks for the kindly follow up, 'tlc-pack/tophub#17' is the the default Autotvm configure file for Yolov3 tiny, could you help to review this patch too? thanks.

@tmoreau89
Copy link
Contributor

Thanks @huajsj , I merged tlc-pack/tophub#17

@tmoreau89 tmoreau89 merged commit 09c55fd into apache:master Feb 26, 2020
@tmoreau89
Copy link
Contributor

Thank you @huajsj @cbalint13 @liangfu , the code has been merged!

alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 29, 2020
* [VTA] YoloV3 Support

Issue:
YoloV3 use some operator and logic that not get good support by
existing vta logic, like nn.pad, upsample, and 255 output channel.

Solution:
add related logic to let darknet YoloV3 can running on VTA

* Fix small(0, or 1 heigh/width) detect frame issue.

* add yolov3-tiny turtorial

* add os import

* address review comments.

* rename tutorial file with a short name.

* rename deploy_vision_on_vta.py into deploy_classification.py.

* address review comment, fix plint eror in deploy_detection.py
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 29, 2020
* [VTA] YoloV3 Support

Issue:
YoloV3 use some operator and logic that not get good support by
existing vta logic, like nn.pad, upsample, and 255 output channel.

Solution:
add related logic to let darknet YoloV3 can running on VTA

* Fix small(0, or 1 heigh/width) detect frame issue.

* add yolov3-tiny turtorial

* add os import

* address review comments.

* rename tutorial file with a short name.

* rename deploy_vision_on_vta.py into deploy_classification.py.

* address review comment, fix plint eror in deploy_detection.py
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2020
* [VTA] YoloV3 Support

Issue:
YoloV3 use some operator and logic that not get good support by
existing vta logic, like nn.pad, upsample, and 255 output channel.

Solution:
add related logic to let darknet YoloV3 can running on VTA

* Fix small(0, or 1 heigh/width) detect frame issue.

* add yolov3-tiny turtorial

* add os import

* address review comments.

* rename tutorial file with a short name.

* rename deploy_vision_on_vta.py into deploy_classification.py.

* address review comment, fix plint eror in deploy_detection.py
tqchen pushed a commit to tqchen/tvm that referenced this pull request Mar 29, 2020
* [VTA] YoloV3 Support

Issue:
YoloV3 use some operator and logic that not get good support by
existing vta logic, like nn.pad, upsample, and 255 output channel.

Solution:
add related logic to let darknet YoloV3 can running on VTA

* Fix small(0, or 1 heigh/width) detect frame issue.

* add yolov3-tiny turtorial

* add os import

* address review comments.

* rename tutorial file with a short name.

* rename deploy_vision_on_vta.py into deploy_classification.py.

* address review comment, fix plint eror in deploy_detection.py
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Apr 16, 2020
* [VTA] YoloV3 Support

Issue:
YoloV3 use some operator and logic that not get good support by
existing vta logic, like nn.pad, upsample, and 255 output channel.

Solution:
add related logic to let darknet YoloV3 can running on VTA

* Fix small(0, or 1 heigh/width) detect frame issue.

* add yolov3-tiny turtorial

* add os import

* address review comments.

* rename tutorial file with a short name.

* rename deploy_vision_on_vta.py into deploy_classification.py.

* address review comment, fix plint eror in deploy_detection.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants