Skip to content

[Build] Add CUDA_VERSION and GIT_COMMIT_TIME#8372

Merged
jcf94 merged 2 commits intoapache:mainfrom
comaniac:cuda_version
Jun 30, 2021
Merged

[Build] Add CUDA_VERSION and GIT_COMMIT_TIME#8372
jcf94 merged 2 commits intoapache:mainfrom
comaniac:cuda_version

Conversation

@comaniac
Copy link
Contributor

@comaniac comaniac commented Jun 29, 2021

  1. Add CUDA_VERSION to libinfo so that users can query which CUDA version was used to build TVM. Usage:
>>> import tvm
>>> tvm.support.libinfo()["CUDA_VERSION"]
'10.2'
  1. Add GIT_COMMIT_TIME to libinfo so that we can do the following
>>> import tvm
>>> tvm.support.libinfo()["GIT_COMMIT_TIME"]
'2021-06-29 22:21:22 +0000'
>>> import datetime
>>> datetime.datetime.strptime(tvm.support.libinfo()["GIT_COMMIT_TIME"], "%Y-%m-%d %H:%M:%S %z")
datetime.datetime(2021, 6, 29, 22, 21, 22, tzinfo=datetime.timezone.utc)

cc @junrushao1994

@comaniac comaniac requested a review from junrushao June 29, 2021 22:22
@comaniac comaniac changed the title [Build] Add CUDA_VERSION to libinfo [Build] Add CUDA_VERSION and GIT_COMMIT_TIME Jun 29, 2021
Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

LGTM

@junrushao
Copy link
Member

Just curious, if a TVM binary fails at loading time due to inconsistent CUDA versions, I imagine we cannot query via libinfo because loading has already failed. Do we have to consider this particular case?

@jcf94
Copy link
Contributor

jcf94 commented Jun 30, 2021

Just curious, if a TVM binary fails at loading time due to inconsistent CUDA versions, I imagine we cannot query via libinfo because loading has already failed. Do we have to consider this particular case?

Reasonable. The cuda version linked at build time and the cuda version in runtime environment when using tvm python package may be different.
Will it be better to rename this to BINARY_CUDA_VERSION or something like cuda version in build time? @comaniac

@comaniac
Copy link
Contributor Author

Just curious, if a TVM binary fails at loading time due to inconsistent CUDA versions, I imagine we cannot query via libinfo because loading has already failed. Do we have to consider this particular case?

It seems out of scope to me. It's more like an environment issue if the binary is incompatible and results in loading failure. The only goal of libinfo is reporting the information of the current binary as a part of the environment logging. If we want to provide the information when failed to load, we should do that in other places such as dlopen.

Reasonable. The cuda version linked at build time and the cuda version in runtime environment when using tvm python package may be different.

Will it be better to rename this to BINARY_CUDA_VERSION or something like cuda version in build time? @comaniac

I would prefer to keep the current one for 2 reasons. First, this is under support.libinfo, which already clearly says this is for the TVM lib instead of the runtime. Second, it consists with LLVM_VERSION.

@jcf94 jcf94 merged commit aa6fd43 into apache:main Jun 30, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* [Build] Add CUDA_VERSION to libinfo

* add git commit time
zxy844288792 pushed a commit to zxy844288792/tvm that referenced this pull request Mar 4, 2022
* [Build] Add CUDA_VERSION to libinfo

* add git commit time
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