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] Reflect Compile-Time CMake Options into libtvm.so #6280

Merged
merged 2 commits into from
Aug 15, 2020
Merged

[Build] Reflect Compile-Time CMake Options into libtvm.so #6280

merged 2 commits into from
Aug 15, 2020

Conversation

junrushao
Copy link
Member

@junrushao junrushao commented Aug 14, 2020

Reflecting build time info (git commit hash, cmake flags and options, etc) is very helpful in TVM development, packaging, and especially trouble shooting. This PR showcases how to incorporate compile-time information into TVM library, specifically, git commit hash in this PR. Other flags can be done in similar fashion, by just appending lines like "TVM_USE_CUDA=${USE_CUDA}" in the CMakeList.txt.

How to use this functionality. Run the command below:

> python -c "import tvm; print(tvm.support.libinfo())"
{"GIT_COMMIT_HASH": "921d4e0efea280c149940669bb23ef8c4de366e9"}

Per discussion with @jroesch. CC: @jwfromm @tqchen.

@tqchen
Copy link
Member

tqchen commented Aug 14, 2020

Thanks @junrushao1994 we will need also to support the build where the code base is not part of a git repo(e.g. in a tarball during release).

@junrushao
Copy link
Member Author

@tqchen If so, we don't have a git commit id, is that correct?

@tqchen
Copy link
Member

tqchen commented Aug 14, 2020

Yes, we can skip the info if that is the case

@junrushao
Copy link
Member Author

I see. We should set it to something like “git-not-found” then

@tqchen tqchen added the status: need update need update based on feedbacks label Aug 15, 2020
@junrushao
Copy link
Member Author

junrushao commented Aug 15, 2020

@tqchen I updated the script accordingly. Now if it is not in a git repo, or git executable is not found, the result will be:

> python -c "import tvm; print(tvm.support.libinfo())"
{"GIT_COMMIT_HASH": "NOT-FOUND"}

@junrushao
Copy link
Member Author

CI is green now. Could you take another look @tqchen?

@tqchen tqchen merged commit a4ebb16 into apache:master Aug 15, 2020
@tqchen
Copy link
Member

tqchen commented Aug 15, 2020

Thanks @junrushao1994 @jroesch !

@tqchen tqchen added status: accepted and removed status: need update need update based on feedbacks labels Aug 15, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
@sikmir sikmir mentioned this pull request Oct 27, 2020
10 tasks
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.

3 participants