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

[Build] Add cmake options into libinfo #6286

Merged
merged 3 commits into from
Aug 17, 2020
Merged

[Build] Add cmake options into libinfo #6286

merged 3 commits into from
Aug 17, 2020

Conversation

junrushao
Copy link
Member

To follow up with #6280, I added cmake options into libinfo, then if we execute the following command, we will have the full build info:

> python -c "import tvm; print('\n'.join(k + '\t' + v for k, v in tvm.support.libinfo().items()))"
USE_LLVM	llvm-config --ignore-libllvm
GIT_COMMIT_HASH	f812dacc024812ea02822fb8f447bf5a8c607f2c
USE_VULKAN	OFF
USE_HEXAGON_SDK	/path/to/sdk
USE_MICRO	OFF
USE_GRAPH_RUNTIME	ON
INSTALL_DEV	OFF
USE_SORT	ON
USE_OPENCL	OFF
USE_THREADS	ON
USE_CUDNN	OFF
USE_RANDOM	OFF
USE_STACKVM_RUNTIME	OFF
USE_GRAPH_RUNTIME_DEBUG	ON
USE_THRUST	OFF
USE_MICRO_STANDALONE_RUNTIME	OFF
USE_TENSORFLOW_PATH	none
USE_MSVC_MT	OFF
USE_CUDA	OFF
USE_TF_TVMDSOOP	OFF
USE_COREML	OFF
USE_HEXAGON_DEVICE	OFF
USE_MIOPEN	OFF
USE_DNNL_CODEGEN	OFF
USE_ROCM	OFF
USE_BLAS	none
USE_TFLITE	OFF
USE_RPC	ON
USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME	OFF
USE_RELAY_DEBUG	ON
USE_TARGET_ONNX	OFF
USE_ROCBLAS	OFF
USE_MKLDNN	OFF
USE_ARM_COMPUTE_LIB	OFF
USE_FALLBACK_STL_MAP	OFF
USE_CUBLAS	OFF
USE_RTTI	ON
USE_OPENMP	none
USE_MKL	OFF
USE_METAL	OFF
HIDE_PRIVATE_SYMBOLS	OFF
USE_NNPACK	OFF
ROCM_PATH	/opt/rocm
USE_CPP_RPC	OFF

CC: @jroesch @jroesch @tqchen

src/support/libinfo.cc Outdated Show resolved Hide resolved
@comaniac
Copy link
Contributor

comaniac commented Aug 17, 2020

This may be out of scope. For example, USE_LLVM=llvm-config provides the command (or a path) used to build with LLVM, but for reproducible purpose, LLVM=9.0 is way more useful. Since now every flag is explicitly specified in libinfo, is that possible to customize the displayed information of some flags to make them more useful?

@junrushao
Copy link
Member Author

Hey @comaniac, I think you proposed two improvements

  1. Incorporate LLVM version: it is easy to do by adding TVM_LLVM_VERSION to libinfo. It will be added in this PR.
  2. Potential ways to customize the information in libinfo: It is a broader question that I may have no perfect answer, because those flags appears in very diverse ways in cmake...But it doesn't mean it is hard to manually do whatever you want if you slightly modify cmake scripts. For example, you may just add a single line in LibInfo.cmake and another line in libinfo.cc to add a flag.

@comaniac
Copy link
Contributor

comaniac commented Aug 17, 2020

Hey thanks for the change. I agree with your methodology that we could customize the libinfo to deliver whatever we want. Apparently, it's impractical to parse camel.config and we have to manually setup the libinfo. With this statement, we should be able to have more flexibility in libinfo. For example, we even don't need USE_LLVM, USE_CUDA corresponding to cmake flags, but just need LLVM_VERSION, CUDA_VERSION.

I think it's worthwhile to have an RFC discussing the libinfo contents (or we could refer to a previous RFC about benchmarking guidelines). However, this PR is a good start and shouldn't be blocked by such topics at least for now.

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM.
cc @zhiics @yzhliu you guys may be interested in this as well.

@junrushao
Copy link
Member Author

@comaniac I agree. It would be helpful if we have a forum thread discussing what should be included in the libinfo. A potentially issue is that I might not have all the devices required to verify correctness, for example, I don't have an ARM device at hand...Therefore, help from you guys and the community would be much appreciated!

@tqchen tqchen merged commit e4dc5c8 into apache:master Aug 17, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [Build] Add cmake options into libinfo

* Address comments from @tqchen

* Add LLVM version to libinfo
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [Build] Add cmake options into libinfo

* Address comments from @tqchen

* Add LLVM version to libinfo
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [Build] Add cmake options into libinfo

* Address comments from @tqchen

* Add LLVM version to libinfo
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
* [Build] Add cmake options into libinfo

* Address comments from @tqchen

* Add LLVM version to libinfo
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
* [Build] Add cmake options into libinfo

* Address comments from @tqchen

* Add LLVM version to libinfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants