Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[v1.x] Simplify TRT build by adding onnx_tensorrt targets in CMake #19742

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

Kh4L
Copy link
Contributor

@Kh4L Kh4L commented Jan 12, 2021

Description

Add a script to build the dependencies required by MXNet-TRT: ONNX and onnx_tensorrt.

@mxnet-bot
Copy link

Hey @Kh4L , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [sanity, windows-cpu, centos-gpu, centos-cpu, miscellaneous, unix-gpu, unix-cpu, clang, windows-gpu, website, edge]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 12, 2021
CMakeLists.txt Outdated Show resolved Hide resolved
@Kh4L Kh4L changed the title [v1.x] Simplify TRT build by adding dependency builder script [v1.x] Simplify TRT build by adding onnx_tensorrt targets in CMake Jan 13, 2021
@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 13, 2021
@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 20, 2021
@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 21, 2021
@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 22, 2021
@lanking520 lanking520 added pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 25, 2021
@Kh4L
Copy link
Contributor Author

Kh4L commented Jan 26, 2021

@mxnet-bot run ci [sanity]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [sanity]

@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-work-in-progress PR is still work in progress labels Jan 26, 2021
@Zha0q1
Copy link
Contributor

Zha0q1 commented Jan 26, 2021

@Kh4L sanity has some issues I think. Current on call is looking into this

@lanking520 lanking520 added pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 26, 2021
@Kh4L
Copy link
Contributor Author

Kh4L commented Jan 26, 2021

@Zha0q1 ok, thank you!

@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-work-in-progress PR is still work in progress labels Jan 27, 2021
@Kh4L Kh4L requested a review from leezu January 27, 2021 06:22
@lanking520 lanking520 added pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 27, 2021
@Kh4L
Copy link
Contributor Author

Kh4L commented Jan 27, 2021

@mxnet-bot run ci [unix-gpu-cu110]

@mxnet-bot
Copy link

None of the jobs entered are supported.
Jobs entered by user: [unix-gpu-cu110]
CI supported Jobs: [windows-cpu, clang, edge, centos-cpu, unix-cpu, windows-gpu, unix-gpu, centos-gpu, website, miscellaneous, sanity]

@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-work-in-progress PR is still work in progress labels Jan 27, 2021
@leezu
Copy link
Contributor

leezu commented Jan 27, 2021

@Kh4L I retriggered the job manually. cc @ChaiBapchya

Comment on lines +245 to +248
set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
set(BUILD_SHARED_LIBS ON)
add_subdirectory(3rdparty/onnx-tensorrt/ EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
Copy link
Contributor

@leezu leezu Jan 27, 2021

Choose a reason for hiding this comment

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

Are you trying to prevent add_subdirectory from changing the global variables? The problem is a "bug" in 3rdparty/onnx-tensorrt/ (ie. they shouldn't change the global variables in the first place). A better workaround compared to manually saving BUILD_SHARED_LIBS is to call add_subdirectory inside a function. Each function in cmake has it's own scope, and add_subdirectory can then only modify the variables inside the function scope.
You can look at load_omp function inside this file to see how it's done. But if 3rdparty/onnx-tensorrt only overwrites BUILD_SHARED_LIBS, it's also fine to merge this PR first and improve later

@lanking520 lanking520 added pr-awaiting-merge Review and CI is complete. Ready to Merge and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Jan 27, 2021
@leezu leezu merged commit 4bd6d48 into apache:v1.x Feb 4, 2021
@leezu
Copy link
Contributor

leezu commented Feb 4, 2021

Thank you @Kh4L. Do you intend to port this PR to the master branch?

@Kh4L
Copy link
Contributor Author

Kh4L commented Feb 5, 2021

@leezu Thank you, yes I will do

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-merge Review and CI is complete. Ready to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants