Commit Graph

30 Commits

Author SHA1 Message Date
Bixia Zheng
fa595eb8fa [TF] Add TensorRT version to tf.sysconfig.get_build_info.
Add is_tensorrt_build and tensorrt_version to build_info.

PiperOrigin-RevId: 341663396
Change-Id: I239d7d52c388767932716abd501061d31324ff10
2020-11-10 11:45:26 -08:00
A. Unique TensorFlower
d475b4f7a5 Make generated build_info source file deterministic. The order of a plain dict is not guaranteed.
PiperOrigin-RevId: 323423187
Change-Id: I7a086ce8cb6995b0da9e2eddceab671349ad41b6
2020-07-27 13:12:45 -07:00
Christian Sigg
7a239d4952 Assemble CUDA and cuDNN DLL name in build_info from version.
The version strings from cuda_configure.bzl are
cuda_version: x.y on Linux, 64_xy on Windows
cudnn_version: x on Linux, 64_x on Windows

The DLL names can be assembled from those, instead of passing them in from environment variables.

This hopefully fixes the Windows build.

PiperOrigin-RevId: 315212567
Change-Id: Ia9709297f8eff1baece1722e58e58f5bb469bbbf
2020-06-07 22:09:26 -07:00
Austin Anderson
0a2db3d354 Provide NVIDIA CUDA build data in metadata and API
This change is a second attempt at , which was rolled back because it was fragile.

First, cuda_configure.bzl templates a file with data it already pulled from get_cuda_config. gen_build_info loads that file to provide package
build information within TensorFlow:

    from tensorflow.python.platform import build_info
    print(build_info.build_info)
    {'cuda_version': '10.2', 'cudnn_version': '7', ... }

Also is exposed through tf.sysconfig.get_build_info(), a public API change.

setup.py pulls build_info into package metadata. The wheel's
long description ends with:

    TensorFlow 2.2.0 for NVIDIA GPUs was built with these platform
    and library versions:

      - NVIDIA CUDA 10.2
      - NVIDIA cuDNN 7
      - NVIDIA CUDA Compute Capabilities compute_30, compute_70 (etc.)

I set one of the new CUDA Classifiers, and add metadata to the "platform" tag:

    >>> import pkginfo
    >>> a = pkginfo.Wheel('./tf_nightly_gpu-2.1.0-cp36-cp36m-linux_x86_64.whl')
    >>> a.platforms
    ['cuda_version:10.2', 'cudnn_version:7', ...]

I'm not 100% confident this is the best way to accomplish this. It
still seems odd to import like this setup.py, even though it works, even in
an environment with TensorFlow installed. This method is much better than the old method as it uses data that was already gathered. It could be extended to gather tensorrt, nccl, etc. from other .bzl files, but I wanted to get feedback (and ensure this lands in 2.3) before designing something like that.

Currently tested only on Linux GPU (Remote Build) for Python 3.6. I'd
like to see more tests before merging.

The API is the same as the earlier change.

Resolves https://github.com/tensorflow/tensorflow/issues/38351.

PiperOrigin-RevId: 315018663
Change-Id: Idf68a8fe4d1585164d22b5870894c879537c280d
2020-06-05 16:44:24 -07:00
A. Unique TensorFlower
2ffde8a339 This breaks multi-python:
The local gen_build_info rule calls into find_cuda_config, which only works in the remote image.

This is additionally brittle: relying on TF_CUDA_VERSION being an action_env is poisoning our caches, and running find_cuda_conifg multiple times is bugprone.

I think the better way to do this is to put the information from the repo_rule into a file template as part of the repo rule configuration (cuda_configure.bzl). Then we can just include that file, instead of trying to do that as part of the action.

PiperOrigin-RevId: 311148754
Change-Id: I80daa8652a85b2a1897c15117e6422bfd21cee6a
2020-05-12 10:12:04 -07:00
TensorFlower Gardener
94c821c0ef Merge pull request from angerson:master
PiperOrigin-RevId: 311025598
Change-Id: Ib47f014000e9183bd25b413ebeb43a4adf543d82
2020-05-11 17:21:17 -07:00
Austin Anderson
bf68743329 Remove extra debug print statement 2020-05-01 11:56:12 -07:00
Austin Anderson
642dc30aca Fix typos from the latest version 2020-04-30 17:45:36 -07:00
Austin Anderson
df1ee5d551 Convert build_info to dict format and expose it.
Since this module now generates a dictionary to expose in tf.config, it
doesn't make much sense to store only certain values in the build_info
dictionary and others as module variables. This obsoletes a lot of code
in gen_build_info.py and I've removed it.

I also updated all the in-code references I've found to the build_info
module. I think this may break whomever used to be using the build_info
library, but since it wasn't part of the API, there was no guarantee
that it would continue to be available.
2020-04-29 16:17:38 -07:00
Austin Anderson
2c71fe1ff3 Provide NVIDIA CUDA build data in metadata and API
This change:

First exposes //third_party/gpus:find_cuda_config as a library.

Then, it extends gen_build_info.py with find_cuda_config to provide package
build information within TensorFlow's API. This is accessible as a
dictionary:

    from tensorflow.python.platform import build_info
    print(build_info.cuda_build_info)
    {'cuda_version': '10.2', 'cudnn_version': '7', 'tensorrt_version': None, 'nccl_version': None}

Finally, setup.py pulls that into package metadata. The same wheel's
long description ends with:

    TensorFlow 2.1.0 for NVIDIA GPUs was built with these platform
    and library versions:

      - NVIDIA CUDA 10.2
      - NVIDIA cuDNN 7
      - NVIDIA NCCL not enabled
      - NVIDIA TensorRT not enabled

In lieu of NVIDIA CUDA classifiers [1], the same metadata is exposed in the
normally-unused "platform" tag:

    >>> import pkginfo
    >>> a = pkginfo.Wheel('./tf_nightly_gpu-2.1.0-cp36-cp36m-linux_x86_64.whl')
    >>> a.platforms
    ['cuda_version:10.2', 'cudnn_version:7', 'tensorrt_version:None', 'nccl_version:None']

I'm not 100% confident this is the best way to accomplish this. It
seems odd to import like this setup.py, even though it works, even in
an environment with TensorFlow installed.

One caveat for RBE: the contents of genrules still run on the local
system, so I had to syncronize my local environment with the RBE
environment I used to build TensorFlow. I'm not sure if this is going to
require intervention on TensorFlow's current CI.

Currently tested only on Linux GPU (Remote Build) for Python 3.6. I'd
like to see more tests before merging.

[1]: (https://github.com/pypa/trove-classifiers/issues/25),
2020-04-29 16:07:31 -07:00
A. Unique TensorFlower
9ca9a4f8e9 Roll forward with fix for Windows & PPC.
PiperOrigin-RevId: 308975869
Change-Id: I22abc77396e8d2a9c8f6a0907bf9d1d22169cc93
2020-04-29 00:43:38 -07:00
Mihai Maruseac
40d3f089be Roll forward with fix for tf-serving.
PiperOrigin-RevId: 308282593
Change-Id: I947d78592a9ca5c481f98a95946bb4acbbb0437f
2020-04-24 10:48:45 -07:00
A. Unique TensorFlower
45e0468e02 Roll forward with fix for tf-serving.
PiperOrigin-RevId: 308011159
Change-Id: I91cffa1f10e8fcb621d18578225be7cc870b6839
2020-04-23 03:00:38 -07:00
Christina Sorokin
a659b93433 rollback of change
Add two repository rules:
- @local_execution_config_platform: local platform to allow selecting locally
  executed tools on
- @local_execution_config_python: python configured for execution...

PiperOrigin-RevId: 307862682
Change-Id: Ie0320f2f137a40b418632989981c9dc072ef80e6
2020-04-22 11:47:06 -07:00
A. Unique TensorFlower
f5bb643360 Add two repository rules:
- @local_execution_config_platform: local platform to allow selecting locally
  executed tools on
- @local_execution_config_python: python configured for execution on the local
  machine during otherwise remote builds

Mark rules that are required to run locally to require our local platform.

This allows pyth...

PiperOrigin-RevId: 307771596
Change-Id: If1f0013ec88a35d507b2b622894208aab2416fe5
2020-04-22 01:47:55 -07:00
Taehee Jeong
0f631f8fb1 Add two repository rules:
- @local_execution_config_platform: local platform to allow selecting locally
  executed tools on
- @local_execution_config_python: python configured for execution on the local
  machine during otherwise remote builds

Mark rules that are required to run locally to require our local platform.

This allows python paths to differ between the remote docker image and local
machine.

For example, the local machine might have python 3.7 installed in
/usr/bin/python3, while the remote docker should use a python installed
in /usr/local/bin/python3.8.

PiperOrigin-RevId: 307585019
Change-Id: I29313121beb967b77ae123e7d1b614c688cb40ca
2020-04-21 05:20:54 -07:00
A. Unique TensorFlower
d68284a16f Add two repository rules:
- @local_execution_config_platform: local platform to allow selecting locally
  executed tools on
- @local_execution_config_python: python configured for execution on the local
  machine during otherwise remote builds

Mark rules that are required to run locally to require our local platform.

This allows python paths to differ between the remote docker image and local
machine.

For example, the local machine might have python 3.7 installed in
/usr/bin/python3, while the remote docker should use a python installed
in /usr/local/bin/python3.8.

PiperOrigin-RevId: 307558811
Change-Id: I0dc2d877a7c26b294bf2b569b4f121cf6506e7fc
2020-04-21 01:10:05 -07:00
Brian Atkinson
66c48046f1 Small adjustments on import spacing.
This is mostly the result of an internal cleanup and formatting pass.

PiperOrigin-RevId: 286318018
Change-Id: I8f9e2f7519070035da73f9f24d2fc90864abc51b
2019-12-18 20:32:12 -08:00
Hye Soo Yang
bbf73b1825 ICM PY3 Migration - //tensorflow/tools [1]
PiperOrigin-RevId: 274268400
2019-10-11 20:29:37 -07:00
TensorFlower Gardener
d0814e19f8 Merge pull request from ROCmSoftwarePlatform:google_upstream_is_built_with_rocm
PiperOrigin-RevId: 256505080
2019-07-04 01:08:35 -07:00
Deven Desai
9a74324a66 enhancing the build_info_test to check for test.is_built_with_rocm() functionality 2019-06-27 13:45:35 +00:00
A. Unique TensorFlower
3e0a311fa0 Apply 'buildozer fix moveLicensesAndDistribs movePackageToTop' to all BUILD files.
PiperOrigin-RevId: 251836013
2019-06-06 06:06:34 -07:00
Gunhan Gulsoy
0d2442c867 n/a
PiperOrigin-RevId: 248282244
2019-05-15 00:22:04 -07:00
A. Unique TensorFlower
a2437ddfe3 Add empty line after package description so buildozer does not misclassify it as a comment to the following macro.
PiperOrigin-RevId: 247929397
2019-05-13 07:29:19 -07:00
Jiri Simsa
90b2e3411f Automated rollback of commit 3bd15c9e72
PiperOrigin-RevId: 244915500
2019-04-23 15:29:23 -07:00
A. Unique TensorFlower
3bd15c9e72 n/a
PiperOrigin-RevId: 244895975
2019-04-23 14:43:59 -07:00
Gunhan Gulsoy
b47a10d0a2 Make gen_build_info genrule to use a py_binary.
This makes the script more platform independent.

PiperOrigin-RevId: 217028598
2018-10-14 00:02:29 -07:00
Martin Wicke
bb582f1b6f Remove all_opensource_files. It's not needed any more.
PiperOrigin-RevId: 190878279
2018-03-28 20:49:47 -07:00
Derek Murray
a8444b7c19 [Windows] Improve import self-check with tests for GPU-related DLLs.
This change incorporates the full logic of the [Windows self-check
script](https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c)
into core TensorFlow.

Fixes .

PiperOrigin-RevId: 170746452
2017-10-02 13:43:29 -07:00
Derek Murray
59bdf598d2 Add an automatically-generated "tensorflow.python.platform.build_info" script.
The motivation for this script is to provide better tools for
diagnosing load-time errors (such as the ones that plague the Windows
build due to DLL issues). Note that the script is intended to be
self-contained, so that it is possible to import it without loading
the entire TensorFlow runtime.

This generated script currently contains a single symbol,
`is_cuda_build`, which records whether the build has GPU support or not.

PiperOrigin-RevId: 168471034
2017-09-12 17:07:07 -07:00